From patchwork Fri Apr 19 10:42:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 10908807 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 51AC914DB for ; Fri, 19 Apr 2019 10:43:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3392528D2C for ; Fri, 19 Apr 2019 10:43:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2797328D6B; Fri, 19 Apr 2019 10:43:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C274B28D2C for ; Fri, 19 Apr 2019 10:43:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From: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=Bsbh2YcF5TqngfPcfsfKCGE1F9UEhL4F9jY4vRdkJy0=; b=t7bTm/TlVtG8p3 a3wF6O2miN3ozHy0y/UAd/5qymgVsHoVDw+WH0DNwtZqcVk0LeG2bw2xl3n+Os/4BkYVwKq6iY1D2 7+GSsVL4jtEBVRjOX84r2EjVMZ2wi++ZGAmldJl68Jgz0KVA0lZNDSEzApweUOgfb4PzUfN44InJH iL/tNf0r85f78kfVTtzMykXgajcsFA6basYUjpDd7XRx9NY69RlBfpDQGXAaIJYmnhLfuHi5Bvus4 Wj3BjLqj0X/EwkCk0PYkbhMkWnIBC/BUecxy7kzKAtnAYvihpqUD5zqN4p3sANNCwKqSOz2HZwHWz d1BceRnukFZqqvTtMXSA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHQyx-0006JT-UN; Fri, 19 Apr 2019 10:42:59 +0000 Received: from mail-eopbgr10084.outbound.protection.outlook.com ([40.107.1.84] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hHQyu-0006Ix-PO for linux-arm-kernel@lists.infradead.org; Fri, 19 Apr 2019 10:42:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+dab7rl0K1PE5IqieSuXh3lngJLk0Iala8CcmGYMNZg=; b=ohrjGLe6qsNTNKIRb2kLnCcMtJDfQLE7m32ylTxu/IU0NdjqOAk5t7z8CTrCVt47H4w3p3+PhbKPMOdAVYNIXMqudhaBLvzB8MBJHt26zPLgbvPUm8nYIbwVi43vehw1ZDFAU6kw8B/a96X6qowx4KErXS3b3noX3dQRvu50r2Q= Received: from AM0PR04MB4211.eurprd04.prod.outlook.com (52.134.92.158) by AM0PR04MB5010.eurprd04.prod.outlook.com (20.176.215.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1813.12; Fri, 19 Apr 2019 10:42:51 +0000 Received: from AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::8cda:4e52:8e87:8f0e]) by AM0PR04MB4211.eurprd04.prod.outlook.com ([fe80::8cda:4e52:8e87:8f0e%2]) with mapi id 15.20.1813.013; Fri, 19 Apr 2019 10:42:51 +0000 From: Aisheng Dong To: "linux-clk@vger.kernel.org" Subject: [PATCH 1/1] Revert "clk: imx: use devm_platform_ioremap_resource() to simplify code" Thread-Topic: [PATCH 1/1] Revert "clk: imx: use devm_platform_ioremap_resource() to simplify code" Thread-Index: AQHU9pyjuGc/37hQDkmX93reiiRIug== Date: Fri, 19 Apr 2019 10:42:51 +0000 Message-ID: <1555670144-24220-1-git-send-email-aisheng.dong@nxp.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.7.4 x-clientproxiedby: HK0PR03CA0052.apcprd03.prod.outlook.com (2603:1096:203:52::16) To AM0PR04MB4211.eurprd04.prod.outlook.com (2603:10a6:208:5b::30) authentication-results: spf=none (sender IP is ) smtp.mailfrom=aisheng.dong@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [119.31.174.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ffbbd93c-a1f2-4a30-027b-08d6c4b3c56a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600141)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM0PR04MB5010; x-ms-traffictypediagnostic: AM0PR04MB5010: x-microsoft-antispam-prvs: x-forefront-prvs: 0012E6D357 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(366004)(136003)(346002)(376002)(396003)(31014005)(199004)(189003)(2501003)(14454004)(4326008)(52116002)(6916009)(8676002)(81166006)(66066001)(86362001)(53936002)(99286004)(5640700003)(486006)(5660300002)(8936002)(81156014)(2616005)(44832011)(68736007)(66556008)(6486002)(476003)(14444005)(54906003)(3846002)(50226002)(73956011)(25786009)(316002)(97736004)(2906002)(256004)(71200400001)(386003)(6506007)(36756003)(305945005)(71190400001)(26005)(6512007)(2351001)(186003)(7736002)(66446008)(66476007)(102836004)(478600001)(66946007)(6436002)(6116002)(64756008); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5010; H:AM0PR04MB4211.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: CCANA33k2wwWifSLA7J2lClGC+HKcggBUOuz2cgNrJop80h2cTxw3Zev221NJnusP+pkmaiJaVowd2VbY72sOkFI2C4pYM9KdIvmB4AXDWpB/5qg3SghFguZBo1UCqENMTFAw5T4wJCc2KQtC9vgoPQrZJ3SFxlVlaGLG/yWJdCYlIwwPbF2ZS90IOb89cN5PIi6WVl0Oitjg/0YBzZjdRLlRBcX6ygGCU2+YO+Z+qX/3tKeg7w01iCPuwvCrWDdKvM4PrLactBF+ETjIzGgFrvgbbVQV1E7eQOd+Dlbw+4Iv60+W4FaY9bmc1uUMNwViG8nOWZO/VOpK2ihPPpZx90gGp0ZgPAsvPWepUyKdDlMXi3Za0lnvwXdpo0hBApArq2Fyj+oEXg58rEAdOPTd5aGEzMinS+3i2cBma/QlVc= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ffbbd93c-a1f2-4a30-027b-08d6c4b3c56a X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2019 10:42:51.3925 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB5010 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190419_034256_827932_C3BFB6F0 X-CRM114-Status: GOOD ( 13.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Aisheng Dong , Anson Huang , "sboyd@kernel.org" , "mturquette@baylibre.com" , dl-linux-imx , "kernel@pengutronix.de" , Fabio Estevam , "shawnguo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit 612d5b65894b5b1607a004bd9bc60d5963b58ef6. Originally we use devm_ioremap() specifically because we want to bypass the devm_request_mem_region due to LPCG address space are shared with some other modules within the same SS (subsystem). The patch in question occasionally added the request_me_region back by calling devm_platform_ioremap_resource which results in all the devices with overlappded IO space failed to be probed as follows: [ 1.062996] fsl-lpuart 5a060000.serial: can't request region for resource [mem 0x5a060000-0x5a060fff] [ 1.071923] fsl-lpuart: probe of 5a060000.serial failed with error -16 Cc: Anson Huang Signed-off-by: Dong Aisheng Tested-by: Leonard Crestez --- Shawn, This is a new issue and only exist in imx/for-next branch. You can decide whether to remove it or take the revert patch. --- drivers/clk/imx/clk-imx8qxp-lpcg.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx8qxp-lpcg.c b/drivers/clk/imx/clk-imx8qxp-lpcg.c index c711654..fb6edf1 100644 --- a/drivers/clk/imx/clk-imx8qxp-lpcg.c +++ b/drivers/clk/imx/clk-imx8qxp-lpcg.c @@ -159,6 +159,7 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev) struct clk_hw_onecell_data *clk_data; const struct imx8qxp_ss_lpcg *ss_lpcg; const struct imx8qxp_lpcg_data *lpcg; + struct resource *res; struct clk_hw **clks; void __iomem *base; int i; @@ -167,7 +168,10 @@ static int imx8qxp_lpcg_clk_probe(struct platform_device *pdev) if (!ss_lpcg) return -ENODEV; - base = devm_platform_ioremap_resource(pdev, 0); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!res) + return -EINVAL; + base = devm_ioremap(dev, res->start, resource_size(res)); if (!base) return -ENOMEM;