Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3505916rdb; Wed, 13 Sep 2023 14:19:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHYU1K7v9Qh/iC3mBSObxkktlqdCZ4Ys2f80NCdb4vhXb6fToGP9+DhSnvqNuYkb9x/kdTN X-Received: by 2002:a05:6a20:9190:b0:153:63b9:8bf9 with SMTP id v16-20020a056a20919000b0015363b98bf9mr4124570pzd.0.1694639953089; Wed, 13 Sep 2023 14:19:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694639953; cv=none; d=google.com; s=arc-20160816; b=a0ofEk8U/4hRtgmv3FTqpr8BV/wDdt3OBO6B682i4cnfSmYGHjurBPnDeow/+/JRga FC4pNK9p7Rz+UDnCRhosnOsiTzq5nXOZbFhN8Shv38dhK5bpJZYMuXQXuB0U9m1SMOdu HmG7G6GlLE3U0zRDDxYPBZDOrs2R/rxIGC1TSfhCqv2STyE0QW5d4M92SDJ7MmHb1YJ1 1YTVvDSh/ai2UO/wXhJNJi4ahSCml3U0BRy7oNHwAVpqNX5Apdy+bdD5ygIDJk+ciWTR RpCzPft4erlCWoxf8DriwCKyidi2dUWjSA3Vqz8YDkTAe7hlsd6FVx7DStVZLwuFnLGE vfOA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=V8qhiHa7+BvC0kXe89yuDCEwUnhTU0BOixVE/J6R3Ts=; fh=Uks5GDAKpH76looF0FSnTV9QnOyZheBdQVbTIvS7TYs=; b=xrQNzywmcIzOhYssJ179TK3/X7xOag15SMrWnkYrlCunrBkcziaLaf1c7cLGRczGPm vFjTKMO2iHImbaM6Xmdjxm5tEoM+XBr6i52EHHaTBlEzJFz1R4T31GjaIpoBtbLIRryK 8PGCKTRiKQ/lSP4ycL8X9lT1C3Cyk5QIlY9CiNamxUcfB1EEPj+/ao/Hq2OL/Yw8Lmuq 1JtquEAILMM2y5X8UZmCutIFmfV9cFbGg27ZEZVOYG2/Xo79NLYuVH7/YEZuUvahehpa 52qVuZg0Pz/Hpzp8usxQYO3Hfq0wTH5KbkOtyeBD0QxvKWT8pSk3Kd0xDrG88si9PPCW ivLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id f13-20020a056a00228d00b00690296eb869si67852pfe.257.2023.09.13.14.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 14:19:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id A927F809268F; Wed, 13 Sep 2023 14:11:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229990AbjIMVL2 (ORCPT + 99 others); Wed, 13 Sep 2023 17:11:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjIMVL1 (ORCPT ); Wed, 13 Sep 2023 17:11:27 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 059DB1720 for ; Wed, 13 Sep 2023 14:11:22 -0700 (PDT) Received: (qmail 969791 invoked by uid 1000); 13 Sep 2023 17:11:22 -0400 Date: Wed, 13 Sep 2023 17:11:22 -0400 From: Alan Stern To: Greg KH Cc: Randy Li , linux-usb@vger.kernel.org, Linux Media Mailing List , linux-kernel@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org Subject: Re: USB: DMA: mapping existing buffer is not supported? Message-ID: <52643326-3a43-43b3-9be1-f13a255a7fc8@rowland.harvard.edu> References: <1e783efe-8659-8be1-82b7-15186302e88c@soulik.info> <2023091323-trombone-storeroom-cbd3@gregkh> <2023091306-affection-lifter-3d9d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2023091306-affection-lifter-3d9d@gregkh> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 13 Sep 2023 14:11:41 -0700 (PDT) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email On Wed, Sep 13, 2023 at 10:32:12PM +0200, Greg KH wrote: > On Thu, Sep 14, 2023 at 04:09:06AM +0800, Randy Li wrote: > > > > On 2023/9/14 03:19, Greg KH wrote: > > > On Thu, Sep 14, 2023 at 03:06:58AM +0800, Randy Li wrote: > > > > Hello > > > > > > > > I was trying to understand why USB webcams (UVC) have to copy video data > > > > through the CPU (uvc_video_complete() schedules uvc_video_copy_data_work() > > > > for this purpose). During my investigation, I noticed that functions > > > > like|usb_sg_*() and |usb_buffer_*() are not available since kernel version > > > > 2.6.12. > > > What do you mean by "not available"? I see them in the tree today, why > > > do you think they are not present? > > > > > usb_buffer_dmasync_sg(), usb_buffer_map(), usb_buffer_dmasync() and usb_buffer_unmap()?are all disabled > > by #if 0 in include/usb/usb.h > > > > usb_buffer_map_sg() and usb_buffer_unmap_sg() are just declaration without definition. > > Sorry, I was looking at the usb_sg_* calls, those are there if you want > to use them. > > But again, why not just use the normal sg field in the urb itself for > the scatter-gather pointer? Will that not work for you? > > > > > If the USB subsystem can no longer work with existing buffers, I propose > > > > that we consider removing the remaining documentation in the "Working with > > > > existing buffers" section of Documentation/driver-api/usb/dma.rst. > > > I don't understand, what is wrong with the information there exactly? > > > Have you tried following the suggestions there? > > Besides my answer to first question, I found no code use them today. That's exactly what it says at the end of the file: ---------------------------------------------------------------------------- Note that several of those interfaces are currently commented out, since they don't have current users. See the source code. Other than the dmasync calls (where the underlying DMA primitives have changed), most of them can easily be commented back in if you want to use them. ---------------------------------------------------------------------------- So Randy, the answer to your question is that those routines are not available any more because nothing needs to use them. If you would like to submit a patch removing the "Working with existing buffers" section from the documentation file, feel free to do so. Alan Stern