From patchwork Sat Apr 1 09:15:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13196831 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 6F5E6C76196 for ; Sat, 1 Apr 2023 09:15:59 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=3sfeX6day6zsk1giJcR9RoEa/ZHJi/WUo/DQw4Qk1tM=; b=ryWrbDf9oG2xcK +0OSieWOTpu59D3rnHl8UQSrjfa9830/n4B5ZEocohfiKPKEZfF0cy40ePgRL/+WNZWxNgnp8Hsaq H2GxVi7+aCODkvsTkGm35tAKUzVlVWGnK6REe00dotStcEQj/GL0yDhKfq7BCLWmEwPXeUNPZ9UwS G0TbOZcLO2fN4qVP+8FNRX9P2AbF186i6/W0Mu0Q8cGfHghjjmR15tM0piichM+4RZrLtgpGPQmNl t1aN/86rephP39zdTvQ/T5AIyrw73OjATaKeI32TtVgT+T8ptvcDFBuOx7Zjf1TNwhQKUFlIS9zAx Q9In4cmzOYj0hO3uNByg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1piXKx-00A5U9-2F; Sat, 01 Apr 2023 09:15:51 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1piXKv-00A5Of-0l for linux-riscv@lists.infradead.org; Sat, 01 Apr 2023 09:15:50 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 158355C0158; Sat, 1 Apr 2023 05:15:40 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Sat, 01 Apr 2023 05:15:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to; s=fm3; t=1680340540; x=1680426940; bh=Sm/eQGuZcU AzNY/GFXXITkKckQxGS+A5PlDB5scZWkU=; b=fjcFYggGb4OVf1pzdEYo17YkMx 2Efmp1shhPRn6Bt9P8kKC2CuKhlv4uih3fPMtxttH+MggUdjwdpBzaYEHhScEq2f HOAaygQJuli8lqLNHXnsYT6gVGMMPKou5k8UTMgDzKBdrjf30lRvHRarJdB7gVp0 pGQofPzD8bXpPLDbjVwEzbVwINYUfQMlPMAOHViBYaMwliqM91HQyYqNL8Q1rTNT c3jbM1CpsAsdOqB5yvUVo848LLS5r7heOYlDCV2+BVHUq6aZUdRIpwptqTG89qYI mlGaG8aGzM6ZYfzQgFafLSQpmy/UbcU02j7Y7lozF5ONQCeMkT/KIkw1lP1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:message-id:mime-version:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1680340540; x=1680426940; bh=Sm/eQGuZcUAzN Y/GFXXITkKckQxGS+A5PlDB5scZWkU=; b=aFtafIFXo2CkpTEHZ1q/tiUh0cQVK 36gIQpmYlyRdjeDWOUhoCssahVisfR62yOm4pIxdUxZxQ8q5tEr6u1LvBaHdcGi1 P6P28PklrflNdwBYQei19f+8bSofs3YFQUdQT7P9lJvzAbYNfzpDyrJj7qm7kAjQ PQvNyjH3yyxtifhIFL22DXoZW6/CJbul3v26LukN0LvaTws/eK1IZcoHF6mx3Pg8 ZGWt/1/zLvvf6b2DJ7A0kDTxe/CaMvncAS3+Z8VNY5uRkTd916HPzoNY8qhLkqum FDDoUUVr4EW2A1xsvxK+0qWKRalQur2MBDcD/8w5uW+3pCkt63JVWaBgg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedgudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertd ertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghnghes fhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhephfetuddtudevieeljeejte ffheeujeduhefgffejudfhueelleduffefgfffveeknecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhihgoh grthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 1 Apr 2023 05:15:36 -0400 (EDT) From: Jiaxun Yang To: iommu@lists.linux.dev Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, tsbogend@alpha.franken.de, mpe@ellerman.id.au, paul.walmsley@sifive.com, palmer@dabbelt.com, robh+dt@kernel.org, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, linux-riscv@lists.infradead.org, devicetree@vger.kernel.org, Jiaxun Yang Subject: [PATCH v4 0/3] Use dma_default_coherent for devicetree default coherency Date: Sat, 1 Apr 2023 10:15:28 +0100 Message-Id: <20230401091531.47412-1-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.39.2 (Apple Git-143) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230401_021549_360687_79BCA231 X-CRM114-Status: UNSURE ( 9.91 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi all, This series split out second half of my previous series "[PATCH 0/4] MIPS DMA coherence fixes". It intends to use dma_default_coherent to determine the default coherency of devicetree probed devices instead of hardcoding it with Kconfig options. For some MIPS systems, dma_default_coherent is determined with either bootloader or hardware registers in platform initilization code, and devicetree does not explicility specify the coherency of the device, so we need the ability to change the default coherency of devicetree probed devices. For other platforms that supports noncoherent, dma_default_coherent is a fixed value set by arch code. It's defaulted to false for most archs except RISC-V and powerpc in some cases. Thanks - Jiaxun --- v2: - Add PATCH 1 to help with backporting - Use Kconfig option to set dma_default_coherent v3: - Style fixes - Squash setting ARCH_DMA_DEFAULT_COHERENT into PATCH 4 - Setting ARCH_DMA_DEFAULT_COHERENT for PowerPC v4: - Drop first patch Jiaxun Yang (3): dma-mapping: Provide a fallback dma_default_coherent dma-mapping: Provide CONFIG_ARCH_DMA_DEFAULT_COHERENT of: address: Always use dma_default_coherent for default coherency arch/powerpc/Kconfig | 2 +- arch/riscv/Kconfig | 2 +- drivers/of/Kconfig | 4 ---- drivers/of/address.c | 2 +- include/linux/dma-map-ops.h | 2 ++ kernel/dma/Kconfig | 7 +++++++ kernel/dma/mapping.c | 6 +++++- 7 files changed, 17 insertions(+), 8 deletions(-)