Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7383763rwl; Mon, 9 Jan 2023 23:25:32 -0800 (PST) X-Google-Smtp-Source: AMrXdXtUpBCO+6RDeYCRpto31xLayJCWh6WU4D2eUV6Gr4Zc0TNopfXSXjrHJDexpnkoeps4oOJ2 X-Received: by 2002:a05:6a21:7893:b0:af:1a39:553d with SMTP id bf19-20020a056a21789300b000af1a39553dmr103562894pzc.14.1673335532507; Mon, 09 Jan 2023 23:25:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673335532; cv=none; d=google.com; s=arc-20160816; b=sNqwrUg6KcA0QkpN2qqMJ/OU74ixnj26BlKdL7ZvCbLRCTCYaq3g1csb12+y60dhF3 GScC6CDU9HKSAm0OvQzsriy8XQpMyw04WeDheuhATpKOpPMkrkLoGGPzzFGBA1xCV+gB Z/538f2WCMyfoMZL5vVUtLokqj7DKInwF7S5WBjh85meZ2Aw9cYcMJeAVgbb3Ejpa2t+ Ysm4u54LRWjhti4cjl1ICZ5QxPvUtwP6kfUwE3DyFGVpBlx7ujlmC70WZWNHU3UE6cG4 zwDOt4tggSoo5AE4CQGKb5vGDhdVnRFSka/dkaK7VulptuyrT+39cKmRQC4J/GDAoRGp 2JXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=x2fKE/PRwWw1Rv6q5iH+iu02odHBVC/Mg/n6kKafyjQ=; b=m8pRAikwYHiHuSFZUDnFu10VwC8lRwZe8QQ65hYDfRETxMcPMf5aGI4m/IIJbwdI3X /DPOgrCJyfsZTKiaKo86a91P4mDm2bnn+kaRxpXstxVR0fFNLZp4bPxiSFup352bAJla LA3MVpEk3O9JC2UWdu52OjXQCmAh3YFdaSxdN0Lnl6ci2AjchVsuGkhyzKw1ySs/OnA3 zL1SAQByfrIUnAVCiTNOxtFcaUbJ4BGj/npKeXleRL6mi3e2ziKa6GkUMAMtLYkBfhng +yrZ5K8tvk35Tp/uwJB4i7dY8V6vsqaDyc9C1cBgDeL5XFdyPUBs5ofvDhhLT3bON5d+ 8HNw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s28-20020a63525c000000b0047895cb2289si10869414pgl.644.2023.01.09.23.25.26; Mon, 09 Jan 2023 23:25:32 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229812AbjAJHBz (ORCPT + 53 others); Tue, 10 Jan 2023 02:01:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbjAJHBw (ORCPT ); Tue, 10 Jan 2023 02:01:52 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C82421B6; Mon, 9 Jan 2023 23:01:51 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id 32C1768BFE; Tue, 10 Jan 2023 08:01:45 +0100 (CET) Date: Tue, 10 Jan 2023 08:01:44 +0100 From: Christoph Hellwig To: Arnd Bergmann Cc: Prabhakar , "Conor.Dooley" , Geert Uytterhoeven , Heiko =?iso-8859-1?Q?St=FCbner?= , guoren , Andrew Jones , Paul Walmsley , Palmer Dabbelt , Albert Ou , "open list:RISC-V ARCHITECTURE" , open list , devicetree@vger.kernel.org, Linux-Renesas , "Lad, Prabhakar" , Philipp Tomsich , Nathan Chancellor , Atish Patra , Anup Patel , Tsukasa OI , Jisheng Zhang , Mayuresh Chitale , Christoph Hellwig , Will Deacon Subject: Re: [RFC PATCH v6 1/6] riscv: mm: dma-noncoherent: Switch using function pointers for cache management Message-ID: <20230110070144.GG10289@lst.de> References: <20230106185526.260163-1-prabhakar.mahadev-lad.rj@bp.renesas.com> <20230106185526.260163-2-prabhakar.mahadev-lad.rj@bp.renesas.com> <6f7d06ef-d74d-4dfc-9b77-6ae83e0d7816@app.fastmail.com> <9017adf0-acd4-4c43-8aea-3579b214b477@app.fastmail.com> <45d6eb0c-cbe3-4a83-aa12-3483638473ae@app.fastmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45d6eb0c-cbe3-4a83-aa12-3483638473ae@app.fastmail.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham 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 On Mon, Jan 09, 2023 at 01:59:12PM +0100, Arnd Bergmann wrote: > I had another look at the arm64 side, which (like the zicbom > variant) uses 'clean' on dma_sync_single_for_device(DMA_FROM_DEVICE), > as that has changed not that long ago, see > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c50f11c6196f45c92ca48b16a5071615d4ae0572 which IIRC has been reverted recently. > I'm still not sure what the correct set of operations has > to be, but nothing in that patch description sounds ISA > or even microarchitecture specific. Nothing is ISA specific, and the only micro architecture related thing is if the specific core can speculate memory accesses. See the table in arch/arc/mm/dma.c for details. And as commented on the arm64 patch I really hate architectures getting creative here, as I'd much prefer to move the choice of primitives to the core DMA code and just provide helpers to invalidate/writeback/ writeback+invalidate from the architectures eventually.