linux/drivers/usb/core
Oliver Neukum 2888258144 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 09:12:34 +01:00
..
buffer.c usb: usbfs: Enforce page requirements for mmap 2023-06-14 11:15:29 +02:00
config.c usb: config: fix iteration issue in 'usb_get_bos_descriptor()' 2023-12-08 08:51:17 +01:00
devices.c usb: core: devices: drop redundant buffer overflow checks 2022-04-26 13:57:38 +02:00
devio.c usb: hide unused usbfs_notify_suspend/resume functions 2023-07-19 16:21:52 +02:00
driver.c usb/core: fix repeated words in comments 2022-07-27 14:32:29 +02: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 usb: core: Fix file path that does not exist 2021-12-05 14:24:19 +01:00
hcd-pci.c USB: hcd-pci: Drop the unused id parameter from usb_hcd_pci_probe() 2022-09-01 16:08:35 +02:00
hcd.c USB: core: Change usb_get_device_descriptor() API 2023-09-13 09:43:04 +02:00
hub.c USB: hub: check for alternate port before enabling A_ALT_HNP_SUPPORT 2024-02-23 09:12:34 +01:00
hub.h usb: hub: Guard against accesses to uninitialized BOS descriptors 2023-10-19 23:08:55 +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: misc: Add onboard_usb_hub driver 2022-07-08 14:53:50 +02:00
message.c USB: core: Change usb_get_device_descriptor() API 2023-09-13 09:43:04 +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 usb: hub: port: add sysfs entry to switch port power 2022-06-12 06:49:46 +02:00
quirks.c USB: quirks: add quirk for Focusrite Scarlett 2023-08-03 10:24:11 +02:00
sysfs.c USB: core: Don't hold device lock while reading the "descriptors" sysfs file 2023-03-03 11:52:25 +01:00
urb.c kmsan: handle memory sent to/from USB 2022-10-03 14:03:22 -07:00
usb-acpi.c usb: acpi: add helper to check port lpm capability using acpi _DSM 2023-01-24 07:24:34 +01:00
usb.c USB: core: Add routines for endpoint checks in old drivers 2023-05-30 14:03:20 +01:00
usb.h USB: core: Change usb_get_device_descriptor() API 2023-09-13 09:43:04 +02:00