* [PATCH V4 01/26] alpha/PCI: deprecate pci_get_bus_and_slot()
[not found] <1513661883-28662-1-git-send-email-okaya@codeaurora.org>
@ 2017-12-19 5:37 ` Sinan Kaya
2018-01-03 12:43 ` Sinan Kaya
0 siblings, 1 reply; 2+ messages in thread
From: Sinan Kaya @ 2017-12-19 5:37 UTC (permalink / raw)
To: linux-pci, timur
Cc: linux-arm-msm, linux-arm-kernel, Sinan Kaya, Richard Henderson,
Ivan Kokshaysky, Matt Turner, Bjorn Helgaas, Thomas Gleixner,
Greg Kroah-Hartman, Lorenzo Pieralisi, Masahiro Yamada,
Philippe Ombredanne, Kate Stewart, open list:ALPHA PORT,
open list
pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.
Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
extract the domain number. Other places, use the actual domain number from
the device.
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
arch/alpha/kernel/pci.c | 2 +-
arch/alpha/kernel/sys_nautilus.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
index 87da005..2e86ebb 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -425,7 +425,7 @@ struct resource * __init
if (bus == 0 && dfn == 0) {
hose = pci_isa_hose;
} else {
- dev = pci_get_bus_and_slot(bus, dfn);
+ dev = pci_get_domain_bus_and_slot(0, bus, dfn);
if (!dev)
return -ENODEV;
hose = dev->sysdata;
diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
index 239dc0e..ff4f54b 100644
--- a/arch/alpha/kernel/sys_nautilus.c
+++ b/arch/alpha/kernel/sys_nautilus.c
@@ -237,7 +237,7 @@
bus = hose->bus = bridge->bus;
pcibios_claim_one_bus(bus);
- irongate = pci_get_bus_and_slot(0, 0);
+ irongate = pci_get_domain_bus_and_slot(pci_domain_nr(bus), 0, 0);
bus->self = irongate;
bus->resource[0] = &irongate_io;
bus->resource[1] = &irongate_mem;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH V4 01/26] alpha/PCI: deprecate pci_get_bus_and_slot()
2017-12-19 5:37 ` [PATCH V4 01/26] alpha/PCI: deprecate pci_get_bus_and_slot() Sinan Kaya
@ 2018-01-03 12:43 ` Sinan Kaya
0 siblings, 0 replies; 2+ messages in thread
From: Sinan Kaya @ 2018-01-03 12:43 UTC (permalink / raw)
To: linux-pci, timur
Cc: linux-arm-msm, linux-arm-kernel, Richard Henderson,
Ivan Kokshaysky, Matt Turner, Bjorn Helgaas, Thomas Gleixner,
Greg Kroah-Hartman, Lorenzo Pieralisi, Masahiro Yamada,
Philippe Ombredanne, Kate Stewart, open list:ALPHA PORT,
open list
On 12/19/2017 12:37 AM, Sinan Kaya wrote:
> pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
> where a PCI device is present. This restricts the device drivers to be
> reused for other domain numbers.
>
> Use pci_get_domain_bus_and_slot() with a domain number of 0 where we can't
> extract the domain number. Other places, use the actual domain number from
> the device.
>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
> arch/alpha/kernel/pci.c | 2 +-
> arch/alpha/kernel/sys_nautilus.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c
> index 87da005..2e86ebb 100644
> --- a/arch/alpha/kernel/pci.c
> +++ b/arch/alpha/kernel/pci.c
> @@ -425,7 +425,7 @@ struct resource * __init
> if (bus == 0 && dfn == 0) {
> hose = pci_isa_hose;
> } else {
> - dev = pci_get_bus_and_slot(bus, dfn);
> + dev = pci_get_domain_bus_and_slot(0, bus, dfn);
> if (!dev)
> return -ENODEV;
> hose = dev->sysdata;
> diff --git a/arch/alpha/kernel/sys_nautilus.c b/arch/alpha/kernel/sys_nautilus.c
> index 239dc0e..ff4f54b 100644
> --- a/arch/alpha/kernel/sys_nautilus.c
> +++ b/arch/alpha/kernel/sys_nautilus.c
> @@ -237,7 +237,7 @@
> bus = hose->bus = bridge->bus;
> pcibios_claim_one_bus(bus);
>
> - irongate = pci_get_bus_and_slot(0, 0);
> + irongate = pci_get_domain_bus_and_slot(pci_domain_nr(bus), 0, 0);
> bus->self = irongate;
> bus->resource[0] = &irongate_io;
> bus->resource[1] = &irongate_mem;
>
Any feedback here? most of the remaining patches have the ACK except these.
--
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-01-03 12:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1513661883-28662-1-git-send-email-okaya@codeaurora.org>
2017-12-19 5:37 ` [PATCH V4 01/26] alpha/PCI: deprecate pci_get_bus_and_slot() Sinan Kaya
2018-01-03 12:43 ` Sinan Kaya
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).