From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A883C48BE5 for ; Sat, 12 Jun 2021 02:33:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 593DF6128A for ; Sat, 12 Jun 2021 02:33:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 593DF6128A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HIdqBGSbTWQU7yKfkA8492JKePO5ItJD5gh4e+bXk2A=; b=FVWNiIWYb/K9Mr Ka2zAwYkfgjluHcbtRfZSueJqUMSopg6GvtHLOpUl2/KxOkBqgXWtHHocIM81oo64ipsBPPFg4HT9 phE6xf1ZbskJYHz4EX84A0827ly8wvAzDwnAxsHZ6uTb3qWFAbF/FMYGvTOFqlX56BOCcB931scgx B3jnsGt4j8Zo10jeuouy91oRvS8S3sPRbzwWqzW2xIHUJ4jy7yQtBiB7HO5XVum6AS3UNCScvxQnK s/3JuNfJe2dTVuXBukPJF9fWNyhI8NQJfjY2Kqx/VJS2C8JePAjwnJ8Cy+giF4GTKCSJ3p6Nyu3E7 2FrGMW9IrkeJzSBeOqMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrtQr-007abw-Jo; Sat, 12 Jun 2021 02:31:33 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1lrtQo-007aba-Nf for linux-arm-kernel@lists.infradead.org; Sat, 12 Jun 2021 02:31:32 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3351D6128A; Sat, 12 Jun 2021 02:31:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623465090; bh=pEJF+vsm1MHKMEFT04SjKyemkTdIxradSFMr4RBmezU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=YQOMdgONzcHWkZ4P9Yu2TSnZMQUkvMU0o8Aqu6XWr4RmUb43cpr7599oY9ZpJqyh8 JMnwGQgECBpnLyag0nhz3fXmSJqY7x0yRVyueAlEGv+buNGP3RQlniCIQyQaviUN8t PgJbyF3s+9d3W/yLMLlKHO9y7RW/N++1+C9xv+/t2MQ0xdeWwfbNIsIZSu9JFgmdhY ou9xgYa8EwiY0MrMuUcEp4ZaSRes5gp6/lBgl9SG1v1SzPNPaiHwhn5z9HaTY41JuQ hf5/I7uRgpUOHQYx2qSof59TgWsg0kheusPnkvMF3gmsUxxLRNuLejM+wkikMB/y9Z W+IKt7J+bVy8w== Date: Sat, 12 Jun 2021 10:31:25 +0800 From: Shawn Guo To: Yang Yingliang Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com Subject: Re: [PATCH -next 1/2] ARM: imx: add missing iounmap() in imx_mmdc_remove() Message-ID: <20210612023124.GF29138@dragon> References: <20210524070700.3032039-1-yangyingliang@huawei.com> <20210524070700.3032039-2-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210524070700.3032039-2-yangyingliang@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210611_193130_816189_E0774DDF X-CRM114-Status: GOOD ( 20.50 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, May 24, 2021 at 03:06:59PM +0800, Yang Yingliang wrote: > 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; > + I do not like such variables. Can we have a data structure holding this and the clock that patch 2/2 is adding? Also please consider to consolidate the mmdc_base in' struct mmdc_pmu'. Shawn > #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; > -- > 2.25.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel