linux/drivers/usb/gadget/udc
Jeremy Kerr dba7567c2f usb: gadget: aspeed_udc: fix device address configuration
In the aspeed UDC setup, we configure the UDC hardware with the assigned
USB device address.

However, we have an off-by-one in the bitmask, so we're only setting the
lower 6 bits of the address (USB addresses being 7 bits, and the
hardware bitmask being bits 0:6).

This means that device enumeration fails if the assigned address is
greater than 64:

[  344.607255] usb 1-1: new high-speed USB device number 63 using ehci-platform
[  344.808459] usb 1-1: New USB device found, idVendor=cc00, idProduct=cc00, bcdDevice= 6.10
[  344.817684] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  344.825671] usb 1-1: Product: Test device
[  344.831075] usb 1-1: Manufacturer: Test vendor
[  344.836335] usb 1-1: SerialNumber: 00
[  349.917181] usb 1-1: USB disconnect, device number 63
[  352.036775] usb 1-1: new high-speed USB device number 64 using ehci-platform
[  352.249432] usb 1-1: device descriptor read/all, error -71
[  352.696740] usb 1-1: new high-speed USB device number 65 using ehci-platform
[  352.909431] usb 1-1: device descriptor read/all, error -71

Use the correct mask of 0x7f (rather than 0x3f), and generate this
through the GENMASK macro, so we have numbers that correspond exactly
to the hardware register definition.

Fixes: 055276c132 ("usb: gadget: add Aspeed ast2600 udc driver")
Cc: stable@vger.kernel.org
Reviewed-by: Neal Liu <neal_liu@aspeedtech.com>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Link: https://lore.kernel.org/r/20240613-aspeed-udc-v2-1-29501ce9cb7a@codeconstruct.com.au
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-06-20 19:38:21 +02:00
..
aspeed-vhub usb: gadget: aspeed: Use devm_platform_get_and_ioremap_resource() 2023-07-27 10:24:08 +02:00
bdc usb: bdc: Convert to platform remove callback returning void 2023-05-28 12:36:25 +01:00
cdns2 tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
amd5536udc_pci.c usb: gadget: udc: fix NULL dereference in remove() 2023-05-29 15:24:24 +01:00
amd5536udc.h
aspeed_udc.c usb: gadget: aspeed_udc: fix device address configuration 2024-06-20 19:38:21 +02:00
at91_udc.c usb: gadget: at91_udc: Convert to platform remove callback returning void 2023-11-22 12:02:53 +00:00
at91_udc.h
atmel_usba_udc.c usb: gadget: udc: atmel: Replace snprintf() with the safer scnprintf() variant 2023-12-15 13:55:29 +01:00
atmel_usba_udc.h
bcm63xx_udc.c usb: gadget/bcm63xx_udc: Convert to platform remove callback returning void 2023-05-28 12:36:25 +01:00
core.c Merge 6.9-rc2 into usb-next 2024-04-01 17:02:18 +02:00
dummy_hcd.c usb: gadget: dummy_hcd: Set transfer interval to 1 microframe 2024-04-18 16:47:07 +02:00
fsl_qe_udc.c usb: Use device_get_match_data() 2023-10-10 08:55:23 +02:00
fsl_qe_udc.h
fsl_udc_core.c usb: gadget: fsl: Initialize udc before using it 2024-04-05 08:08:37 +02:00
fsl_usb2_udc.h usb: gadget: fsl-udc: Replace custom log wrappers by dev_{err,warn,dbg,vdbg} 2024-03-05 13:29:03 +00:00
fusb300_udc.c usb: gadget: fusb300-udc: Convert to use module_platform_driver() 2023-10-21 12:47:24 +02:00
fusb300_udc.h
goku_udc.c usb: gadget: udc: do not clear gadget driver.bus 2023-02-02 09:41:17 +01:00
goku_udc.h
gr_udc.c usb: gadget: gr_udc: Convert to platform remove callback returning void 2023-11-22 12:02:53 +00:00
gr_udc.h
Kconfig usb: cdns2: Add main part of Cadence USBHS driver 2023-06-13 11:59:29 +02:00
lpc32xx_udc.c usb: gadget: lpc32xx_udc: Convert to platform remove callback returning void 2023-11-22 12:02:53 +00:00
m66592-udc.c usb: gadget: m66592-udc: Convert to use module_platform_driver() 2023-10-21 12:47:24 +02:00
m66592-udc.h
Makefile usb: cdns2: Add main part of Cadence USBHS driver 2023-06-13 11:59:29 +02:00
max3420_udc.c usb: gadget: max3420_udc: Follow renaming of SPI "master" to "controller" 2024-02-08 11:54:57 +00:00
mv_u3d_core.c usb: gadget: mv_u3d: replace deprecated strncpy with strscpy 2024-03-26 10:44:32 +01:00
mv_u3d.h
mv_udc_core.c drivers/usb/gadget/udc: Fix spelling typo in comments(reqest->request) 2024-01-02 14:41:15 +01:00
mv_udc.h
net2272.c usb: gadget: net2272: Use irqflags in the call to net2272_probe_fin 2024-03-07 20:59:30 +00:00
net2272.h
net2280.c usb: gadget: udc: do not clear gadget driver.bus 2023-02-02 09:41:17 +01:00
net2280.h
omap_udc.c usb: gadget: omap_udc: remove unused variable 2024-04-04 17:06:19 +02:00
omap_udc.h
pch_udc.c usb: gadget: pch_udc: fix an Excess kernel-doc warning 2024-01-27 17:41:26 -08:00
pxa25x_udc.c usb: gadget: pxa25x_udc: Convert to platform remove callback returning void 2023-11-22 12:02:53 +00:00
pxa25x_udc.h
pxa27x_udc.c USB: gadget: pxa27x_udc: Remove unused of_gpio.h 2024-03-07 20:58:30 +00:00
pxa27x_udc.h
r8a66597-udc.c usb: gadget: r8a66597-udc: Convert to use module_platform_driver() 2023-10-21 12:47:24 +02:00
r8a66597-udc.h
renesas_usb3.c usb: Explicitly include correct DT includes 2023-07-25 18:20:02 +02:00
renesas_usbf.c usb: gadget: udc: Remove redundant initialization for udc_driver 2023-08-04 14:46:40 +02:00
rzv2m_usb3drd.c usb: gadget/rzv2m_usb3drd: Convert to platform remove callback returning void 2023-05-28 12:36:27 +01:00
snps_udc_core.c usb: gadget: udc: do not clear gadget driver.bus 2023-02-02 09:41:17 +01:00
snps_udc_plat.c usb: gadget/snps_udc_plat: Remove unused of_gpio.h 2024-03-07 20:58:27 +00:00
tegra-xudc.c usb: gadget: tegra-xudc: Fix USB3 PHY retrieval logic 2024-03-07 20:58:33 +00:00
trace.c
trace.h tracing/treewide: Remove second parameter of __assign_str() 2024-05-22 20:14:47 -04:00
udc-xilinx.c usb: gadget: udc-xilinx: replace memcpy with memcpy_toio 2023-10-02 14:26:36 +02:00