Re: [PATCH v1] usb: handle warm-reset port requests on hub_init

From: Kai-Heng Feng
Date: Tue Jan 10 2023 - 21:35:05 EST


Hi yangyinglu,

On Tue, Jan 10, 2023 at 4:20 PM yangyinglu <yangyinglu@xxxxxxxxxxx> wrote:
>
> USB-C storage device not detected on USB 3.0 host when
> plugged in after boot, so need to warm-reset port

Is it possible to enable USB dyndbg, plug a USB 3.0 device, then paste
the relevant dmesg here? Thanks!

Kai-Heng

>
> Signed-off-by: yangyinglu <yangyinglu@xxxxxxxxxxx>
> ---
> drivers/usb/core/hub.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 77e73fc8d673..bd4496b80c2d 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -1159,7 +1159,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
> }
>
> /* Make sure a warm-reset request is handled by port_event */
> - if (type == HUB_RESUME &&
> + if ((type == HUB_RESUME || type == HUB_INIT2) &&
> hub_port_warm_reset_required(hub, port1, portstatus))
> set_bit(port1, hub->event_bits);
>
> --
> 2.20.1
>