From patchwork Wed Feb 22 13:24:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13149139 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C66D0C636D6 for ; Wed, 22 Feb 2023 13:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231778AbjBVNYk (ORCPT ); Wed, 22 Feb 2023 08:24:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231689AbjBVNYj (ORCPT ); Wed, 22 Feb 2023 08:24:39 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45E3F2FCE9; Wed, 22 Feb 2023 05:24:38 -0800 (PST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id B47D45C011B; Wed, 22 Feb 2023 08:24:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 22 Feb 2023 08:24:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1677072277; x=1677158677; bh=EP SSc8zmdPgI05TJa3CUPRSOx9d1h71CZw1l3kq4OlU=; b=hgDPnHyaWtUSE6sxDt xymQ9ErJ1eijmW28BrMxDDjmTXuJH2ekWMiAMlL4luAtwFrhiwbNE6Zgxkqgz5Xn IgfUUuPXh6/CZVe2NyNZ9FbyJRaWiKeAqETJtOF2mEyWcb2TCHMOz5kwKBKv1bjk 4f/a9hV1MNM31Zk6Z4GtUEDTbhaUBu16TDP346fcLERld52lSDUcHLkG/kZoQ+AN nXgSQMTFqROStx4NFztlWHuuKJQTFZQF4dVuYvLK6jZ2vykhYULH/7ZoJHzRTOEK BhiIV9vf3aH9YDK/sY9ptH25+eLDIyrXFDhqugiDZgFCa+yS+foJ6vE5Uknb9zcy rtAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1677072277; x=1677158677; bh=EPSSc8zmdPgI0 5TJa3CUPRSOx9d1h71CZw1l3kq4OlU=; b=pnO03XCQw9tLQOxImyoJIpW1OulUD evwXHGkX/68qg93M9FLe9ueBGB7GWNv2GvL7QR6axfNbsFyZuYCmYqAOeF48xmdn wwjNBS5QjchW7P91L5AQslWkDQZF83CcPhbnuq/gr0ms9t5XFY30LjTAN2Jq3FL/ M0dqVYAmNs3bJMFD4MPlAIBHAtlIRXWAPnIFW3yvlxQ7RbmpR9mq9z/3/zi+diQQ lv7Bl+vXyuEDEVXtSjgiOTZDo2X3UWsPE9fIOh39ndlXCE2Ftjdn6OQ3l7vU8y9f HK3qRlbYjwsehMYfRd6IgUqtalUaEV14jud7J06N06mQLJHGzOAP7gPMw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejledghedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Feb 2023 08:24:36 -0500 (EST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, hch@lst.de, Jiaxun Yang Subject: [PATCH v2 1/4] MIPS: Remove DMA_PERDEV_COHERENT Date: Wed, 22 Feb 2023 13:24:22 +0000 Message-Id: <20230222132425.7442-2-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230222132425.7442-1-jiaxun.yang@flygoat.com> References: <20230222132425.7442-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org As now we are always managing DMA coherence on per dev bias, there is no need to have such option. And it's not selected by any platform. Signed-off-by: Jiaxun Yang Reviewed-by: Philippe Mathieu-Daudé --- v2: Remove unrelated change. --- arch/mips/Kconfig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 37072e15b263..a1170f0a0c04 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1080,11 +1080,6 @@ config FW_CFE config ARCH_SUPPORTS_UPROBES bool -config DMA_PERDEV_COHERENT - bool - select ARCH_HAS_SETUP_DMA_OPS - select DMA_NONCOHERENT - config DMA_NONCOHERENT bool # From patchwork Wed Feb 22 13:24:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13149140 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C5C6C64EC4 for ; Wed, 22 Feb 2023 13:24:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbjBVNYm (ORCPT ); Wed, 22 Feb 2023 08:24:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231799AbjBVNYk (ORCPT ); Wed, 22 Feb 2023 08:24:40 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25543431E; Wed, 22 Feb 2023 05:24:39 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 394115C0132; Wed, 22 Feb 2023 08:24:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 22 Feb 2023 08:24:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1677072279; x=1677158679; bh=p1 V6c2YQKPdBi091Tqa4iPFzeD9QI7L6DP4eQYxxvFM=; b=wI4nXPl2zfm3ZUxD1K H9K0JWhjrFZJNb393iyBS0bApQ4Rs0/iqOh0kxXo4NXH3ludGeV03Ran/+wFdYQH TU3ojIs/rxtBHUSHBCyjTKEkjF72W+Dmo0pczskCbNg3//T8jFyT6mAEwWFhCGa6 Cz7PdIWyJMwFP61oIURw+45OAaFxFJcfrLGZjmV4vKiwcHh4phC0jxdZ9l2GuHEB F9d4JMrEnJllna5HAGOypUuQGdGCx6CbU8VdOeGAAguBTTZOkDLevicD8bCS1Hk5 P6gLA3imLk6WJAAZ29rbkoPGdMIasqaR4z3VU3WlZ8MppWQDYT8rC07LnBmY1zeE USlA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1677072279; x=1677158679; bh=p1V6c2YQKPdBi 091Tqa4iPFzeD9QI7L6DP4eQYxxvFM=; b=Y5ehZbXZlmfaJ6YtJUwqm0nl69Q9y TpPisx3hhMiNXqoZjp28cMEBraOz1SJPKdxjUKYQxSpfL3sG9q98PSsF2sZbqOAm wHFU6ZsISGm2o1UTxGnSMZWkGOt09EJhJ6r12iDXF9pUj3sEpoNnt3oBrSqIoZ51 U1Zkbc8wgN8PfnemAEikR8xwnME1IUhq5G41fjJ8G+mrJ6kE/EPDSsEJWQxs1r3B 2oN4WwLf88mp8HBj/e9rCkdgVS19/CIbX8j9vA8Qf50tpwTLFLQUmDfeknWciYkd zYLoZ27h3eEWzJfPeXY/ZgDeo1Wjugzw0pwB7+xKPArD3pVDmdC9sFO9g== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejledgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Feb 2023 08:24:37 -0500 (EST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, hch@lst.de, Jiaxun Yang Subject: [PATCH v2 2/4] MIPS: Always select ARCH_HAS_SETUP_DMA_OPS Date: Wed, 22 Feb 2023 13:24:23 +0000 Message-Id: <20230222132425.7442-3-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230222132425.7442-1-jiaxun.yang@flygoat.com> References: <20230222132425.7442-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org arch_setup_dma_ops on MIPS sets coherency information in struct device. It's essential for per-device coherency to work. Select it for all non-coherent platforms. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index a1170f0a0c04..dae894b7d857 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -134,7 +134,6 @@ choice config MIPS_GENERIC_KERNEL bool "Generic board-agnostic MIPS kernel" - select ARCH_HAS_SETUP_DMA_OPS select MIPS_GENERIC select BOOT_RAW select BUILTIN_DTB @@ -1089,6 +1088,7 @@ config DMA_NONCOHERENT # by pgprot_writcombine can be mixed, and the latter sometimes provides # significant advantages. # + select ARCH_HAS_SETUP_DMA_OPS select ARCH_HAS_DMA_WRITE_COMBINE select ARCH_HAS_DMA_PREP_COHERENT select ARCH_HAS_SYNC_DMA_FOR_DEVICE From patchwork Wed Feb 22 13:24:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13149142 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FC4DC636D6 for ; Wed, 22 Feb 2023 13:24:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232024AbjBVNYx (ORCPT ); Wed, 22 Feb 2023 08:24:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231867AbjBVNYm (ORCPT ); Wed, 22 Feb 2023 08:24:42 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E30E23A87E; Wed, 22 Feb 2023 05:24:41 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5B8E05C0126; Wed, 22 Feb 2023 08:24:41 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 22 Feb 2023 08:24:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1677072281; x=1677158681; bh=1f HXxGT/iesFaGy7SZWpw+qtrHiwycc/gJ0b/Z34gNU=; b=RFR1ljJO1HboBLMR/k T8Owsv6wy0nYzCS+jvf+ayOZgYpSJyumTyuTFBIvNfJ05GDoYVVUBRvXCjTr1xA5 QiUcLfCWw3laN/2oHpj3N974lTNifZmyMzR32ms+P4wtnmL6M9Aincw/3E0RIE1L zOj1iJ05NI/n/tRp5RIc0e8KZ8UXWi+LA8ayae1FOMjrr0AE8zfpU35ErTFg1mDk o2TljOTaTne87baKSZ02XMky1gnOZbyvpHykcdfUCDjm+Up9Ybg3KyMCDnBUZcct wMfX/kxlq/y4K13H2mT7s/ecaErC0Ra/QfNIx0NLtkyJcclBUE7OOE+mB/xBqF22 FJ7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1677072281; x=1677158681; bh=1fHXxGT/iesFa Gy7SZWpw+qtrHiwycc/gJ0b/Z34gNU=; b=hUOO9KVAuogMaAaQdxoQ3PeUBZpWH YKWAcTVQw46gIBjKFGNWNTUnkdJBNWe+7+Oa96y/JrpjrM9oWtABwIacb0fk8Exz 5J1lgaivP9OhGD3ccijPUG+mutq4o5SqfcPppnwl3UcmKUVeV4U7p+PHzCCeOZnO K/HpfyAwmEGsIQvSufEYGQKghACqC4eWlfjAPv7NVDLRCwSh4HFUlQtMwl9MdmQ0 +sIPdDvO1OjTVrCgSPK5WX7iCzc5Scc7gWbyLaWK5iQXVDbWzTlZdSwbOV9SQw0X 4rtOEHgUAo3ODEnod7PxnXWdq035n4bnU0Eqcwez0gdUMsSjALjOHJdFg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejledgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Feb 2023 08:24:39 -0500 (EST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, hch@lst.de, Jiaxun Yang Subject: [PATCH v2 3/4] MIPS: Always select ARCH_HAS_SYNC_DMA_FOR_CPU for noncoherent platforms Date: Wed, 22 Feb 2023 13:24:24 +0000 Message-Id: <20230222132425.7442-4-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230222132425.7442-1-jiaxun.yang@flygoat.com> References: <20230222132425.7442-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org As now we are telling the necessity of post DMA flush per CPU type, there is no need to select ARCH_HAS_SYNC_DMA_FOR_CPU on per platform bias, just select it unconditionally and we can sort it at runtime. Signed-off-by: Jiaxun Yang --- arch/mips/Kconfig | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index dae894b7d857..bcca65b25f62 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -115,7 +115,6 @@ config MACH_INGENIC select SYS_SUPPORTS_LITTLE_ENDIAN select SYS_SUPPORTS_ZBOOT select DMA_NONCOHERENT - select ARCH_HAS_SYNC_DMA_FOR_CPU select IRQ_MIPS_CPU select PINCTRL select GPIOLIB @@ -1091,6 +1090,7 @@ config DMA_NONCOHERENT select ARCH_HAS_SETUP_DMA_OPS select ARCH_HAS_DMA_WRITE_COMBINE select ARCH_HAS_DMA_PREP_COHERENT + select ARCH_HAS_SYNC_DMA_FOR_CPU select ARCH_HAS_SYNC_DMA_FOR_DEVICE select ARCH_HAS_DMA_SET_UNCACHED select DMA_NONCOHERENT_MMAP @@ -1854,11 +1854,9 @@ config SYS_HAS_CPU_MIPS32_R3_5 config SYS_HAS_CPU_MIPS32_R5 bool - select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT config SYS_HAS_CPU_MIPS32_R6 bool - select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT config SYS_HAS_CPU_MIPS64_R1 bool @@ -1868,15 +1866,12 @@ config SYS_HAS_CPU_MIPS64_R2 config SYS_HAS_CPU_MIPS64_R5 bool - select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT config SYS_HAS_CPU_MIPS64_R6 bool - select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT config SYS_HAS_CPU_P5600 bool - select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT config SYS_HAS_CPU_R3000 bool @@ -1901,7 +1896,6 @@ config SYS_HAS_CPU_NEVADA config SYS_HAS_CPU_R10000 bool - select ARCH_HAS_SYNC_DMA_FOR_CPU if DMA_NONCOHERENT config SYS_HAS_CPU_RM7000 bool @@ -1930,7 +1924,6 @@ config SYS_HAS_CPU_BMIPS4380 config SYS_HAS_CPU_BMIPS5000 bool select SYS_HAS_CPU_BMIPS - select ARCH_HAS_SYNC_DMA_FOR_CPU # # CPU may reorder R->R, R->W, W->R, W->W From patchwork Wed Feb 22 13:24:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiaxun Yang X-Patchwork-Id: 13149141 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAA1BC61DA4 for ; Wed, 22 Feb 2023 13:24:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbjBVNYw (ORCPT ); Wed, 22 Feb 2023 08:24:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232161AbjBVNYt (ORCPT ); Wed, 22 Feb 2023 08:24:49 -0500 Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DA5F3B3CB; Wed, 22 Feb 2023 05:24:43 -0800 (PST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id C6DEB5C016D; Wed, 22 Feb 2023 08:24:42 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 22 Feb 2023 08:24:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm2; t=1677072282; x=1677158682; bh=6T 1o68vOusF0U/JsH2f0H8DjY8CJLE2Yaxz8jLQ29x0=; b=ixIYenL6yUTrdKDf/y yGIMj2+CSE4XTpBVAo7gCAd6shbojXwqI3NUDE39LbMxm++eR0YWt1gTl0i9l5IA Fm0+kXA6ietLck3SBwQybWWhAkxkbpSfi+3qr8HliYb7qKgDGwbXYFCwd6Pr8s/S Niw9CedJjVYG+kN05usHi5zNCLSnJFYiMQR4QuzIsjjLAk9L2hr04JsFqcXoZxng MyOY5dY51iukVAInSIqcLGFCdBX9CuCYIbVp3VZul40fOfAzd0cZ7wgrcwgX2WC8 dqipPh/sBhj+y8nfWd6Ffeh08TDdXnhxiiG673ourd/lszWo2HYu2WAmw4D8d3wa liFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1677072282; x=1677158682; bh=6T1o68vOusF0U /JsH2f0H8DjY8CJLE2Yaxz8jLQ29x0=; b=pNBkQpTD4j3sLCiTNDX2ffGfvR6r7 54tMAQhX6XvhaNkeB3gAXYgggEq7wjC0amoqS+d6x2anSKX6x7ud+PgzAd5giu1E LuDCHCAXRpcPyodL87kAsINNGwLAJrM8XyZrbd6W7biR40o8MiuSsQ5kFK4Z6vfv nkXQcunmuBHQoPlTTz6CkTDKMjk9ub2/KrK71q7MKgdWOQFwWqfu93FtU82tJ8fI Bz1giQiKdcTir3WqXX3KhjpfBFCVDe0u7COTOp7KtB5yOznBTUnLMFz6gxw9W914 nhutfvI7FL9c+bw1wpYo8Z8tuoYdnqv7GCse1/qjXL3blxKadGlQS7yDg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudejledgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpeflihgrgihunhcujggrnhhguceojhhirgiguhhnrdihrghn ghesfhhlhihgohgrthdrtghomheqnecuggftrfgrthhtvghrnhepfeeludefheegvdeuvd dvgeekgfdvtdettdelieeihfegtedugeekhfdvhfejfedtnecuvehluhhsthgvrhfuihii vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepjhhirgiguhhnrdihrghnghesfhhlhi hgohgrthdrtghomh X-ME-Proxy: Feedback-ID: ifd894703:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Feb 2023 08:24:41 -0500 (EST) From: Jiaxun Yang To: linux-mips@vger.kernel.org Cc: linux-kernel@vger.kernel.org, tsbogend@alpha.franken.de, hch@lst.de, Jiaxun Yang Subject: [PATCH v2 4/4] MIPS: c-r4k: Always install dma flush functions Date: Wed, 22 Feb 2023 13:24:25 +0000 Message-Id: <20230222132425.7442-5-jiaxun.yang@flygoat.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) In-Reply-To: <20230222132425.7442-1-jiaxun.yang@flygoat.com> References: <20230222132425.7442-1-jiaxun.yang@flygoat.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org As nowadays DMA coherence is managed per device, it is possible to have a system that is defaulted to coherent dma but still have noncoherent device that needs to use those flush functions. Just install them unconditionally. Signed-off-by: Jiaxun Yang --- arch/mips/mm/c-r4k.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/arch/mips/mm/c-r4k.c b/arch/mips/mm/c-r4k.c index a549fa98c2f4..7d447050a20b 100644 --- a/arch/mips/mm/c-r4k.c +++ b/arch/mips/mm/c-r4k.c @@ -1867,15 +1867,9 @@ void r4k_cache_init(void) __local_flush_icache_user_range = local_r4k_flush_icache_user_range; #ifdef CONFIG_DMA_NONCOHERENT - if (dma_default_coherent) { - _dma_cache_wback_inv = (void *)cache_noop; - _dma_cache_wback = (void *)cache_noop; - _dma_cache_inv = (void *)cache_noop; - } else { - _dma_cache_wback_inv = r4k_dma_cache_wback_inv; - _dma_cache_wback = r4k_dma_cache_wback_inv; - _dma_cache_inv = r4k_dma_cache_inv; - } + _dma_cache_wback_inv = r4k_dma_cache_wback_inv; + _dma_cache_wback = r4k_dma_cache_wback_inv; + _dma_cache_inv = r4k_dma_cache_inv; #endif /* CONFIG_DMA_NONCOHERENT */ build_clear_page();