Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1051511pxj; Fri, 11 Jun 2021 19:44:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLXwoRCl457syMMwKVnFmDGbRM1fJOZHYTkWJal4Vz5U47BlOvTLk3Qw1p6Tj5FD7MLkGH X-Received: by 2002:a17:906:6899:: with SMTP id n25mr6244120ejr.462.1623465897587; Fri, 11 Jun 2021 19:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623465897; cv=none; d=google.com; s=arc-20160816; b=iuHdBw9S30h5ZYA1nCDyV5mBSEQHg/h7AM1LBJTAzuD2wFV5F4d+X/2mq27FzoVoBU vI4ULiUr8NYja1FHdU/hw7o9Yd8fo1mnFLpqTuBpXGDygCrFIOFGMFJ4Upic+D2frGS0 jn3XJco7Pabl59H0W1duZQdKDDAghq3hcjekFzGCvgVlJqARvBkS2lc9jjA1kI4OYpbM +sHAatFPU3wDS14POhGyOObQW7sDhn9R01uw0WQagbNJTPSWTd7lHN2CpcVydVI3lLFD uJSLA5H9qbLKkI4BC/kf+axJVHtyaCYak6ZWnxO5Yb/XaMUzmy4qHuUztt13FI/qYntF NPfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Kdn8G4nCTL6VNoHSLi724qw/ovYMNo2n5PoC12J8BGs=; b=CqXjlRtx6L/2SRfvBHbiTJFB1gdH5P1b9FAqX+RXy5aGdmkkLspa1U13LB2lkCH5MZ 4+4q5fhgBUYVLGxpUh5hhIp5wQAIUbTrKCP0aSEFbGpvDSx62GJJM24WS4FYZHfJN0EG vzf9A/8BQBw0NrKhwl7zod3D1fJI4KhRScgs1t/EMssLMSSlHq2rqBOBeckgVcRBq5tA khL2n4FG8EYj6L++I5kKOFW6vJ+oOq5MFq1UnXPLwfFva4Y4GIvLnDqkAm2PYnHI67aC MOM4qLnGiLi4vEmjxX6MFRA5DeRxnA/wAEx5NWvVxyRcJ9NwLPyPup9RRgjkUZ8HFNy4 kXcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YQOMdgON; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si6246501edt.542.2021.06.11.19.44.32; Fri, 11 Jun 2021 19:44:57 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=YQOMdgON; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230370AbhFLCd3 (ORCPT + 99 others); Fri, 11 Jun 2021 22:33:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:37068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229874AbhFLCd2 (ORCPT ); Fri, 11 Jun 2021 22:33:28 -0400 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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210524070700.3032039-2-yangyingliang@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 >