Re: [PATCH] usb: gadget: aspeed: Fix probe regression

From: Jae Hyun Yoo
Date: Mon Oct 17 2022 - 17:00:37 EST


On 10/17/2022 1:40 PM, Zev Weiss wrote:
On Sun, Oct 16, 2022 at 10:30:06PM PDT, Joel Stanley wrote:
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.

Reported-by: Zev Weiss <zev@xxxxxxxxxxxxxxxxx>
Reported-by: Jae Hyun Yoo <quic_jaehyoo@xxxxxxxxxxx>
Fixes: fc274c1e9973 ("USB: gadget: Add a new bus for gadgets")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Joel Stanley <joel@xxxxxxxxx>

Thanks Joel!

Tested-by: Zev Weiss <zev@xxxxxxxxxxxxxxxxx>

It works for my AST2600 build targets too. Thanks Joel!

Tested-by: Jae Hyun Yoo <quic_jaehyoo@xxxxxxxxxxx>