linux/drivers/usb/core
Oliver Neukum 44c7567cc4 USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT
commit f17c34ffc7 upstream.

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 <oneukum@suse.com>
Cc: stable <stable@kernel.org>
Fixes: 7d2d641c44 ("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 <gregkh@linuxfoundation.org>
History 2024-02-23 08:55:04 +01:00
..
buffer.c usb: usbfs: Enforce page requirements for mmap 2023-06-14 11:13:07 +02:00
config.c usb: config: fix iteration issue in 'usb_get_bos_descriptor()' 2023-12-08 08:48:02 +01:00
devices.c usb: common: add function to get interval expressed in us unit 2021-03-10 09:37:17 +01:00
devio.c usb: hide unused usbfs_notify_suspend/resume functions 2023-07-23 13:47:23 +02:00
driver.c USB: core: rename usb_driver_claim_interface() data parameter 2021-03-23 12:39:39 +01:00
endpoint.c usb: common: add function to get interval expressed in us unit 2021-03-10 09:37:17 +01:00
file.c USB: core: Fix races in character device registration and deregistraion 2019-08-12 22:47:24 +02:00
generic.c usbcore: Check both id_table and match() when both available 2020-10-28 13:24:58 +01:00
hcd-pci.c USB: hcd-pci: Fully suspend across freeze/thaw cycle 2022-06-14 18:36:21 +02:00
hcd.c USB: core: Change usb_get_device_descriptor() API 2023-09-19 12:22:53 +02:00
hub.c USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT 2024-02-23 08:55:04 +01:00
hub.h usb: hub: Guard against accesses to uninitialized BOS descriptors 2023-10-19 23:05:39 +02:00
Kconfig USB: hub: Add Kconfig option to reduce number of port initialization retries 2020-10-02 11:29:02 +02:00
ledtrig-usbport.c usb: core: ledtrig-usbport: Demote obvious misuse of kerneldoc to standard comment blocks 2020-07-09 16:46:57 +02:00
Makefile usb: core: add a wrapper for the USB PHYs on the HCD 2018-03-09 09:43:53 -08:00
message.c USB: core: Change usb_get_device_descriptor() API 2023-09-19 12:22:53 +02:00
notify.c USB: core: Remove usbfs_mutex 2019-06-26 10:28:09 +08:00
of.c drivers: usb: Fix trivial spelling 2020-06-18 10:13:16 +02:00
otg_productlist.h USB: OTG: rename product list of devices 2020-06-19 08:58:55 +02:00
phy.c usb: core: phy: add support for PHY calibration 2019-09-03 15:54:55 +02:00
phy.h usb: core: phy: add support for PHY calibration 2019-09-03 15:54:55 +02:00
port.c Revert "usb: Link the ports to the connectors they are attached to" 2021-04-12 14:36:02 +02:00
quirks.c USB: quirks: add quirk for Focusrite Scarlett 2023-08-03 10:22:42 +02:00
sysfs.c USB: core: Don't hold device lock while reading the "descriptors" sysfs file 2023-03-03 11:45:54 +01:00
urb.c USB: core: Fix hang in usb_kill_urb by adding memory barriers 2022-02-01 17:27:04 +01:00
usb-acpi.c usb: acpi: add helper to check port lpm capability using acpi _DSM 2023-01-24 07:22:44 +01:00
usb.c USB: core: Add routines for endpoint checks in old drivers 2023-05-30 13:55:31 +01:00
usb.h USB: core: Change usb_get_device_descriptor() API 2023-09-19 12:22:53 +02:00