2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/drivers/usb/dwc2
Fabrice Gasnier 58cd423820 usb: dwc2: gadget: remove of_node reference upon udc_stop
In dwc2_hsotg_udc_start(), e.g. when binding composite driver, "of_node"
is set to hsotg->dev->of_node.

It causes errors when binding the gadget driver several times, on
stm32mp157c-ev1 board. Below error is seen:
"pin PA10 already requested by 49000000.usb-otg; cannot claim for gadget.0"

The first time, no issue is seen as when registering the driver, of_node
isn't NULL:
-> gadget_dev_desc_UDC_store
  -> usb_gadget_register_driver_owner
    -> driver_register
    ...
      -> really_probe -> pinctrl_bind_pins (no effect)

Then dwc2_hsotg_udc_start() sets of_node.

The second time (stop the gadget, reconfigure it, then start it again),
of_node has been set, so the probing code tries to acquire pins for the
gadget. These pins are hold by the controller, hence the error.

So clear gadget.dev.of_node in udc_stop() routine to avoid the issue.

Fixes: 7d7b22928b ("usb: gadget: s3c-hsotg: Propagate devicetree to gadget drivers")
Cc: stable <stable@kernel.org>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@foss.st.com>
Link: https://lore.kernel.org/r/20250124173325.2747710-1-fabrice.gasnier@foss.st.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-02-03 16:42:05 +01:00
..
core_intr.c Merge 6.9-rc2 into usb-next 2024-04-01 17:02:18 +02:00
core.c usb: dwc2: New bitfield definition and programming in GRSTCTL 2024-03-26 10:44:53 +01:00
core.h Merge 6.9-rc2 into usb-next 2024-04-01 17:02:18 +02:00
debug.h USB: dwc2: Use the correct style for SPDX License Identifier 2020-05-05 10:58:50 +03:00
debugfs.c usb: dwc2: debugfs: Print parameter no_clock_gating 2024-07-31 10:47:10 +02:00
drd.c usb: dwc2: drd: fix clock gating on USB role switch 2024-09-11 15:35:33 +02:00
gadget.c usb: dwc2: gadget: remove of_node reference upon udc_stop 2025-02-03 16:42:05 +01:00
hcd_ddma.c usb: dwc2: host: Fix dereference issue in DDMA completion flow. 2024-04-09 17:29:38 +02:00
hcd_intr.c USB: dwc2: write HCINT with INTMASK applied 2023-11-21 15:30:27 +01:00
hcd_queue.c usb: dwc2: Remove cat_printf() 2024-03-26 10:43:45 +01:00
hcd.c usb: dwc2: Fix HCD port connection race 2024-12-04 16:30:05 +01:00
hcd.h usb: dwc2: Remove redundant license text 2022-09-22 15:52:29 +02:00
hw.h Merge 6.9-rc2 into usb-next 2024-04-01 17:02:18 +02:00
Kconfig usb: use "prompt" instead of "bool" for choice prompts 2024-11-04 17:53:09 +09:00
Makefile usb: dwc2: override PHY input signals with usb role switch support 2020-10-02 13:29:13 +03:00
params.c Revert "usb: dwc2: Skip clock gating on Broadcom SoCs" 2024-10-29 04:24:54 +01:00
pci.c usb: dwc2: add pci_device_id driver_data parse support 2023-08-22 14:49:12 +02:00
platform.c usb: Switch back to struct platform_driver::remove() 2024-10-04 15:13:03 +02:00