From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B856CC77B75 for ; Wed, 17 May 2023 14:44:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231909AbjEQOo6 (ORCPT ); Wed, 17 May 2023 10:44:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbjEQOo4 (ORCPT ); Wed, 17 May 2023 10:44:56 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 115978F for ; Wed, 17 May 2023 07:44:53 -0700 (PDT) Received: (qmail 876293 invoked by uid 1000); 17 May 2023 10:44:53 -0400 Date: Wed, 17 May 2023 10:44:53 -0400 From: Alan Stern To: Badhri Jagan Sridharan Cc: gregkh@linuxfoundation.org, colin.i.king@gmail.com, xuetao09@huawei.com, quic_eserrao@quicinc.com, water.zhangjiantao@huawei.com, peter.chen@freescale.com, balbi@ti.com, francesco@dolcini.it, alistair@alistair23.me, stephan@gerhold.net, bagasdotme@gmail.com, luca@z3ntu.xyz, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Francesco Dolcini Subject: Re: [PATCH v1] usb: gadget: udc: core: Offload usb_udc_vbus_handler processing Message-ID: References: <20230517115955.1078339-1-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230517115955.1078339-1-badhri@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 17, 2023 at 11:59:55AM +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. Surely that is the wrong approach. The real problem here is that usb_udc_vbus_handler() gets called from within a udc_start routine. But this is totally unnecessary, because the UDC core will call usb_udc_connect_control_locked() itself, later on during gadget_bind_driver(). So a proper solution would be simply to remove the unnecessary usb_udc_vbus_handler() call from the chipidea driver (and similarly for the max3420_udc driver). Similar changes may be needed in these drivers' udc_stop routines. Alan Stern