Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6161763rwi; Tue, 18 Oct 2022 08:50:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/Q/xxcq1BpWwbqaMBsoHhIzsD7rgVJyNXErifA7+oLH8t0+FBvFkPNxrCh1gWjZBa0A+c X-Received: by 2002:a17:907:3d91:b0:78d:f675:5659 with SMTP id he17-20020a1709073d9100b0078df6755659mr2953098ejc.92.1666108219679; Tue, 18 Oct 2022 08:50:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666108219; cv=none; d=google.com; s=arc-20160816; b=jwm994B4REyeftBrti/YTKPxxPTwMKCaahJ4ONgroeC3y+Iyx625L1RanFHtus/P2n 4jcbftDziXRSYLWbRXxv93+YhWeo2EywsNSh8NpBiAXHpXZbmpevJXL5z4vFBti6CA4z WSO4GH22yz19D091OlTPt3bQcnnF8vVdv0OCNlAOC67u1ZNmg5VWEAHuQ8IgI1dPMBue PNLudyi+4EVEkAnLGif9xfu6rnNyM5pH80mf6nNunovuvKctOvZBM9nLHy++dq5mVU4U b3nBaL4HNIXp7qi+HqJAKF8dvm07ZXQ8Ry6WGB/cYMrMTTI5pM4EpAgS7f32RIIEjQ2A 83WA== 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=tHBq5UKi/EEWbD0Zaseh2LYNpZ2yWNFUtg0bX5ZCBog=; b=SsW+CGuAqyTyRiUaL1qanrUCaunoRJZGBW8IvBBffe2fCcfX3My6d6C7AJuxYX6+Uv dWDKem9KM5Lay4iiAMDiJjFDls9VecU+W0hS/Xz/crxD10nLcbL9YBA35mACClmPLk9x jtbCSmP7f5wokLo4mq94MkdXXaj0HoYGXBdEsSk1H1knY8kslm72VC9HYwK8QzodQ1Q0 3U+c0wOKmvY92F2FpvgBtKXzNYF2pwhdEtgr7bvbouk+/bfBGWx4o9r8q8vfOU7BXE66 OE56uQBzOeawpkejTD3zCX4X8uUu29nouhN3sO3N+Jb+hoNGFraen0CsyBn8igoS/1r/ d+gQ== 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 m15-20020a1709060d8f00b0073db9474d06si11010174eji.325.2022.10.18.08.49.53; Tue, 18 Oct 2022 08:50:19 -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 S231548AbiJROcm (ORCPT + 99 others); Tue, 18 Oct 2022 10:32:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231297AbiJROch (ORCPT ); Tue, 18 Oct 2022 10:32:37 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id F0066C894B for ; Tue, 18 Oct 2022 07:32:34 -0700 (PDT) Received: (qmail 1213921 invoked by uid 1000); 18 Oct 2022 10:32:33 -0400 Date: Tue, 18 Oct 2022 10:32:33 -0400 From: Alan Stern To: Dan Scally Cc: Dan Vacura , linux-usb@vger.kernel.org, Thinh Nguyen , Jeff Vanhoof , Greg Kroah-Hartman , Jonathan Corbet , Laurent Pinchart , Felipe Balbi , Michael Grzeschik , Paul Elder , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org Subject: Re: [PATCH v3 6/6] usb: gadget: uvc: add configfs option for sg support Message-ID: References: <20221017205446.523796-1-w36195@motorola.com> <20221017205446.523796-7-w36195@motorola.com> <78c6403a-22d9-903d-f0cf-4205e17962d3@ideasonboard.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <78c6403a-22d9-903d-f0cf-4205e17962d3@ideasonboard.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 Tue, Oct 18, 2022 at 02:27:13PM +0100, Dan Scally wrote: > Hi Dan > > On 17/10/2022 21:54, Dan Vacura wrote: > > The scatter gather support doesn't appear to work well with some UDC hw. > > Add the ability to turn on the feature depending on the controller in > > use. > > > > Signed-off-by: Dan Vacura > > > Nitpick: I would call it use_sg everywhere, but either way: > > > Reviewed-by: Daniel Scally > > Tested-by: Daniel Scally > > > --- > > V1 -> V2: > > - no change, new patch in serie > > V2 -> V3: > > - default on, same as baseline > > > > Documentation/ABI/testing/configfs-usb-gadget-uvc | 1 + > > Documentation/usb/gadget-testing.rst | 2 ++ > > drivers/usb/gadget/function/f_uvc.c | 2 ++ > > drivers/usb/gadget/function/u_uvc.h | 1 + > > drivers/usb/gadget/function/uvc_configfs.c | 2 ++ > > drivers/usb/gadget/function/uvc_queue.c | 4 ++-- > > 6 files changed, 10 insertions(+), 2 deletions(-) > > > > diff --git a/Documentation/ABI/testing/configfs-usb-gadget-uvc b/Documentation/ABI/testing/configfs-usb-gadget-uvc > > index 5dfaa3f7f6a4..839a75fc28ee 100644 > > --- a/Documentation/ABI/testing/configfs-usb-gadget-uvc > > +++ b/Documentation/ABI/testing/configfs-usb-gadget-uvc > > @@ -9,6 +9,7 @@ Description: UVC function directory > > streaming_interval 1..16 > > function_name string [32] > > req_int_skip_div unsigned int > > + sg_supported 0..1 > > =================== ============================= > > What: /config/usb-gadget/gadget/functions/uvc.name/control > > diff --git a/Documentation/usb/gadget-testing.rst b/Documentation/usb/gadget-testing.rst > > index f9b5a09be1f4..8e3072d6a590 100644 > > --- a/Documentation/usb/gadget-testing.rst > > +++ b/Documentation/usb/gadget-testing.rst > > @@ -796,6 +796,8 @@ The uvc function provides these attributes in its function directory: > > function_name name of the interface > > req_int_skip_div divisor of total requests to aid in calculating > > interrupt frequency, 0 indicates all interrupt > > + sg_supported allow for scatter gather to be used if the UDC > > + hw supports it Why is a configuration option needed for this? Why not always use SG when the UDC supports it? Or at least, make the decision automatically (say, based on the amount of data to be transferred) with no need for any user input? Is this because the SG support in some UDC drivers is buggy? In that case the proper approach is to fix the UDC drivers, not add new options that users won't know when to use. Or is it because the UDC hardware itself is buggy? In that case the best approach is to fix the UDC drivers so that they don't advertise working SG support when the hardware is unable to handle it. Alan Stern