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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E160C433E0 for ; Fri, 19 Feb 2021 15:54:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C56364DFD for ; Fri, 19 Feb 2021 15:54:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229535AbhBSPyM (ORCPT ); Fri, 19 Feb 2021 10:54:12 -0500 Received: from netrider.rowland.org ([192.131.102.5]:55873 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S229524AbhBSPyL (ORCPT ); Fri, 19 Feb 2021 10:54:11 -0500 Received: (qmail 1112983 invoked by uid 1000); 19 Feb 2021 10:53:28 -0500 Date: Fri, 19 Feb 2021 10:53:28 -0500 From: Alan Stern To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Thomas Zimmermann , daniel@ffwll.ch, airlied@linux.ie, maarten.lankhorst@linux.intel.com, mripard@kernel.org, sumit.semwal@linaro.org, gregkh@linuxfoundation.org, dri-devel@lists.freedesktop.org, noralf@tronnes.org, Christoph Hellwig , Johan Hovold , Andy Shevchenko , Sebastian Andrzej Siewior , "Ahmed S. Darwish" , Mathias Nyman , Oliver Neukum , Felipe Balbi , Thomas Gleixner , stable@vger.kernel.org Subject: Re: [PATCH] drm/prime: Only call dma_map_sgtable() for devices with DMA support Message-ID: <20210219155328.GA1111829@rowland.harvard.edu> References: <20210219134014.7775-1-tzimmermann@suse.de> <02a45c11-fc73-1e5a-3839-30b080950af8@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <02a45c11-fc73-1e5a-3839-30b080950af8@amd.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Fri, Feb 19, 2021 at 02:45:54PM +0100, Christian König wrote: > Well as far as I can see this is a relative clear NAK. > > When a device can't do DMA and has no DMA mask then why it is requesting an > sg-table in the first place? This may not be important for your discussion, but I'd like to give an answer to the question -- at least, for the case of USB. A USB device cannot do DMA and has no DMA mask. Nevertheless, if you want to send large amounts of bulk data to/from a USB device then using an SG table is often a good way to do it. The reason is simple: All communication with a USB device has to go through a USB host controller, and many (though not all) host controllers _can_ do DMA and _do_ have a DMA mask. The USB mass-storage and uas drivers in particular make heavy use of this mechanism. Alan Stern