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 414A1C77B7A for ; Tue, 30 May 2023 00:42:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229621AbjE3Ame (ORCPT ); Mon, 29 May 2023 20:42:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbjE3Amd (ORCPT ); Mon, 29 May 2023 20:42:33 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 4E7A5D9 for ; Mon, 29 May 2023 17:42:32 -0700 (PDT) Received: (qmail 389153 invoked by uid 1000); 29 May 2023 20:42:31 -0400 Date: Mon, 29 May 2023 20:42:31 -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, 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, Francesco Dolcini Subject: Re: [PATCH v2] usb: gadget: udc: core: Offload usb_udc_vbus_handler processing Message-ID: <56f54ab7-4c4a-45fc-9d43-c15c1ac07fd9@rowland.harvard.edu> References: <20230519043041.1593578-1-badhri@google.com> <547ecbb2-921d-4714-82b7-066202ccf292@rowland.harvard.edu> <406371f0-db48-4195-b85d-b75ce83e738b@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Mon, May 29, 2023 at 04:32:29PM -0700, Badhri Jagan Sridharan wrote: > On Sat, May 27, 2023 at 9:36 AM Alan Stern wrote: > > > > I think it would be better just to merge the new material into > > usb_gadget_connect() and usb_gadget_disconnect(). > > I ended up merging them into usb_gadget_pullup_update_locked() so that > each of the individual helper function can call > usb_gadget_pullup_update_locked() while holding the connect_lock. I > actually had usb_gadget_(dis)connect() set udc->vbus. What? No, that's not right. They are two completely separate concepts. The host controls VBUS and the gadget controls the pullup. > It appears to me > that both usb_gadget_(dis)connect() and usb_udc_vbus_handler() are > meant to be called based on vbus presence and hence seem to be > redundant. They are not. We need to support turning off the pullup while VBUS is on. > Wondering if we could get rid of usb_gadget_(dis)connect() > given that drivers/power/supply/isp1704_charger.c is only call it and > instead make it call usb_udc_vbus_handler() instead ? In short, no. Alan Stern