Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2776276rwl; Mon, 27 Mar 2023 05:16:59 -0700 (PDT) X-Google-Smtp-Source: AKy350Y6Kq+m0iAUVjC4uPM9xHVAW/OUMfaOJwdYunIZ1EyL5QxngMJfZ7oLNfj6VT6skv9QKLca X-Received: by 2002:a17:906:980b:b0:932:4eea:17ce with SMTP id lm11-20020a170906980b00b009324eea17cemr12571004ejb.39.1679919419801; Mon, 27 Mar 2023 05:16:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679919419; cv=none; d=google.com; s=arc-20160816; b=KDxT1YOEiWXwGGrTMNNc3v2amOsihzONA1Sd8fvUx6oSe0mlaEfimQ9SMV3Ut+mnbZ f5aJEyvHq2RjcpYfVzmX2t5pv+xukjvcafZ3ibb3+1MyGO/aNb789MMpBy4FjZ776cp7 1VtPwbHem+IxaP9nRLVQTWwNYvCcVirOnYSsbebMQBV9kMgq4ShhxQNXycoIpaPRUHJ1 GBR+xyMoRgbNPh3qwhSGEJjiEWdJcOMgKyPrDnK/4Te7z8djwAbndLyinT3NBRbMzpdK rBy4ddoi7UEOH22zM2cbIlKhLmrcmoH4ezrlXHQ2b7d4Iovbd+X41Xc3Q1XPb50egh5c LvFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=FXgZ2GnewURjUmjqkmJR2ISfTWb7H6eAL1I5u4UVkHo=; b=F3b6YuMKVQDxpiOjZNMwRFcxD6Y9Wh/1BQt4IrLiMqz9/VLmsl6X+uk4NI650G54ya RQ0RqNgh5UW0gWctynxRbeE40awo0XsnWvMp6Q/cknjT9S9bx6tzbMTTr5tf7c3HU9y2 VTTx+UnkKLUtXAl21iN0p9dapuTGgRzSDbv0gwZQbeeFipzX0qSVfFQCr0l+XUqJgZWc rIcpx65DdTMiIkZiqzDs1qkLB0yIsd4U/N9i0czvcP94LXtRG2CvpKgv7UaYosTY65sQ RCtVqrcstZB+MdOiFztAUM3GnwQ3+EEfOPjMGZrXMse83wxJaylXsYXjcEDB/6I6TkRp CTEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d1KUM73y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i25-20020a17090685d900b00924a95bdf25si28001811ejy.315.2023.03.27.05.16.34; Mon, 27 Mar 2023 05:16:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=d1KUM73y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230229AbjC0MOq (ORCPT + 99 others); Mon, 27 Mar 2023 08:14:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232739AbjC0MOb (ORCPT ); Mon, 27 Mar 2023 08:14:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97AFF3C2A; Mon, 27 Mar 2023 05:14:26 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4B661B8115E; Mon, 27 Mar 2023 12:14:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D461BC433A4; Mon, 27 Mar 2023 12:14:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679919264; bh=/zMPyAlfGd5fpJsITtg1RxPyUHI2dqVyx+YefpHkWXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d1KUM73yCUytmr56IfxXPD1HZ5UAmAKM+0CBBY3u49w6bNCyrB2sEPtREvafbUkjb CFGZfI0FCfmknT0h+L+eXyaIpkkJwi4v3Z4EgaKViz+/z9QPPlnu3v9F3flYQ26Q7U q3EOb110zv0M3qi2mMyrlqEWXlVpt/VQQyKgll7QY7/XsuTxEM/ZKlPsmMjjXqmTMk uGUPoZTe4WHm4gicfHvkF72XI2puokOkW3TeQ/sk06+15hCStezZtavWZrwr2jQs/G iy1gH+XnYUCVyfsVu1+ZP4/ApT59WEmDcash0EKA5e1KL8ASTdihabMg2li4cEac/w 6iZEB7B78CFDw== From: Arnd Bergmann To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Vineet Gupta , Russell King , Neil Armstrong , Linus Walleij , Catalin Marinas , Will Deacon , Guo Ren , Brian Cain , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , Dinh Nguyen , Stafford Horne , Helge Deller , Michael Ellerman , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Rich Felker , John Paul Adrian Glaubitz , "David S. Miller" , Max Filippov , Christoph Hellwig , Robin Murphy , Lad Prabhakar , Conor Dooley , linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-oxnas@groups.io, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org Subject: [PATCH 03/21] sparc32: flush caches in dma_sync_*for_device Date: Mon, 27 Mar 2023 14:12:59 +0200 Message-Id: <20230327121317.4081816-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230327121317.4081816-1-arnd@kernel.org> References: <20230327121317.4081816-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnd Bergmann Leon has a very minimalistic cache that has no range operations and requires being flushed entirely to deal with noncoherent DMA. Most in-order architectures do their cache management in the dma_sync_*for_device() operations rather than dma_sync_*for_cpu. Since the cache is write-through only, both should have the same effect, so change it for consistency with the other architectures. Signed-off-by: Arnd Bergmann --- arch/sparc/Kconfig | 2 +- arch/sparc/kernel/ioport.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/sparc/Kconfig b/arch/sparc/Kconfig index 84437a4c6545..637da50e236c 100644 --- a/arch/sparc/Kconfig +++ b/arch/sparc/Kconfig @@ -51,7 +51,7 @@ config SPARC config SPARC32 def_bool !64BIT select ARCH_32BIT_OFF_T - select ARCH_HAS_SYNC_DMA_FOR_CPU + select ARCH_HAS_SYNC_DMA_FOR_DEVICE select CLZ_TAB select DMA_DIRECT_REMAP select GENERIC_ATOMIC64 diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 4e4f3d3263e4..4f3d26066ec2 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c @@ -306,7 +306,7 @@ arch_initcall(sparc_register_ioport); * On LEON systems without cache snooping, the entire D-CACHE must be flushed to * make DMA to cacheable memory coherent. */ -void arch_sync_dma_for_cpu(phys_addr_t paddr, size_t size, +void arch_sync_dma_for_device(phys_addr_t paddr, size_t size, enum dma_data_direction dir) { if (dir != DMA_TO_DEVICE && -- 2.39.2