Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp464845pxf; Thu, 25 Mar 2021 07:50:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybsMb8BXbiuF/gzX/Jrc5uP8vrYpkWFuIgBWbrACV4IvWZltrytqQt0GFQD2sTxynz+25k X-Received: by 2002:a17:906:c9d8:: with SMTP id hk24mr10034069ejb.480.1616683856918; Thu, 25 Mar 2021 07:50:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616683856; cv=none; d=google.com; s=arc-20160816; b=dWb6tHrcaY3svHqR/mD5UrXUsjVA1e8wxCafkLmkbfwkj8ID25IrA8EUm012c9/Uud WDbIH0qJn0nZuaStorL1YCLhgHeg6e66045DoJMbQ3Pp3a39HJFxe6bHhpQKeiQFKlBJ 8i8LTQDc4EY6rljWgCHCGGzsuIOUC/iYaXo5PSuEERwW+LETXMOsf7DhLSUb3ArzRgT/ M2B3oFxn0mR0DEpAdXFgKSBNZ0ZY3AseTwQIb+n6yG+l+p5d6Yi27ZKRB6wakqACiODz IO4Ar8I3gW6+7Es5k2SGpsoLl63mnocv6Am2OuKjZv6t5IeVAjIg5e1Ry1TpkSracOn6 SwMA== 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 :dkim-signature; bh=gre/3napSgbDYK/cCCMdYKw4mOqPg2V+li4QR1NmdXw=; b=j5QNC2TSwMR9w5ReGXBI/4qNoBsQuG5iXWHXIIUhKXIAPnR4x56DSwlQZdOVLc/gnp KWKbe31Vv0OirUwSHoc2Y4/HuFoB10UQiuJMyYAmDDAAWkyRYNxyuvsVyRTq+RNQu0AF cFGjifxQFyiVd1jja90Wtp5+eW7noxQhh05OFNn6wQpytKscx92HDyACs+YIZqZTL5Zc pwAu41fkOY8bo+W87+sIDAuodfiW/u/Y1Sw6bwJ8sE5fhOKcgsSjU807wGwYqoNH0oeV TepNRh+BpPVeiLrNeJLQkkhyfrHiDm5ZK2SGEfteM82p0HAllnjO7mJK4WPV/4fmUyZF Coqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B7AXfE4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bm7si4290535edb.188.2021.03.25.07.50.33; Thu, 25 Mar 2021 07:50:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=B7AXfE4j; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231184AbhCYOtb (ORCPT + 99 others); Thu, 25 Mar 2021 10:49:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:53440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbhCYOtO (ORCPT ); Thu, 25 Mar 2021 10:49:14 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 837F7619F9; Thu, 25 Mar 2021 14:49:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616683753; bh=g2ZlXDmeEeZxEkxEnqAn7onjv8xh5BForWiFk2ex04U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=B7AXfE4jFRrobfpRw2FaAYKC6MvyXtU6obWFBYkN0lGwjbQiFaLragEzkHbZItBws QBand/1dIuqMlS8nHo0I+YXxuG4FUSBqCuL4lSjtB1KNR8ZC5A0dHPTgjp6C4Oj477 YGYoQaHRwjTqkyAUy9nju41KQckd840sj7rAx2b0qbeWS73PVSRLi5XxftNFChRgBj A74iOhWJ7Z2hED2cBG6LJSpp0VhA5RVDGFxCz/bh5Feg/yMuNLIKAvIJSpdBVn+DEc g38Q/XF19LYytoglY1yJyqNca2iKkNPAL5ceWnMOmYHNen+O1Ivl6iLodMdhA7We0k rrMK1jKks2Uxg== Date: Thu, 25 Mar 2021 14:49:06 +0000 From: Will Deacon To: Hector Martin Cc: Arnd Bergmann , Linux ARM , Marc Zyngier , Rob Herring , Olof Johansson , Krzysztof Kozlowski , Mark Kettenis , Tony Lindgren , Mohamed Mediouni , Stan Skowronek , Alexander Graf , Linus Walleij , Mark Rutland , Andy Shevchenko , Greg Kroah-Hartman , Jonathan Corbet , Catalin Marinas , Christoph Hellwig , "David S. Miller" , DTML , "open list:SERIAL DRIVERS" , "open list:DOCUMENTATION" , "moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES" , linux-arch , Linux Kernel Mailing List Subject: Re: [RFT PATCH v3 08/27] asm-generic/io.h: Add a non-posted variant of ioremap() Message-ID: <20210325144905.GA15109@willie-the-truck> References: <20210304213902.83903-1-marcan@marcan.st> <20210304213902.83903-9-marcan@marcan.st> <20210324181210.GB13181@willie-the-truck> <9e510158-551a-3feb-bdba-17e070f12a8e@marcan.st> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9e510158-551a-3feb-bdba-17e070f12a8e@marcan.st> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 11:07:40PM +0900, Hector Martin wrote: > On 25/03/2021 04.09, Arnd Bergmann wrote: > > On Wed, Mar 24, 2021 at 7:12 PM Will Deacon wrote: > > > > > > > +/* > > > > + * ioremap_np needs an explicit architecture implementation, as it > > > > + * requests stronger semantics than regular ioremap(). Portable drivers > > > > + * should instead use one of the higher-level abstractions, like > > > > + * devm_ioremap_resource(), to choose the correct variant for any given > > > > + * device and bus. Portable drivers with a good reason to want non-posted > > > > + * write semantics should always provide an ioremap() fallback in case > > > > + * ioremap_np() is not available. > > > > + */ > > > > +#ifndef ioremap_np > > > > +#define ioremap_np ioremap_np > > > > +static inline void __iomem *ioremap_np(phys_addr_t offset, size_t size) > > > > +{ > > > > + return NULL; > > > > +} > > > > +#endif > > > > > > Can we implement the generic pci_remap_cfgspace() in terms of ioremap_np() > > > if it is supported by the architecture? That way, we could avoid defining > > > both on arm64. > > > > Good idea. It needs a fallback in case the ioremap_np() fails on most > > architectures, but that sounds easy enough. > > > > Since pci_remap_cfgspace() only has custom implementations, it sounds like > > we can actually make the generic implementation unconditional in the end, > > but that requires adding ioremap_np() on 32-bit as well, and I would keep > > that separate from this series. > > Sounds good; I'm adding a patch to adjust the generic implementation and > remove the arm64 one in v4, and we can then complete the cleanup for other > arches later. Cheers. Don't forget to update the comment in the generic code which complains about the lack of an ioremap() API for non-posted writes ;) Will