linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Dejin Zheng <zhengdejin5@gmail.com>
Cc: toan@os.amperecomputing.com, lorenzo.pieralisi@arm.com,
	robh@kernel.org, bhelgaas@google.com,
	gustavo.pimentel@synopsys.com, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, dann.frazier@canonical.com
Subject: Re: [PATCH] PCI: xgene: fix a mistake about cfg address
Date: Tue, 30 Mar 2021 14:19:26 -0500	[thread overview]
Message-ID: <20210330191926.GA1297928@bjorn-Precision-5520> (raw)
In-Reply-To: <20210328144118.305074-1-zhengdejin5@gmail.com>

On Sun, Mar 28, 2021 at 10:41:18PM +0800, Dejin Zheng wrote:
> It has a wrong modification to the xgene driver by the commit
> e2dcd20b1645a. it use devm_platform_ioremap_resource_byname() to
> simplify codes and remove the res variable, But the following code
> needs to use this res variable, So after this commit, the port->cfg_addr
> will get a wrong address. Now, revert it.
> 
> Fixes: e2dcd20b1645a ("PCI: controller: Convert to devm_platform_ioremap_resource_byname()")
> Reported-by: dann.frazier@canonical.com
> Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>

This looks right to me, but since e2dcd20b1645a appeared in v5.9-rc1,
I think it should have:

  Cc: stable@vger.kernel.org	# v5.9+

> ---
>  drivers/pci/controller/pci-xgene.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c
> index 2afdc865253e..7f503dd4ff81 100644
> --- a/drivers/pci/controller/pci-xgene.c
> +++ b/drivers/pci/controller/pci-xgene.c
> @@ -354,7 +354,8 @@ static int xgene_pcie_map_reg(struct xgene_pcie_port *port,
>  	if (IS_ERR(port->csr_base))
>  		return PTR_ERR(port->csr_base);
>  
> -	port->cfg_base = devm_platform_ioremap_resource_byname(pdev, "cfg");
> +	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cfg");
> +	port->cfg_base = devm_ioremap_resource(dev, res);
>  	if (IS_ERR(port->cfg_base))
>  		return PTR_ERR(port->cfg_base);
>  	port->cfg_addr = res->start;
> -- 
> 2.30.1
> 

  parent reply	other threads:[~2021-03-30 19:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-28 14:41 Dejin Zheng
2021-03-28 15:38 ` dann frazier
2021-03-29  9:32 ` Lorenzo Pieralisi
2021-03-30 19:19 ` Bjorn Helgaas [this message]
2021-03-31  9:35   ` Lorenzo Pieralisi

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=20210330191926.GA1297928@bjorn-Precision-5520 \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=dann.frazier@canonical.com \
    --cc=gustavo.pimentel@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=robh@kernel.org \
    --cc=toan@os.amperecomputing.com \
    --cc=zhengdejin5@gmail.com \
    --subject='Re: [PATCH] PCI: xgene: fix a mistake about cfg address' \
    /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

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).