<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/usb/core, branch v6.8</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v6.8</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v6.8'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2024-03-05T13:21:15Z</updated>
<entry>
<title>usb: port: Don't try to peer unused USB ports based on location</title>
<updated>2024-03-05T13:21:15Z</updated>
<author>
<name>Mathias Nyman</name>
<email>mathias.nyman@linux.intel.com</email>
</author>
<published>2024-02-22T23:33:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=69c63350e573367f9c8594162288cffa8a26d0d1'/>
<id>urn:sha1:69c63350e573367f9c8594162288cffa8a26d0d1</id>
<content type='text'>
Unused USB ports may have bogus location data in ACPI PLD tables.
This causes port peering failures as these unused USB2 and USB3 ports
location may match.

Due to these failures the driver prints a
"usb: port power management may be unreliable" warning, and
unnecessarily blocks port power off during runtime suspend.

This was debugged on a couple DELL systems where the unused ports
all returned zeroes in their location data.
Similar bugreports exist for other systems.

Don't try to peer or match ports that have connect type set to
USB_PORT_NOT_USED.

Fixes: 3bfd659baec8 ("usb: find internal hub tier mismatch via acpi")
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218465
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218486
Tested-by: Paul Menzel &lt;pmenzel@molgen.mpg.de&gt;
Link: https://lore.kernel.org/linux-usb/5406d361-f5b7-4309-b0e6-8c94408f7d75@molgen.mpg.de
Cc: stable@vger.kernel.org # v3.16+
Signed-off-by: Mathias Nyman &lt;mathias.nyman@linux.intel.com&gt;
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218490
Link: https://lore.kernel.org/r/20240222233343.71856-1-mathias.nyman@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT</title>
<updated>2024-01-28T00:39:54Z</updated>
<author>
<name>Oliver Neukum</name>
<email>oneukum@suse.com</email>
</author>
<published>2024-01-22T15:35:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f17c34ffc792bbb520e4b61baa16b6cfc7d44b13'/>
<id>urn:sha1:f17c34ffc792bbb520e4b61baa16b6cfc7d44b13</id>
<content type='text'>
The OTG 1.3 spec has the feature A_ALT_HNP_SUPPORT, which tells
a device that it is connected to the wrong port. Some devices
refuse to operate if you enable that feature, because it indicates
to them that they ought to request to be connected to another port.

According to the spec this feature may be used based only the following
three conditions:

6.5.3 a_alt_hnp_support
Setting this feature indicates to the B-device that it is connected to
an A-device port that is not capable of HNP, but that the A-device does
have an alternate port that is capable of HNP.
The A-device is required to set this feature under the following conditions:
• the A-device has multiple receptacles
• the A-device port that connects to the B-device does not support HNP
• the A-device has another port that does support HNP

A check for the third and first condition is missing. Add it.

Signed-off-by: Oliver Neukum &lt;oneukum@suse.com&gt;
Cc: stable &lt;stable@kernel.org&gt;
Fixes: 7d2d641c44269 ("usb: otg: don't set a_alt_hnp_support feature for OTG 2.0 device")
Link: https://lore.kernel.org/r/20240122153545.12284-1-oneukum@suse.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: core: Prevent null pointer dereference in update_port_device_state</title>
<updated>2024-01-28T00:38:39Z</updated>
<author>
<name>Udipto Goswami</name>
<email>quic_ugoswami@quicinc.com</email>
</author>
<published>2024-01-10T09:58:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=12783c0b9e2c7915a50d5ec829630ff2da50472c'/>
<id>urn:sha1:12783c0b9e2c7915a50d5ec829630ff2da50472c</id>
<content type='text'>
Currently, the function update_port_device_state gets the usb_hub from
udev-&gt;parent by calling usb_hub_to_struct_hub.
However, in case the actconfig or the maxchild is 0, the usb_hub would
be NULL and upon further accessing to get port_dev would result in null
pointer dereference.

Fix this by introducing an if check after the usb_hub is populated.

Fixes: 83cb2604f641 ("usb: core: add sysfs entry for usb device state")
Cc: stable@vger.kernel.org
Signed-off-by: Udipto Goswami &lt;quic_ugoswami@quicinc.com&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20240110095814.7626-1-quic_ugoswami@quicinc.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>USB: core: Use device_driver directly in struct usb_driver and usb_device_driver</title>
<updated>2024-01-04T15:06:32Z</updated>
<author>
<name>Yajun Deng</name>
<email>yajun.deng@linux.dev</email>
</author>
<published>2024-01-04T03:28:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=49a78b05d5ca1e23fd737747a8757b8bdc319b30'/>
<id>urn:sha1:49a78b05d5ca1e23fd737747a8757b8bdc319b30</id>
<content type='text'>
There is usbdrv_wrap in struct usb_driver and usb_device_driver, it
contains device_driver and for_devices. for_devices is used to
distinguish between device drivers and interface drivers.

Like the is_usb_device(), it tests the type of the device. We can test
that if the probe of device_driver is equal to usb_probe_device in
is_usb_device_driver(), and then the struct usbdrv_wrap is no longer
needed.

Clean up struct usbdrv_wrap, use device_driver directly in struct
usb_driver and usb_device_driver. This makes the code cleaner.

