From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 87663A8; Mon, 4 Dec 2023 04:54:59 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CAD8E1424; Mon, 4 Dec 2023 04:55:45 -0800 (PST) Received: from [10.1.196.40] (e121345-lin.cambridge.arm.com [10.1.196.40]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 8F8DA3F5A1; Mon, 4 Dec 2023 04:54:54 -0800 (PST) Message-ID: <4c55f016-ae17-4ba1-aa39-3b96f11bdb5a@arm.com> Date: Mon, 4 Dec 2023 12:54:53 +0000 Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 7/7] dma-mapping: Simplify arch_setup_dma_ops() Content-Language: en-GB To: Christoph Hellwig Cc: Joerg Roedel , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Paul Walmsley , Palmer Dabbelt , Albert Ou , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Suravee Suthikulpanit , David Woodhouse , Lu Baolu , Niklas Schnelle , Matthew Rosato , Gerald Schaefer , Jean-Philippe Brucker , Rob Herring , Frank Rowand , Marek Szyprowski , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org References: <590a4a1b7d10fb9bb1c42ca6cd438e98e6cc94a7.1701268753.git.robin.murphy@arm.com> <20231204084440.GB919@lst.de> From: Robin Murphy In-Reply-To: <20231204084440.GB919@lst.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 04/12/2023 8:44 am, Christoph Hellwig wrote: > On Wed, Nov 29, 2023 at 05:43:04PM +0000, Robin Murphy wrote: >> The dma_base, size and iommu arguments are only used by ARM, and can >> now easily be deduced from the device itself, so there's no need to pass >> them through the callchain as well. > > This looks even better than the patch form Jason that only removed the > iommu argument: > > Reviewed-by: Christoph Hellwig > > I wonder if it makes sense to also remove the coherent argument > by setting up dev->dma_coherent in the caller. That would require > a pretty careful audit as we're doing a few weird things in that > area, though. Yeah, it crossed my mind too, but then I remembered we have at least the ARM stuff which may have already set a platform-specific value for dev->dma_coherent to take precedence over the firmware value, thus still needs to differentiate between the two at this point. Leaving the established argument in place seems neater IMO than having to go back to arch-specific mechanisms for that and any other similar tricks. Thanks, Robin.