From patchwork Mon May 24 07:06:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Yingliang X-Patchwork-Id: 1482848 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (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 4Fpj8v4VHrz9sRK for ; Tue, 25 May 2021 02:19:38 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PbGH4X/bBUfZyfsnzzpOvQDU+cLdrIYodo9QN4wabJM=; b=cnFdQVRUTrZErA VN/Enl1DT1auJDslnckk/1VYAELPOz6RzGH0KVrMZPAbSh2DPubYjTgM0J+8/6EK/OROvaeaC6fyu 51vNNJEhVZPY37k9Vl1Vzo79sgmJT0G+82ToHm3xQntqEuzPSxOvAkmT1BuUTF4JLQ0gVNOo9eZY5 UIsCdSXe6Pzqi7iP4CpeLmr/IthxMbgSrB3CxxsksWSOoj+3laU3d/8P0zdUz6PqU3f5lKTe/CoM1 DJx1P/cBKDfemXm0iByTbEHPYIxBRkJOjC6ThP7mMnyim953HvgyO7CwJzE07Rpuo32+8VwuqS2LK OCveV85fIES2sCiIh2AQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1llDI5-0014Ci-Dt; Mon, 24 May 2021 16:18:53 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ll4bc-000jK2-6c for linux-arm-kernel@lists.infradead.org; Mon, 24 May 2021 07:02:30 +0000 Received: from dggems704-chm.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4FpSjd6cXZzQrVf; Mon, 24 May 2021 14:58:45 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggems704-chm.china.huawei.com (10.3.19.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 15:02:21 +0800 Received: from huawei.com (10.175.103.91) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Mon, 24 May 2021 15:02:20 +0800 From: Yang Yingliang To: , , CC: Subject: [PATCH -next 1/2] ARM: imx: add missing iounmap() in imx_mmdc_remove() Date: Mon, 24 May 2021 15:06:59 +0800 Message-ID: <20210524070700.3032039-2-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210524070700.3032039-1-yangyingliang@huawei.com> References: <20210524070700.3032039-1-yangyingliang@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210524_000228_435679_9EA38A48 X-CRM114-Status: GOOD ( 10.89 ) X-Spam-Score: -2.3 (--) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: mmdc_base need be unmapped in imx_mmdc_remove(). Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- arch/arm/mach-imx/mmd [...] Content analysis details: (-2.3 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.191 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [45.249.212.191 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org mmdc_base need be unmapped in imx_mmdc_remove(). Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- arch/arm/mach-imx/mmdc.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/arch/arm/mach-imx/mmdc.c b/arch/arm/mach-imx/mmdc.c index 0dfd0ae7a63d..c313eb1f614c 100644 --- a/arch/arm/mach-imx/mmdc.c +++ b/arch/arm/mach-imx/mmdc.c @@ -77,6 +77,8 @@ static const struct of_device_id imx_mmdc_dt_ids[] = { { /* sentinel */ } }; +static void __iomem *mmdc_base; + #ifdef CONFIG_PERF_EVENTS static enum cpuhp_state cpuhp_mmdc_state; @@ -456,16 +458,6 @@ static int mmdc_pmu_init(struct mmdc_pmu *pmu_mmdc, return mmdc_num; } -static int imx_mmdc_remove(struct platform_device *pdev) -{ - struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev); - - cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node); - perf_pmu_unregister(&pmu_mmdc->pmu); - kfree(pmu_mmdc); - return 0; -} - static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_base) { struct mmdc_pmu *pmu_mmdc; @@ -528,14 +520,26 @@ static int imx_mmdc_perf_init(struct platform_device *pdev, void __iomem *mmdc_b } #else -#define imx_mmdc_remove NULL #define imx_mmdc_perf_init(pdev, mmdc_base) 0 #endif +static int imx_mmdc_remove(struct platform_device *pdev) +{ +#ifdef CONFIG_PERF_EVENTS + struct mmdc_pmu *pmu_mmdc = platform_get_drvdata(pdev); + + cpuhp_state_remove_instance_nocalls(cpuhp_mmdc_state, &pmu_mmdc->node); + perf_pmu_unregister(&pmu_mmdc->pmu); + kfree(pmu_mmdc); +#endif + iounmap(mmdc_base); + return 0; +} + static int imx_mmdc_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - void __iomem *mmdc_base, *reg; + void *reg; struct clk *mmdc_ipg_clk; u32 val; int err;