Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp3536691rwb; Fri, 20 Jan 2023 18:21:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXsteObVaHZaTV8sSd/kLOKMKf/m+o1Ctu5KVq17y3D9yt5B2LQrLGiKnmTlQOz0b+nILVAP X-Received: by 2002:a17:90a:a618:b0:229:989:4b30 with SMTP id c24-20020a17090aa61800b0022909894b30mr17899292pjq.46.1674267659983; Fri, 20 Jan 2023 18:20:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674267659; cv=none; d=google.com; s=arc-20160816; b=0BBK0cVbk2dOT/CizTuXay/3vGx1JYc3vvEmB5RtmZRM6K5C/qXHmyJe+VA/qdinj6 S6T4BxKntumDX/syX4Efl3M6IDSAfxBld1QvEih4Olr30mmPMz+1vOBzlNRKXwkl0Tl7 dajJuTmoc1plkMrqxuWFQNyKagUYOGldFtDBTdS1KCeHLJNincjF/q3Ld2ObmZhlxazQ mhxdPekwetwGj0wgN8ECb9y5hqxw8pgTYED3aiUYiHXhUkDlQm3lVNCPVLToni0CtBia eWnT4AaJ8OKNOyThCfbPoCZkbUSgQ0D5v6ifSazxkutfVsMlUnJ0b4tXu5e2H808zYrK Q3GA== 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=4BtYm+YMjiWC+UjJ2KlAQNPmeXRl7cUJBUw+ZxUgID0=; b=jLUDycIv/+hint9c0zy/Da9YLhQQRn1AzrGauAJZGdR34mpnYXY36s1dW62Y76pGGq 1Zm+7zJz2HSrXKa23rubcPhHn72Ahis613CdUyrq/ZgGTl6eIfu6oGU42KlV7OoUDIys 3YLnk+/CzkOybhooy4mdfiIfjYJEzZ/EHD3W+P0IsIofGtmR0yOpxELTNnvwFBdurO6g bZVdEd4dgsYyFyCyqCaU3WtiScVP8OzGtVVhSAEoowU9KorftfTe/OGzAtefkdW5tgMo Cd4dWC6YgP9ClbXfqw5DNMDFww16lR7Klr3pWYh1yBX6bT2HMOzNIjuEJQEFgTBxW2XV vBCg== 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 bc22-20020a656d96000000b004d0cefdd223si9226787pgb.562.2023.01.20.18.20.53; Fri, 20 Jan 2023 18:20:59 -0800 (PST) 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 S229685AbjAUCGq (ORCPT + 50 others); Fri, 20 Jan 2023 21:06:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229639AbjAUCGp (ORCPT ); Fri, 20 Jan 2023 21:06:45 -0500 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 268C359769 for ; Fri, 20 Jan 2023 18:06:40 -0800 (PST) Received: (qmail 55081 invoked by uid 1000); 20 Jan 2023 21:06:39 -0500 Date: Fri, 20 Jan 2023 21:06:39 -0500 From: Alan Stern To: Thinh Nguyen Cc: Elson Serrao , "gregkh@linuxfoundation.org" , "balbi@kernel.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "quic_wcheng@quicinc.com" , "quic_jackp@quicinc.com" Subject: Re: [PATCH v2 1/5] usb: gadget: Add remote wakeup capable flag Message-ID: References: <1673992507-7823-1-git-send-email-quic_eserrao@quicinc.com> <1673992507-7823-2-git-send-email-quic_eserrao@quicinc.com> <20230119014409.yiw6xlp5cwlmu25s@synopsys.com> <20230120011513.ajwum224lfwwb6ws@synopsys.com> <045f9ac1-5d48-fad0-8e74-8d5144aa1431@quicinc.com> <20230121002059.mpiqavemelnntxd7@synopsys.com> <20230121020223.l2tyvyqifc7umqpy@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230121020223.l2tyvyqifc7umqpy@synopsys.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS 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 Sat, Jan 21, 2023 at 02:02:36AM +0000, Thinh Nguyen wrote: > On Fri, Jan 20, 2023, Alan Stern wrote: > > A UDC design might have multiple versions, some supporting remote wakeup > > and others not. But drivers generally use a single static > > usb_gadget_ops structure, and they don't modify it at runtime to account > > for hardware differences. So if a single driver controls those multiple > > versions, you can't rely on the presence of gadget->ops->wakeup to > > indicate whether there actually is hardware remote wakeup support. > > > > Ideally, the usb_gadget structure should have a wakeup_capable flag > > which the UDC driver would set appropriately (probably during its probe > > routine). > > > > I was thinking that it can be handled by the > usb_gadget_enable_remote_wakeup() so we can do away with the > wakeup_capable flag. usb_gadget_enable_remote_wakeup() gets called when the gadget or function is suspended, right? But a gadget driver may want to know long before that whether the UDC supports remote wakeup, in order to set up its config descriptor correctly. Alan Stern