linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Zhichang Yuan <yuanzhichang@hisilicon.com>
Cc: grant.likely@linaro.org, linux-pci@vger.kernel.org,
	stable@vger.kernel.org, gabriele.paoloni@huawei.com,
	Liviu.Dudau@arm.com
Subject: Re: [PATCH v2] of/pci: fix a bug in function pci_pio_to_address
Date: Sat, 16 May 2015 11:06:44 -0500	[thread overview]
Message-ID: <20150516160644.GL31666@google.com> (raw)
In-Reply-To: <1429866309-202444-1-git-send-email-yuanzhichang@hisilicon.com>

On Fri, Apr 24, 2015 at 05:05:09PM +0800, Zhichang Yuan wrote:
> In the patch whose commit id is 41f8bba7f5552d0, function pci_pio_to_address
> was modified to retieve the corresponding I/O port by CPU physical address.
> But the convertion processing is not correct. It will return a wrong I/O port.
> This patch will fix it.

Argh.  As I mentioned for v1, your patch changes pci_address_to_pio(),
but your patch title and changelog mentions pci_pio_to_address().

I fixed it for you, added Liviu's ack, and applied it to pci/host-generic
for v4.2.

The original change (41f8bba7f555) went through my tree because it was part
of a series that added arm64 PCI support, so maybe it makes sense for this
fix to go through my tree, too.  But if you'd rather send it through the OF
tree, that's fine with me.  Just let me know.

> Fixes: 41f8bba7f555 ("of/pci: Add pci_register_io_range() and pci_pio_to_address()")
> CC: stable@vger.kernel.org
> Signed-off-by: Zhichang Yuan <yuanzhichang@hisilicon.com>
> ---
> changes since V1:
> Improved commit message.
> 
>  drivers/of/address.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/of/address.c b/drivers/of/address.c
> index 78a7dcb..6906a3f 100644
> --- a/drivers/of/address.c
> +++ b/drivers/of/address.c
> @@ -765,7 +765,7 @@ unsigned long __weak pci_address_to_pio(phys_addr_t address)
>  	spin_lock(&io_range_lock);
>  	list_for_each_entry(res, &io_range_list, list) {
>  		if (address >= res->start && address < res->start + res->size) {
> -			addr = res->start - address + offset;
> +			addr = address - res->start + offset;
>  			break;
>  		}
>  		offset += res->size;
> -- 
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-05-16 16:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-24  9:05 [PATCH v2] of/pci: fix a bug in function pci_pio_to_address Zhichang Yuan
2015-04-24 10:13 ` Liviu Dudau
2015-05-16 16:06 ` Bjorn Helgaas [this message]
2015-06-29  8:20   ` yuanzhichang

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=20150516160644.GL31666@google.com \
    --to=bhelgaas@google.com \
    --cc=Liviu.Dudau@arm.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=grant.likely@linaro.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yuanzhichang@hisilicon.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).