Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2291688rwd; Wed, 17 May 2023 08:10:30 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ58asEvujZW3lvqNMroFNnR1+I/vUZI5A3zVPlS9CtSHJO3n4yxNDNURUFN4qKBsXDh8g1N X-Received: by 2002:a05:6a20:1583:b0:105:f368:dfc4 with SMTP id h3-20020a056a20158300b00105f368dfc4mr15347538pzj.2.1684336230236; Wed, 17 May 2023 08:10:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684336230; cv=none; d=google.com; s=arc-20160816; b=WnyPpWUiBmFxRFUcWgNe2J4ErlnaLQ6gUauGqef30KmVCsDFJ4a5AmKvouBzzvxL3D 81cUI2dpZMz69IPeqFtyV9bC9iMNTZmbOPCVPCXO4ZosXBI/0n80O+JVEwoE+r9l9Wm4 VwjZMzH2PpOsKzUfJPWGZhcm55BwCzqKHJjgL3ZEULEasiHPQhFLeMDLx7tZ2IHTi6qX xOBUF5ijlJgex42oVTUpdkKZd5vO7bTRhmFDoWJPMDTMWKEO1EdmrM/2T7zH98O5B5Q8 S30IBx2rME2WXlXl8YCWEK1CnA6+4K45whooTESVl/PK7ueIE89CfuRLPYgP4E8toeQR VCKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=E0KcC8nJma/d5kkVnTTRYuvp98WFlkBhDOls7KqgISk=; b=b98eW9QWWljJUzIICvO4JXWBD36Sg0B+N8YI1tHtZe4cJN89dnb5f8R9R4maaaru6v vheuenWYIxQJlUB0A2vZHPRQ1h3Cw22krmODJf7B71SIiv9YtNK0HUfHAMlEffstALAb jiZuLeOYECb9I3lVdHBjkQQqJmSmiKyQYXaIQgPV2jqxN2Kk+4zZSe/uUZ/W51fkD/s4 Sy030pO+pu/FqHXmu7HHY3j6XmSvqefTg+tC/C0Aqk27su+UJP0WLA7i4zrXoU7hrTW0 NG3ycpww6xAA9b5Dik6i9Ti96fX9/y2gJO50VLPHRocWOYLL0siAlA6I4i42130hIGTR cI1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u129-20020a627987000000b0064580409a12si22328379pfc.320.2023.05.17.08.10.17; Wed, 17 May 2023 08:10:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231903AbjEQOo5 (ORCPT + 99 others); Wed, 17 May 2023 10:44:57 -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> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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