From patchwork Wed Oct 18 05:26:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13426355 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 CFC3ACDB47E for ; Wed, 18 Oct 2023 05:27:21 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oPU4+Q/8HykngUU7EuaKdIGp7yS5LHNh0JXuz4Q/xnw=; b=LNdv0wRFOkLxdf 1dk3UwuMwTXW2YcmVO2WG9uIcA1C43DUHXmdVvgOqY8BeGH5O9aasgi8tPPIVoNO1OXa8Lm8jYNc5 2+MivQFn2VloEqjJ2XEFoaioBqiceNIh3t/jL9z6bAo4v9/VmowMoBAkwuFtPUX46WKbmJQxz0Mlp h6qLII/XvoZJF+l4vgPfkOzlfgMmoqZmjIu/BQ0XiznEzdO4j4etl+LU5fETF2FbQYQXq5Mk/M6qM chavMve4odieiNItKqOyvkF0tY+3Hd1397UAqqArtANfd/BsMloynX63zN067najtUwPbfQUxbRDK ji6I7LX22/Sc59wMvE+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsz5C-00Dp3o-27; Wed, 18 Oct 2023 05:27:02 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qsz59-00Dp3K-2I; Wed, 18 Oct 2023 05:27:00 +0000 From: Christoph Hellwig To: Paul Walmsley , Palmer Dabbelt , Conor Dooley , Geert Uytterhoeven , Magnus Damm Subject: [PATCH 1/3] riscv: RISCV_NONSTANDARD_CACHE_OPS shouldn't depend on RISCV_DMA_NONCOHERENT Date: Wed, 18 Oct 2023 07:26:52 +0200 Message-Id: <20231018052654.50074-2-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018052654.50074-1-hch@lst.de> References: <20231018052654.50074-1-hch@lst.de> MIME-Version: 1.0 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: , Cc: Arnd Bergmann , Conor Dooley , linux-renesas-soc@vger.kernel.org, soc@kernel.org, Olof Johansson , linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org RISCV_NONSTANDARD_CACHE_OPS is also used for the pmem cache maintenance helpers, which are built into the kernel unconditionally. Signed-off-by: Christoph Hellwig Acked-by: Conor Dooley --- arch/riscv/Kconfig | 1 - drivers/cache/Kconfig | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index d607ab0f7c6daf..0ac0b538379718 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -277,7 +277,6 @@ config RISCV_DMA_NONCOHERENT config RISCV_NONSTANDARD_CACHE_OPS bool - depends on RISCV_DMA_NONCOHERENT help This enables function pointer support for non-standard noncoherent systems to handle cache management. diff --git a/drivers/cache/Kconfig b/drivers/cache/Kconfig index a57677f908f3ba..d6e5e3abaad8af 100644 --- a/drivers/cache/Kconfig +++ b/drivers/cache/Kconfig @@ -3,7 +3,7 @@ menu "Cache Drivers" config AX45MP_L2_CACHE bool "Andes Technology AX45MP L2 Cache controller" - depends on RISCV_DMA_NONCOHERENT + depends on RISCV select RISCV_NONSTANDARD_CACHE_OPS help Support for the L2 cache controller on Andes Technology AX45MP platforms. From patchwork Wed Oct 18 05:26:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13426354 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 697AACDB47E for ; Wed, 18 Oct 2023 05:27:17 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hSSWaW1slJ3pkWHXoKdTwwr5tfyOaEIm07EtmljeKIQ=; b=tIFvqKHsLD8uEb f5lLQHGaBgBk0Xdr+fLmYQsUPruP+0I5LO9p+/hWzVEfs3k35db553Wv5rg/tGsRj2SFubx7o6j8B RE1c1jctsRbxxaoUxAUZ5lu2C0gSdYLUdMwaOZN+2dbAUlRNeTZcpfpCugLqRXDgCcavfIJ+iPQao i1vGpi3wgIE4Y6BZij4IlkWdqi3DacrmbEfFiCbhBaNlPAIIH99LxPopopnaCwoO0I762/BK/75q0 aFdh8KwJN4+9ErbenZ25YcVgg6g4qXBfp1JyhKBVyN9yj5RPRGEd9YpTEED4rE4hrx43ZJQu9aAP2 wxDOWNtnMU8fVJKeLkpg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsz5F-00Dp4H-0t; Wed, 18 Oct 2023 05:27:05 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qsz5C-00Dp3e-0O; Wed, 18 Oct 2023 05:27:02 +0000 From: Christoph Hellwig To: Paul Walmsley , Palmer Dabbelt , Conor Dooley , Geert Uytterhoeven , Magnus Damm Subject: [PATCH 2/3] riscv: only select DMA_DIRECT_REMAP from RISCV_ISA_ZICBOM and ERRATA_THEAD_PBMT Date: Wed, 18 Oct 2023 07:26:53 +0200 Message-Id: <20231018052654.50074-3-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018052654.50074-1-hch@lst.de> References: <20231018052654.50074-1-hch@lst.de> MIME-Version: 1.0 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: , Cc: Arnd Bergmann , Lad Prabhakar , Conor Dooley , linux-renesas-soc@vger.kernel.org, soc@kernel.org, Olof Johansson , linux-riscv@lists.infradead.org, Robin Murphy Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org RISCV_DMA_NONCOHERENT is also used for whacky non-standard non-coherent ops that use different hooks in dma-direct. Signed-off-by: Christoph Hellwig Reviewed-by: Conor Dooley Reviewed-by: Robin Murphy Reviewed-by: Lad Prabhakar Tested-by: Samuel Holland --- arch/riscv/Kconfig | 2 +- arch/riscv/Kconfig.errata | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index 0ac0b538379718..9c48fecc671918 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -273,7 +273,6 @@ config RISCV_DMA_NONCOHERENT select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYNC_DMA_FOR_DEVICE select DMA_BOUNCE_UNALIGNED_KMALLOC if SWIOTLB - select DMA_DIRECT_REMAP if MMU config RISCV_NONSTANDARD_CACHE_OPS bool @@ -549,6 +548,7 @@ config RISCV_ISA_ZICBOM depends on RISCV_ALTERNATIVE default y select RISCV_DMA_NONCOHERENT + select DMA_DIRECT_REMAP help Adds support to dynamically detect the presence of the ZICBOM extension (Cache Block Management Operations) and enable its diff --git a/arch/riscv/Kconfig.errata b/arch/riscv/Kconfig.errata index 566bcefeab502c..e2c731cfed8cc6 100644 --- a/arch/riscv/Kconfig.errata +++ b/arch/riscv/Kconfig.errata @@ -77,6 +77,7 @@ config ERRATA_THEAD_PBMT config ERRATA_THEAD_CMO bool "Apply T-Head cache management errata" depends on ERRATA_THEAD && MMU + select DMA_DIRECT_REMAP select RISCV_DMA_NONCOHERENT default y help From patchwork Wed Oct 18 05:26:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 13426356 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 CCEFACDB47E for ; Wed, 18 Oct 2023 05:27:27 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vGsCYe9xzSLbwtHHmNMiegcWdkZ4CTsoIKPBkXJ6EH8=; b=UAirzCzakpz327 hqrDV1mpQLR1MnakhRXGbiU/rmRgdiiFKIRBx4E2VOBX1WhKZv94CTdaf3Vil1edFUgCDDBKin5zU oaMnuiY09aK94165ZeNT2jYLk8fUtx3mESmAinIjI5AVSEmqo4KUHXcQDvz0x23vILAzWKVebbH1B zU8JqZ8Ed/lsOggXaPoPppP/dgRh5T5QawCY3Ox51EKanfaXQQlnc+7M/530S5OvG/aIAIMk58Ya2 A1qU8MrpV4fK+tSyvRlGGAmzDqJx0G/PPaJcj6nRImnGPGKGVQvOzpUK6soczoZ1GSs4haFTsdwGt ejeXFsWKavhu/uL3cYgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qsz5G-00Dp4U-2r; Wed, 18 Oct 2023 05:27:06 +0000 Received: from 2a02-8389-2341-5b80-39d3-4735-9a3c-88d8.cable.dynamic.v6.surfer.at ([2a02:8389:2341:5b80:39d3:4735:9a3c:88d8] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qsz5E-00Dp3w-1i; Wed, 18 Oct 2023 05:27:04 +0000 From: Christoph Hellwig To: Paul Walmsley , Palmer Dabbelt , Conor Dooley , Geert Uytterhoeven , Magnus Damm Subject: [PATCH 3/3] soc: renesas: ARCH_R9A07G043 depends on !RISCV_ISA_ZICBOM Date: Wed, 18 Oct 2023 07:26:54 +0200 Message-Id: <20231018052654.50074-4-hch@lst.de> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231018052654.50074-1-hch@lst.de> References: <20231018052654.50074-1-hch@lst.de> MIME-Version: 1.0 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: , Cc: Conor Dooley , Arnd Bergmann , Lad Prabhakar , linux-renesas-soc@vger.kernel.org, soc@kernel.org, Olof Johansson , linux-riscv@lists.infradead.org Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org ARCH_R9A07G043 has its own non-standard global pool based DMA coherent allocator, which conflicts with the remap based RISCV_ISA_ZICBOM version. Add a proper dependency. Signed-off-by: Christoph Hellwig Reviewed-by: Lad Prabhakar Acked-by: Conor Dooley Acked-by: Geert Uytterhoeven --- drivers/soc/renesas/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/renesas/Kconfig b/drivers/soc/renesas/Kconfig index 335251ff6e8214..624185e09c967b 100644 --- a/drivers/soc/renesas/Kconfig +++ b/drivers/soc/renesas/Kconfig @@ -341,6 +341,7 @@ config ARCH_R9A07G043 bool "RISC-V Platform support for RZ/Five" depends on NONPORTABLE depends on RISCV_ALTERNATIVE + depends on !RISCV_ISA_ZICBOM depends on RISCV_SBI select ARCH_RZG2L select AX45MP_L2_CACHE