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: linux-acpi@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. 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 46D87C4167B for ; Mon, 4 Dec 2023 12:55:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3EBRF3b6rpiXZVrjiS9tB1pUpHJWBQmyLSgWkEJPTT8=; b=a1cN5h7SasVJiO nUtFMASYxB/TWBxa3xBZo5xb0Jh7FWZ+skIX9EV8HJgPEyxa2ar3IjXtwaclUjnZkpEZELIjW8fIj jwlxhdmAPRsahfdO4k7eKstTDAhgrwFVf8RBUvVA//tMzb0zlanqNVflZK5v6jbIv378vivo76sBs pZHyoSUaNwA6ceOioeqlK0gYuU8y3C+MHOfkdFsg9JHEzBoqwNzHsRpqHSgfX1Ag1VWeQRHMBRnjB jiF/mWeug1dxI8G31Whzse5bl9zPOczhCFqMHCw7xu5aPQtk8/4OkemkiOWReBoY2vDRDyzdDfOjR iIRHUUGnT9Y+qqa4aCPA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rA8Tb-004GqO-1b; Mon, 04 Dec 2023 12:55:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rA8TY-004GlN-0D for linux-arm-kernel@lists.infradead.org; Mon, 04 Dec 2023 12:55:05 +0000 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231204_045504_176292_749853E0 X-CRM114-Status: GOOD ( 17.77 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel