Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19057183rwd; Wed, 28 Jun 2023 04:37:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6RCBQ8p0I+UMAZWThgP6Z8J5hsBwnI/qOD+Utngz5eIjOJmK97d4CzXU+/Ogs8BmM8IRAj X-Received: by 2002:a17:907:783:b0:982:c8d0:683f with SMTP id xd3-20020a170907078300b00982c8d0683fmr32122534ejb.18.1687952278512; Wed, 28 Jun 2023 04:37:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1687952278; cv=pass; d=google.com; s=arc-20160816; b=MLHDTFugaSx3kOmmx/tR4A2/5rpzVts8hTTd6kNHPFh6GUqmSTwv2a4QsCNQou17mo HKW1Pt98rLIbmaeosB5xYwYbz03zaazdvDQRU67SpvbOtlrqqqm5EQV41bXj6sp/DkAa WodCiK8u0cgxNpc5bzG5LfkmLr5hAfWMm6zIGYSZWzU2D56Z91RyuyOI5D8o88sv6vWp fCxhZcDhLpc/yu4FYOpejcf+EKkxc74lErUGb/F4PoiJa+iWlDgdfBeiRt8RegJtXhaD vDsOWy1xBVpu66o7VXObdJOGoch7KWiVylf3J4hwoQXdFDEzsKdvdE/dkd3Sr3blckLA UWog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=FITWfOQSLZcRm2X7I99mXdDRUnYkfYJapAY6VqQhFJU=; fh=6pE7/TJQvsU3ZJjaDyH0FhuQ4jg+sXFVrEYcaoWJBxM=; b=V1ClyznFYBOBqzY/nLS1Q47c+BMKiQRQwy/iajk5yADvQCanu2q7phI3IEmRTKANdh uolY0UvsiiOPTgugo/YNsJmiSXCdjUEtvQacYXdum5lWBoXVgdD9uCTcuTZkxilURkh0 5F0IqiJJJ2SI6VW+buK6ka9pDuD0EM3gcWBZ/sNkVtBTWvjWnteaZAFdItvUdcdfrwUe cyoKNr09RjWhcG/x6SJFVF21Qzd8DgSmKNVN8X5mIh42hm04eRhj75zi4xcYR5hHY3XL 7bDa3axdv3aCaMtU31ksUJ0SvnAHv5LQdnuoOW9D7nPYt4yvUpOVQQ4n0nmQ0yAB4gy4 GnhQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.beauty header.s=zmail header.b="QIUXc/SI"; arc=pass (i=1 spf=pass spfdomain=linux.beauty dkim=pass dkdomain=linux.beauty dmarc=pass fromdomain=linux.beauty>); 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 a2-20020a1709065f8200b0098867fad438si5946130eju.479.2023.06.28.04.37.25; Wed, 28 Jun 2023 04:37:58 -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=pass header.i=@linux.beauty header.s=zmail header.b="QIUXc/SI"; arc=pass (i=1 spf=pass spfdomain=linux.beauty dkim=pass dkdomain=linux.beauty dmarc=pass fromdomain=linux.beauty>); 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 S231351AbjF1LQw (ORCPT + 99 others); Wed, 28 Jun 2023 07:16:52 -0400 Received: from sender4-op-o15.zoho.com ([136.143.188.15]:17592 "EHLO sender4-op-o15.zoho.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231239AbjF1LQe (ORCPT ); Wed, 28 Jun 2023 07:16:34 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1687950982; cv=none; d=zohomail.com; s=zohoarc; b=ZZlgzUq5NUHrka0aoshbot51CpzuDpBdy+XKtPamjnL6D3ELRZ6OoL+v7Hz3pc3OFtC8dIogwpwk7zQYisPvWLZ0wr1WEEVbUHnKJWKcF9HeX9I9IDQ8WJx4gbPx7g1N6RP3eTNTPKNXzgNKvsgQzAQsEXGOh8c/53IxYcGtmhc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1687950982; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=FITWfOQSLZcRm2X7I99mXdDRUnYkfYJapAY6VqQhFJU=; b=mLv3uoGKqAUOcGGffN8hYILcMhxAIpkWusuqhFJONMcAZ05qu7RM91xcaLOL9CCTbgqS0BqUQZlJJtqT4j7LmR5x/8Ih/F70APpuzcgPphoMfYz3XyNwknjR69SlRl4bdUoCTyK2jBjsVcBVA+yvNKb4hKBFVzLayg5eu0wW40Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1687950982; s=zmail; d=linux.beauty; i=me@linux.beauty; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=FITWfOQSLZcRm2X7I99mXdDRUnYkfYJapAY6VqQhFJU=; b=QIUXc/SIzOT1F8TwSXJNZYa/yUpPTWoRaop0FQVtqJ7zfTlfrznHaZYf/FE61mKh gs08M1fSWXTG+2+BMp37OFFv9jboZiFTHkNXtfoshlZlD0M/nARP68PFSNKj/89KT9l 6mqDXsbs3WCgh5C06ZsEsc7TEeNJFPU8WWlxndRc= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1687950981133598.4605502910363; Wed, 28 Jun 2023 04:16:21 -0700 (PDT) Date: Wed, 28 Jun 2023 19:16:21 +0800 From: Li Chen To: "Russell King (Oracle)" Cc: "dmaengine" , "linux-arm-kernel" , "linux-kernel" , "Arnd Bergmann" Message-ID: <18901b7f7f4.10c6f89c4692094.481698950513259776@linux.beauty> In-Reply-To: References: <18901a6cbf0.c9e3e099688173.4166132371304083225@linux.beauty> Subject: Re: Should dma_map_single take the dma controller or its consumer as an argument? MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Russell, ---- On Wed, 28 Jun 2023 19:02:47 +0800 Russell King (Oracle) wrote --- > 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. Thanks for your quick response. Therefore, I just need to use chan->device->dev in my dma_map_single and there is no need to configure the dma_mask for my consumer peripherals. Regards, Li