Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp421820pxf; Thu, 25 Mar 2021 07:10:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzHA2W7LeeUp7K2XG6WXL5VbEW2eb8LBDyV/r2EhCpt3v/BCymMrp1zUUgTZsdr5RfH71UU X-Received: by 2002:aa7:c0cd:: with SMTP id j13mr9637846edp.41.1616681407807; Thu, 25 Mar 2021 07:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616681407; cv=none; d=google.com; s=arc-20160816; b=u9Z3Ax1kJGkra/e/XukUUOHmkZieOJvK+b8tTJ5tg24SAQCQL+Cnq+1Rkyl+CLrWDL kzzgCifrsWvh+lrCjjli2YZSud6WgjkoGlktSjJKKEcdfbVQCrgwv6+F4rDONoNLT0ZY +qE3TvFwSb/ESdMw3YTx6b4X89Z4II+j9YWq2v1wUP9TBCE3MsSjiX8ASkcXj3uiuZsu 8S0lQPZfjWDLPSNwfssB2lqWZc6A0Ylcju+K3ATbP9Htp4nM/rGdCRDcO/SrhUF0gN/S zr2FSnrE/yHRqhQcNYDylLEVceYTelb4fnndZpb97e3zi2E5zgrbUdLaEk46qTWnzbTP Oxng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=EnYHhNTW26N7ndBZPCk29E3mInkxY2LDp6pQZg/6+X0=; b=a5j0KcxiEhu7+0hET13J/ToF8EJbEs7uS7vdsEWuRrpSTrXHsL5+F4r2iqbJdxcmoQ Ab0NcIuF6SBt+gIi/b3vJ17OsI2CTe3RiPQqS3Blq5rI+RcW977Xjw/vMwdOIQB2bSbs OQy5nOB/I3qOCUNe95TsyFomp9uTxfN+dlthYt4cAVaXHWniBTQq5kUlv8iFZ05iZ4jd mWznQZ3LCvdyX/Zvj9lbbhkzKwV9NoLYziMSk7m+2EYXkCv2FyvmR6p5rJhvdM1yhuS2 QGztOTIZlsIZJd5ujSozFC71P9oZJkUGn9QD97hSMYFhbH/V+Y/3CPajPsMARegKml1N q8ZA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f11si4335863ejw.277.2021.03.25.07.09.43; Thu, 25 Mar 2021 07:10:07 -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; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=marcan.st Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231210AbhCYOIa (ORCPT + 99 others); Thu, 25 Mar 2021 10:08:30 -0400 Received: from [212.63.208.185] ([212.63.208.185]:40364 "EHLO mail.marcansoft.com" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S230093AbhCYOID (ORCPT ); Thu, 25 Mar 2021 10:08:03 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id 354CF41A6E; Thu, 25 Mar 2021 14:07:42 +0000 (UTC) To: Arnd Bergmann , Will Deacon Cc: 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 References: <20210304213902.83903-1-marcan@marcan.st> <20210304213902.83903-9-marcan@marcan.st> <20210324181210.GB13181@willie-the-truck> From: Hector Martin Subject: Re: [RFT PATCH v3 08/27] asm-generic/io.h: Add a non-posted variant of ioremap() Message-ID: <9e510158-551a-3feb-bdba-17e070f12a8e@marcan.st> Date: Thu, 25 Mar 2021 23:07:40 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: es-ES Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Hector Martin (marcan@marcan.st) Public Key: https://mrcn.st/pub