[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c181c8ef-f342-4a31-9b8c-e1fa14ad214e@rowland.harvard.edu>
Date: Fri, 19 May 2023 10:49:49 -0400
From: Alan Stern <stern@...land.harvard.edu>
To: Badhri Jagan Sridharan <badhri@...gle.com>
Cc: gregkh@...uxfoundation.org, colin.i.king@...il.com,
xuetao09@...wei.com, quic_eserrao@...cinc.com,
water.zhangjiantao@...wei.com, peter.chen@...escale.com,
balbi@...com, francesco@...cini.it, alistair@...stair23.me,
stephan@...hold.net, bagasdotme@...il.com, luca@...tu.xyz,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
stable@...r.kernel.org,
Francesco Dolcini <francesco.dolcini@...adex.com>
Subject: Re: [PATCH v2] usb: gadget: udc: core: Offload usb_udc_vbus_handler
processing
On Fri, May 19, 2023 at 04:30:41AM +0000, Badhri Jagan Sridharan wrote:
> chipidea udc calls usb_udc_vbus_handler from udc_start gadget
> ops causing a deadlock. Avoid this by offloading usb_udc_vbus_handler
> processing.
Look, this is way overkill.
usb_udc_vbus_handler() has only two jobs to do: set udc->vbus and call
usb_udc_connect_control(). Furthermore, it gets called from only two
drivers: chipidea and max3420.
Why not have the callers set udc->vbus themselves and then call
usb_gadget_{dis}connect() directly? Then we could eliminate
usb_udc_vbus_handler() entirely. And the unnecessary calls -- the ones
causing deadlocks -- from within udc_start() and udc_stop() handlers can
be removed with no further consequence.
This approach simplifies and removes code. Whereas your approach
complicates and adds code for no good reason.
Alan Stern
Powered by blists - more mailing lists