usb: gadget: aspeed: Fix probe regression
Subsystems (3)
Joel Stanley
maintainerPATCH 1/1 usb: gadget: aspeed: Fix probe regression
Since commit fc274c1e9973 ("USB: gadget: Add a new bus for gadgets"), the gadget devices are proper driver core devices, which caused each device to request pinmux settings:
aspeed_vhub 1e6a0000.usb-vhub: Initialized virtual hub in USB2 mode
aspeed-g5-pinctrl 1e6e2080.pinctrl: pin A7 already requested by 1e6a0000.usb-vhub; cannot claim for gadget.0 aspeed-g5-pinctrl 1e6e2080.pinctrl: pin-232 (gadget.0) status -22
aspeed-g5-pinctrl 1e6e2080.pinctrl: could not request pin 232 (A7) from group USB2AD on device aspeed-g5-pinctrl g_mass_storage gadget.0: Error applying setting, reverse things back
The vhub driver has already claimed the pins, so prevent the gadgets from requesting them too by setting the magic of_node_reused flag. This causes the driver core to skip the mux request.
--- drivers/usb/gadget/udc/aspeed-vhub/dev.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/gadget/udc/aspeed-vhub/dev.c +1 -0
@@ -591,6 +591,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx) d->gadget.max_speed =USB_SPEED_HIGH ; d->gadget.speed =USB_SPEED_UNKNOWN ; d->gadget.dev.of_node = vhub->pdev->dev.of_node; + d->gadget.dev.of_node_reused = true; rc =usb_add_gadget_udc (d->port_dev, &d->gadget);if (rc !=0 )
Signature · 1 line
2.35.1
Quoted 14 lines · Joel Stanley
Since commit
fc274c1e9973("USB: gadget: Add a new bus for gadgets"), the gadget devices are proper driver core devices, which caused each device to request pinmux settings:
aspeed_vhub1e6a0000.usb-vhub: Initialized virtual hub in USB2 mode
aspeed-g5-pinctrl 1e6e2080.pinctrl: pin A7 already requested by 1e6a0000.usb-vhub; cannot claim for gadget.0 aspeed-g5-pinctrl 1e6e2080.pinctrl: pin-232 (gadget.0) status -22
aspeed-g5-pinctrl 1e6e2080.pinctrl: could not request pin 232 (A7) from group USB2AD on device aspeed-g5-pinctrlg_mass_storagegadget.0: Error applying setting, reverse things backThe vhub driver has already claimed the pins, so prevent the gadgets from requesting them too by setting the magic
of_node_reusedflag. This causes the driver core to skip the mux request.
Quoted 5 lines
Reported-by Zev Weiss <[email protected]>Reported-by Jae Hyun Yoo <[email protected]>Fixes fc274c1e9973 ("USB: gadget: Add a new bus for gadgets")Cc stable at vger.kernel.orgSigned-off-by Joel Stanley <[email protected]>
Thanks Joel!
Jae Hyun Yoo
Tested-byQuoted 23 lines · Zev Weiss
Quoted 16 lines · Joel Stanley
Since commit
fc274c1e9973("USB: gadget: Add a new bus for gadgets"), the gadget devices are proper driver core devices, which caused each device to request pinmux settings:
aspeed_vhub1e6a0000.usb-vhub: Initialized virtual hub in USB2 mode aspeed-g5-pinctrl 1e6e2080.pinctrl: pin A7 already requested by 1e6a0000.usb-vhub; cannot claim for gadget.0 aspeed-g5-pinctrl 1e6e2080.pinctrl: pin-232 (gadget.0) status -22 aspeed-g5-pinctrl 1e6e2080.pinctrl: could not request pin 232 (A7) from group USB2AD? on device aspeed-g5-pinctrlg_mass_storagegadget.0: Error applying setting, reverse things backThe vhub driver has already claimed the pins, so prevent the gadgets from requesting them too by setting the magic
of_node_reusedflag. This causes the driver core to skip the mux request.Quoted 5 lines
Reported-by Zev Weiss <[email protected]>Reported-by Jae Hyun Yoo <[email protected]>Fixes fc274c1e9973 ("USB: gadget: Add a new bus for gadgets")Cc stable at vger.kernel.orgSigned-off-by Joel Stanley <[email protected]>
Quoted 3 lines
Thanks Joel!
Tested-by Zev Weiss <[email protected]>
It works for my AST2600 build targets too. Thanks Joel!