Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp481018rwb; Thu, 6 Oct 2022 22:57:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4BiVc4WjmT83t/sRL0KzdqWIr2XYflaZsp2PSp1mygRPnJBakvcte5oKg8w4Tnx+/DK2/I X-Received: by 2002:a17:902:ecc3:b0:178:3217:e455 with SMTP id a3-20020a170902ecc300b001783217e455mr3532222plh.18.1665122254740; Thu, 06 Oct 2022 22:57:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665122254; cv=none; d=google.com; s=arc-20160816; b=xYWB+a1ghYAQ8WMQyIizM5JizTrHqq3rzH9xHpgbadOlG9PGfB80r3Ok8wDlpN45vw b7KMrqp4l5thV5UaDYppFZsZ1GMepQktzhhVpvZcW0RIeK6tYPx3g9CGxN0xIeomBtzq KwlDux1C66ERfBRuP+Rd/qXzM//YqNgkUmhEP4JSskaBnf/5RTPgeKvLBGcSyPsp0Ybt rRmBIcRTwR18qmSPJ27onILqODnBXUmsiPEK+1TJo9IzHbm0kYKdNuj6fFjFYpa3ngbo K8h04fpjbioHSR7hbMROeH+MokKE/+mExkr6uCE5ivV7+NuIuOJVs0djRCweVrwUzXqi DLSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4jbGxKrMNyFrPT2wGOijm8eTvwIabIkBrKxbAT6PEw4=; b=XengXLzgO8jObqNJAaTwmDOCHrIV8nPXiWL040ssW75Rf3MqCBR3MCDSN7xP99LQ8S NolfdDnia8j33FqRVn59VuCU/VJZv7jgzPkhztr2F3WHE30nYYW5XZgZ2XkeaMheuiL7 toGQxqBpy81UkunnVeXqyMUPCVvWDzXEtJh3TQAtJT6TREOu1P63Z6BQFKIekoDWDjdc XYt+HdzSftBOVmL0g2nI7XU+AI94asorQAvvc0AI2oK+hT2nPoV93Zu8wOqpUkbiNz2c 9mUFeKfguHbSFhTYO+a/jry+JAbVV97Iy44nbN9Nqfvb8ge98sWjZ+UfZo3A0j5XVJmp L/BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=NMpqMafE; 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 j76-20020a636e4f000000b0042b20426194si1829340pgc.597.2022.10.06.22.57.19; Thu, 06 Oct 2022 22:57:34 -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=@brainfault-org.20210112.gappssmtp.com header.s=20210112 header.b=NMpqMafE; 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 S229555AbiJGFeq (ORCPT + 99 others); Fri, 7 Oct 2022 01:34:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229450AbiJGFen (ORCPT ); Fri, 7 Oct 2022 01:34:43 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D86C6578 for ; Thu, 6 Oct 2022 22:34:41 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id r17so8983263eja.7 for ; Thu, 06 Oct 2022 22:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=4jbGxKrMNyFrPT2wGOijm8eTvwIabIkBrKxbAT6PEw4=; b=NMpqMafEZGLvFJinUjEMNwJc2rAJJOzrQbQOdjP2MzhyXzyrJ7ONGhlRfnm+bbla5q sT8r8tD2/aeMk/7D03Qpt2KVlLPIVxIigH5u6rby7moU9u9Rm4VwU1xHsx2+tktlldI7 rESt98Ls4SirQGWP1FIGErVL3pTdrdstlH2UALxf52V6Uz6Fv5WkqRYuVBXje0laTjkJ 6703B25OkSBwK0jz35y4duOLKSSyr4Pzs/pXSu14Xi3FpUM4xo6BCY9T8Ri3NNYn7r3H RvY3X04CLMGzbgNJdbK87hyKsXtt0vc6uvU689NZN5KTT30VRWwj3kyD5cW2G3hyh886 5ViQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4jbGxKrMNyFrPT2wGOijm8eTvwIabIkBrKxbAT6PEw4=; b=IXShci+vrc04/U3cs3WL0D1lnReRmDYtOoMGt2dhHbsli7XIQrFWq1PAIuyQIQb7/U 957DHlkbUNBXy/Vg1VNTPRzT/q4BaBkK1+JoBiKAaHIOkzU+OZXGcXPzf8TNcvXZfk15 ULiqpXoQwf6aozW51RB5+PO30R4Ms1dBWSlMspmsJhBbFlyeuBW4FXs9U8NGleisOodM DMck4BxuvxOWJ5saOwTi0ZWlpSwZE7NhosI6tqpLwmTiDbjuj8iusUFQHGzGyn9tw8fu +qQxaRvHVgb6rdOT+VB5DjSDXvqviLLbZn95x6EjlImq7CkfTgdsAXOJS/fCgjtA2FMY CIJw== X-Gm-Message-State: ACrzQf1V4ytwjvTml4bWvhXJ9eYKpmCNjFBVc8qaOR3RFTH8uy1Z4+XS SNoiWNUi5SAii5DFkHZ4kDEqdc5TkXjlJh7KtU8crg== X-Received: by 2002:a17:906:eec7:b0:733:189f:b07a with SMTP id wu7-20020a170906eec700b00733189fb07amr2774018ejb.230.1665120879890; Thu, 06 Oct 2022 22:34:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Anup Patel Date: Fri, 7 Oct 2022 11:04:28 +0530 Message-ID: Subject: Re: [PATCH v2 1/4] RISC-V: Fix ioremap_cache() and ioremap_wc() for systems with Svpbmt To: Palmer Dabbelt Cc: Christoph Hellwig , apatel@ventanamicro.com, Paul Walmsley , atishp@atishpatra.org, heiko@sntech.de, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, mchitale@ventanamicro.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,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 Fri, Oct 7, 2022 at 9:20 AM Palmer Dabbelt wrote: > > On Wed, 28 Sep 2022 05:14:30 PDT (-0700), Christoph Hellwig wrote: > > On Thu, Sep 22, 2022 at 09:35:56AM -0700, Palmer Dabbelt wrote: > >> Sorry I missed this, I thought it was just part of the rest of this patch > >> set. That said, I'm not actually sure this is a critical fix: sure it's a > >> performance problem, and if some driver is expecting ioremap_cache() to go > >> fast then possibly a pretty big one, but the only Svpmbt hardware that > > > > More importantly nothing should be using ioremap_cache at all. It is > > an API that has long been deprecated in favor of memremap. > > There's a few uses of it, I just send along a patch to make it > arch-specific and make the users depend on it. That should let us stop > adding this to ports just to get the drivers building. I agree, ioremap_cache() should not be used by drivers. I encountered this issue with the PMEM driver which uses devm_memremap() which in-turn calls memremap() (kernel/iomem.c). The kernel memremap() still expects arch-specific ioremap_xyz() functions/macros to implement various MEMREMAP_xyz flags which is why we need these RISC-V specific ioremap_xyz(). An alternative way is to implement RISC-V specific arch_memremap_wb() but this will still look similar to ioremap_cache() added by this patch. Also, only 32bit ARM implements arch_memremap_wb() whereas all other archs (ARM64, x86_64, etc) implement ioremap_xyz() functions/macros. Regards, Anup