devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Xu Yang <xu.yang_2@nxp.com>,
	will@kernel.org, mark.rutland@arm.com, robh+dt@kernel.org,
	shawnguo@kernel.org
Cc: krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	linux-imx@nxp.com, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, ye.li@nxp.com
Subject: Re: [PATCH 1/2] perf: imx9_ddr_perf: resolve resource map conflict
Date: Thu, 14 Sep 2023 12:21:34 +0200	[thread overview]
Message-ID: <334c70fd-31f0-6ebb-e7e2-9f428da97cfa@linaro.org> (raw)
In-Reply-To: <20230914102038.2944844-1-xu.yang_2@nxp.com>

On 14/09/2023 12:20, Xu Yang wrote:
> Usually, the ddr pmu node will be a subnode of DDR controller, then using
> devm_platform_ioremap_resource will report conflict with DDR controller
> resource. So update the driver to use devm_ioremap to avoid such
> resource check.
> 

Why would you like to map same region twice? The resource check is for
purpose there...

> Signed-off-by: Ye Li <ye.li@nxp.com>
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> ---
>  drivers/perf/fsl_imx9_ddr_perf.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/perf/fsl_imx9_ddr_perf.c b/drivers/perf/fsl_imx9_ddr_perf.c
> index 5cf770a1bc31..885024665968 100644
> --- a/drivers/perf/fsl_imx9_ddr_perf.c
> +++ b/drivers/perf/fsl_imx9_ddr_perf.c
> @@ -602,8 +602,15 @@ static int ddr_perf_probe(struct platform_device *pdev)
>  	void __iomem *base;
>  	int ret, irq;
>  	char *name;
> +	struct resource *r;
>  
> -	base = devm_platform_ioremap_resource(pdev, 0);
> +	r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> +	if (!r) {
> +		dev_err(&pdev->dev, "platform_get_resource() failed\n");
> +		return -ENOMEM;
> +	}
> +
> +	base = devm_ioremap(&pdev->dev, r->start, resource_size(r));

You need to document this, otherwise someone will revert your commit soon.


Best regards,
Krzysztof


  parent reply	other threads:[~2023-09-14 10:21 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-14 10:20 [PATCH 1/2] perf: imx9_ddr_perf: resolve resource map conflict Xu Yang
2023-09-14 10:20 ` [PATCH 2/2] arm64: dts: imx93: add DDR controller node Xu Yang
2023-09-14 10:19   ` Krzysztof Kozlowski
2023-09-15  2:39     ` [EXT] " Xu Yang
2023-09-15  6:54       ` Krzysztof Kozlowski
2023-09-15  7:33         ` Xu Yang
2023-09-14 14:20   ` [EXT] " Frank Li
2023-09-15  1:33     ` Ye Li
2023-09-14 10:21 ` Krzysztof Kozlowski [this message]
2023-09-15  2:46   ` [EXT] Re: [PATCH 1/2] perf: imx9_ddr_perf: resolve resource map conflict Xu Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=334c70fd-31f0-6ebb-e7e2-9f428da97cfa@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=mark.rutland@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=will@kernel.org \
    --cc=xu.yang_2@nxp.com \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).