* [PATCH] ia64/PCI: Fix the build warning of pci_domain_nr()
@ 2015-03-04 6:16 Yijing Wang
2015-03-04 17:22 ` Bjorn Helgaas
0 siblings, 1 reply; 2+ messages in thread
From: Yijing Wang @ 2015-03-04 6:16 UTC (permalink / raw)
To: bhelgaas, tony.luck
Cc: linux-pci, fenghua.yu, linux-ia64, Yijing Wang, stable
We should pass pci_bus * instead of pci_dev * to pci_domain_nr().
Signed-off-by: Yijing Wang <wangyijing@huawei.com>
CC: Tony Luck <tony.luck@intel.com>
CC: Fenghua Yu <fenghua.yu@intel.com>
CC: linux-ia64@vger.kernel.org
CC: stable@vger.kernel.org
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
---
arch/ia64/sn/kernel/io_acpi_init.c | 6 +++---
arch/ia64/sn/kernel/io_init.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
index 0640739..2fd7414 100644
--- a/arch/ia64/sn/kernel/io_acpi_init.c
+++ b/arch/ia64/sn/kernel/io_acpi_init.c
@@ -364,12 +364,12 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
&segment);
if (ACPI_SUCCESS(status)) {
- if (segment != pci_domain_nr(dev)) {
+ if (segment != pci_domain_nr(dev->bus)) {
acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME,
&name_buffer);
printk(KERN_ERR
"%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n",
- __func__, segment, pci_domain_nr(dev),
+ __func__, segment, pci_domain_nr(dev->bus),
(char *)name_buffer.pointer);
kfree(name_buffer.pointer);
return 1;
@@ -407,7 +407,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
/* Build up the pcidev_info.pdi_slot_host_handle */
host_devfn = get_host_devfn(pcidev_match.handle, rootbus_handle);
(*pcidev_info)->pdi_slot_host_handle =
- ((unsigned long) pci_domain_nr(dev) << 40) |
+ ((unsigned long) pci_domain_nr(dev->bus) << 40) |
/* bus == 0 */
host_devfn;
return 0;
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index 55776df..19506a5 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -164,7 +164,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
panic("%s: Unable to alloc memory for sn_irq_info", __func__);
/* Call to retrieve pci device information needed by kernel. */
- status = sal_get_pcidev_info((u64) pci_domain_nr(dev),
+ status = sal_get_pcidev_info((u64) pci_domain_nr(dev->bus),
(u64) dev->bus->number,
dev->devfn,
(u64) __pa(pcidev_info),
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ia64/PCI: Fix the build warning of pci_domain_nr()
2015-03-04 6:16 [PATCH] ia64/PCI: Fix the build warning of pci_domain_nr() Yijing Wang
@ 2015-03-04 17:22 ` Bjorn Helgaas
0 siblings, 0 replies; 2+ messages in thread
From: Bjorn Helgaas @ 2015-03-04 17:22 UTC (permalink / raw)
To: Yijing Wang
Cc: Tony Luck, linux-pci@vger.kernel.org, Fenghua Yu,
linux-ia64@vger.kernel.org, stable@vger.kernel.org
On Wed, Mar 4, 2015 at 12:16 AM, Yijing Wang <wangyijing@huawei.com> wrote:
> We should pass pci_bus * instead of pci_dev * to pci_domain_nr().
>
> Signed-off-by: Yijing Wang <wangyijing@huawei.com>
> CC: Tony Luck <tony.luck@intel.com>
> CC: Fenghua Yu <fenghua.yu@intel.com>
> CC: linux-ia64@vger.kernel.org
> CC: stable@vger.kernel.org
> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
I think this seems correct, at least in terms of fixing a build issue.
But it changes some behavior too. It would be nice to have
confirmation that the change *fixes* something rather than breaking
something.
It looks like this code has been this way since 6f09a9250a5d ("Altix:
ACPI SSDT PCI device support") in 2007. So if it really is broken
without this fix, it seems strange that we wouldn't have noticed until
now.
Tony, since I can't test this, and the rest of Yijing's PCI series
doesn't depend on this, do you want to take care of this? You can
drop my Signed-off-by in that case.
Bjorn
> ---
> arch/ia64/sn/kernel/io_acpi_init.c | 6 +++---
> arch/ia64/sn/kernel/io_init.c | 2 +-
> 2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/ia64/sn/kernel/io_acpi_init.c b/arch/ia64/sn/kernel/io_acpi_init.c
> index 0640739..2fd7414 100644
> --- a/arch/ia64/sn/kernel/io_acpi_init.c
> +++ b/arch/ia64/sn/kernel/io_acpi_init.c
> @@ -364,12 +364,12 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
> status = acpi_evaluate_integer(rootbus_handle, METHOD_NAME__SEG, NULL,
> &segment);
> if (ACPI_SUCCESS(status)) {
> - if (segment != pci_domain_nr(dev)) {
> + if (segment != pci_domain_nr(dev->bus)) {
> acpi_get_name(rootbus_handle, ACPI_FULL_PATHNAME,
> &name_buffer);
> printk(KERN_ERR
> "%s: Segment number mismatch, 0x%llx vs 0x%x for: %s\n",
> - __func__, segment, pci_domain_nr(dev),
> + __func__, segment, pci_domain_nr(dev->bus),
> (char *)name_buffer.pointer);
> kfree(name_buffer.pointer);
> return 1;
> @@ -407,7 +407,7 @@ sn_acpi_get_pcidev_info(struct pci_dev *dev, struct pcidev_info **pcidev_info,
> /* Build up the pcidev_info.pdi_slot_host_handle */
> host_devfn = get_host_devfn(pcidev_match.handle, rootbus_handle);
> (*pcidev_info)->pdi_slot_host_handle =
> - ((unsigned long) pci_domain_nr(dev) << 40) |
> + ((unsigned long) pci_domain_nr(dev->bus) << 40) |
> /* bus == 0 */
> host_devfn;
> return 0;
> diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
> index 55776df..19506a5 100644
> --- a/arch/ia64/sn/kernel/io_init.c
> +++ b/arch/ia64/sn/kernel/io_init.c
> @@ -164,7 +164,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
> panic("%s: Unable to alloc memory for sn_irq_info", __func__);
>
> /* Call to retrieve pci device information needed by kernel. */
> - status = sal_get_pcidev_info((u64) pci_domain_nr(dev),
> + status = sal_get_pcidev_info((u64) pci_domain_nr(dev->bus),
> (u64) dev->bus->number,
> dev->devfn,
> (u64) __pa(pcidev_info),
> --
> 1.7.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-04 17:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-04 6:16 [PATCH] ia64/PCI: Fix the build warning of pci_domain_nr() Yijing Wang
2015-03-04 17:22 ` Bjorn Helgaas
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).