Signed-off-by: Yajun Deng &lt;yajun.deng@linux.dev&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20240104032822.1896596-1-yajun.deng@linux.dev
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: core: Fix crash w/ usb_choose_configuration() if no driver</title>
<updated>2023-12-15T12:54:09Z</updated>
<author>
<name>Douglas Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2023-12-11T15:32:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=44995e6f07028f798efd0c3c11a1efc78330f600'/>
<id>urn:sha1:44995e6f07028f798efd0c3c11a1efc78330f600</id>
<content type='text'>
It's possible that usb_choose_configuration() can get called when a
USB device has no driver. In this case the recent commit a87b8e3be926
("usb: core: Allow subclassed USB drivers to override
usb_choose_configuration()") can cause a crash since it dereferenced
the driver structure without checking for NULL. Let's add a check.

A USB device with no driver is an anomaly, so make
usb_choose_configuration() return immediately if there is no driver.

This was seen in the real world when usbguard got ahold of a r8152
device at the wrong time. It can also be simulated via this on a
computer with one r8152-based USB Ethernet adapter:
  cd /sys/bus/usb/drivers/r8152-cfgselector
  to_unbind="$(ls -d *-*)"
  real_dir="$(readlink -f "${to_unbind}")"
  echo "${to_unbind}" &gt; unbind
  cd "${real_dir}"
  echo 0 &gt; authorized
  echo 1 &gt; authorized

Fixes: a87b8e3be926 ("usb: core: Allow subclassed USB drivers to override usb_choose_configuration()")
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Link: https://lore.kernel.org/r/20231211073237.v3.1.If27eb3bf7812f91ab83810f232292f032f4203e0@changeid
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: hub: Add quirk to decrease IN-ep poll interval for Microchip USB491x hub</title>
<updated>2023-12-06T03:37:07Z</updated>
<author>
<name>Hardik Gajjar</name>
<email>hgajjar@de.adit-jv.com</email>
</author>
<published>2023-12-05T18:18:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=855d75cf8311fee156fabb5639bb53757ca83dd4'/>
<id>urn:sha1:855d75cf8311fee156fabb5639bb53757ca83dd4</id>
<content type='text'>
There is a potential delay in notifying Linux USB drivers of downstream
USB bus activity when connecting a high-speed or superSpeed device via the
Microchip USB491x hub. This delay is due to the fixed bInterval value of
12 in the silicon of the Microchip USB491x hub.

Microchip requested to ignore the device descriptor and decrease that
value to 9 as it was too late to modify that in silicon.

This patch speeds up the USB enummeration process that helps to pass
Apple Carplay certifications and improve the User experience when utilizing
the USB device via Microchip Multihost USB491x Hub.

A new hub quirk HUB_QUIRK_REDUCE_FRAME_INTR_BINTERVAL speeds up
the notification process for Microchip USB491x hub by limiting
the maximum bInterval value to 9.

Signed-off-by: Hardik Gajjar &lt;hgajjar@de.adit-jv.com&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20231205181829.127353-2-hgajjar@de.adit-jv.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: hub: Replace hardcoded quirk value with BIT() macro</title>
<updated>2023-12-06T03:36:05Z</updated>
<author>
<name>Hardik Gajjar</name>
<email>hgajjar@de.adit-jv.com</email>
</author>
<published>2023-12-05T18:18:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6666ea93d2c422ebeb8039d11e642552da682070'/>
<id>urn:sha1:6666ea93d2c422ebeb8039d11e642552da682070</id>
<content type='text'>
This patch replaces the hardcoded quirk value in the macro with
BIT().

Signed-off-by: Hardik Gajjar &lt;hgajjar@de.adit-jv.com&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20231205181829.127353-1-hgajjar@de.adit-jv.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: core: Allow subclassed USB drivers to override usb_choose_configuration()</title>
<updated>2023-12-04T13:28:20Z</updated>
<author>
<name>Douglas Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2023-12-01T18:29:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a87b8e3be926af0fc3b9b1af42b1127bd1ff077c'/>
<id>urn:sha1:a87b8e3be926af0fc3b9b1af42b1127bd1ff077c</id>
<content type='text'>
For some USB devices we might want to do something different for
usb_choose_configuration(). One example here is the r8152 driver where
we want to end up using the vendor driver with the preferred
interface.

The r8152 driver tried to make things work by implementing a USB
generic_subclass driver and then overriding the normal config
selection after it happened. This is less than ideal and also caused
breakage if someone deauthorized and re-authorized the USB device
because the USB core ended up going back to it's default logic for
choosing the best config. I made an attempt to fix this [1] but it was
a bit ugly.

Let's do this better and allow USB generic_subclass drivers to
override usb_choose_configuration().

[1] https://lore.kernel.org/r/20231130154337.1.Ie00e07f07f87149c9ce0b27ae4e26991d307e14b@changeid

Suggested-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20231201102946.v2.2.Iade5fa31997f1a0ca3e1dec0591633b02471df12@changeid
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>usb: core: Don't force USB generic_subclass drivers to define probe()</title>
<updated>2023-12-04T13:28:19Z</updated>
<author>
<name>Douglas Anderson</name>
<email>dianders@chromium.org</email>
</author>
<published>2023-12-01T18:29:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c2d95fcff0f01fa00d9683dddeeea6732b74c779'/>
<id>urn:sha1:c2d95fcff0f01fa00d9683dddeeea6732b74c779</id>
<content type='text'>
There's no real reason that subclassed USB drivers _need_ to define
probe() since they might want to subclass for some other reason. Make
it optional to define probe() if we're a generic_subclass.

Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Reviewed-by: Grant Grundler &lt;grundler@chromium.org&gt;
Reviewed-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Link: https://lore.kernel.org/r/20231201102946.v2.1.I7ea0dd55ee2acdb48b0e6d28c1a704ab2c29206f@changeid
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 6.7-rc3 into usb-next</title>
<updated>2023-11-27T09:23:49Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2023-11-27T09:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3396b3372e61f8b579395e32c53212612b14daff'/>
<id>urn:sha1:3396b3372e61f8b579395e32c53212612b14daff</id>
<content type='text'>
We need the USB/PHY/Thunderbolt fixes in here as well for later patches
to build on top of.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
