Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19032293rwd; Wed, 28 Jun 2023 04:15:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ77E8f2mXkEkJoWoGM74qrWJDMzZf8+kfsmGQCCHvuiz+yfN73YYeCwP121Dr2s+bEKRgFj X-Received: by 2002:a05:6a20:3d09:b0:121:4d30:8d7a with SMTP id y9-20020a056a203d0900b001214d308d7amr29198234pzi.62.1687950927968; Wed, 28 Jun 2023 04:15:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687950927; cv=none; d=google.com; s=arc-20160816; b=SH/zmDIFqcbJXeCRan6tlLfHJ8oTmi7+XeixVl2V0w0Eoat/LWbEvIYpWc0YY7OkMT MNh5mR3bHP3PGWHSglIsu72GjbSAMHm2BnK0dpthfZokpJ6yzV/A5lfPlTK6II2qSwYz qsvKQ8hOICsPFVp8EoelTeEHThAvWsaGU6EyFZS0T7scW9azSmVclZOXlyzhcgFrgCsa f+71dAHrAIMN6tEADnCQjA6Yoph2eFS1tZUd+7M3pVFVNFvLdjuFjT7RT/Eg5oHF/0dR FKHx1mlunN5JpEafpMTmWmIWePseWmKspQ4yA0hj1+upB1GQAgY7JQ61TE7/53pagDC+ U36g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=OjshFGISJ/qtJIee/CUzi6GtoPX/MHew0Bsta1Jvsfg=; fh=EzBxEDmJg208qB4tcf3AmhAbAsFwb1NsV8WQmPzgT08=; b=ykONEWF6fEIFZ7hc+pXZJdlI+Mou+wK1f5Hzgps9awqJC3DErwrGoon8IYeSbTRR9A mDdC6zaSnSWtzCwHYbSlfFV8JvcTFxo+VFTUIuDEPE6B5Z9ypyiVFpLVvQIK85MZ0N9J YdvkXJDVUYNbaVphFtNdBbomrnKz/VMfPhlXIxQPEHgo4EAxORrz/2JjyZqCrlnft5UQ rso1YvDnV+GQEgH61FADY8Hrk+5tcAxBBcHDAFvb12bczRxoxT6bP1qdMmVZnYhDvLy9 maUrOmq+cGTiTt/6XJuopf1fVoYxhgACUgfAZOkUuiy47mB9LaLzoRbu7hZGNK/XDvgC bzDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=yn0gV3wp; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x35-20020a056a0018a300b0066887057a46si1933888pfh.120.2023.06.28.04.15.15; Wed, 28 Jun 2023 04:15:27 -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; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=yn0gV3wp; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231430AbjF1LDC (ORCPT + 99 others); Wed, 28 Jun 2023 07:03:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231314AbjF1LCy (ORCPT ); Wed, 28 Jun 2023 07:02:54 -0400 Received: from pandora.armlinux.org.uk (pandora.armlinux.org.uk [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 926651FCD; Wed, 28 Jun 2023 04:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=OjshFGISJ/qtJIee/CUzi6GtoPX/MHew0Bsta1Jvsfg=; b=yn0gV3wpaCQWMUh0Fg/AzYfxb8 6CISsIPZMNCkKVee+RyGOVprK1JXROr/VAxH19hDNag82NfTUu+CWo29Lu2glfhOT/W/q0o+wia6e tCTq+4fmjwJttF0lwZx8P7I9TKY9iqvezVEcbGpCWhFr/eACeS+Tlk1xWKnerPmuLbNJrELtnB0dU h7aD1F1EJ0BJmwXcCTrMXXJacDrphakL+79zrUJIDkyRdMe6Fb7eTjsshEHCcGEaRot/84LRsF0Wo wxbgssq+qA1w7D4nKvZ1Yirexug/goORl42ceb7pxCav+hJXhPHNWLjKixAp7YNJBeUeRA4Xx9YJD SmSLPDxQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:57630) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qESwi-0007CA-37; Wed, 28 Jun 2023 12:02:50 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qESwi-0006hD-0w; Wed, 28 Jun 2023 12:02:48 +0100 Date: Wed, 28 Jun 2023 12:02:47 +0100 From: "Russell King (Oracle)" To: Li Chen Cc: dmaengine , linux-arm-kernel , linux-kernel , Arnd Bergmann Subject: Re: Should dma_map_single take the dma controller or its consumer as an argument? Message-ID: References: <18901a6cbf0.c9e3e099688173.4166132371304083225@linux.beauty> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18901a6cbf0.c9e3e099688173.4166132371304083225@linux.beauty> Sender: Russell King (Oracle) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Wed, Jun 28, 2023 at 06:57:35PM +0800, Li Chen wrote: > Hi all, > > I recently encountered an issue where the dma_mask was set in the DMA controller's driver, but the consumer peripheral driver didn't set its own dma_mask. It should always take the device that is *actually* performing the DMA, since that is the device that has restrictions on what addresses can be accessed, etc. Devices that "consume" the data from a DMA controller don't access memory - they are merely the targets, and they can't on their own access host memory. Therefore, their dma mask _should_ be irrelevant. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!