Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp1157882ybh; Thu, 23 Jul 2020 01:45:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzAUkYDfrNUOGWBONvf17J1JZzMe9qY+ZoXfuC8YxBNAC3M+un9xYeX5g9+DF7VrCSKgjNR X-Received: by 2002:a17:906:eb93:: with SMTP id mh19mr3225441ejb.552.1595493933270; Thu, 23 Jul 2020 01:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595493933; cv=none; d=google.com; s=arc-20160816; b=jBy1jWplbph4eHXr9PuO3lYeUxkpF/OFa2LIc/MTmnKomPhOcaDXc12wTVZf7YECcQ iWCSfJuMbbJOkEiKQs6a+aZpnRPB1DJskjBDsC9Ma3R3g9Nt8wHuiB6rT1HrxVBpF97t G66AymFTbGn++Iekz4GYr04btttmnFDDsuR1L9DhrtP1Mji1wSROZw1TNhDAoWRttmA2 ccRfLjum/QAkC/AOG3EBFvVHJe2F5E3UZf9w2hgnj9tRkw7AbTmfvZWpZEp/SrVVsqwL CqAriJsoXL/ODfHYQ2XNLhBIFtZXsxIwkB9AjVGJkT2AnDy+6gSbSNbnz+dUdQO8mFIz kVHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=98ExSb5hYnsDXq2ZwavgwZhCLheHyEwPHWcZ+2SWRBg=; b=SSSLq32L6pEpduFgRkzCaEUR5m6w0bZSqtqtvUqY0agiv/VS40SrYZt9Upn5aOuYH+ vfV7Dtas88xoEG+n39K82VQslofw6rwwnyUwu44b0tU7Ju1HFWV/+ZFl7nB/LDDMLMhx BnQYw26xy+wp6LOwgn61Y+UbZ3sfnxeZy9NHbzXt7NhSBci3PK+GrZ5FpbPpxA4GOMlK AsHlEYNrY8MtuTSPZ7vmfB5DuPq1KlAW0SHY8wFTDCe/aNK2pM/nRTrROTSPCtt3qSDn I/dz8VYx0olXtUtfZM3QsJbPVbqInAGKs42v4Wx4/k6PToCxx6X6kXXVbv9mdjRAlUnA V0/g== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l21si1696868ejg.690.2020.07.23.01.45.10; Thu, 23 Jul 2020 01:45:33 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726109AbgGWIm5 (ORCPT + 99 others); Thu, 23 Jul 2020 04:42:57 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2513 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725858AbgGWIm5 (ORCPT ); Thu, 23 Jul 2020 04:42:57 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id CAA78D7CF743FE7D3470; Thu, 23 Jul 2020 09:42:55 +0100 (IST) Received: from localhost (10.52.125.229) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Thu, 23 Jul 2020 09:42:55 +0100 Date: Thu, 23 Jul 2020 09:41:34 +0100 From: Jonathan Cameron To: David Gow CC: Greg Kroah-Hartman , Jeff Dike , , Logan Gunthorpe , Richard Weinberger , Brendan Higgins , , linux-um , Subject: Re: [RFC PATCH] platform: ioremap: Build iomap functions even without HAS_IOMEM Message-ID: <20200723094134.0000432d@Huawei.com> In-Reply-To: <20200721054528.2556267-1-davidgow@google.com> References: <20200721054528.2556267-1-davidgow@google.com> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.125.229] X-ClientProxiedBy: lhreml725-chm.china.huawei.com (10.201.108.76) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 Jul 2020 22:45:28 -0700 David Gow wrote: > A number of drivers use devm_platform_ioremap_resource(), but do not (or > did not) explicitly depend on IOMEM[1,2]. Given that the only platform > without HAS_IOMEM seems to be UML, and it has sufficient stubs for > devm_platform_ioremap_resource() and its dependencies to build, we can > remove the HAS_IOMEM requirement here, rather than playing whack-a-mole > with different drivers which don't try to build against ARCH=um. > > The reason this works at the moment is that stub ioremap and iounmap > functions were added to UML to support this sort-of thing[3]. This > particular change doesn't require adding any additional stubs, but there > is possibly room in the future to stub out the remaining iomem functions > (or to provide mock implementations for testing), and get rid of > HAS_IOMEM entirely. > > [1]: https://lkml.org/lkml/2020/6/30/176 > [2]: > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1e7468bd9d30a21e059af477106dc5588ae52dff > [3]: > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1405627.html Hi David, I don't quite follow why we change when iomap_copy.c is built. Was this just a case of there not seeming to be any reason to protect it or is there a direct dependency on something in there that I'm missing? Otherwise looks good to me. Jonathan > > Signed-off-by: David Gow > --- > drivers/base/platform.c | 2 -- > lib/Makefile | 2 +- > 2 files changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > index c0d0a5490ac6..628dde6675cf 100644 > --- a/drivers/base/platform.c > +++ b/drivers/base/platform.c > @@ -61,7 +61,6 @@ struct resource *platform_get_resource(struct platform_device *dev, > } > EXPORT_SYMBOL_GPL(platform_get_resource); > > -#ifdef CONFIG_HAS_IOMEM > /** > * devm_platform_get_and_ioremap_resource - call devm_ioremap_resource() for a > * platform device and get resource > @@ -135,7 +134,6 @@ devm_platform_ioremap_resource_byname(struct platform_device *pdev, > return devm_ioremap_resource(&pdev->dev, res); > } > EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_byname); > -#endif /* CONFIG_HAS_IOMEM */ > > /** > * platform_get_irq_optional - get an optional IRQ for a device > diff --git a/lib/Makefile b/lib/Makefile > index b1c42c10073b..35c21af33b93 100644 > --- a/lib/Makefile > +++ b/lib/Makefile > @@ -115,7 +115,7 @@ obj-y += math/ crypto/ > > obj-$(CONFIG_GENERIC_IOMAP) += iomap.o > obj-$(CONFIG_GENERIC_PCI_IOMAP) += pci_iomap.o > -obj-$(CONFIG_HAS_IOMEM) += iomap_copy.o devres.o > +obj-y += iomap_copy.o devres.o > obj-$(CONFIG_CHECK_SIGNATURE) += check_signature.o > obj-$(CONFIG_DEBUG_LOCKING_API_SELFTESTS) += locking-selftest.o >