Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3821249rwd; Mon, 29 May 2023 17:55:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7tXi/zEnp7ucQZdNMzRimPQJLyb0e4tw1spQSEYD7oqXKw18aRkP2X86l4pnTZO4E48GxM X-Received: by 2002:a17:90b:68f:b0:252:89bc:1cd9 with SMTP id m15-20020a17090b068f00b0025289bc1cd9mr9609532pjz.20.1685408131891; Mon, 29 May 2023 17:55:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685408131; cv=none; d=google.com; s=arc-20160816; b=Q75kEvnUEI//Tyay+4T0AlI3xgPdWc4cG1BW6JMy/Kq2qeqiXc6HQC/8max3Kk/YnT YzA1XMtCgVdb7G29OpEDyxBPdMWdlYoAk2WBumqCac34c6xURdeN1x5Z/aN8MhZSBBIT a3PRSs4vCEyceZb5LB22BZ2M/TN0BSUFU/ZIvsnGPz/mNiAqShFq1SHWypaSmvaiYg4L B+M9CnGzyvUNn2k4wkEw4amaMDB2OsQ7PtokZXNzC2ywwGnIjF4LA0yjAtu4zOjn12fP XuY+y05w/nxKLrRaltYgwynnbaWkB4qIwF4h3pLBQ057fLnlq9sC1llSz3y1f7AzYqvG yrWg== 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=Ty5pcguzlQr2fr0CGICEOhbxFPnuk3QoJq3ENUgKD2A=; b=fhP5jwFILJrUKeut34WOhrkgr5M+wlII6VfGPkfm0gLck9AJPFNRnhaeneL4QhaVfB xfR49snSFf2uCcz4OvT0FY06GTBB4VN4MP03LGE/vb1lvNrR+6S62hRAOo2R4vQ/uVg/ 1q2qWy0OKXnYpJ7HQsdmVC1Q9L3hiXboiwfWhR/a6mtbVjsKvS3l7bECQSpJ2M0okTWv CbMws2I09r79XiJDhuOqKSJ/ybNQyMvlidbt3IDy9OGaJyz190qpaMrR4WCa/Waxzk4d lRXwdkDYGqZ0qd7Z/ipnHGMkTAcCqgs7RwuGAky8o2g/wVNoDQFB+sh/13vNoNg6F+c9 IwMQ== 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 on1-20020a17090b1d0100b0025378fb1538si1059781pjb.41.2023.05.29.17.55.17; Mon, 29 May 2023 17:55:31 -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 S229670AbjE3AoI (ORCPT + 99 others); Mon, 29 May 2023 20:44:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjE3AoH (ORCPT ); Mon, 29 May 2023 20:44:07 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id B96D6D9 for ; Mon, 29 May 2023 17:44:05 -0700 (PDT) Received: (qmail 389211 invoked by uid 1000); 29 May 2023 20:44:05 -0400 Date: Mon, 29 May 2023 20:44:05 -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 Subject: Re: [PATCH v4 2/3] Revert "Revert "usb: gadget: udc: core: Prevent redundant calls to pullup"" Message-ID: <224b6dd7-03e4-4d49-8dca-d13619367371@rowland.harvard.edu> References: <20230529234816.3720623-1-badhri@google.com> <20230529234816.3720623-2-badhri@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230529234816.3720623-2-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 Mon, May 29, 2023 at 11:48:15PM +0000, Badhri Jagan Sridharan wrote: > This reverts commit 5e1617210aede9f1b91bb9819c93097b6da481f9. > > The regression reported in > https://lore.kernel.org/all/ZF4bMptC3Lf2Hnee@gerhold.net/ is being > fixed in > commit 7d7863db7cc0 ("usb: gadget: udc: core: Offload usb_udc_vbus_handler processing"). > Hence reverting the revert. > > Signed-off-by: Badhri Jagan Sridharan > --- > drivers/usb/gadget/udc/core.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c > index 583c339876ab..4641153e9706 100644 > --- a/drivers/usb/gadget/udc/core.c > +++ b/drivers/usb/gadget/udc/core.c > @@ -703,6 +703,9 @@ static int usb_gadget_connect_locked(struct usb_gadget *gadget) > goto out; > } > > + if (gadget->connected) > + goto out; > + > if (gadget->deactivated || !gadget->udc->started) { > /* > * If gadget is deactivated we only save new state. This is silly. There's no need to make this a separate commit; it should be merged in with the preceding patch. There's no good reason for creating a commit that contains a known error. Alan Stern