Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3625898rdb; Wed, 13 Sep 2023 19:13:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE0KMbl1Qwuq+bsDYMM4hh0rXFPWFDiiEsPc96sRqU0Vi4MELW4rR/000wVDI2FtQkFjHKD X-Received: by 2002:a67:b915:0:b0:44d:6246:658b with SMTP id q21-20020a67b915000000b0044d6246658bmr2918291vsn.4.1694657588776; Wed, 13 Sep 2023 19:13:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694657588; cv=none; d=google.com; s=arc-20160816; b=k6+w778GyfE6B9Fsmv4o0TZbrFsLpZfO0ndKNptzi3gWRRMh4uBxq6XQsHkKbfgKe0 Be+FcQTWsEzA22huhAVHO9bIZNkLsP0NL7Pn0ZnbwT0E/z9G3Ll6gn9CZw/H9Bd6w18J 7zmISVhGevBjVsXkQk3jgrclTGCMmtINdlqjJS6NJFzgjzXsEjyZEs6Sqfg9oExQM0Og Swji3Aop0woZUmJ4o2QenKsDe3qC0awLBg8KevQtQr5LHurUyPrKwYWmDGg4UWXmj97y sZBi3QUD1XFnVsDxufV0+DcUBJTdawzhSy0qFUkML6VMTbbYkeNHw6dJ2P/FRfjLN1Ws NBXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature:dkim-filter; bh=8LpVTPUsCPQXr1wiITeRmr4X6XXYzbnyOzSEdKAjgqk=; fh=QLHHjk8si54roZdrH5WED4DvNmDX4gudUNEWFGomAIw=; b=EeOVFyyUSwtvEvBn4Jmh6vNak8dRO4BkLgHHa92O+qHHib5Fx/TwcfTMM4nh15OkxD f2tiBu+1yLDS13c0ccNF4FGFxibb2Fb/TB6Hr8ldyqUpE3UKz8vEt3PPo7/mfHRSkKDq dlL7mUh3N8JxZ4r9WwPgm0KQQVdsf9WU7klFNZaTKNEtnkGy9niB7gh1Ivvo0rpByx8Z AzsJex2O8+z7rFi898++B6wP6rVsK5JruPHh4WLEt4uW8i5qJ7/zLua8kb1qg4Y1JyQv QZqIm7z6QBu2dHS748GSA1D1J/d7uaRPJS/n8Gimlf3VfeEHJ44dSploJBSUQczWnYPX gn9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soulik.info header.s=mail header.b=ttd6MdBo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=soulik.info Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id m130-20020a633f88000000b005774c8a2ea7si467397pga.159.2023.09.13.19.13.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 19:13:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@soulik.info header.s=mail header.b=ttd6MdBo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=soulik.info Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 47DF08289507; Wed, 13 Sep 2023 13:09:30 -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 S231955AbjIMUJQ (ORCPT + 99 others); Wed, 13 Sep 2023 16:09:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbjIMUJP (ORCPT ); Wed, 13 Sep 2023 16:09:15 -0400 Received: from kozue.soulik.info (kozue.soulik.info [108.61.200.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F9B19AC for ; Wed, 13 Sep 2023 13:09:11 -0700 (PDT) Received: from [192.168.10.7] (unknown [10.0.12.132]) by kozue.soulik.info (Postfix) with ESMTPSA id A549D300219; Thu, 14 Sep 2023 05:08:56 +0900 (JST) DKIM-Filter: OpenDKIM Filter v2.11.0 kozue.soulik.info A549D300219 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soulik.info; s=mail; t=1694635737; bh=8LpVTPUsCPQXr1wiITeRmr4X6XXYzbnyOzSEdKAjgqk=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ttd6MdBo3xG/+DtOGGfYck1YuM4HBVhWOleDEu+59FeyRZpaA86Zb4vw5cOiIgreB Uidv7Gl+GevqpR4vQdE+sXGfLIJUw2Wzt1vDHRCWqyLjLi9FyJ5HF4tk183MwhrdRi 5EUpJJMm0mtk495jt7KDh7ZaCM2aDTKSPKEaWb0U= Message-ID: Date: Thu, 14 Sep 2023 04:09:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: USB: DMA: mapping existing buffer is not supported? Content-Language: en-US To: Greg KH Cc: linux-usb@vger.kernel.org, Linux Media Mailing List , linux-kernel@vger.kernel.org, corbet@lwn.net, linux-doc@vger.kernel.org References: <1e783efe-8659-8be1-82b7-15186302e88c@soulik.info> <2023091323-trombone-storeroom-cbd3@gregkh> From: Randy Li In-Reply-To: <2023091323-trombone-storeroom-cbd3@gregkh> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 13:09:30 -0700 (PDT) X-Spam-Status: No, score=-2.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 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. >> I can comprehend that USB host controllers such as xHCI, commonly found in >> embedded implementations like dwc3, do not support IOMMU. However, this >> should not prevent them from operating on a contiguous buffer. > Are you sure that the protocol for these devices allow this? I thought that is what hcd_buffer_alloc() does. > >> 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. > > thanks, > > greg k-h