From patchwork Tue Jul 21 05:45:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Gow X-Patchwork-Id: 1332801 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2001:8b0:10b:1231::1; helo=merlin.infradead.org; envelope-from=linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=merlin.20170209 header.b=WhbjRjpt; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=apmv1SMn; dkim-atps=neutral Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::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) by ozlabs.org (Postfix) with ESMTPS id 4B9nd84ryCz9sRW for ; Tue, 21 Jul 2020 15:45:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:Mime-Version:Message-Id:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=ALxq+m+L7cdgW2S9Of7xI1F8roDPd2kQ0ImxdrLpsTQ=; b=WhbjRjptEQp9naqQtJufdqmZmN sMPd3q2Sh6+Qk/dNcjGbOt51B1m6HudwlseHRcZVW5DUvxLfvaCI23L/ttWAU/cwKFQmx25o+fjlw oLEKYtfe7c54KIm8iK8AlF/Z0RpfWiCCbttND1KBLTJFDVXmE7+b0Z3+gNYQCctUGOqbnCTO6mbV9 uLltb79qKO4hnJ2OP5pLEORKynzFQpKG6Z8fYhWTpTT9WXNcjuMa4ZnHb1TA1E/yTYx6LQC78e3bF oSBl6A7tvokYbpES3Giq9ceUr+cxuDHIA1x+UQ+eibHZ6ojyZuJdvYcLO0qMp1v7P1aQgqfZhyr7u TA/sTTBQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxl60-0005K2-Br; Tue, 21 Jul 2020 05:45:44 +0000 Received: from mail-qk1-x74a.google.com ([2607:f8b0:4864:20::74a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jxl5x-0005Iz-8k for linux-um@lists.infradead.org; Tue, 21 Jul 2020 05:45:42 +0000 Received: by mail-qk1-x74a.google.com with SMTP id k16so13034246qkh.12 for ; Mon, 20 Jul 2020 22:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:message-id:mime-version:subject:from:to:cc; bh=TREar1MO2dsLwpnPrx9gwj7yD63VFVL8bjf4tFYmBsU=; b=apmv1SMniLyVP9DP8KpPXG7RQHOGN/fSC0pWUwKU4iyWw1wJHLTBLr9qo+HGEHWvT1 swKqZoFolFmggo4Cc+ufeVeyFR7xB6wibB068ZGt6DKq3tBcTW1dh+5sYnKZHVvEjQUO 6rhy03ouhnuF6qOdmivW9gN/97XA4291+spP/i1Gk0AU3ieZHacv1G+9YY8t3KxFZTCU qQLqLUgapsMx7zZ/Gk59hAi8urEfOijeVxZBHqWeRkOyuUt/DQ4m/1QepoFDGzz7s0z+ 97bo2KFXq2HYguOxwI+3RkyuCwf0CL06WAfuMBue657xdx/IxQYRuNhM2vlTQQ62CDBG AVLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=TREar1MO2dsLwpnPrx9gwj7yD63VFVL8bjf4tFYmBsU=; b=Rwjhhh874COlXRXKP8W2GdSQtapBQbeBq699HozXmnWxFv7NGlEwNsmal/uMLW7ZaM aOnSAbuctX2fM50TrVwWyL7A7+TcSNHg1qY2+9qvpHx40/Ui9NTfqMjKAk5/jXs9Y9lz nlaRd71Op+8d5UShNfv9jNoLJUYiZjHoIJX6klv2MOjth4wwgs4LpG6jchWwcG7O0AHY n1jhWcIY44rOZW2WHpEuTjHU76WxeusPdS9Vf53AERGSSGMQAcEa7HfuahDHkElQSSXw 29PWb3g/78byLrD0p07hSTT+zUr0TplL8hEvro57LYp3GtJWLIiF7HZdY9LyIumcitbZ H5VQ== X-Gm-Message-State: AOAM533AkeBoIDHqH6VzuVlRCNrUMJ9Rk8dPpU0mfwURhGsvcKB/BKUo 1NJGK5/071wSnl9ObHl4vQYas2CqvZEJwQ== X-Google-Smtp-Source: ABdhPJz9eYdF6Y8P16PshMHLBCfnnfJcQ+KbbT0G2k1BgzIqZJH7K+ErSTQxW2A37QxhMw2uUlIqOn2gw+wz3A== X-Received: by 2002:a0c:b712:: with SMTP id t18mr25194014qvd.205.1595310336945; Mon, 20 Jul 2020 22:45:36 -0700 (PDT) Date: Mon, 20 Jul 2020 22:45:28 -0700 Message-Id: <20200721054528.2556267-1-davidgow@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.rc0.105.gf9edc3c819-goog Subject: [RFC PATCH] platform: ioremap: Build iomap functions even without HAS_IOMEM From: David Gow To: Greg Kroah-Hartman , Jeff Dike , rafael@kernel.org, Logan Gunthorpe , Richard Weinberger , Jonathan Cameron X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200721_014541_328385_8599D974 X-CRM114-Status: GOOD ( 12.33 ) X-Spam-Score: -7.7 (-------) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-7.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:74a listed in] [list.dnswl.org] -7.5 USER_IN_DEF_DKIM_WL From: address is in the default DKIM white-list 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.0 DKIMWL_WL_MED DKIMwl.org - Medium sender X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-um , Brendan Higgins , linux-kernel@vger.kernel.org, David Gow , kunit-dev@googlegroups.com Sender: "linux-um" Errors-To: linux-um-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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 Signed-off-by: David Gow Reviewed-by: Brendan Higgins --- 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