All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57 ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur; +Cc: linux-arm-msm, intel-gfx, linux-arm-kernel

Deprecate pci_get_bus_and_slot() in favor of pci_get_domain_bus_and_slot()
in order to remove domain 0 assumptions in the kernel.

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.

Changes from v2:
* commit text cleanups
* remove implicit busfn assignments and use PCI_DEVFN call in place.
* change storage type for local copy of pci_domain_nr() value to int

Sinan Kaya (29):
  alpha/PCI: deprecate pci_get_bus_and_slot()
  powerpc/PCI: deprecate pci_get_bus_and_slot()
  x86/PCI: deprecate pci_get_bus_and_slot()
  ata: deprecate pci_get_bus_and_slot()
  agp: nvidia: deprecate pci_get_bus_and_slot()
  edd: deprecate pci_get_bus_and_slot()
  ibft: deprecate pci_get_bus_and_slot()
  drm/gma500: deprecate pci_get_bus_and_slot()
  drm/i915: deprecate pci_get_bus_and_slot()
  drm/nouveau: deprecate pci_get_bus_and_slot()
  Drivers: ide: deprecate pci_get_bus_and_slot()
  iommu/amd: deprecate pci_get_bus_and_slot()
  powerpc/powermac: deprecate pci_get_bus_and_slot()
  bnx2x: deprecate pci_get_bus_and_slot()
  pch_gbe: deprecate pci_get_bus_and_slot()
  PCI: cpqhp: deprecate pci_get_bus_and_slot()
  PCI: ibmphp: deprecate pci_get_bus_and_slot()
  PCI/quirks: deprecate pci_get_bus_and_slot()
  PCI/syscall: deprecate pci_get_bus_and_slot()
  xen: deprecate pci_get_bus_and_slot()
  openprom: deprecate pci_get_bus_and_slot()
  [media] atomisp: deprecate pci_get_bus_and_slot()
  staging: rts5208: remove rtsx_read_pci_cfg_byte()
  backlight: deprecate pci_get_bus_and_slot()
  video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
  video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
  video: fbdev: riva: deprecate pci_get_bus_and_slot()
  i7300_idle: remove unused file
  PCI: remove pci_get_bus_and_slot() function

 arch/alpha/kernel/pci.c                            |  2 +-
 arch/alpha/kernel/sys_nautilus.c                   |  2 +-
 arch/powerpc/kernel/pci_32.c                       |  3 +-
 arch/powerpc/platforms/powermac/feature.c          |  2 +-
 arch/powerpc/sysdev/mv64x60_pci.c                  |  4 +-
 arch/x86/pci/irq.c                                 |  3 +-
 drivers/ata/pata_ali.c                             |  3 +-
 drivers/char/agp/nvidia-agp.c                      | 12 +++-
 drivers/char/agp/sworks-agp.c                      |  3 +-
 drivers/firmware/edd.c                             |  8 +--
 drivers/firmware/iscsi_ibft.c                      |  5 +-
 drivers/gpu/drm/gma500/cdv_device.c                | 16 +++--
 drivers/gpu/drm/gma500/gma_device.c                |  4 +-
 drivers/gpu/drm/gma500/mid_bios.c                  | 12 +++-
 drivers/gpu/drm/gma500/psb_drv.c                   | 10 ++-
 drivers/gpu/drm/gma500/psb_drv.h                   | 18 ++---
 drivers/gpu/drm/i915/i915_drv.c                    |  5 +-
 drivers/gpu/drm/nouveau/dispnv04/arb.c             |  4 +-
 drivers/gpu/drm/nouveau/dispnv04/hw.c              | 10 ++-
 drivers/gpu/drm/nouveau/nouveau_drm.c              |  3 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c   | 10 ++-
 drivers/ide/sl82c105.c                             |  5 +-
 drivers/iommu/amd_iommu.c                          |  3 +-
 drivers/iommu/amd_iommu_init.c                     |  9 +--
 drivers/iommu/amd_iommu_v2.c                       |  3 +-
 drivers/macintosh/via-pmu.c                        |  2 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c  | 10 ++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h  |  1 +
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |  6 +-
 drivers/pci/hotplug/cpqphp_pci.c                   | 18 +++--
 drivers/pci/hotplug/ibmphp_core.c                  |  7 +-
 drivers/pci/quirks.c                               |  3 +-
 drivers/pci/syscall.c                              |  4 +-
 drivers/pci/xen-pcifront.c                         |  3 +-
 drivers/sbus/char/openprom.c                       |  5 +-
 .../media/atomisp/pci/atomisp2/atomisp_v4l2.c      |  2 +-
 .../platform/intel-mid/intel_mid_pcihelpers.c      |  2 +-
 drivers/staging/rts5208/rtsx.c                     | 17 -----
 drivers/staging/rts5208/rtsx.h                     |  2 -
 drivers/video/backlight/apple_bl.c                 |  2 +-
 drivers/video/fbdev/intelfb/intelfbhw.c            |  4 +-
 drivers/video/fbdev/nvidia/nv_hw.c                 | 11 +--
 drivers/video/fbdev/nvidia/nv_setup.c              |  3 +-
 drivers/video/fbdev/riva/fbdev.c                   |  2 +-
 drivers/video/fbdev/riva/nv_driver.c               |  7 +-
 drivers/video/fbdev/riva/riva_hw.c                 | 20 ++++--
 drivers/video/fbdev/riva/riva_hw.h                 |  3 +-
 include/linux/i7300_idle.h                         | 84 ----------------------
 include/linux/pci.h                                |  8 ---
 49 files changed, 181 insertions(+), 204 deletions(-)
 delete mode 100644 include/linux/i7300_idle.h

-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57 ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur; +Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya

Deprecate pci_get_bus_and_slot() in favor of pci_get_domain_bus_and_slot()
in order to remove domain 0 assumptions in the kernel.

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.

Changes from v2:
* commit text cleanups
* remove implicit busfn assignments and use PCI_DEVFN call in place.
* change storage type for local copy of pci_domain_nr() value to int

Sinan Kaya (29):
  alpha/PCI: deprecate pci_get_bus_and_slot()
  powerpc/PCI: deprecate pci_get_bus_and_slot()
  x86/PCI: deprecate pci_get_bus_and_slot()
  ata: deprecate pci_get_bus_and_slot()
  agp: nvidia: deprecate pci_get_bus_and_slot()
  edd: deprecate pci_get_bus_and_slot()
  ibft: deprecate pci_get_bus_and_slot()
  drm/gma500: deprecate pci_get_bus_and_slot()
  drm/i915: deprecate pci_get_bus_and_slot()
  drm/nouveau: deprecate pci_get_bus_and_slot()
  Drivers: ide: deprecate pci_get_bus_and_slot()
  iommu/amd: deprecate pci_get_bus_and_slot()
  powerpc/powermac: deprecate pci_get_bus_and_slot()
  bnx2x: deprecate pci_get_bus_and_slot()
  pch_gbe: deprecate pci_get_bus_and_slot()
  PCI: cpqhp: deprecate pci_get_bus_and_slot()
  PCI: ibmphp: deprecate pci_get_bus_and_slot()
  PCI/quirks: deprecate pci_get_bus_and_slot()
  PCI/syscall: deprecate pci_get_bus_and_slot()
  xen: deprecate pci_get_bus_and_slot()
  openprom: deprecate pci_get_bus_and_slot()
  [media] atomisp: deprecate pci_get_bus_and_slot()
  staging: rts5208: remove rtsx_read_pci_cfg_byte()
  backlight: deprecate pci_get_bus_and_slot()
  video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
  video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
  video: fbdev: riva: deprecate pci_get_bus_and_slot()
  i7300_idle: remove unused file
  PCI: remove pci_get_bus_and_slot() function

 arch/alpha/kernel/pci.c                            |  2 +-
 arch/alpha/kernel/sys_nautilus.c                   |  2 +-
 arch/powerpc/kernel/pci_32.c                       |  3 +-
 arch/powerpc/platforms/powermac/feature.c          |  2 +-
 arch/powerpc/sysdev/mv64x60_pci.c                  |  4 +-
 arch/x86/pci/irq.c                                 |  3 +-
 drivers/ata/pata_ali.c                             |  3 +-
 drivers/char/agp/nvidia-agp.c                      | 12 +++-
 drivers/char/agp/sworks-agp.c                      |  3 +-
 drivers/firmware/edd.c                             |  8 +--
 drivers/firmware/iscsi_ibft.c                      |  5 +-
 drivers/gpu/drm/gma500/cdv_device.c                | 16 +++--
 drivers/gpu/drm/gma500/gma_device.c                |  4 +-
 drivers/gpu/drm/gma500/mid_bios.c                  | 12 +++-
 drivers/gpu/drm/gma500/psb_drv.c                   | 10 ++-
 drivers/gpu/drm/gma500/psb_drv.h                   | 18 ++---
 drivers/gpu/drm/i915/i915_drv.c                    |  5 +-
 drivers/gpu/drm/nouveau/dispnv04/arb.c             |  4 +-
 drivers/gpu/drm/nouveau/dispnv04/hw.c              | 10 ++-
 drivers/gpu/drm/nouveau/nouveau_drm.c              |  3 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c   | 10 ++-
 drivers/ide/sl82c105.c                             |  5 +-
 drivers/iommu/amd_iommu.c                          |  3 +-
 drivers/iommu/amd_iommu_init.c                     |  9 +--
 drivers/iommu/amd_iommu_v2.c                       |  3 +-
 drivers/macintosh/via-pmu.c                        |  2 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c  | 10 ++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h  |  1 +
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |  6 +-
 drivers/pci/hotplug/cpqphp_pci.c                   | 18 +++--
 drivers/pci/hotplug/ibmphp_core.c                  |  7 +-
 drivers/pci/quirks.c                               |  3 +-
 drivers/pci/syscall.c                              |  4 +-
 drivers/pci/xen-pcifront.c                         |  3 +-
 drivers/sbus/char/openprom.c                       |  5 +-
 .../media/atomisp/pci/atomisp2/atomisp_v4l2.c      |  2 +-
 .../platform/intel-mid/intel_mid_pcihelpers.c      |  2 +-
 drivers/staging/rts5208/rtsx.c                     | 17 -----
 drivers/staging/rts5208/rtsx.h                     |  2 -
 drivers/video/backlight/apple_bl.c                 |  2 +-
 drivers/video/fbdev/intelfb/intelfbhw.c            |  4 +-
 drivers/video/fbdev/nvidia/nv_hw.c                 | 11 +--
 drivers/video/fbdev/nvidia/nv_setup.c              |  3 +-
 drivers/video/fbdev/riva/fbdev.c                   |  2 +-
 drivers/video/fbdev/riva/nv_driver.c               |  7 +-
 drivers/video/fbdev/riva/riva_hw.c                 | 20 ++++--
 drivers/video/fbdev/riva/riva_hw.h                 |  3 +-
 include/linux/i7300_idle.h                         | 84 ----------------------
 include/linux/pci.h                                |  8 ---
 49 files changed, 181 insertions(+), 204 deletions(-)
 delete mode 100644 include/linux/i7300_idle.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57 ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

Deprecate pci_get_bus_and_slot() in favor of pci_get_domain_bus_and_slot()
in order to remove domain 0 assumptions in the kernel.

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.

Changes from v2:
* commit text cleanups
* remove implicit busfn assignments and use PCI_DEVFN call in place.
* change storage type for local copy of pci_domain_nr() value to int

Sinan Kaya (29):
  alpha/PCI: deprecate pci_get_bus_and_slot()
  powerpc/PCI: deprecate pci_get_bus_and_slot()
  x86/PCI: deprecate pci_get_bus_and_slot()
  ata: deprecate pci_get_bus_and_slot()
  agp: nvidia: deprecate pci_get_bus_and_slot()
  edd: deprecate pci_get_bus_and_slot()
  ibft: deprecate pci_get_bus_and_slot()
  drm/gma500: deprecate pci_get_bus_and_slot()
  drm/i915: deprecate pci_get_bus_and_slot()
  drm/nouveau: deprecate pci_get_bus_and_slot()
  Drivers: ide: deprecate pci_get_bus_and_slot()
  iommu/amd: deprecate pci_get_bus_and_slot()
  powerpc/powermac: deprecate pci_get_bus_and_slot()
  bnx2x: deprecate pci_get_bus_and_slot()
  pch_gbe: deprecate pci_get_bus_and_slot()
  PCI: cpqhp: deprecate pci_get_bus_and_slot()
  PCI: ibmphp: deprecate pci_get_bus_and_slot()
  PCI/quirks: deprecate pci_get_bus_and_slot()
  PCI/syscall: deprecate pci_get_bus_and_slot()
  xen: deprecate pci_get_bus_and_slot()
  openprom: deprecate pci_get_bus_and_slot()
  [media] atomisp: deprecate pci_get_bus_and_slot()
  staging: rts5208: remove rtsx_read_pci_cfg_byte()
  backlight: deprecate pci_get_bus_and_slot()
  video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
  video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
  video: fbdev: riva: deprecate pci_get_bus_and_slot()
  i7300_idle: remove unused file
  PCI: remove pci_get_bus_and_slot() function

 arch/alpha/kernel/pci.c                            |  2 +-
 arch/alpha/kernel/sys_nautilus.c                   |  2 +-
 arch/powerpc/kernel/pci_32.c                       |  3 +-
 arch/powerpc/platforms/powermac/feature.c          |  2 +-
 arch/powerpc/sysdev/mv64x60_pci.c                  |  4 +-
 arch/x86/pci/irq.c                                 |  3 +-
 drivers/ata/pata_ali.c                             |  3 +-
 drivers/char/agp/nvidia-agp.c                      | 12 +++-
 drivers/char/agp/sworks-agp.c                      |  3 +-
 drivers/firmware/edd.c                             |  8 +--
 drivers/firmware/iscsi_ibft.c                      |  5 +-
 drivers/gpu/drm/gma500/cdv_device.c                | 16 +++--
 drivers/gpu/drm/gma500/gma_device.c                |  4 +-
 drivers/gpu/drm/gma500/mid_bios.c                  | 12 +++-
 drivers/gpu/drm/gma500/psb_drv.c                   | 10 ++-
 drivers/gpu/drm/gma500/psb_drv.h                   | 18 ++---
 drivers/gpu/drm/i915/i915_drv.c                    |  5 +-
 drivers/gpu/drm/nouveau/dispnv04/arb.c             |  4 +-
 drivers/gpu/drm/nouveau/dispnv04/hw.c              | 10 ++-
 drivers/gpu/drm/nouveau/nouveau_drm.c              |  3 +-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c   | 10 ++-
 drivers/ide/sl82c105.c                             |  5 +-
 drivers/iommu/amd_iommu.c                          |  3 +-
 drivers/iommu/amd_iommu_init.c                     |  9 +--
 drivers/iommu/amd_iommu_v2.c                       |  3 +-
 drivers/macintosh/via-pmu.c                        |  2 +-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c  | 10 ++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h  |  1 +
 .../net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c   |  6 +-
 drivers/pci/hotplug/cpqphp_pci.c                   | 18 +++--
 drivers/pci/hotplug/ibmphp_core.c                  |  7 +-
 drivers/pci/quirks.c                               |  3 +-
 drivers/pci/syscall.c                              |  4 +-
 drivers/pci/xen-pcifront.c                         |  3 +-
 drivers/sbus/char/openprom.c                       |  5 +-
 .../media/atomisp/pci/atomisp2/atomisp_v4l2.c      |  2 +-
 .../platform/intel-mid/intel_mid_pcihelpers.c      |  2 +-
 drivers/staging/rts5208/rtsx.c                     | 17 -----
 drivers/staging/rts5208/rtsx.h                     |  2 -
 drivers/video/backlight/apple_bl.c                 |  2 +-
 drivers/video/fbdev/intelfb/intelfbhw.c            |  4 +-
 drivers/video/fbdev/nvidia/nv_hw.c                 | 11 +--
 drivers/video/fbdev/nvidia/nv_setup.c              |  3 +-
 drivers/video/fbdev/riva/fbdev.c                   |  2 +-
 drivers/video/fbdev/riva/nv_driver.c               |  7 +-
 drivers/video/fbdev/riva/riva_hw.c                 | 20 ++++--
 drivers/video/fbdev/riva/riva_hw.h                 |  3 +-
 include/linux/i7300_idle.h                         | 84 ----------------------
 include/linux/pci.h                                |  8 ---
 49 files changed, 181 insertions(+), 204 deletions(-)
 delete mode 100644 include/linux/i7300_idle.h

-- 
1.9.1

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 01/29] alpha/PCI: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: Kate Stewart, Lorenzo Pieralisi, Greg Kroah-Hartman,
	linux-arm-msm, intel-gfx, open list:ALPHA PORT, open list,
	Masahiro Yamada, Ivan Kokshaysky, Philippe Ombredanne,
	Bjorn Helgaas, Thomas Gleixner, linux-arm-kernel,
	Richard Henderson

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 08235bb..e866daf 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -416,7 +416,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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 01/29] alpha/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Richard Henderson, Ivan Kokshaysky, Matt Turner, Kate Stewart,
	Masahiro Yamada, Philippe Ombredanne, Greg Kroah-Hartman,
	Lorenzo Pieralisi, Bjorn Helgaas, Thomas Gleixner,
	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 08235bb..e866daf 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -416,7 +416,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] 172+ messages in thread

* [PATCH V3 01/29] alpha/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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 08235bb..e866daf 100644
--- a/arch/alpha/kernel/pci.c
+++ b/arch/alpha/kernel/pci.c
@@ -416,7 +416,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] 172+ messages in thread

* [PATCH V3 02/29] powerpc/PCI: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: Rob Herring, linux-arm-msm, intel-gfx, open list, Bhumika Goyal,
	Paul Mackerras, Michael Ellerman, Benjamin Herrenschmidt,
	open list:LINUX FOR POWERPC 32-BIT AND 64-BIT, linux-arm-kernel,
	Tyrel Datwyler

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() with a domain number of 0 as the code
is not ready to consume multiple domains and existing code used domain
number 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/powerpc/kernel/pci_32.c              | 3 ++-
 arch/powerpc/platforms/powermac/feature.c | 2 +-
 arch/powerpc/sysdev/mv64x60_pci.c         | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 1d817f4..85ad2f7 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -96,7 +96,8 @@
 		reg = of_get_property(node, "reg", NULL);
 		if (!reg)
 			continue;
-		dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff));
+		dev = pci_get_domain_bus_and_slot(0, pci_bus,
+						  ((reg[0] >> 8) & 0xff));
 		if (!dev || !dev->subordinate) {
 			pci_dev_put(dev);
 			continue;
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 9e3f39d..ed8b166 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -829,7 +829,7 @@ static long core99_scc_enable(struct device_node *node, long param, long value)
 
 	if (value) {
 		if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
-			pdev = pci_get_bus_and_slot(pbus, pid);
+			pdev = pci_get_domain_bus_and_slot(0, pbus, pid);
 		if (pdev == NULL)
 			return 0;
 		rc = pci_enable_device(pdev);
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index d52b3b8..6fe9104 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -37,7 +37,7 @@ static ssize_t mv64x60_hs_reg_read(struct file *filp, struct kobject *kobj,
 	if (count < MV64X60_VAL_LEN_MAX)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!phb)
 		return -ENODEV;
 	pci_read_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, &v);
@@ -61,7 +61,7 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj,
 	if (sscanf(buf, "%i", &v) != 1)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!phb)
 		return -ENODEV;
 	pci_write_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, v);
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 02/29] powerpc/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Tyrel Datwyler, Rob Herring, Bhumika Goyal,
	open list:LINUX FOR POWERPC (32-BIT AND 64-BIT),
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() with a domain number of 0 as the code
is not ready to consume multiple domains and existing code used domain
number 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/powerpc/kernel/pci_32.c              | 3 ++-
 arch/powerpc/platforms/powermac/feature.c | 2 +-
 arch/powerpc/sysdev/mv64x60_pci.c         | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 1d817f4..85ad2f7 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -96,7 +96,8 @@
 		reg = of_get_property(node, "reg", NULL);
 		if (!reg)
 			continue;
-		dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff));
+		dev = pci_get_domain_bus_and_slot(0, pci_bus,
+						  ((reg[0] >> 8) & 0xff));
 		if (!dev || !dev->subordinate) {
 			pci_dev_put(dev);
 			continue;
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 9e3f39d..ed8b166 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -829,7 +829,7 @@ static long core99_scc_enable(struct device_node *node, long param, long value)
 
 	if (value) {
 		if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
-			pdev = pci_get_bus_and_slot(pbus, pid);
+			pdev = pci_get_domain_bus_and_slot(0, pbus, pid);
 		if (pdev == NULL)
 			return 0;
 		rc = pci_enable_device(pdev);
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index d52b3b8..6fe9104 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -37,7 +37,7 @@ static ssize_t mv64x60_hs_reg_read(struct file *filp, struct kobject *kobj,
 	if (count < MV64X60_VAL_LEN_MAX)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!phb)
 		return -ENODEV;
 	pci_read_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, &v);
@@ -61,7 +61,7 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj,
 	if (sscanf(buf, "%i", &v) != 1)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!phb)
 		return -ENODEV;
 	pci_write_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, v);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 02/29] powerpc/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() with a domain number of 0 as the code
is not ready to consume multiple domains and existing code used domain
number 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/powerpc/kernel/pci_32.c              | 3 ++-
 arch/powerpc/platforms/powermac/feature.c | 2 +-
 arch/powerpc/sysdev/mv64x60_pci.c         | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c
index 1d817f4..85ad2f7 100644
--- a/arch/powerpc/kernel/pci_32.c
+++ b/arch/powerpc/kernel/pci_32.c
@@ -96,7 +96,8 @@
 		reg = of_get_property(node, "reg", NULL);
 		if (!reg)
 			continue;
-		dev = pci_get_bus_and_slot(pci_bus, ((reg[0] >> 8) & 0xff));
+		dev = pci_get_domain_bus_and_slot(0, pci_bus,
+						  ((reg[0] >> 8) & 0xff));
 		if (!dev || !dev->subordinate) {
 			pci_dev_put(dev);
 			continue;
diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
index 9e3f39d..ed8b166 100644
--- a/arch/powerpc/platforms/powermac/feature.c
+++ b/arch/powerpc/platforms/powermac/feature.c
@@ -829,7 +829,7 @@ static long core99_scc_enable(struct device_node *node, long param, long value)
 
 	if (value) {
 		if (pci_device_from_OF_node(node, &pbus, &pid) == 0)
-			pdev = pci_get_bus_and_slot(pbus, pid);
+			pdev = pci_get_domain_bus_and_slot(0, pbus, pid);
 		if (pdev == NULL)
 			return 0;
 		rc = pci_enable_device(pdev);
diff --git a/arch/powerpc/sysdev/mv64x60_pci.c b/arch/powerpc/sysdev/mv64x60_pci.c
index d52b3b8..6fe9104 100644
--- a/arch/powerpc/sysdev/mv64x60_pci.c
+++ b/arch/powerpc/sysdev/mv64x60_pci.c
@@ -37,7 +37,7 @@ static ssize_t mv64x60_hs_reg_read(struct file *filp, struct kobject *kobj,
 	if (count < MV64X60_VAL_LEN_MAX)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!phb)
 		return -ENODEV;
 	pci_read_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, &v);
@@ -61,7 +61,7 @@ static ssize_t mv64x60_hs_reg_write(struct file *filp, struct kobject *kobj,
 	if (sscanf(buf, "%i", &v) != 1)
 		return -EINVAL;
 
-	phb = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	phb = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!phb)
 		return -ENODEV;
 	pci_write_config_dword(phb, MV64X60_PCICFG_CPCI_HOTSWAP, v);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT,
	open list:X86 ARCHITECTURE 32-BIT AND 64-BIT

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use domain number of 0 as the domain number is not available in struct
irq_routing_table.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/x86/pci/irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 04526291..52e5510 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
 	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
 	    rt->rtr_vendor, rt->rtr_device);
 
-	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
+	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
+						      rt->rtr_devfn);
 	if (!pirq_router_dev) {
 		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
 			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use domain number of 0 as the domain number is not available in struct
irq_routing_table.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/x86/pci/irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 04526291..52e5510 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
 	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
 	    rt->rtr_vendor, rt->rtr_device);
 
-	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
+	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
+						      rt->rtr_devfn);
 	if (!pirq_router_dev) {
 		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
 			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx,
	maintainer:X86 ARCHITECTURE 32-BIT AND 64-BIT,
	open list:X86 ARCHITECTURE 32-BIT AND 64-BIT, Sinan Kaya,
	Ingo Molnar, H. Peter Anvin, Bjorn Helgaas, Thomas Gleixner,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use domain number of 0 as the domain number is not available in struct
irq_routing_table.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/x86/pci/irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 04526291..52e5510 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
 	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
 	    rt->rtr_vendor, rt->rtr_device);
 
-	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
+	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
+						      rt->rtr_devfn);
 	if (!pirq_router_dev) {
 		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
 			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use domain number of 0 as the domain number is not available in struct
irq_routing_table.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 arch/x86/pci/irq.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
index 04526291..52e5510 100644
--- a/arch/x86/pci/irq.c
+++ b/arch/x86/pci/irq.c
@@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
 	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
 	    rt->rtr_vendor, rt->rtr_device);
 
-	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
+	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
+						      rt->rtr_devfn);
 	if (!pirq_router_dev) {
 		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
 			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 04/29] ata: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: Bartlomiej Zolnierkiewicz, linux-arm-msm, intel-gfx, open list,
	open list:LIBATA PATA DRIVERS, Tejun Heo, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() and extract the actual domain number
from the pdev passed in.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ata/pata_ali.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index d19cd88..0b122f9 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -466,7 +466,8 @@ static void ali_init_chipset(struct pci_dev *pdev)
 			tmp |= 0x01;	/* CD_ROM enable for DMA */
 		pci_write_config_byte(pdev, 0x53, tmp);
 	}
-	north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
+	north = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+					    PCI_DEVFN(0, 0));
 	if (north && north->vendor == PCI_VENDOR_ID_AL && ali_isa_bridge) {
 		/* Configure the ALi bridge logic. For non ALi rely on BIOS.
 		   Set the south bridge enable bit */
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 04/29] ata: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bartlomiej Zolnierkiewicz, Tejun Heo,
	open list:LIBATA PATA DRIVERS, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() and extract the actual domain number
from the pdev passed in.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ata/pata_ali.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index d19cd88..0b122f9 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -466,7 +466,8 @@ static void ali_init_chipset(struct pci_dev *pdev)
 			tmp |= 0x01;	/* CD_ROM enable for DMA */
 		pci_write_config_byte(pdev, 0x53, tmp);
 	}
-	north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
+	north = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+					    PCI_DEVFN(0, 0));
 	if (north && north->vendor == PCI_VENDOR_ID_AL && ali_isa_bridge) {
 		/* Configure the ALi bridge logic. For non ALi rely on BIOS.
 		   Set the south bridge enable bit */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 04/29] ata: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use pci_get_domain_bus_and_slot() and extract the actual domain number
from the pdev passed in.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ata/pata_ali.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
index d19cd88..0b122f9 100644
--- a/drivers/ata/pata_ali.c
+++ b/drivers/ata/pata_ali.c
@@ -466,7 +466,8 @@ static void ali_init_chipset(struct pci_dev *pdev)
 			tmp |= 0x01;	/* CD_ROM enable for DMA */
 		pci_write_config_byte(pdev, 0x53, tmp);
 	}
-	north = pci_get_bus_and_slot(0, PCI_DEVFN(0,0));
+	north = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+					    PCI_DEVFN(0, 0));
 	if (north && north->vendor == PCI_VENDOR_ID_AL && ali_isa_bridge) {
 		/* Configure the ALi bridge logic. For non ALi rely on BIOS.
 		   Set the south bridge enable bit */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 05/29] agp: nvidia: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/char/agp/nvidia-agp.c | 12 +++++++++---
 drivers/char/agp/sworks-agp.c |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 828b344..623205b 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -340,11 +340,17 @@ static int agp_nvidia_probe(struct pci_dev *pdev,
 	u8 cap_ptr;
 
 	nvidia_private.dev_1 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 1));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 1));
 	nvidia_private.dev_2 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 2));
 	nvidia_private.dev_3 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(30, 0));
 
 	if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) {
 		printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 "
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 03be4ac..4dbdd3b 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -474,7 +474,8 @@ static int agp_serverworks_probe(struct pci_dev *pdev,
 	}
 
 	/* Everything is on func 1 here so we are hardcoding function one */
-	bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+			(unsigned int)pdev->bus->number,
 			PCI_DEVFN(0, 1));
 	if (!bridge_dev) {
 		dev_info(&pdev->dev, "can't find secondary device\n");
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 05/29] agp: nvidia: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	David Airlie, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/char/agp/nvidia-agp.c | 12 +++++++++---
 drivers/char/agp/sworks-agp.c |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 828b344..623205b 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -340,11 +340,17 @@ static int agp_nvidia_probe(struct pci_dev *pdev,
 	u8 cap_ptr;
 
 	nvidia_private.dev_1 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 1));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 1));
 	nvidia_private.dev_2 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 2));
 	nvidia_private.dev_3 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(30, 0));
 
 	if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) {
 		printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 "
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 03be4ac..4dbdd3b 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -474,7 +474,8 @@ static int agp_serverworks_probe(struct pci_dev *pdev,
 	}
 
 	/* Everything is on func 1 here so we are hardcoding function one */
-	bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+			(unsigned int)pdev->bus->number,
 			PCI_DEVFN(0, 1));
 	if (!bridge_dev) {
 		dev_info(&pdev->dev, "can't find secondary device\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 05/29] agp: nvidia: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list, Sinan Kaya,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/char/agp/nvidia-agp.c | 12 +++++++++---
 drivers/char/agp/sworks-agp.c |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 828b344..623205b 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -340,11 +340,17 @@ static int agp_nvidia_probe(struct pci_dev *pdev,
 	u8 cap_ptr;
 
 	nvidia_private.dev_1 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 1));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 1));
 	nvidia_private.dev_2 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 2));
 	nvidia_private.dev_3 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(30, 0));
 
 	if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) {
 		printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 "
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 03be4ac..4dbdd3b 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -474,7 +474,8 @@ static int agp_serverworks_probe(struct pci_dev *pdev,
 	}
 
 	/* Everything is on func 1 here so we are hardcoding function one */
-	bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+			(unsigned int)pdev->bus->number,
 			PCI_DEVFN(0, 1));
 	if (!bridge_dev) {
 		dev_info(&pdev->dev, "can't find secondary device\n");
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 05/29] agp: nvidia: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/char/agp/nvidia-agp.c | 12 +++++++++---
 drivers/char/agp/sworks-agp.c |  3 ++-
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/char/agp/nvidia-agp.c b/drivers/char/agp/nvidia-agp.c
index 828b344..623205b 100644
--- a/drivers/char/agp/nvidia-agp.c
+++ b/drivers/char/agp/nvidia-agp.c
@@ -340,11 +340,17 @@ static int agp_nvidia_probe(struct pci_dev *pdev,
 	u8 cap_ptr;
 
 	nvidia_private.dev_1 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 1));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 1));
 	nvidia_private.dev_2 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(0, 2));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(0, 2));
 	nvidia_private.dev_3 =
-		pci_get_bus_and_slot((unsigned int)pdev->bus->number, PCI_DEVFN(30, 0));
+		pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+					    (unsigned int)pdev->bus->number,
+					    PCI_DEVFN(30, 0));
 
 	if (!nvidia_private.dev_1 || !nvidia_private.dev_2 || !nvidia_private.dev_3) {
 		printk(KERN_INFO PFX "Detected an NVIDIA nForce/nForce2 "
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c
index 03be4ac..4dbdd3b 100644
--- a/drivers/char/agp/sworks-agp.c
+++ b/drivers/char/agp/sworks-agp.c
@@ -474,7 +474,8 @@ static int agp_serverworks_probe(struct pci_dev *pdev,
 	}
 
 	/* Everything is on func 1 here so we are hardcoding function one */
-	bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+			(unsigned int)pdev->bus->number,
 			PCI_DEVFN(0, 1));
 	if (!bridge_dev) {
 		dev_info(&pdev->dev, "can't find secondary device\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 06/29] edd: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur; +Cc: linux-arm-msm, intel-gfx, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Domain number is not available in struct edd_info. Hard-coding the domain
number as 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/edd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index e229576..60a8f13 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -669,10 +669,10 @@ static void edd_release(struct kobject * kobj)
 	struct edd_info *info = edd_dev_get_info(edev);
 
 	if (edd_dev_is_type(edev, "PCI") || edd_dev_is_type(edev, "XPRS")) {
-		return pci_get_bus_and_slot(info->params.interface_path.pci.bus,
-				     PCI_DEVFN(info->params.interface_path.pci.slot,
-					       info->params.interface_path.pci.
-					       function));
+		return pci_get_domain_bus_and_slot(0,
+				info->params.interface_path.pci.bus,
+				PCI_DEVFN(info->params.interface_path.pci.slot,
+				info->params.interface_path.pci.function));
 	}
 	return NULL;
 }
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 06/29] edd: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Domain number is not available in struct edd_info. Hard-coding the domain
number as 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/edd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index e229576..60a8f13 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -669,10 +669,10 @@ static void edd_release(struct kobject * kobj)
 	struct edd_info *info = edd_dev_get_info(edev);
 
 	if (edd_dev_is_type(edev, "PCI") || edd_dev_is_type(edev, "XPRS")) {
-		return pci_get_bus_and_slot(info->params.interface_path.pci.bus,
-				     PCI_DEVFN(info->params.interface_path.pci.slot,
-					       info->params.interface_path.pci.
-					       function));
+		return pci_get_domain_bus_and_slot(0,
+				info->params.interface_path.pci.bus,
+				PCI_DEVFN(info->params.interface_path.pci.slot,
+				info->params.interface_path.pci.function));
 	}
 	return NULL;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 06/29] edd: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: Sinan Kaya, linux-arm-msm, intel-gfx, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Domain number is not available in struct edd_info. Hard-coding the domain
number as 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/edd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index e229576..60a8f13 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -669,10 +669,10 @@ static void edd_release(struct kobject * kobj)
 	struct edd_info *info = edd_dev_get_info(edev);
 
 	if (edd_dev_is_type(edev, "PCI") || edd_dev_is_type(edev, "XPRS")) {
-		return pci_get_bus_and_slot(info->params.interface_path.pci.bus,
-				     PCI_DEVFN(info->params.interface_path.pci.slot,
-					       info->params.interface_path.pci.
-					       function));
+		return pci_get_domain_bus_and_slot(0,
+				info->params.interface_path.pci.bus,
+				PCI_DEVFN(info->params.interface_path.pci.slot,
+				info->params.interface_path.pci.function));
 	}
 	return NULL;
 }
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 06/29] edd: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Domain number is not available in struct edd_info. Hard-coding the domain
number as 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/edd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index e229576..60a8f13 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -669,10 +669,10 @@ static void edd_release(struct kobject * kobj)
 	struct edd_info *info = edd_dev_get_info(edev);
 
 	if (edd_dev_is_type(edev, "PCI") || edd_dev_is_type(edev, "XPRS")) {
-		return pci_get_bus_and_slot(info->params.interface_path.pci.bus,
-				     PCI_DEVFN(info->params.interface_path.pci.slot,
-					       info->params.interface_path.pci.
-					       function));
+		return pci_get_domain_bus_and_slot(0,
+				info->params.interface_path.pci.bus,
+				PCI_DEVFN(info->params.interface_path.pci.slot,
+				info->params.interface_path.pci.function));
 	}
 	return NULL;
 }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 07/29] ibft: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Peter Jones, Konrad Rzeszutek Wilk, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

We don't search for the device in other domains than zero. This is because
on x86 platforms the BIOS executes only devices which are in domain 0.
Furthermore, the iBFT spec doesn't have a domain id field.

Acked-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/iscsi_ibft.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 14042a6..6bc8e66 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -719,8 +719,9 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header,
 		* executes only devices which are in domain 0. Furthermore, the
 		* iBFT spec doesn't have a domain id field :-(
 		*/
-		pci_dev = pci_get_bus_and_slot((nic->pci_bdf & 0xff00) >> 8,
-					       (nic->pci_bdf & 0xff));
+		pci_dev = pci_get_domain_bus_and_slot(0,
+						(nic->pci_bdf & 0xff00) >> 8,
+						(nic->pci_bdf & 0xff));
 		if (pci_dev) {
 			rc = sysfs_create_link(&boot_kobj->kobj,
 					       &pci_dev->dev.kobj, "device");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 07/29] ibft: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Peter Jones, Konrad Rzeszutek Wilk, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

We don't search for the device in other domains than zero. This is because
on x86 platforms the BIOS executes only devices which are in domain 0.
Furthermore, the iBFT spec doesn't have a domain id field.

Acked-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/iscsi_ibft.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 14042a6..6bc8e66 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -719,8 +719,9 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header,
 		* executes only devices which are in domain 0. Furthermore, the
 		* iBFT spec doesn't have a domain id field :-(
 		*/
-		pci_dev = pci_get_bus_and_slot((nic->pci_bdf & 0xff00) >> 8,
-					       (nic->pci_bdf & 0xff));
+		pci_dev = pci_get_domain_bus_and_slot(0,
+						(nic->pci_bdf & 0xff00) >> 8,
+						(nic->pci_bdf & 0xff));
 		if (pci_dev) {
 			rc = sysfs_create_link(&boot_kobj->kobj,
 					       &pci_dev->dev.kobj, "device");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 07/29] ibft: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Sinan Kaya,
	Konrad Rzeszutek Wilk, Peter Jones, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

We don't search for the device in other domains than zero. This is because
on x86 platforms the BIOS executes only devices which are in domain 0.
Furthermore, the iBFT spec doesn't have a domain id field.

Acked-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/iscsi_ibft.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 14042a6..6bc8e66 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -719,8 +719,9 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header,
 		* executes only devices which are in domain 0. Furthermore, the
 		* iBFT spec doesn't have a domain id field :-(
 		*/
-		pci_dev = pci_get_bus_and_slot((nic->pci_bdf & 0xff00) >> 8,
-					       (nic->pci_bdf & 0xff));
+		pci_dev = pci_get_domain_bus_and_slot(0,
+						(nic->pci_bdf & 0xff00) >> 8,
+						(nic->pci_bdf & 0xff));
 		if (pci_dev) {
 			rc = sysfs_create_link(&boot_kobj->kobj,
 					       &pci_dev->dev.kobj, "device");
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 07/29] ibft: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

We don't search for the device in other domains than zero. This is because
on x86 platforms the BIOS executes only devices which are in domain 0.
Furthermore, the iBFT spec doesn't have a domain id field.

Acked-by: Konrad Rzeszutek Wilk <konrad@kernel.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/firmware/iscsi_ibft.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index 14042a6..6bc8e66 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -719,8 +719,9 @@ static int __init ibft_create_kobject(struct acpi_table_ibft *header,
 		* executes only devices which are in domain 0. Furthermore, the
 		* iBFT spec doesn't have a domain id field :-(
 		*/
-		pci_dev = pci_get_bus_and_slot((nic->pci_bdf & 0xff00) >> 8,
-					       (nic->pci_bdf & 0xff));
+		pci_dev = pci_get_domain_bus_and_slot(0,
+						(nic->pci_bdf & 0xff00) >> 8,
+						(nic->pci_bdf & 0xff));
 		if (pci_dev) {
 			rc = sysfs_create_link(&boot_kobj->kobj,
 					       &pci_dev->dev.kobj, "device");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 08/29] drm/gma500: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Patrik Jakobsson, David Airlie, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Add domain parameter to CDV_MSG_READ32, CDV_MSG_WRITE32, MRST_MSG_READ32,
MRST_MSG_WRITE32, MDFLD_MSG_READ32, MDFLD_MSG_WRITE32.

Extract pci_dev from struct drm_device and use pdev to find the domain
number while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/gma500/cdv_device.c | 16 +++++++++-------
 drivers/gpu/drm/gma500/gma_device.c |  4 +++-
 drivers/gpu/drm/gma500/mid_bios.c   | 12 +++++++++---
 drivers/gpu/drm/gma500/psb_drv.c    | 10 ++++++++--
 drivers/gpu/drm/gma500/psb_drv.h    | 18 ++++++++++--------
 5 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
index 8745971..3a3bf75 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -185,21 +185,22 @@ static int cdv_backlight_init(struct drm_device *dev)
  *	for this and the MID devices.
  */
 
-static inline u32 CDV_MSG_READ32(uint port, uint offset)
+static inline u32 CDV_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
 
-static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset,
+				   u32 value)
 {
 	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
@@ -216,11 +217,12 @@ static void cdv_init_pm(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	u32 pwr_cnt;
+	int domain = pci_domain_nr(dev->pdev->bus);
 	int i;
 
-	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+	dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
 							PSB_APMBA) & 0xFFFF;
-	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+	dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
 							PSB_OSPMBA) & 0xFFFF;
 
 	/* Power status */
@@ -251,7 +253,7 @@ static void cdv_errata(struct drm_device *dev)
 	 *	Bonus Launch to work around the issue, by degrading
 	 *	performance.
 	 */
-	 CDV_MSG_WRITE32(3, 0x30, 0x08027108);
+	 CDV_MSG_WRITE32(pci_domain_nr(dev->pdev->bus), 3, 0x30, 0x08027108);
 }
 
 /**
diff --git a/drivers/gpu/drm/gma500/gma_device.c b/drivers/gpu/drm/gma500/gma_device.c
index 4a295f9..a7fb6de 100644
--- a/drivers/gpu/drm/gma500/gma_device.c
+++ b/drivers/gpu/drm/gma500/gma_device.c
@@ -19,7 +19,9 @@
 void gma_get_core_freq(struct drm_device *dev)
 {
 	uint32_t clock;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, 0);
 	struct drm_psb_private *dev_priv = dev->dev_private;
 
 	/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
index d75ecb3..5c23d4e 100644
--- a/drivers/gpu/drm/gma500/mid_bios.c
+++ b/drivers/gpu/drm/gma500/mid_bios.c
@@ -32,7 +32,9 @@
 static void mid_get_fuse_settings(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, 0);
 	uint32_t fuse_value = 0;
 	uint32_t fuse_value_tmp = 0;
 
@@ -104,7 +106,9 @@ static void mid_get_fuse_settings(struct drm_device *dev)
 static void mid_get_pci_revID(struct drm_psb_private *dev_priv)
 {
 	uint32_t platform_rev_id = 0;
-	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
+	int domain = pci_domain_nr(dev_priv->dev->pdev->bus);
+	struct pci_dev *pci_gfx_root =
+		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(2, 0));
 
 	if (pci_gfx_root == NULL) {
 		WARN_ON(1);
@@ -281,7 +285,9 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
 	u32 addr;
 	u8 __iomem *vbt_virtual;
 	struct mid_vbt_header vbt_header;
-	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
+	struct pci_dev *pci_gfx_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, PCI_DEVFN(2, 0));
 	int ret = -1;
 
 	/* Get the address of the platform config vbt */
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 37a3be7..99d6527 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -261,7 +261,11 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
 		goto out_err;
 
 	if (IS_MRST(dev)) {
-		dev_priv->aux_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(3, 0));
+		int domain = pci_domain_nr(dev->pdev->bus);
+
+		dev_priv->aux_pdev =
+			pci_get_domain_bus_and_slot(domain, 0,
+						    PCI_DEVFN(3, 0));
 
 		if (dev_priv->aux_pdev) {
 			resource_start = pci_resource_start(dev_priv->aux_pdev,
@@ -281,7 +285,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
 		}
 		dev_priv->gmbus_reg = dev_priv->aux_reg;
 
-		dev_priv->lpc_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(31, 0));
+		dev_priv->lpc_pdev =
+			pci_get_domain_bus_and_slot(domain, 0,
+						    PCI_DEVFN(31, 0));
 		if (dev_priv->lpc_pdev) {
 			pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
 				&dev_priv->lpc_gpio_base);
diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
index 821497d..d409e02 100644
--- a/drivers/gpu/drm/gma500/psb_drv.h
+++ b/drivers/gpu/drm/gma500/psb_drv.h
@@ -781,38 +781,40 @@ extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
 extern int drm_idle_check_interval;
 
 /* Utilities */
-static inline u32 MRST_MSG_READ32(uint port, uint offset)
+static inline u32 MRST_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0xD0<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
-static inline void MRST_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset,
+				    u32 value)
 {
 	int mcr = (0xE0<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
 }
-static inline u32 MDFLD_MSG_READ32(uint port, uint offset)
+static inline u32 MDFLD_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
-static inline void MDFLD_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void MDFLD_MSG_WRITE32(int domain, uint port, uint offset,
+				     u32 value)
 {
 	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 08/29] drm/gma500: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Patrik Jakobsson, David Airlie, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Add domain parameter to CDV_MSG_READ32, CDV_MSG_WRITE32, MRST_MSG_READ32,
MRST_MSG_WRITE32, MDFLD_MSG_READ32, MDFLD_MSG_WRITE32.

Extract pci_dev from struct drm_device and use pdev to find the domain
number while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/gma500/cdv_device.c | 16 +++++++++-------
 drivers/gpu/drm/gma500/gma_device.c |  4 +++-
 drivers/gpu/drm/gma500/mid_bios.c   | 12 +++++++++---
 drivers/gpu/drm/gma500/psb_drv.c    | 10 ++++++++--
 drivers/gpu/drm/gma500/psb_drv.h    | 18 ++++++++++--------
 5 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
index 8745971..3a3bf75 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -185,21 +185,22 @@ static int cdv_backlight_init(struct drm_device *dev)
  *	for this and the MID devices.
  */
 
-static inline u32 CDV_MSG_READ32(uint port, uint offset)
+static inline u32 CDV_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
 
-static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset,
+				   u32 value)
 {
 	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
@@ -216,11 +217,12 @@ static void cdv_init_pm(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	u32 pwr_cnt;
+	int domain = pci_domain_nr(dev->pdev->bus);
 	int i;
 
-	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+	dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
 							PSB_APMBA) & 0xFFFF;
-	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+	dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
 							PSB_OSPMBA) & 0xFFFF;
 
 	/* Power status */
@@ -251,7 +253,7 @@ static void cdv_errata(struct drm_device *dev)
 	 *	Bonus Launch to work around the issue, by degrading
 	 *	performance.
 	 */
-	 CDV_MSG_WRITE32(3, 0x30, 0x08027108);
+	 CDV_MSG_WRITE32(pci_domain_nr(dev->pdev->bus), 3, 0x30, 0x08027108);
 }
 
 /**
diff --git a/drivers/gpu/drm/gma500/gma_device.c b/drivers/gpu/drm/gma500/gma_device.c
index 4a295f9..a7fb6de 100644
--- a/drivers/gpu/drm/gma500/gma_device.c
+++ b/drivers/gpu/drm/gma500/gma_device.c
@@ -19,7 +19,9 @@
 void gma_get_core_freq(struct drm_device *dev)
 {
 	uint32_t clock;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, 0);
 	struct drm_psb_private *dev_priv = dev->dev_private;
 
 	/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
index d75ecb3..5c23d4e 100644
--- a/drivers/gpu/drm/gma500/mid_bios.c
+++ b/drivers/gpu/drm/gma500/mid_bios.c
@@ -32,7 +32,9 @@
 static void mid_get_fuse_settings(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, 0);
 	uint32_t fuse_value = 0;
 	uint32_t fuse_value_tmp = 0;
 
@@ -104,7 +106,9 @@ static void mid_get_fuse_settings(struct drm_device *dev)
 static void mid_get_pci_revID(struct drm_psb_private *dev_priv)
 {
 	uint32_t platform_rev_id = 0;
-	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
+	int domain = pci_domain_nr(dev_priv->dev->pdev->bus);
+	struct pci_dev *pci_gfx_root =
+		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(2, 0));
 
 	if (pci_gfx_root == NULL) {
 		WARN_ON(1);
@@ -281,7 +285,9 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
 	u32 addr;
 	u8 __iomem *vbt_virtual;
 	struct mid_vbt_header vbt_header;
-	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
+	struct pci_dev *pci_gfx_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, PCI_DEVFN(2, 0));
 	int ret = -1;
 
 	/* Get the address of the platform config vbt */
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 37a3be7..99d6527 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -261,7 +261,11 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
 		goto out_err;
 
 	if (IS_MRST(dev)) {
-		dev_priv->aux_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(3, 0));
+		int domain = pci_domain_nr(dev->pdev->bus);
+
+		dev_priv->aux_pdev =
+			pci_get_domain_bus_and_slot(domain, 0,
+						    PCI_DEVFN(3, 0));
 
 		if (dev_priv->aux_pdev) {
 			resource_start = pci_resource_start(dev_priv->aux_pdev,
@@ -281,7 +285,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
 		}
 		dev_priv->gmbus_reg = dev_priv->aux_reg;
 
-		dev_priv->lpc_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(31, 0));
+		dev_priv->lpc_pdev =
+			pci_get_domain_bus_and_slot(domain, 0,
+						    PCI_DEVFN(31, 0));
 		if (dev_priv->lpc_pdev) {
 			pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
 				&dev_priv->lpc_gpio_base);
diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
index 821497d..d409e02 100644
--- a/drivers/gpu/drm/gma500/psb_drv.h
+++ b/drivers/gpu/drm/gma500/psb_drv.h
@@ -781,38 +781,40 @@ extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
 extern int drm_idle_check_interval;
 
 /* Utilities */
-static inline u32 MRST_MSG_READ32(uint port, uint offset)
+static inline u32 MRST_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0xD0<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
-static inline void MRST_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset,
+				    u32 value)
 {
 	int mcr = (0xE0<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
 }
-static inline u32 MDFLD_MSG_READ32(uint port, uint offset)
+static inline u32 MDFLD_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
-static inline void MDFLD_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void MDFLD_MSG_WRITE32(int domain, uint port, uint offset,
+				     u32 value)
 {
 	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 08/29] drm/gma500: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Add domain parameter to CDV_MSG_READ32, CDV_MSG_WRITE32, MRST_MSG_READ32,
MRST_MSG_WRITE32, MDFLD_MSG_READ32, MDFLD_MSG_WRITE32.

Extract pci_dev from struct drm_device and use pdev to find the domain
number while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/gma500/cdv_device.c | 16 +++++++++-------
 drivers/gpu/drm/gma500/gma_device.c |  4 +++-
 drivers/gpu/drm/gma500/mid_bios.c   | 12 +++++++++---
 drivers/gpu/drm/gma500/psb_drv.c    | 10 ++++++++--
 drivers/gpu/drm/gma500/psb_drv.h    | 18 ++++++++++--------
 5 files changed, 39 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
index 8745971..3a3bf75 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -185,21 +185,22 @@ static int cdv_backlight_init(struct drm_device *dev)
  *	for this and the MID devices.
  */
 
-static inline u32 CDV_MSG_READ32(uint port, uint offset)
+static inline u32 CDV_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
 
-static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset,
+				   u32 value)
 {
 	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
@@ -216,11 +217,12 @@ static void cdv_init_pm(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	u32 pwr_cnt;
+	int domain = pci_domain_nr(dev->pdev->bus);
 	int i;
 
-	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+	dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
 							PSB_APMBA) & 0xFFFF;
-	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
+	dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
 							PSB_OSPMBA) & 0xFFFF;
 
 	/* Power status */
@@ -251,7 +253,7 @@ static void cdv_errata(struct drm_device *dev)
 	 *	Bonus Launch to work around the issue, by degrading
 	 *	performance.
 	 */
-	 CDV_MSG_WRITE32(3, 0x30, 0x08027108);
+	 CDV_MSG_WRITE32(pci_domain_nr(dev->pdev->bus), 3, 0x30, 0x08027108);
 }
 
 /**
diff --git a/drivers/gpu/drm/gma500/gma_device.c b/drivers/gpu/drm/gma500/gma_device.c
index 4a295f9..a7fb6de 100644
--- a/drivers/gpu/drm/gma500/gma_device.c
+++ b/drivers/gpu/drm/gma500/gma_device.c
@@ -19,7 +19,9 @@
 void gma_get_core_freq(struct drm_device *dev)
 {
 	uint32_t clock;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, 0);
 	struct drm_psb_private *dev_priv = dev->dev_private;
 
 	/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
index d75ecb3..5c23d4e 100644
--- a/drivers/gpu/drm/gma500/mid_bios.c
+++ b/drivers/gpu/drm/gma500/mid_bios.c
@@ -32,7 +32,9 @@
 static void mid_get_fuse_settings(struct drm_device *dev)
 {
 	struct drm_psb_private *dev_priv = dev->dev_private;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, 0);
 	uint32_t fuse_value = 0;
 	uint32_t fuse_value_tmp = 0;
 
@@ -104,7 +106,9 @@ static void mid_get_fuse_settings(struct drm_device *dev)
 static void mid_get_pci_revID(struct drm_psb_private *dev_priv)
 {
 	uint32_t platform_rev_id = 0;
-	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
+	int domain = pci_domain_nr(dev_priv->dev->pdev->bus);
+	struct pci_dev *pci_gfx_root =
+		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(2, 0));
 
 	if (pci_gfx_root == NULL) {
 		WARN_ON(1);
@@ -281,7 +285,9 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
 	u32 addr;
 	u8 __iomem *vbt_virtual;
 	struct mid_vbt_header vbt_header;
-	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
+	struct pci_dev *pci_gfx_root =
+		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
+					    0, PCI_DEVFN(2, 0));
 	int ret = -1;
 
 	/* Get the address of the platform config vbt */
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index 37a3be7..99d6527 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -261,7 +261,11 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
 		goto out_err;
 
 	if (IS_MRST(dev)) {
-		dev_priv->aux_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(3, 0));
+		int domain = pci_domain_nr(dev->pdev->bus);
+
+		dev_priv->aux_pdev =
+			pci_get_domain_bus_and_slot(domain, 0,
+						    PCI_DEVFN(3, 0));
 
 		if (dev_priv->aux_pdev) {
 			resource_start = pci_resource_start(dev_priv->aux_pdev,
@@ -281,7 +285,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
 		}
 		dev_priv->gmbus_reg = dev_priv->aux_reg;
 
-		dev_priv->lpc_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(31, 0));
+		dev_priv->lpc_pdev =
+			pci_get_domain_bus_and_slot(domain, 0,
+						    PCI_DEVFN(31, 0));
 		if (dev_priv->lpc_pdev) {
 			pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
 				&dev_priv->lpc_gpio_base);
diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
index 821497d..d409e02 100644
--- a/drivers/gpu/drm/gma500/psb_drv.h
+++ b/drivers/gpu/drm/gma500/psb_drv.h
@@ -781,38 +781,40 @@ extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
 extern int drm_idle_check_interval;
 
 /* Utilities */
-static inline u32 MRST_MSG_READ32(uint port, uint offset)
+static inline u32 MRST_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0xD0<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
-static inline void MRST_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset,
+				    u32 value)
 {
 	int mcr = (0xE0<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
 }
-static inline u32 MDFLD_MSG_READ32(uint port, uint offset)
+static inline u32 MDFLD_MSG_READ32(int domain, uint port, uint offset)
 {
 	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
 	uint32_t ret_val = 0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_read_config_dword(pci_root, 0xD4, &ret_val);
 	pci_dev_put(pci_root);
 	return ret_val;
 }
-static inline void MDFLD_MSG_WRITE32(uint port, uint offset, u32 value)
+static inline void MDFLD_MSG_WRITE32(int domain, uint port, uint offset,
+				     u32 value)
 {
 	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
-	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
+	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
 	pci_write_config_dword(pci_root, 0xD4, value);
 	pci_write_config_dword(pci_root, 0xD0, mcr);
 	pci_dev_put(pci_root);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list,
	open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from drm_device and pass it into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9f45cfe..5a8cb79 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
 
 static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
 {
-	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
+
+	dev_priv->bridge_dev =
+		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
 	if (!dev_priv->bridge_dev) {
 		DRM_ERROR("bridge device not found\n");
 		return -1;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	open list:DRM DRIVERS, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from drm_device and pass it into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9f45cfe..5a8cb79 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
 
 static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
 {
-	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
+
+	dev_priv->bridge_dev =
+		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
 	if (!dev_priv->bridge_dev) {
 		DRM_ERROR("bridge device not found\n");
 		return -1;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, Joonas Lahtinen,
	open list, Jani Nikula, Sinan Kaya, open list:DRM DRIVERS,
	Rodrigo Vivi, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from drm_device and pass it into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9f45cfe..5a8cb79 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
 
 static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
 {
-	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
+
+	dev_priv->bridge_dev =
+		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
 	if (!dev_priv->bridge_dev) {
 		DRM_ERROR("bridge device not found\n");
 		return -1;
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from drm_device and pass it into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9f45cfe..5a8cb79 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
 
 static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
 {
-	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
+
+	dev_priv->bridge_dev =
+		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
 	if (!dev_priv->bridge_dev) {
 		DRM_ERROR("bridge device not found\n");
 		return -1;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, Ben Skeggs,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, Ilia Mirkin,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/nouveau/dispnv04/arb.c           |  4 +++-
 drivers/gpu/drm/nouveau/dispnv04/hw.c            | 10 +++++++---
 drivers/gpu/drm/nouveau/nouveau_drm.c            |  3 ++-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +++++++++-
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
index 90075b6..c79160c 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
@@ -213,8 +213,10 @@ struct nv_sim_state {
 	if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
 	    (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
 		uint32_t type;
+		int domain = pci_domain_nr(dev->pdev->bus);
 
-		pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
+				      0x7c, &type);
 
 		sim_data.memory_type = (type >> 12) & 1;
 		sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
index b985990..0c9bdf0 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
@@ -216,12 +216,15 @@
 {
 	struct nvkm_pll_vals pllvals;
 	int ret;
+	int domain;
+
+	domain = pci_domain_nr(dev->pdev->bus);
 
 	if (plltype == PLL_MEMORY &&
 	    (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
 		uint32_t mpllP;
-
-		pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
+				      0x6c, &mpllP);
 		mpllP = (mpllP >> 8) & 0xf;
 		if (!mpllP)
 			mpllP = 4;
@@ -232,7 +235,8 @@
 	    (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
 		uint32_t clock;
 
-		pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
+				      0x4c, &clock);
 		return clock / 1000;
 	}
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 595630d..0b6c639 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	}
 
 	/* subfunction one is a hdmi audio device? */
-	drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+	drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+						(unsigned int)pdev->bus->number,
 						PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
 
 	if (!drm->hdmi_device) {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
index 3c6a871..8849b71 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
@@ -28,8 +28,16 @@
 {
 	struct pci_dev *bridge;
 	u32 mem, mib;
+	int domain = 0;
+	struct pci_dev *pdev = NULL;
 
-	bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
+	if (dev_is_pci(fb->subdev.device->dev))
+		pdev = to_pci_dev(fb->subdev.device->dev);
+
+	if (pdev)
+		domain = pci_domain_nr(pdev->bus);
+
+	bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
 	if (!bridge) {
 		nvkm_error(&fb->subdev, "no bridge device\n");
 		return -ENODEV;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Ben Skeggs, David Airlie, Ilia Mirkin,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/nouveau/dispnv04/arb.c           |  4 +++-
 drivers/gpu/drm/nouveau/dispnv04/hw.c            | 10 +++++++---
 drivers/gpu/drm/nouveau/nouveau_drm.c            |  3 ++-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +++++++++-
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
index 90075b6..c79160c 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
@@ -213,8 +213,10 @@ struct nv_sim_state {
 	if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
 	    (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
 		uint32_t type;
+		int domain = pci_domain_nr(dev->pdev->bus);
 
-		pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
+				      0x7c, &type);
 
 		sim_data.memory_type = (type >> 12) & 1;
 		sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
index b985990..0c9bdf0 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
@@ -216,12 +216,15 @@
 {
 	struct nvkm_pll_vals pllvals;
 	int ret;
+	int domain;
+
+	domain = pci_domain_nr(dev->pdev->bus);
 
 	if (plltype == PLL_MEMORY &&
 	    (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
 		uint32_t mpllP;
-
-		pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
+				      0x6c, &mpllP);
 		mpllP = (mpllP >> 8) & 0xf;
 		if (!mpllP)
 			mpllP = 4;
@@ -232,7 +235,8 @@
 	    (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
 		uint32_t clock;
 
-		pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
+				      0x4c, &clock);
 		return clock / 1000;
 	}
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 595630d..0b6c639 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	}
 
 	/* subfunction one is a hdmi audio device? */
-	drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+	drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+						(unsigned int)pdev->bus->number,
 						PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
 
 	if (!drm->hdmi_device) {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
index 3c6a871..8849b71 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
@@ -28,8 +28,16 @@
 {
 	struct pci_dev *bridge;
 	u32 mem, mib;
+	int domain = 0;
+	struct pci_dev *pdev = NULL;
 
-	bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
+	if (dev_is_pci(fb->subdev.device->dev))
+		pdev = to_pci_dev(fb->subdev.device->dev);
+
+	if (pdev)
+		domain = pci_domain_nr(pdev->bus);
+
+	bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
 	if (!bridge) {
 		nvkm_error(&fb->subdev, "no bridge device\n");
 		return -ENODEV;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from
1. struct pci_dev
2. struct pci_dev through drm_device->pdev
3. struct pci_dev through fb->subdev->drm_device->pdev

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/gpu/drm/nouveau/dispnv04/arb.c           |  4 +++-
 drivers/gpu/drm/nouveau/dispnv04/hw.c            | 10 +++++++---
 drivers/gpu/drm/nouveau/nouveau_drm.c            |  3 ++-
 drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +++++++++-
 4 files changed, 21 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
index 90075b6..c79160c 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
@@ -213,8 +213,10 @@ struct nv_sim_state {
 	if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
 	    (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
 		uint32_t type;
+		int domain = pci_domain_nr(dev->pdev->bus);
 
-		pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
+				      0x7c, &type);
 
 		sim_data.memory_type = (type >> 12) & 1;
 		sim_data.memory_width = 64;
diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
index b985990..0c9bdf0 100644
--- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
+++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
@@ -216,12 +216,15 @@
 {
 	struct nvkm_pll_vals pllvals;
 	int ret;
+	int domain;
+
+	domain = pci_domain_nr(dev->pdev->bus);
 
 	if (plltype == PLL_MEMORY &&
 	    (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
 		uint32_t mpllP;
-
-		pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
+				      0x6c, &mpllP);
 		mpllP = (mpllP >> 8) & 0xf;
 		if (!mpllP)
 			mpllP = 4;
@@ -232,7 +235,8 @@
 	    (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
 		uint32_t clock;
 
-		pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
+		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
+				      0x4c, &clock);
 		return clock / 1000;
 	}
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 595630d..0b6c639 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
 	}
 
 	/* subfunction one is a hdmi audio device? */
-	drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
+	drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
+						(unsigned int)pdev->bus->number,
 						PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
 
 	if (!drm->hdmi_device) {
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
index 3c6a871..8849b71 100644
--- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
+++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
@@ -28,8 +28,16 @@
 {
 	struct pci_dev *bridge;
 	u32 mem, mib;
+	int domain = 0;
+	struct pci_dev *pdev = NULL;
 
-	bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
+	if (dev_is_pci(fb->subdev.device->dev))
+		pdev = to_pci_dev(fb->subdev.device->dev);
+
+	if (pdev)
+		domain = pci_domain_nr(pdev->bus);
+
+	bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
 	if (!bridge) {
 		nvkm_error(&fb->subdev, "no bridge device\n");
 		return -ENODEV;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 11/29] Drivers: ide: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, open list:IDE SUBSYSTEM,
	David S. Miller, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ide/sl82c105.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index 8755df3..3300dac 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -239,8 +239,9 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev)
 	/*
 	 * The bridge should be part of the same device, but function 0.
 	 */
-	bridge = pci_get_bus_and_slot(dev->bus->number,
-			       PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
+	bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
+					dev->bus->number,
+					PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	if (!bridge)
 		return -1;
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 11/29] Drivers: ide: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	David S. Miller, open list:IDE SUBSYSTEM, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ide/sl82c105.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index 8755df3..3300dac 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -239,8 +239,9 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev)
 	/*
 	 * The bridge should be part of the same device, but function 0.
 	 */
-	bridge = pci_get_bus_and_slot(dev->bus->number,
-			       PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
+	bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
+					dev->bus->number,
+					PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	if (!bridge)
 		return -1;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 11/29] Drivers: ide: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Sinan Kaya,
	open list:IDE SUBSYSTEM, David S. Miller, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ide/sl82c105.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index 8755df3..3300dac 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -239,8 +239,9 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev)
 	/*
 	 * The bridge should be part of the same device, but function 0.
 	 */
-	bridge = pci_get_bus_and_slot(dev->bus->number,
-			       PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
+	bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
+					dev->bus->number,
+					PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	if (!bridge)
 		return -1;
 
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 11/29] Drivers: ide: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
and extract the domain number from struct pci_dev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/ide/sl82c105.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/sl82c105.c b/drivers/ide/sl82c105.c
index 8755df3..3300dac 100644
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -239,8 +239,9 @@ static u8 sl82c105_bridge_revision(struct pci_dev *dev)
 	/*
 	 * The bridge should be part of the same device, but function 0.
 	 */
-	bridge = pci_get_bus_and_slot(dev->bus->number,
-			       PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
+	bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus),
+					dev->bus->number,
+					PCI_DEVFN(PCI_SLOT(dev->devfn), 0));
 	if (!bridge)
 		return -1;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 12/29] iommu/amd: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, open list:AMD IOMMU AMD-VI,
	Joerg Roedel, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 for the AMD IOMMU driver.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/iommu/amd_iommu.c      | 3 ++-
 drivers/iommu/amd_iommu_init.c | 9 +++++----
 drivers/iommu/amd_iommu_v2.c   | 3 ++-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8e8874d..2c3452f 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -528,7 +528,8 @@ static void amd_iommu_report_page_fault(u16 devid, u16 domain_id,
 	struct iommu_dev_data *dev_data = NULL;
 	struct pci_dev *pdev;
 
-	pdev = pci_get_bus_and_slot(PCI_BUS_NUM(devid), devid & 0xff);
+	pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid),
+					   devid & 0xff);
 	if (pdev)
 		dev_data = get_dev_data(&pdev->dev);
 
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 6fe2d03..4e4a615 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1697,8 +1697,8 @@ static int iommu_init_pci(struct amd_iommu *iommu)
 	u32 range, misc, low, high;
 	int ret;
 
-	iommu->dev = pci_get_bus_and_slot(PCI_BUS_NUM(iommu->devid),
-					  iommu->devid & 0xff);
+	iommu->dev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(iommu->devid),
+						 iommu->devid & 0xff);
 	if (!iommu->dev)
 		return -ENODEV;
 
@@ -1764,8 +1764,9 @@ static int iommu_init_pci(struct amd_iommu *iommu)
 	if (is_rd890_iommu(iommu->dev)) {
 		int i, j;
 
-		iommu->root_pdev = pci_get_bus_and_slot(iommu->dev->bus->number,
-				PCI_DEVFN(0, 0));
+		iommu->root_pdev =
+			pci_get_domain_bus_and_slot(0, iommu->dev->bus->number,
+						    PCI_DEVFN(0, 0));
 
 		/*
 		 * Some rd890 systems may not be fully reconfigured by the
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index 7d94e1d..8696382 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -564,7 +564,8 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data)
 	finish      = (iommu_fault->tag >> 9) & 1;
 
 	devid = iommu_fault->device_id;
-	pdev = pci_get_bus_and_slot(PCI_BUS_NUM(devid), devid & 0xff);
+	pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid),
+					   devid & 0xff);
 	if (!pdev)
 		return -ENODEV;
 	dev_data = get_dev_data(&pdev->dev);
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 12/29] iommu/amd: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Joerg Roedel, open list:AMD IOMMU (AMD-VI),
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 for the AMD IOMMU driver.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/iommu/amd_iommu.c      | 3 ++-
 drivers/iommu/amd_iommu_init.c | 9 +++++----
 drivers/iommu/amd_iommu_v2.c   | 3 ++-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8e8874d..2c3452f 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -528,7 +528,8 @@ static void amd_iommu_report_page_fault(u16 devid, u16 domain_id,
 	struct iommu_dev_data *dev_data = NULL;
 	struct pci_dev *pdev;
 
-	pdev = pci_get_bus_and_slot(PCI_BUS_NUM(devid), devid & 0xff);
+	pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid),
+					   devid & 0xff);
 	if (pdev)
 		dev_data = get_dev_data(&pdev->dev);
 
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 6fe2d03..4e4a615 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1697,8 +1697,8 @@ static int iommu_init_pci(struct amd_iommu *iommu)
 	u32 range, misc, low, high;
 	int ret;
 
-	iommu->dev = pci_get_bus_and_slot(PCI_BUS_NUM(iommu->devid),
-					  iommu->devid & 0xff);
+	iommu->dev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(iommu->devid),
+						 iommu->devid & 0xff);
 	if (!iommu->dev)
 		return -ENODEV;
 
@@ -1764,8 +1764,9 @@ static int iommu_init_pci(struct amd_iommu *iommu)
 	if (is_rd890_iommu(iommu->dev)) {
 		int i, j;
 
-		iommu->root_pdev = pci_get_bus_and_slot(iommu->dev->bus->number,
-				PCI_DEVFN(0, 0));
+		iommu->root_pdev =
+			pci_get_domain_bus_and_slot(0, iommu->dev->bus->number,
+						    PCI_DEVFN(0, 0));
 
 		/*
 		 * Some rd890 systems may not be fully reconfigured by the
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index 7d94e1d..8696382 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -564,7 +564,8 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data)
 	finish      = (iommu_fault->tag >> 9) & 1;
 
 	devid = iommu_fault->device_id;
-	pdev = pci_get_bus_and_slot(PCI_BUS_NUM(devid), devid & 0xff);
+	pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid),
+					   devid & 0xff);
 	if (!pdev)
 		return -ENODEV;
 	dev_data = get_dev_data(&pdev->dev);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 12/29] iommu/amd: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 for the AMD IOMMU driver.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/iommu/amd_iommu.c      | 3 ++-
 drivers/iommu/amd_iommu_init.c | 9 +++++----
 drivers/iommu/amd_iommu_v2.c   | 3 ++-
 3 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
index 8e8874d..2c3452f 100644
--- a/drivers/iommu/amd_iommu.c
+++ b/drivers/iommu/amd_iommu.c
@@ -528,7 +528,8 @@ static void amd_iommu_report_page_fault(u16 devid, u16 domain_id,
 	struct iommu_dev_data *dev_data = NULL;
 	struct pci_dev *pdev;
 
-	pdev = pci_get_bus_and_slot(PCI_BUS_NUM(devid), devid & 0xff);
+	pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid),
+					   devid & 0xff);
 	if (pdev)
 		dev_data = get_dev_data(&pdev->dev);
 
diff --git a/drivers/iommu/amd_iommu_init.c b/drivers/iommu/amd_iommu_init.c
index 6fe2d03..4e4a615 100644
--- a/drivers/iommu/amd_iommu_init.c
+++ b/drivers/iommu/amd_iommu_init.c
@@ -1697,8 +1697,8 @@ static int iommu_init_pci(struct amd_iommu *iommu)
 	u32 range, misc, low, high;
 	int ret;
 
-	iommu->dev = pci_get_bus_and_slot(PCI_BUS_NUM(iommu->devid),
-					  iommu->devid & 0xff);
+	iommu->dev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(iommu->devid),
+						 iommu->devid & 0xff);
 	if (!iommu->dev)
 		return -ENODEV;
 
@@ -1764,8 +1764,9 @@ static int iommu_init_pci(struct amd_iommu *iommu)
 	if (is_rd890_iommu(iommu->dev)) {
 		int i, j;
 
-		iommu->root_pdev = pci_get_bus_and_slot(iommu->dev->bus->number,
-				PCI_DEVFN(0, 0));
+		iommu->root_pdev =
+			pci_get_domain_bus_and_slot(0, iommu->dev->bus->number,
+						    PCI_DEVFN(0, 0));
 
 		/*
 		 * Some rd890 systems may not be fully reconfigured by the
diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c
index 7d94e1d..8696382 100644
--- a/drivers/iommu/amd_iommu_v2.c
+++ b/drivers/iommu/amd_iommu_v2.c
@@ -564,7 +564,8 @@ static int ppr_notifier(struct notifier_block *nb, unsigned long e, void *data)
 	finish      = (iommu_fault->tag >> 9) & 1;
 
 	devid = iommu_fault->device_id;
-	pdev = pci_get_bus_and_slot(PCI_BUS_NUM(devid), devid & 0xff);
+	pdev = pci_get_domain_bus_and_slot(0, PCI_BUS_NUM(devid),
+					   devid & 0xff);
 	if (!pdev)
 		return -ENODEV;
 	dev_data = get_dev_data(&pdev->dev);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 13/29] powerpc/powermac: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Benjamin Herrenschmidt,
	open list:LINUX FOR POWER MACINTOSH, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 to match the previous behavior.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/macintosh/via-pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index c4c2b3b..3e8b3b6 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1799,7 +1799,7 @@ static int powerbook_sleep_grackle(void)
 	struct adb_request req;
 	struct pci_dev *grackle;
 
-	grackle = pci_get_bus_and_slot(0, 0);
+	grackle = pci_get_domain_bus_and_slot(0, 0, 0);
 	if (!grackle)
 		return -ENODEV;
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 13/29] powerpc/powermac: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Benjamin Herrenschmidt, open list:LINUX FOR POWER MACINTOSH,
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 to match the previous behavior.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/macintosh/via-pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index c4c2b3b..3e8b3b6 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1799,7 +1799,7 @@ static int powerbook_sleep_grackle(void)
 	struct adb_request req;
 	struct pci_dev *grackle;
 
-	grackle = pci_get_bus_and_slot(0, 0);
+	grackle = pci_get_domain_bus_and_slot(0, 0, 0);
 	if (!grackle)
 		return -ENODEV;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 13/29] powerpc/powermac: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-code the domain number as 0 to match the previous behavior.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/macintosh/via-pmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c
index c4c2b3b..3e8b3b6 100644
--- a/drivers/macintosh/via-pmu.c
+++ b/drivers/macintosh/via-pmu.c
@@ -1799,7 +1799,7 @@ static int powerbook_sleep_grackle(void)
 	struct adb_request req;
 	struct pci_dev *grackle;
 
-	grackle = pci_get_bus_and_slot(0, 0);
+	grackle = pci_get_domain_bus_and_slot(0, 0, 0);
 	if (!grackle)
 		return -ENODEV;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 14/29] bnx2x: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Ariel Elior,
	open list:BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER,
	supporter:BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Introduce bnx2x_vf_domain() function to extract the domain information
and save it to VF specific data structure.

Use the saved domain value while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 10 +++++++++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 9ca994d..9f40c23 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -812,7 +812,7 @@ static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp, u8 abs_vfid)
 	if (!vf)
 		return false;
 
-	dev = pci_get_bus_and_slot(vf->bus, vf->devfn);
+	dev = pci_get_domain_bus_and_slot(vf->domain, vf->bus, vf->devfn);
 	if (dev)
 		return bnx2x_is_pcie_pending(dev);
 	return false;
@@ -1041,6 +1041,13 @@ void bnx2x_iov_init_dmae(struct bnx2x *bp)
 		REG_WR(bp, DMAE_REG_BACKWARD_COMP_EN, 0);
 }
 
+static int bnx2x_vf_domain(struct bnx2x *bp, int vfid)
+{
+	struct pci_dev *dev = bp->pdev;
+
+	return pci_domain_nr(dev->bus);
+}
+
 static int bnx2x_vf_bus(struct bnx2x *bp, int vfid)
 {
 	struct pci_dev *dev = bp->pdev;
@@ -1611,6 +1618,7 @@ int bnx2x_iov_nic_init(struct bnx2x *bp)
 		struct bnx2x_virtf *vf = BP_VF(bp, vfid);
 
 		/* fill in the BDF and bars */
+		vf->domain = bnx2x_vf_domain(bp, vfid);
 		vf->bus = bnx2x_vf_bus(bp, vfid);
 		vf->devfn = bnx2x_vf_devfn(bp, vfid);
 		bnx2x_vf_set_bars(bp, vf);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
index 53466f6..eb814c6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
@@ -182,6 +182,7 @@ struct bnx2x_virtf {
 	u32 error;	/* 0 means all's-well */
 
 	/* BDF */
+	unsigned int domain;
 	unsigned int bus;
 	unsigned int devfn;
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 14/29] bnx2x: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Ariel Elior, supporter:BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER,
	open list:BROADCOM BNX2X 10 GIGABIT ETHERNET DRIVER, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Introduce bnx2x_vf_domain() function to extract the domain information
and save it to VF specific data structure.

Use the saved domain value while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 10 +++++++++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 9ca994d..9f40c23 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -812,7 +812,7 @@ static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp, u8 abs_vfid)
 	if (!vf)
 		return false;
 
-	dev = pci_get_bus_and_slot(vf->bus, vf->devfn);
+	dev = pci_get_domain_bus_and_slot(vf->domain, vf->bus, vf->devfn);
 	if (dev)
 		return bnx2x_is_pcie_pending(dev);
 	return false;
@@ -1041,6 +1041,13 @@ void bnx2x_iov_init_dmae(struct bnx2x *bp)
 		REG_WR(bp, DMAE_REG_BACKWARD_COMP_EN, 0);
 }
 
+static int bnx2x_vf_domain(struct bnx2x *bp, int vfid)
+{
+	struct pci_dev *dev = bp->pdev;
+
+	return pci_domain_nr(dev->bus);
+}
+
 static int bnx2x_vf_bus(struct bnx2x *bp, int vfid)
 {
 	struct pci_dev *dev = bp->pdev;
@@ -1611,6 +1618,7 @@ int bnx2x_iov_nic_init(struct bnx2x *bp)
 		struct bnx2x_virtf *vf = BP_VF(bp, vfid);
 
 		/* fill in the BDF and bars */
+		vf->domain = bnx2x_vf_domain(bp, vfid);
 		vf->bus = bnx2x_vf_bus(bp, vfid);
 		vf->devfn = bnx2x_vf_devfn(bp, vfid);
 		bnx2x_vf_set_bars(bp, vf);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
index 53466f6..eb814c6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
@@ -182,6 +182,7 @@ struct bnx2x_virtf {
 	u32 error;	/* 0 means all's-well */
 
 	/* BDF */
+	unsigned int domain;
 	unsigned int bus;
 	unsigned int devfn;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 14/29] bnx2x: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Introduce bnx2x_vf_domain() function to extract the domain information
and save it to VF specific data structure.

Use the saved domain value while calling pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 10 +++++++++-
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h |  1 +
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 9ca994d..9f40c23 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -812,7 +812,7 @@ static u8 bnx2x_vf_is_pcie_pending(struct bnx2x *bp, u8 abs_vfid)
 	if (!vf)
 		return false;
 
-	dev = pci_get_bus_and_slot(vf->bus, vf->devfn);
+	dev = pci_get_domain_bus_and_slot(vf->domain, vf->bus, vf->devfn);
 	if (dev)
 		return bnx2x_is_pcie_pending(dev);
 	return false;
@@ -1041,6 +1041,13 @@ void bnx2x_iov_init_dmae(struct bnx2x *bp)
 		REG_WR(bp, DMAE_REG_BACKWARD_COMP_EN, 0);
 }
 
+static int bnx2x_vf_domain(struct bnx2x *bp, int vfid)
+{
+	struct pci_dev *dev = bp->pdev;
+
+	return pci_domain_nr(dev->bus);
+}
+
 static int bnx2x_vf_bus(struct bnx2x *bp, int vfid)
 {
 	struct pci_dev *dev = bp->pdev;
@@ -1611,6 +1618,7 @@ int bnx2x_iov_nic_init(struct bnx2x *bp)
 		struct bnx2x_virtf *vf = BP_VF(bp, vfid);
 
 		/* fill in the BDF and bars */
+		vf->domain = bnx2x_vf_domain(bp, vfid);
 		vf->bus = bnx2x_vf_bus(bp, vfid);
 		vf->devfn = bnx2x_vf_devfn(bp, vfid);
 		bnx2x_vf_set_bars(bp, vf);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
index 53466f6..eb814c6 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
@@ -182,6 +182,7 @@ struct bnx2x_virtf {
 	u32 error;	/* 0 means all's-well */
 
 	/* BDF */
+	unsigned int domain;
 	unsigned int bus;
 	unsigned int devfn;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 15/29] pch_gbe: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Eric Dumazet,
	open list:NETWORKING DRIVERS, Tobias Klauser, David S. Miller,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use the domain information from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 5ae9681..4be7806 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2603,8 +2603,10 @@ static int pch_gbe_probe(struct pci_dev *pdev,
 	if (adapter->pdata && adapter->pdata->platform_init)
 		adapter->pdata->platform_init(pdev);
 
-	adapter->ptp_pdev = pci_get_bus_and_slot(adapter->pdev->bus->number,
-					       PCI_DEVFN(12, 4));
+	adapter->ptp_pdev =
+		pci_get_domain_bus_and_slot(pci_domain_nr(adapter->pdev->bus),
+					    adapter->pdev->bus->number,
+					    PCI_DEVFN(12, 4));
 
 	netdev->netdev_ops = &pch_gbe_netdev_ops;
 	netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 15/29] pch_gbe: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	David S. Miller, Tobias Klauser, Eric Dumazet,
	open list:NETWORKING DRIVERS, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use the domain information from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 5ae9681..4be7806 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2603,8 +2603,10 @@ static int pch_gbe_probe(struct pci_dev *pdev,
 	if (adapter->pdata && adapter->pdata->platform_init)
 		adapter->pdata->platform_init(pdev);
 
-	adapter->ptp_pdev = pci_get_bus_and_slot(adapter->pdev->bus->number,
-					       PCI_DEVFN(12, 4));
+	adapter->ptp_pdev =
+		pci_get_domain_bus_and_slot(pci_domain_nr(adapter->pdev->bus),
+					    adapter->pdev->bus->number,
+					    PCI_DEVFN(12, 4));
 
 	netdev->netdev_ops = &pch_gbe_netdev_ops;
 	netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 15/29] pch_gbe: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Use the domain information from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 5ae9681..4be7806 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -2603,8 +2603,10 @@ static int pch_gbe_probe(struct pci_dev *pdev,
 	if (adapter->pdata && adapter->pdata->platform_init)
 		adapter->pdata->platform_init(pdev);
 
-	adapter->ptp_pdev = pci_get_bus_and_slot(adapter->pdev->bus->number,
-					       PCI_DEVFN(12, 4));
+	adapter->ptp_pdev =
+		pci_get_domain_bus_and_slot(pci_domain_nr(adapter->pdev->bus),
+					    adapter->pdev->bus->number,
+					    PCI_DEVFN(12, 4));
 
 	netdev->netdev_ops = &pch_gbe_netdev_ops;
 	netdev->watchdog_timeo = PCH_GBE_WATCHDOG_PERIOD;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 16/29] PCI: cpqhp: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain number as 0. The code doesn't seem to be ready
for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/hotplug/cpqphp_pci.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index e220d49..8897a77 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -89,7 +89,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
 	pci_lock_rescan_remove();
 
 	if (func->pci_dev == NULL)
-		func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function));
+		func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus,
+							PCI_DEVFN(func->device,
+							func->function));
 
 	/* No pci device, we need to create it then */
 	if (func->pci_dev == NULL) {
@@ -99,7 +101,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
 		if (num)
 			pci_bus_add_devices(ctrl->pci_dev->bus);
 
-		func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function));
+		func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus,
+							PCI_DEVFN(func->device,
+							func->function));
 		if (func->pci_dev == NULL) {
 			dbg("ERROR: pci_dev still null\n");
 			goto out;
@@ -129,7 +133,10 @@ int cpqhp_unconfigure_device(struct pci_func *func)
 
 	pci_lock_rescan_remove();
 	for (j = 0; j < 8 ; j++) {
-		struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
+		struct pci_dev *temp = pci_get_domain_bus_and_slot(0,
+							func->bus,
+							PCI_DEVFN(func->device,
+							j));
 		if (temp) {
 			pci_dev_put(temp);
 			pci_stop_and_remove_bus_device(temp);
@@ -319,6 +326,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
 	int cloop = 0;
 	int stop_it;
 	int index;
+	u16 devfn;
 
 	/* Decide which slots are supported */
 
@@ -416,7 +424,9 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
 			new_slot->switch_save = 0x10;
 			/* In case of unsupported board */
 			new_slot->status = DevError;
-			new_slot->pci_dev = pci_get_bus_and_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function);
+			devfn = (new_slot->device << 3) | new_slot->function;
+			new_slot->pci_dev = pci_get_domain_bus_and_slot(0,
+							new_slot->bus, devfn);
 
 			for (cloop = 0; cloop < 0x20; cloop++) {
 				rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(device, function), cloop << 2, (u32 *) &(new_slot->config_space[cloop]));
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 16/29] PCI: cpqhp: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain number as 0. The code doesn't seem to be ready
for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/hotplug/cpqphp_pci.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index e220d49..8897a77 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -89,7 +89,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
 	pci_lock_rescan_remove();
 
 	if (func->pci_dev == NULL)
-		func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function));
+		func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus,
+							PCI_DEVFN(func->device,
+							func->function));
 
 	/* No pci device, we need to create it then */
 	if (func->pci_dev == NULL) {
@@ -99,7 +101,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
 		if (num)
 			pci_bus_add_devices(ctrl->pci_dev->bus);
 
-		func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function));
+		func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus,
+							PCI_DEVFN(func->device,
+							func->function));
 		if (func->pci_dev == NULL) {
 			dbg("ERROR: pci_dev still null\n");
 			goto out;
@@ -129,7 +133,10 @@ int cpqhp_unconfigure_device(struct pci_func *func)
 
 	pci_lock_rescan_remove();
 	for (j = 0; j < 8 ; j++) {
-		struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
+		struct pci_dev *temp = pci_get_domain_bus_and_slot(0,
+							func->bus,
+							PCI_DEVFN(func->device,
+							j));
 		if (temp) {
 			pci_dev_put(temp);
 			pci_stop_and_remove_bus_device(temp);
@@ -319,6 +326,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
 	int cloop = 0;
 	int stop_it;
 	int index;
+	u16 devfn;
 
 	/* Decide which slots are supported */
 
@@ -416,7 +424,9 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
 			new_slot->switch_save = 0x10;
 			/* In case of unsupported board */
 			new_slot->status = DevError;
-			new_slot->pci_dev = pci_get_bus_and_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function);
+			devfn = (new_slot->device << 3) | new_slot->function;
+			new_slot->pci_dev = pci_get_domain_bus_and_slot(0,
+							new_slot->bus, devfn);
 
 			for (cloop = 0; cloop < 0x20; cloop++) {
 				rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(device, function), cloop << 2, (u32 *) &(new_slot->config_space[cloop]));
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 16/29] PCI: cpqhp: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain number as 0. The code doesn't seem to be ready
for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/hotplug/cpqphp_pci.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/pci/hotplug/cpqphp_pci.c b/drivers/pci/hotplug/cpqphp_pci.c
index e220d49..8897a77 100644
--- a/drivers/pci/hotplug/cpqphp_pci.c
+++ b/drivers/pci/hotplug/cpqphp_pci.c
@@ -89,7 +89,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
 	pci_lock_rescan_remove();
 
 	if (func->pci_dev == NULL)
-		func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function));
+		func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus,
+							PCI_DEVFN(func->device,
+							func->function));
 
 	/* No pci device, we need to create it then */
 	if (func->pci_dev == NULL) {
@@ -99,7 +101,9 @@ int cpqhp_configure_device(struct controller *ctrl, struct pci_func *func)
 		if (num)
 			pci_bus_add_devices(ctrl->pci_dev->bus);
 
-		func->pci_dev = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, func->function));
+		func->pci_dev = pci_get_domain_bus_and_slot(0, func->bus,
+							PCI_DEVFN(func->device,
+							func->function));
 		if (func->pci_dev == NULL) {
 			dbg("ERROR: pci_dev still null\n");
 			goto out;
@@ -129,7 +133,10 @@ int cpqhp_unconfigure_device(struct pci_func *func)
 
 	pci_lock_rescan_remove();
 	for (j = 0; j < 8 ; j++) {
-		struct pci_dev *temp = pci_get_bus_and_slot(func->bus, PCI_DEVFN(func->device, j));
+		struct pci_dev *temp = pci_get_domain_bus_and_slot(0,
+							func->bus,
+							PCI_DEVFN(func->device,
+							j));
 		if (temp) {
 			pci_dev_put(temp);
 			pci_stop_and_remove_bus_device(temp);
@@ -319,6 +326,7 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
 	int cloop = 0;
 	int stop_it;
 	int index;
+	u16 devfn;
 
 	/* Decide which slots are supported */
 
@@ -416,7 +424,9 @@ int cpqhp_save_config(struct controller *ctrl, int busnumber, int is_hot_plug)
 			new_slot->switch_save = 0x10;
 			/* In case of unsupported board */
 			new_slot->status = DevError;
-			new_slot->pci_dev = pci_get_bus_and_slot(new_slot->bus, (new_slot->device << 3) | new_slot->function);
+			devfn = (new_slot->device << 3) | new_slot->function;
+			new_slot->pci_dev = pci_get_domain_bus_and_slot(0,
+							new_slot->bus, devfn);
 
 			for (cloop = 0; cloop < 0x20; cloop++) {
 				rc = pci_bus_read_config_dword(ctrl->pci_bus, PCI_DEVFN(device, function), cloop << 2, (u32 *) &(new_slot->config_space[cloop]));
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 17/29] PCI: ibmphp: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, Arvind Yadav, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain parameter as 0 since the code doesn't seem to be
ready for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/hotplug/ibmphp_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index 73cf846..92dd882 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -707,7 +707,8 @@ static void ibm_unconfigure_device(struct pci_func *func)
 	pci_lock_rescan_remove();
 
 	for (j = 0; j < 0x08; j++) {
-		temp = pci_get_bus_and_slot(func->busno, (func->device << 3) | j);
+		temp = pci_get_domain_bus_and_slot(0, func->busno,
+						   (func->device << 3) | j);
 		if (temp) {
 			pci_stop_and_remove_bus_device(temp);
 			pci_dev_put(temp);
@@ -780,7 +781,7 @@ static int ibm_configure_device(struct pci_func *func)
 	if (!(bus_structure_fixup(func->busno)))
 		flag = 1;
 	if (func->dev == NULL)
-		func->dev = pci_get_bus_and_slot(func->busno,
+		func->dev = pci_get_domain_bus_and_slot(0, func->busno,
 				PCI_DEVFN(func->device, func->function));
 
 	if (func->dev == NULL) {
@@ -793,7 +794,7 @@ static int ibm_configure_device(struct pci_func *func)
 		if (num)
 			pci_bus_add_devices(bus);
 
-		func->dev = pci_get_bus_and_slot(func->busno,
+		func->dev = pci_get_domain_bus_and_slot(0, func->busno,
 				PCI_DEVFN(func->device, func->function));
 		if (func->dev == NULL) {
 			err("ERROR... : pci_dev still NULL\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 17/29] PCI: ibmphp: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, Arvind Yadav, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain parameter as 0 since the code doesn't seem to be
ready for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/hotplug/ibmphp_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index 73cf846..92dd882 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -707,7 +707,8 @@ static void ibm_unconfigure_device(struct pci_func *func)
 	pci_lock_rescan_remove();
 
 	for (j = 0; j < 0x08; j++) {
-		temp = pci_get_bus_and_slot(func->busno, (func->device << 3) | j);
+		temp = pci_get_domain_bus_and_slot(0, func->busno,
+						   (func->device << 3) | j);
 		if (temp) {
 			pci_stop_and_remove_bus_device(temp);
 			pci_dev_put(temp);
@@ -780,7 +781,7 @@ static int ibm_configure_device(struct pci_func *func)
 	if (!(bus_structure_fixup(func->busno)))
 		flag = 1;
 	if (func->dev == NULL)
-		func->dev = pci_get_bus_and_slot(func->busno,
+		func->dev = pci_get_domain_bus_and_slot(0, func->busno,
 				PCI_DEVFN(func->device, func->function));
 
 	if (func->dev == NULL) {
@@ -793,7 +794,7 @@ static int ibm_configure_device(struct pci_func *func)
 		if (num)
 			pci_bus_add_devices(bus);
 
-		func->dev = pci_get_bus_and_slot(func->busno,
+		func->dev = pci_get_domain_bus_and_slot(0, func->busno,
 				PCI_DEVFN(func->device, func->function));
 		if (func->dev == NULL) {
 			err("ERROR... : pci_dev still NULL\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 17/29] PCI: ibmphp: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain parameter as 0 since the code doesn't seem to be
ready for multiple domains.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/hotplug/ibmphp_core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c
index 73cf846..92dd882 100644
--- a/drivers/pci/hotplug/ibmphp_core.c
+++ b/drivers/pci/hotplug/ibmphp_core.c
@@ -707,7 +707,8 @@ static void ibm_unconfigure_device(struct pci_func *func)
 	pci_lock_rescan_remove();
 
 	for (j = 0; j < 0x08; j++) {
-		temp = pci_get_bus_and_slot(func->busno, (func->device << 3) | j);
+		temp = pci_get_domain_bus_and_slot(0, func->busno,
+						   (func->device << 3) | j);
 		if (temp) {
 			pci_stop_and_remove_bus_device(temp);
 			pci_dev_put(temp);
@@ -780,7 +781,7 @@ static int ibm_configure_device(struct pci_func *func)
 	if (!(bus_structure_fixup(func->busno)))
 		flag = 1;
 	if (func->dev == NULL)
-		func->dev = pci_get_bus_and_slot(func->busno,
+		func->dev = pci_get_domain_bus_and_slot(0, func->busno,
 				PCI_DEVFN(func->device, func->function));
 
 	if (func->dev == NULL) {
@@ -793,7 +794,7 @@ static int ibm_configure_device(struct pci_func *func)
 		if (num)
 			pci_bus_add_devices(bus);
 
-		func->dev = pci_get_bus_and_slot(func->busno,
+		func->dev = pci_get_domain_bus_and_slot(0, func->busno,
 				PCI_DEVFN(func->device, func->function));
 		if (func->dev == NULL) {
 			err("ERROR... : pci_dev still NULL\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 18/29] PCI/quirks: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Bjorn Helgaas, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/quirks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 911b3b6..4c46cc5 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2699,7 +2699,8 @@ static void __nv_msi_ht_cap_quirk(struct pci_dev *dev, int all)
 	 * HT MSI mapping should be disabled on devices that are below
 	 * a non-Hypertransport host bridge. Locate the host bridge...
 	 */
-	host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	host_bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), 0,
+						  PCI_DEVFN(0, 0));
 	if (host_bridge == NULL) {
 		dev_warn(&dev->dev, "nv_msi_ht_cap_quirk didn't locate host bridge\n");
 		return;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 18/29] PCI/quirks: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/quirks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 911b3b6..4c46cc5 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2699,7 +2699,8 @@ static void __nv_msi_ht_cap_quirk(struct pci_dev *dev, int all)
 	 * HT MSI mapping should be disabled on devices that are below
 	 * a non-Hypertransport host bridge. Locate the host bridge...
 	 */
-	host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	host_bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), 0,
+						  PCI_DEVFN(0, 0));
 	if (host_bridge == NULL) {
 		dev_warn(&dev->dev, "nv_msi_ht_cap_quirk didn't locate host bridge\n");
 		return;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 18/29] PCI/quirks: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Sinan Kaya, Bjorn Helgaas,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/quirks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 911b3b6..4c46cc5 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2699,7 +2699,8 @@ static void __nv_msi_ht_cap_quirk(struct pci_dev *dev, int all)
 	 * HT MSI mapping should be disabled on devices that are below
 	 * a non-Hypertransport host bridge. Locate the host bridge...
 	 */
-	host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	host_bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), 0,
+						  PCI_DEVFN(0, 0));
 	if (host_bridge == NULL) {
 		dev_warn(&dev->dev, "nv_msi_ht_cap_quirk didn't locate host bridge\n");
 		return;
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 18/29] PCI/quirks: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Extract the domain number from pdev while calling into
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/quirks.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
index 911b3b6..4c46cc5 100644
--- a/drivers/pci/quirks.c
+++ b/drivers/pci/quirks.c
@@ -2699,7 +2699,8 @@ static void __nv_msi_ht_cap_quirk(struct pci_dev *dev, int all)
 	 * HT MSI mapping should be disabled on devices that are below
 	 * a non-Hypertransport host bridge. Locate the host bridge...
 	 */
-	host_bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	host_bridge = pci_get_domain_bus_and_slot(pci_domain_nr(dev->bus), 0,
+						  PCI_DEVFN(0, 0));
 	if (host_bridge == NULL) {
 		dev_warn(&dev->dev, "nv_msi_ht_cap_quirk didn't locate host bridge\n");
 		return;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 19/29] PCI/syscall: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Bjorn Helgaas, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain value as 0 because the domain information is not
coming from the userspace.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 83efa00..e725f99 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -28,7 +28,7 @@
 		return -EPERM;
 
 	err = -ENODEV;
-	dev = pci_get_bus_and_slot(bus, dfn);
+	dev = pci_get_domain_bus_and_slot(0, bus, dfn);
 	if (!dev)
 		goto error;
 
@@ -96,7 +96,7 @@
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	dev = pci_get_bus_and_slot(bus, dfn);
+	dev = pci_get_domain_bus_and_slot(0, bus, dfn);
 	if (!dev)
 		return -ENODEV;
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 19/29] PCI/syscall: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, 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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain value as 0 because the domain information is not
coming from the userspace.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 83efa00..e725f99 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -28,7 +28,7 @@
 		return -EPERM;
 
 	err = -ENODEV;
-	dev = pci_get_bus_and_slot(bus, dfn);
+	dev = pci_get_domain_bus_and_slot(0, bus, dfn);
 	if (!dev)
 		goto error;
 
@@ -96,7 +96,7 @@
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	dev = pci_get_bus_and_slot(bus, dfn);
+	dev = pci_get_domain_bus_and_slot(0, bus, dfn);
 	if (!dev)
 		return -ENODEV;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 19/29] PCI/syscall: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain value as 0 because the domain information is not
coming from the userspace.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/syscall.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 83efa00..e725f99 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -28,7 +28,7 @@
 		return -EPERM;
 
 	err = -ENODEV;
-	dev = pci_get_bus_and_slot(bus, dfn);
+	dev = pci_get_domain_bus_and_slot(0, bus, dfn);
 	if (!dev)
 		goto error;
 
@@ -96,7 +96,7 @@
 	if (!capable(CAP_SYS_ADMIN))
 		return -EPERM;
 
-	dev = pci_get_bus_and_slot(bus, dfn);
+	dev = pci_get_domain_bus_and_slot(0, bus, dfn);
 	if (!dev)
 		return -ENODEV;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 20/29] xen: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: Juergen Gross, Konrad Rzeszutek Wilk, linux-arm-msm, intel-gfx,
	open list, Bjorn Helgaas, moderated list:XEN PCI SUBSYSTEM,
	Boris Ostrovsky, linux-arm-kernel

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.

Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/xen-pcifront.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 8fc2e95..94b25b5 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -595,6 +595,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 	struct pci_driver *pdrv;
 	int bus = pdev->sh_info->aer_op.bus;
 	int devfn = pdev->sh_info->aer_op.devfn;
+	int domain = pdev->sh_info->aer_op.domain;
 	struct pci_dev *pcidev;
 	int flag = 0;
 
@@ -603,7 +604,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 		cmd, bus, devfn);
 	result = PCI_ERS_RESULT_NONE;
 
-	pcidev = pci_get_bus_and_slot(bus, devfn);
+	pcidev = pci_get_domain_bus_and_slot(domain, bus, devfn);
 	if (!pcidev || !pcidev->driver) {
 		dev_err(&pdev->xdev->dev, "device or AER driver is NULL\n");
 		pci_dev_put(pcidev);
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 20/29] xen: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Konrad Rzeszutek Wilk, Boris Ostrovsky, Juergen Gross,
	Bjorn Helgaas, moderated list:XEN PCI SUBSYSTEM, 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.

Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/xen-pcifront.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 8fc2e95..94b25b5 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -595,6 +595,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 	struct pci_driver *pdrv;
 	int bus = pdev->sh_info->aer_op.bus;
 	int devfn = pdev->sh_info->aer_op.devfn;
+	int domain = pdev->sh_info->aer_op.domain;
 	struct pci_dev *pcidev;
 	int flag = 0;
 
@@ -603,7 +604,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 		cmd, bus, devfn);
 	result = PCI_ERS_RESULT_NONE;
 
-	pcidev = pci_get_bus_and_slot(bus, devfn);
+	pcidev = pci_get_domain_bus_and_slot(domain, bus, devfn);
 	if (!pcidev || !pcidev->driver) {
 		dev_err(&pdev->xdev->dev, "device or AER driver is NULL\n");
 		pci_dev_put(pcidev);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 20/29] xen: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/xen-pcifront.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 8fc2e95..94b25b5 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -595,6 +595,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 	struct pci_driver *pdrv;
 	int bus = pdev->sh_info->aer_op.bus;
 	int devfn = pdev->sh_info->aer_op.devfn;
+	int domain = pdev->sh_info->aer_op.domain;
 	struct pci_dev *pcidev;
 	int flag = 0;
 
@@ -603,7 +604,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 		cmd, bus, devfn);
 	result = PCI_ERS_RESULT_NONE;
 
-	pcidev = pci_get_bus_and_slot(bus, devfn);
+	pcidev = pci_get_domain_bus_and_slot(domain, bus, devfn);
 	if (!pcidev || !pcidev->driver) {
 		dev_err(&pdev->xdev->dev, "device or AER driver is NULL\n");
 		pci_dev_put(pcidev);
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 20/29] xen: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
                   ` (20 preceding siblings ...)
  (?)
@ 2017-11-27 16:57 ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: Juergen Gross, Konrad Rzeszutek Wilk, linux-arm-msm, intel-gfx,
	open list, Sinan Kaya, Bjorn Helgaas,
	moderated list:XEN PCI SUBSYSTEM, Boris Ostrovsky,
	linux-arm-kernel

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.

Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/pci/xen-pcifront.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/xen-pcifront.c b/drivers/pci/xen-pcifront.c
index 8fc2e95..94b25b5 100644
--- a/drivers/pci/xen-pcifront.c
+++ b/drivers/pci/xen-pcifront.c
@@ -595,6 +595,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 	struct pci_driver *pdrv;
 	int bus = pdev->sh_info->aer_op.bus;
 	int devfn = pdev->sh_info->aer_op.devfn;
+	int domain = pdev->sh_info->aer_op.domain;
 	struct pci_dev *pcidev;
 	int flag = 0;
 
@@ -603,7 +604,7 @@ static pci_ers_result_t pcifront_common_process(int cmd,
 		cmd, bus, devfn);
 	result = PCI_ERS_RESULT_NONE;
 
-	pcidev = pci_get_bus_and_slot(bus, devfn);
+	pcidev = pci_get_domain_bus_and_slot(domain, bus, devfn);
 	if (!pcidev || !pcidev->driver) {
 		dev_err(&pdev->xdev->dev, "device or AER driver is NULL\n");
 		pci_dev_put(pcidev);
-- 
1.9.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 21/29] openprom: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
                     ` (2 preceding siblings ...)
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list,
	open list:SPARC + UltraSPARC sparc/sparc64, David S. Miller,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0 since domain information is not available.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/sbus/char/openprom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 2c2e6a3..7b31f19 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -251,8 +251,9 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp
 		struct pci_dev *pdev;
 		struct device_node *dp;
 
-		pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
-				      ((int *) op->oprom_array)[1]);
+		pdev = pci_get_domain_bus_and_slot(0,
+						((int *) op->oprom_array)[0],
+						((int *) op->oprom_array)[1]);
 
 		dp = pci_device_to_OF_node(pdev);
 		data->current_node = dp;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 21/29] openprom: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	David S. Miller, open list:SPARC + UltraSPARC (sparc/sparc64),
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0 since domain information is not available.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/sbus/char/openprom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 2c2e6a3..7b31f19 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -251,8 +251,9 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp
 		struct pci_dev *pdev;
 		struct device_node *dp;
 
-		pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
-				      ((int *) op->oprom_array)[1]);
+		pdev = pci_get_domain_bus_and_slot(0,
+						((int *) op->oprom_array)[0],
+						((int *) op->oprom_array)[1]);
 
 		dp = pci_device_to_OF_node(pdev);
 		data->current_node = dp;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 21/29] openprom: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Sinan Kaya,
	open list:SPARC + UltraSPARC sparc/sparc64, David S. Miller,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0 since domain information is not available.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/sbus/char/openprom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 2c2e6a3..7b31f19 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -251,8 +251,9 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp
 		struct pci_dev *pdev;
 		struct device_node *dp;
 
-		pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
-				      ((int *) op->oprom_array)[1]);
+		pdev = pci_get_domain_bus_and_slot(0,
+						((int *) op->oprom_array)[0],
+						((int *) op->oprom_array)[1]);
 
 		dp = pci_device_to_OF_node(pdev);
 		data->current_node = dp;
-- 
1.9.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 21/29] openprom: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list,
	open list:SPARC + UltraSPARC sparc/sparc64, David S. Miller,
	linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0 since domain information is not available.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/sbus/char/openprom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 2c2e6a3..7b31f19 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -251,8 +251,9 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp
 		struct pci_dev *pdev;
 		struct device_node *dp;
 
-		pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
-				      ((int *) op->oprom_array)[1]);
+		pdev = pci_get_domain_bus_and_slot(0,
+						((int *) op->oprom_array)[0],
+						((int *) op->oprom_array)[1]);
 
 		dp = pci_device_to_OF_node(pdev);
 		data->current_node = dp;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 21/29] openprom: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0 since domain information is not available.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/sbus/char/openprom.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index 2c2e6a3..7b31f19 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -251,8 +251,9 @@ static int oprompci2node(void __user *argp, struct device_node *dp, struct openp
 		struct pci_dev *pdev;
 		struct device_node *dp;
 
-		pdev = pci_get_bus_and_slot (((int *) op->oprom_array)[0],
-				      ((int *) op->oprom_array)[1]);
+		pdev = pci_get_domain_bus_and_slot(0,
+						((int *) op->oprom_array)[0],
+						((int *) op->oprom_array)[1]);
 
 		dp = pci_device_to_OF_node(pdev);
 		data->current_node = dp;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:57   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Alan Cox,
	Hans Verkuil, kbuild test robot, Dan Carpenter, Arnd Bergmann,
	Arushi Singhal, Avraham Shukron, Philippe Ombredanne,
	Valentin Vidic, open list:MEDIA INPUT INFRASTRUCTURE V4L/DVB,
	open list:STAGING SUBSYSTEM, linux-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function. Since ISP always
uses domain 0, hard-code it in the code when calling the replacement
function pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c               | 2 +-
 drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
index 663aa91..95b9c7a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -1233,7 +1233,7 @@ static int atomisp_pci_probe(struct pci_dev *dev,
 	isp->pdev = dev;
 	isp->dev = &dev->dev;
 	isp->sw_contex.power_state = ATOM_ISP_POWER_UP;
-	isp->pci_root = pci_get_bus_and_slot(0, 0);
+	isp->pci_root = pci_get_domain_bus_and_slot(0, 0, 0);
 	if (!isp->pci_root) {
 		dev_err(&dev->dev, "Unable to find PCI host\n");
 		return -ENODEV;
diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
index 4631b1d..51dcef57 100644
--- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
+++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
@@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
 
 static int intel_mid_msgbus_init(void)
 {
-	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!pci_root) {
 		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
 		return -ENODEV;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Alan Cox,
	Hans Verkuil, kbuild test robot, Dan Carpenter, Arnd Bergmann,
	Arushi Singhal, Avraham Shukron, Philippe Ombredanne,
	Valentin Vidic, open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
	open list:STAGING SUBSYSTEM, 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.

Getting ready to remove pci_get_bus_and_slot() function. Since ISP always
uses domain 0, hard-code it in the code when calling the replacement
function pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c               | 2 +-
 drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
index 663aa91..95b9c7a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -1233,7 +1233,7 @@ static int atomisp_pci_probe(struct pci_dev *dev,
 	isp->pdev = dev;
 	isp->dev = &dev->dev;
 	isp->sw_contex.power_state = ATOM_ISP_POWER_UP;
-	isp->pci_root = pci_get_bus_and_slot(0, 0);
+	isp->pci_root = pci_get_domain_bus_and_slot(0, 0, 0);
 	if (!isp->pci_root) {
 		dev_err(&dev->dev, "Unable to find PCI host\n");
 		return -ENODEV;
diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
index 4631b1d..51dcef57 100644
--- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
+++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
@@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
 
 static int intel_mid_msgbus_init(void)
 {
-	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!pci_root) {
 		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
 		return -ENODEV;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:57   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:57 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function. Since ISP always
uses domain 0, hard-code it in the code when calling the replacement
function pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c               | 2 +-
 drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
index 663aa91..95b9c7a 100644
--- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
+++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_v4l2.c
@@ -1233,7 +1233,7 @@ static int atomisp_pci_probe(struct pci_dev *dev,
 	isp->pdev = dev;
 	isp->dev = &dev->dev;
 	isp->sw_contex.power_state = ATOM_ISP_POWER_UP;
-	isp->pci_root = pci_get_bus_and_slot(0, 0);
+	isp->pci_root = pci_get_domain_bus_and_slot(0, 0, 0);
 	if (!isp->pci_root) {
 		dev_err(&dev->dev, "Unable to find PCI host\n");
 		return -ENODEV;
diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
index 4631b1d..51dcef57 100644
--- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
+++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
@@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
 
 static int intel_mid_msgbus_init(void)
 {
-	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
+	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
 	if (!pci_root) {
 		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
 		return -ENODEV;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 23/29] staging: rts5208: remove rtsx_read_pci_cfg_byte()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:58   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: open list:STAGING SUBSYSTEM, Greg Kroah-Hartman, linux-arm-msm,
	intel-gfx, Gaurav Pathak, open list, Hannes Reinecke,
	Johannes Thumshirn, Colin Ian King, linux-arm-kernel

Remove unused rtsx_read_pci_cfg_byte() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/staging/rts5208/rtsx.c | 17 -----------------
 drivers/staging/rts5208/rtsx.h |  2 --
 2 files changed, 19 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index 89e2cfe..70e0b86 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -275,23 +275,6 @@ static int rtsx_acquire_irq(struct rtsx_dev *dev)
 	return 0;
 }
 
-int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val)
-{
-	struct pci_dev *pdev;
-	u8 data;
-	u8 devfn = (dev << 3) | func;
-
-	pdev = pci_get_bus_and_slot(bus, devfn);
-	if (!pdev)
-		return -1;
-
-	pci_read_config_byte(pdev, offset, &data);
-	if (val)
-		*val = data;
-
-	return 0;
-}
-
 #ifdef CONFIG_PM
 /*
  * power management
diff --git a/drivers/staging/rts5208/rtsx.h b/drivers/staging/rts5208/rtsx.h
index 575e573..62e467c 100644
--- a/drivers/staging/rts5208/rtsx.h
+++ b/drivers/staging/rts5208/rtsx.h
@@ -174,8 +174,6 @@ static inline void get_current_time(u8 *timeval_buf, int buf_len)
 /* struct scsi_cmnd transfer buffer access utilities */
 enum xfer_buf_dir	{TO_XFER_BUF, FROM_XFER_BUF};
 
-int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val);
-
 #define _MSG_TRACE
 
 #include "trace.h"
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 23/29] staging: rts5208: remove rtsx_read_pci_cfg_byte()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Greg Kroah-Hartman, Johannes Thumshirn, Hannes Reinecke,
	Colin Ian King, Gaurav Pathak, open list:STAGING SUBSYSTEM,
	open list

Remove unused rtsx_read_pci_cfg_byte() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/staging/rts5208/rtsx.c | 17 -----------------
 drivers/staging/rts5208/rtsx.h |  2 --
 2 files changed, 19 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index 89e2cfe..70e0b86 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -275,23 +275,6 @@ static int rtsx_acquire_irq(struct rtsx_dev *dev)
 	return 0;
 }
 
-int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val)
-{
-	struct pci_dev *pdev;
-	u8 data;
-	u8 devfn = (dev << 3) | func;
-
-	pdev = pci_get_bus_and_slot(bus, devfn);
-	if (!pdev)
-		return -1;
-
-	pci_read_config_byte(pdev, offset, &data);
-	if (val)
-		*val = data;
-
-	return 0;
-}
-
 #ifdef CONFIG_PM
 /*
  * power management
diff --git a/drivers/staging/rts5208/rtsx.h b/drivers/staging/rts5208/rtsx.h
index 575e573..62e467c 100644
--- a/drivers/staging/rts5208/rtsx.h
+++ b/drivers/staging/rts5208/rtsx.h
@@ -174,8 +174,6 @@ static inline void get_current_time(u8 *timeval_buf, int buf_len)
 /* struct scsi_cmnd transfer buffer access utilities */
 enum xfer_buf_dir	{TO_XFER_BUF, FROM_XFER_BUF};
 
-int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val);
-
 #define _MSG_TRACE
 
 #include "trace.h"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 23/29] staging: rts5208: remove rtsx_read_pci_cfg_byte()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

Remove unused rtsx_read_pci_cfg_byte() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/staging/rts5208/rtsx.c | 17 -----------------
 drivers/staging/rts5208/rtsx.h |  2 --
 2 files changed, 19 deletions(-)

diff --git a/drivers/staging/rts5208/rtsx.c b/drivers/staging/rts5208/rtsx.c
index 89e2cfe..70e0b86 100644
--- a/drivers/staging/rts5208/rtsx.c
+++ b/drivers/staging/rts5208/rtsx.c
@@ -275,23 +275,6 @@ static int rtsx_acquire_irq(struct rtsx_dev *dev)
 	return 0;
 }
 
-int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val)
-{
-	struct pci_dev *pdev;
-	u8 data;
-	u8 devfn = (dev << 3) | func;
-
-	pdev = pci_get_bus_and_slot(bus, devfn);
-	if (!pdev)
-		return -1;
-
-	pci_read_config_byte(pdev, offset, &data);
-	if (val)
-		*val = data;
-
-	return 0;
-}
-
 #ifdef CONFIG_PM
 /*
  * power management
diff --git a/drivers/staging/rts5208/rtsx.h b/drivers/staging/rts5208/rtsx.h
index 575e573..62e467c 100644
--- a/drivers/staging/rts5208/rtsx.h
+++ b/drivers/staging/rts5208/rtsx.h
@@ -174,8 +174,6 @@ static inline void get_current_time(u8 *timeval_buf, int buf_len)
 /* struct scsi_cmnd transfer buffer access utilities */
 enum xfer_buf_dir	{TO_XFER_BUF, FROM_XFER_BUF};
 
-int rtsx_read_pci_cfg_byte(u8 bus, u8 dev, u8 func, u8 offset, u8 *val);
-
 #define _MSG_TRACE
 
 #include "trace.h"
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:58   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Lee Jones, Daniel Thompson, Jingoo Han,
	Bartlomiej Zolnierkiewicz, open list:FRAMEBUFFER LAYER,
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0.

Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/backlight/apple_bl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c
index d843296..6a34ab9 100644
--- a/drivers/video/backlight/apple_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
 	struct pci_dev *host;
 	int intensity;
 
-	host = pci_get_bus_and_slot(0, 0);
+	host = pci_get_domain_bus_and_slot(0, 0, 0);
 
 	if (!host) {
 		pr_err("unable to find PCI host\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Lee Jones, Daniel Thompson, Jingoo Han,
	Bartlomiej Zolnierkiewicz, open list:FRAMEBUFFER LAYER,
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0.

Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/backlight/apple_bl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c
index d843296..6a34ab9 100644
--- a/drivers/video/backlight/apple_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
 	struct pci_dev *host;
 	int intensity;
 
-	host = pci_get_bus_and_slot(0, 0);
+	host = pci_get_domain_bus_and_slot(0, 0, 0);
 
 	if (!host) {
 		pr_err("unable to find PCI host\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Lee Jones, Daniel Thompson, Jingoo Han,
	Bartlomiej Zolnierkiewicz, open list:FRAMEBUFFER LAYER,
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0.

Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/backlight/apple_bl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c
index d843296..6a34ab9 100644
--- a/drivers/video/backlight/apple_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
 	struct pci_dev *host;
 	int intensity;
 
-	host = pci_get_bus_and_slot(0, 0);
+	host = pci_get_domain_bus_and_slot(0, 0, 0);
 
 	if (!host) {
 		pr_err("unable to find PCI host\n");
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Hard-coding the domain as 0.

Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/backlight/apple_bl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/backlight/apple_bl.c b/drivers/video/backlight/apple_bl.c
index d843296..6a34ab9 100644
--- a/drivers/video/backlight/apple_bl.c
+++ b/drivers/video/backlight/apple_bl.c
@@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
 	struct pci_dev *host;
 	int intensity;
 
-	host = pci_get_bus_and_slot(0, 0);
+	host = pci_get_domain_bus_and_slot(0, 0, 0);
 
 	if (!host) {
 		pr_err("unable to find PCI host\n");
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 25/29] video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:58   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: open list:INTEL FRAMEBUFFER DRIVER excluding 810 and 815,
	Bartlomiej Zolnierkiewicz, linux-arm-msm, intel-gfx,
	Maik Broemme, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Find the domain number from pdev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/intelfb/intelfbhw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
index d31ed4e..f695867 100644
--- a/drivers/video/fbdev/intelfb/intelfbhw.c
+++ b/drivers/video/fbdev/intelfb/intelfbhw.c
@@ -181,7 +181,9 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
 		return 1;
 
 	/* Find the bridge device.  It is always 0:0.0 */
-	if (!(bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)))) {
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+						 PCI_DEVFN(0, 0));
+	if (!bridge_dev) {
 		ERR_MSG("cannot find bridge device\n");
 		return 1;
 	}
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 25/29] video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Maik Broemme, Bartlomiej Zolnierkiewicz,
	open list:INTEL FRAMEBUFFER DRIVER (excluding 810 and 815),
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Find the domain number from pdev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/intelfb/intelfbhw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
index d31ed4e..f695867 100644
--- a/drivers/video/fbdev/intelfb/intelfbhw.c
+++ b/drivers/video/fbdev/intelfb/intelfbhw.c
@@ -181,7 +181,9 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
 		return 1;
 
 	/* Find the bridge device.  It is always 0:0.0 */
-	if (!(bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)))) {
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+						 PCI_DEVFN(0, 0));
+	if (!bridge_dev) {
 		ERR_MSG("cannot find bridge device\n");
 		return 1;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 25/29] video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: open list:INTEL FRAMEBUFFER DRIVER excluding 810 and 815,
	Bartlomiej Zolnierkiewicz, linux-arm-msm, intel-gfx,
	Maik Broemme, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Find the domain number from pdev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/intelfb/intelfbhw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
index d31ed4e..f695867 100644
--- a/drivers/video/fbdev/intelfb/intelfbhw.c
+++ b/drivers/video/fbdev/intelfb/intelfbhw.c
@@ -181,7 +181,9 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
 		return 1;
 
 	/* Find the bridge device.  It is always 0:0.0 */
-	if (!(bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)))) {
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+						 PCI_DEVFN(0, 0));
+	if (!bridge_dev) {
 		ERR_MSG("cannot find bridge device\n");
 		return 1;
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 25/29] video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Find the domain number from pdev.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/intelfb/intelfbhw.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/intelfb/intelfbhw.c b/drivers/video/fbdev/intelfb/intelfbhw.c
index d31ed4e..f695867 100644
--- a/drivers/video/fbdev/intelfb/intelfbhw.c
+++ b/drivers/video/fbdev/intelfb/intelfbhw.c
@@ -181,7 +181,9 @@ int intelfbhw_get_memory(struct pci_dev *pdev, int *aperture_size,
 		return 1;
 
 	/* Find the bridge device.  It is always 0:0.0 */
-	if (!(bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0)))) {
+	bridge_dev = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus), 0,
+						 PCI_DEVFN(0, 0));
+	if (!bridge_dev) {
 		ERR_MSG("cannot find bridge device\n");
 		return 1;
 	}
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 26/29] video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:58   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: open list:NVIDIA rivafb and nvidiafb FRAMEBUFFER DRIVER,
	Antonino Daplas, Bartlomiej Zolnierkiewicz, linux-arm-msm,
	intel-gfx, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct nvidia_par has a pointer to struct pci_dev. Use the pci_dev
member to extract the domain information and pass it to
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/nvidia/nv_hw.c    | 11 ++++++-----
 drivers/video/fbdev/nvidia/nv_setup.c |  3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/nv_hw.c b/drivers/video/fbdev/nvidia/nv_hw.c
index 81c80ac..8335da4 100644
--- a/drivers/video/fbdev/nvidia/nv_hw.c
+++ b/drivers/video/fbdev/nvidia/nv_hw.c
@@ -683,10 +683,11 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	nv10_sim_state sim_data;
 	unsigned int M, N, P, pll, MClk, NVClk, memctrl;
 	struct pci_dev *dev;
+	int domain = pci_domain_nr(par->pci_dev->bus);
 
 	if ((par->Chipset & 0x0FF0) == 0x01A0) {
 		unsigned int uMClkPostDiv;
-		dev = pci_get_bus_and_slot(0, 3);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 		pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
 		uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
 
@@ -694,7 +695,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 			uMClkPostDiv = 4;
 		MClk = 400000 / uMClkPostDiv;
 	} else {
-		dev = pci_get_bus_and_slot(0, 5);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 5);
 		pci_read_config_dword(dev, 0x4c, &MClk);
 		MClk /= 1000;
 	}
@@ -707,13 +708,13 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	sim_data.pix_bpp = (char)pixelDepth;
 	sim_data.enable_video = 0;
 	sim_data.enable_mp = 0;
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 	pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
 	pci_dev_put(dev);
 	sim_data.memory_type = (sim_data.memory_type >> 12) & 1;
 	sim_data.memory_width = 64;
 
-	dev = pci_get_bus_and_slot(0, 3);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 	pci_read_config_dword(dev, 0, &memctrl);
 	pci_dev_put(dev);
 	memctrl >>= 16;
@@ -721,7 +722,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	if ((memctrl == 0x1A9) || (memctrl == 0x1AB) || (memctrl == 0x1ED)) {
 		u32 dimm[3];
 
-		dev = pci_get_bus_and_slot(0, 2);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 2);
 		pci_read_config_dword(dev, 0x40, &dimm[0]);
 		dimm[0] = (dimm[0] >> 8) & 0x4f;
 		pci_read_config_dword(dev, 0x44, &dimm[1]);
diff --git a/drivers/video/fbdev/nvidia/nv_setup.c b/drivers/video/fbdev/nvidia/nv_setup.c
index 2f2e162..b17acd2 100644
--- a/drivers/video/fbdev/nvidia/nv_setup.c
+++ b/drivers/video/fbdev/nvidia/nv_setup.c
@@ -264,7 +264,8 @@ static void nv10GetConfig(struct nvidia_par *par)
 	}
 #endif
 
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(pci_domain_nr(par->pci_dev->bus),
+					  0, 1);
 	if ((par->Chipset & 0xffff) == 0x01a0) {
 		u32 amt;
 
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 26/29] video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Antonino Daplas, Bartlomiej Zolnierkiewicz,
	open list:NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER,
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct nvidia_par has a pointer to struct pci_dev. Use the pci_dev
member to extract the domain information and pass it to
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/nvidia/nv_hw.c    | 11 ++++++-----
 drivers/video/fbdev/nvidia/nv_setup.c |  3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/nv_hw.c b/drivers/video/fbdev/nvidia/nv_hw.c
index 81c80ac..8335da4 100644
--- a/drivers/video/fbdev/nvidia/nv_hw.c
+++ b/drivers/video/fbdev/nvidia/nv_hw.c
@@ -683,10 +683,11 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	nv10_sim_state sim_data;
 	unsigned int M, N, P, pll, MClk, NVClk, memctrl;
 	struct pci_dev *dev;
+	int domain = pci_domain_nr(par->pci_dev->bus);
 
 	if ((par->Chipset & 0x0FF0) == 0x01A0) {
 		unsigned int uMClkPostDiv;
-		dev = pci_get_bus_and_slot(0, 3);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 		pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
 		uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
 
@@ -694,7 +695,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 			uMClkPostDiv = 4;
 		MClk = 400000 / uMClkPostDiv;
 	} else {
-		dev = pci_get_bus_and_slot(0, 5);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 5);
 		pci_read_config_dword(dev, 0x4c, &MClk);
 		MClk /= 1000;
 	}
@@ -707,13 +708,13 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	sim_data.pix_bpp = (char)pixelDepth;
 	sim_data.enable_video = 0;
 	sim_data.enable_mp = 0;
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 	pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
 	pci_dev_put(dev);
 	sim_data.memory_type = (sim_data.memory_type >> 12) & 1;
 	sim_data.memory_width = 64;
 
-	dev = pci_get_bus_and_slot(0, 3);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 	pci_read_config_dword(dev, 0, &memctrl);
 	pci_dev_put(dev);
 	memctrl >>= 16;
@@ -721,7 +722,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	if ((memctrl == 0x1A9) || (memctrl == 0x1AB) || (memctrl == 0x1ED)) {
 		u32 dimm[3];
 
-		dev = pci_get_bus_and_slot(0, 2);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 2);
 		pci_read_config_dword(dev, 0x40, &dimm[0]);
 		dimm[0] = (dimm[0] >> 8) & 0x4f;
 		pci_read_config_dword(dev, 0x44, &dimm[1]);
diff --git a/drivers/video/fbdev/nvidia/nv_setup.c b/drivers/video/fbdev/nvidia/nv_setup.c
index 2f2e162..b17acd2 100644
--- a/drivers/video/fbdev/nvidia/nv_setup.c
+++ b/drivers/video/fbdev/nvidia/nv_setup.c
@@ -264,7 +264,8 @@ static void nv10GetConfig(struct nvidia_par *par)
 	}
 #endif
 
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(pci_domain_nr(par->pci_dev->bus),
+					  0, 1);
 	if ((par->Chipset & 0xffff) == 0x01a0) {
 		u32 amt;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 26/29] video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: open list:NVIDIA rivafb and nvidiafb FRAMEBUFFER DRIVER,
	Antonino Daplas, Bartlomiej Zolnierkiewicz, linux-arm-msm,
	intel-gfx, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct nvidia_par has a pointer to struct pci_dev. Use the pci_dev
member to extract the domain information and pass it to
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/nvidia/nv_hw.c    | 11 ++++++-----
 drivers/video/fbdev/nvidia/nv_setup.c |  3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/nv_hw.c b/drivers/video/fbdev/nvidia/nv_hw.c
index 81c80ac..8335da4 100644
--- a/drivers/video/fbdev/nvidia/nv_hw.c
+++ b/drivers/video/fbdev/nvidia/nv_hw.c
@@ -683,10 +683,11 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	nv10_sim_state sim_data;
 	unsigned int M, N, P, pll, MClk, NVClk, memctrl;
 	struct pci_dev *dev;
+	int domain = pci_domain_nr(par->pci_dev->bus);
 
 	if ((par->Chipset & 0x0FF0) = 0x01A0) {
 		unsigned int uMClkPostDiv;
-		dev = pci_get_bus_and_slot(0, 3);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 		pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
 		uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
 
@@ -694,7 +695,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 			uMClkPostDiv = 4;
 		MClk = 400000 / uMClkPostDiv;
 	} else {
-		dev = pci_get_bus_and_slot(0, 5);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 5);
 		pci_read_config_dword(dev, 0x4c, &MClk);
 		MClk /= 1000;
 	}
@@ -707,13 +708,13 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	sim_data.pix_bpp = (char)pixelDepth;
 	sim_data.enable_video = 0;
 	sim_data.enable_mp = 0;
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 	pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
 	pci_dev_put(dev);
 	sim_data.memory_type = (sim_data.memory_type >> 12) & 1;
 	sim_data.memory_width = 64;
 
-	dev = pci_get_bus_and_slot(0, 3);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 	pci_read_config_dword(dev, 0, &memctrl);
 	pci_dev_put(dev);
 	memctrl >>= 16;
@@ -721,7 +722,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	if ((memctrl = 0x1A9) || (memctrl = 0x1AB) || (memctrl = 0x1ED)) {
 		u32 dimm[3];
 
-		dev = pci_get_bus_and_slot(0, 2);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 2);
 		pci_read_config_dword(dev, 0x40, &dimm[0]);
 		dimm[0] = (dimm[0] >> 8) & 0x4f;
 		pci_read_config_dword(dev, 0x44, &dimm[1]);
diff --git a/drivers/video/fbdev/nvidia/nv_setup.c b/drivers/video/fbdev/nvidia/nv_setup.c
index 2f2e162..b17acd2 100644
--- a/drivers/video/fbdev/nvidia/nv_setup.c
+++ b/drivers/video/fbdev/nvidia/nv_setup.c
@@ -264,7 +264,8 @@ static void nv10GetConfig(struct nvidia_par *par)
 	}
 #endif
 
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(pci_domain_nr(par->pci_dev->bus),
+					  0, 1);
 	if ((par->Chipset & 0xffff) = 0x01a0) {
 		u32 amt;
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 26/29] video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct nvidia_par has a pointer to struct pci_dev. Use the pci_dev
member to extract the domain information and pass it to
pci_get_domain_bus_and_slot() function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/nvidia/nv_hw.c    | 11 ++++++-----
 drivers/video/fbdev/nvidia/nv_setup.c |  3 ++-
 2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/video/fbdev/nvidia/nv_hw.c b/drivers/video/fbdev/nvidia/nv_hw.c
index 81c80ac..8335da4 100644
--- a/drivers/video/fbdev/nvidia/nv_hw.c
+++ b/drivers/video/fbdev/nvidia/nv_hw.c
@@ -683,10 +683,11 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	nv10_sim_state sim_data;
 	unsigned int M, N, P, pll, MClk, NVClk, memctrl;
 	struct pci_dev *dev;
+	int domain = pci_domain_nr(par->pci_dev->bus);
 
 	if ((par->Chipset & 0x0FF0) == 0x01A0) {
 		unsigned int uMClkPostDiv;
-		dev = pci_get_bus_and_slot(0, 3);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 		pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
 		uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
 
@@ -694,7 +695,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 			uMClkPostDiv = 4;
 		MClk = 400000 / uMClkPostDiv;
 	} else {
-		dev = pci_get_bus_and_slot(0, 5);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 5);
 		pci_read_config_dword(dev, 0x4c, &MClk);
 		MClk /= 1000;
 	}
@@ -707,13 +708,13 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	sim_data.pix_bpp = (char)pixelDepth;
 	sim_data.enable_video = 0;
 	sim_data.enable_mp = 0;
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 	pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
 	pci_dev_put(dev);
 	sim_data.memory_type = (sim_data.memory_type >> 12) & 1;
 	sim_data.memory_width = 64;
 
-	dev = pci_get_bus_and_slot(0, 3);
+	dev = pci_get_domain_bus_and_slot(domain, 0, 3);
 	pci_read_config_dword(dev, 0, &memctrl);
 	pci_dev_put(dev);
 	memctrl >>= 16;
@@ -721,7 +722,7 @@ static void nForceUpdateArbitrationSettings(unsigned VClk,
 	if ((memctrl == 0x1A9) || (memctrl == 0x1AB) || (memctrl == 0x1ED)) {
 		u32 dimm[3];
 
-		dev = pci_get_bus_and_slot(0, 2);
+		dev = pci_get_domain_bus_and_slot(domain, 0, 2);
 		pci_read_config_dword(dev, 0x40, &dimm[0]);
 		dimm[0] = (dimm[0] >> 8) & 0x4f;
 		pci_read_config_dword(dev, 0x44, &dimm[1]);
diff --git a/drivers/video/fbdev/nvidia/nv_setup.c b/drivers/video/fbdev/nvidia/nv_setup.c
index 2f2e162..b17acd2 100644
--- a/drivers/video/fbdev/nvidia/nv_setup.c
+++ b/drivers/video/fbdev/nvidia/nv_setup.c
@@ -264,7 +264,8 @@ static void nv10GetConfig(struct nvidia_par *par)
 	}
 #endif
 
-	dev = pci_get_bus_and_slot(0, 1);
+	dev = pci_get_domain_bus_and_slot(pci_domain_nr(par->pci_dev->bus),
+					  0, 1);
 	if ((par->Chipset & 0xffff) == 0x01a0) {
 		u32 amt;
 
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 27/29] video: fbdev: riva: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 16:58   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: open list:NVIDIA rivafb and nvidiafb FRAMEBUFFER DRIVER,
	Antonino Daplas, Bartlomiej Zolnierkiewicz, linux-arm-msm,
	intel-gfx, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct riva_par has a pointer to struct pci_dev. Use the pci_dev member
to extract the domain information.

Change the function signature for CalcStateExt and RivaGetConfig to pass
in struct pci_dev in addition to RIVA_HW_INST so that code inside the
riva_hw.c can also calculate domain number and pass it to
pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/riva/fbdev.c     |  2 +-
 drivers/video/fbdev/riva/nv_driver.c |  7 ++++---
 drivers/video/fbdev/riva/riva_hw.c   | 20 +++++++++++++-------
 drivers/video/fbdev/riva/riva_hw.h   |  3 ++-
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 1ea78bb..ff82823 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -780,7 +780,7 @@ static int riva_load_video_mode(struct fb_info *info)
 	else
 		newmode.misc_output |= 0x80;	
 
-	rc = CalcStateExt(&par->riva, &newmode.ext, bpp, width,
+	rc = CalcStateExt(&par->riva, &newmode.ext, par->pdev, bpp, width,
 			  hDisplaySize, height, dotClock);
 	if (rc)
 		goto out;
diff --git a/drivers/video/fbdev/riva/nv_driver.c b/drivers/video/fbdev/riva/nv_driver.c
index f3694cf..a3d9c66 100644
--- a/drivers/video/fbdev/riva/nv_driver.c
+++ b/drivers/video/fbdev/riva/nv_driver.c
@@ -159,6 +159,7 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	unsigned int chipset = par->Chipset;
 	struct pci_dev* dev;
 	u32 amt;
+	int domain = pci_domain_nr(par->pdev->bus);
 
 	switch (chip->Architecture) {
 	case NV_ARCH_03:
@@ -226,12 +227,12 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	case NV_ARCH_30:
 		if(chipset == NV_CHIP_IGEFORCE2) {
 
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x7C, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 6) & 31) + 1) * 1024;
 		} else if (chipset == NV_CHIP_0x01F0) {
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x84, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 4) & 127) + 1) * 1024;
@@ -417,6 +418,6 @@ unsigned long riva_get_maxdclk(struct riva_par *par)
 	}
 	par->riva.flatPanel = (par->FlatPanel > 0) ? TRUE : FALSE;
 
-	RivaGetConfig(&par->riva, par->Chipset);
+	RivaGetConfig(&par->riva, par->pdev, par->Chipset);
 }
 
diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 8bdf37f..0601c13 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -1108,7 +1108,8 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned      pixelDepth,
     unsigned     *burst,
     unsigned     *lwm,
-    RIVA_HW_INST *chip
+    RIVA_HW_INST *chip,
+    struct pci_dev *pdev
 )
 {
     nv10_fifo_info fifo_data;
@@ -1116,8 +1117,9 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned int M, N, P, pll, MClk, NVClk;
     unsigned int uMClkPostDiv;
     struct pci_dev *dev;
+    int domain = pci_domain_nr(pdev->bus);
 
-    dev = pci_get_bus_and_slot(0, 3);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 3);
     pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
     pci_dev_put(dev);
     uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
@@ -1132,7 +1134,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     sim_data.enable_video   = 0;
     sim_data.enable_mp      = 0;
 
-    dev = pci_get_bus_and_slot(0, 1);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 1);
     pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
     pci_dev_put(dev);
     sim_data.memory_type    = (sim_data.memory_type >> 12) & 1;
@@ -1234,6 +1236,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -1300,7 +1303,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
                                           pixelDepth * 8,
                                          &(state->arbitration0),
                                          &(state->arbitration1),
-                                          chip);
+                                          chip, pdev);
             } else {
                 nv10UpdateArbitrationSettings(VClk, 
                                           pixelDepth * 8, 
@@ -2102,10 +2105,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 static void nv10GetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
     struct pci_dev* dev;
+    int domain = pci_domain_nr(pdev->bus);
     u32 amt;
 
 #ifdef __BIG_ENDIAN
@@ -2118,12 +2123,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
      * Fill in chip configuration.
      */
     if(chipset == NV_CHIP_IGEFORCE2) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x7C, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024;
     } else if(chipset == NV_CHIP_0x01F0) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x84, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024;
@@ -2224,6 +2229,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 int RivaGetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
@@ -2245,7 +2251,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
         case NV_ARCH_10:
         case NV_ARCH_20:
         case NV_ARCH_30:
-            nv10GetConfig(chip, chipset);
+            nv10GetConfig(chip, pdev, chipset);
             break;
         default:
             return (-1);
diff --git a/drivers/video/fbdev/riva/riva_hw.h b/drivers/video/fbdev/riva/riva_hw.h
index c2769f7..5e7b354 100644
--- a/drivers/video/fbdev/riva/riva_hw.h
+++ b/drivers/video/fbdev/riva/riva_hw.h
@@ -536,6 +536,7 @@
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -546,7 +547,7 @@
 /*
  * External routines.
  */
-int RivaGetConfig(RIVA_HW_INST *, unsigned int);
+int RivaGetConfig(RIVA_HW_INST *chip, struct pci_dev *pdev, unsigned int c);
 /*
  * FIFO Free Count. Should attempt to yield processor if RIVA is busy.
  */
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 27/29] video: fbdev: riva: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Antonino Daplas, Bartlomiej Zolnierkiewicz,
	open list:NVIDIA (rivafb and nvidiafb) FRAMEBUFFER DRIVER,
	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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct riva_par has a pointer to struct pci_dev. Use the pci_dev member
to extract the domain information.

Change the function signature for CalcStateExt and RivaGetConfig to pass
in struct pci_dev in addition to RIVA_HW_INST so that code inside the
riva_hw.c can also calculate domain number and pass it to
pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/riva/fbdev.c     |  2 +-
 drivers/video/fbdev/riva/nv_driver.c |  7 ++++---
 drivers/video/fbdev/riva/riva_hw.c   | 20 +++++++++++++-------
 drivers/video/fbdev/riva/riva_hw.h   |  3 ++-
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 1ea78bb..ff82823 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -780,7 +780,7 @@ static int riva_load_video_mode(struct fb_info *info)
 	else
 		newmode.misc_output |= 0x80;	
 
-	rc = CalcStateExt(&par->riva, &newmode.ext, bpp, width,
+	rc = CalcStateExt(&par->riva, &newmode.ext, par->pdev, bpp, width,
 			  hDisplaySize, height, dotClock);
 	if (rc)
 		goto out;
diff --git a/drivers/video/fbdev/riva/nv_driver.c b/drivers/video/fbdev/riva/nv_driver.c
index f3694cf..a3d9c66 100644
--- a/drivers/video/fbdev/riva/nv_driver.c
+++ b/drivers/video/fbdev/riva/nv_driver.c
@@ -159,6 +159,7 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	unsigned int chipset = par->Chipset;
 	struct pci_dev* dev;
 	u32 amt;
+	int domain = pci_domain_nr(par->pdev->bus);
 
 	switch (chip->Architecture) {
 	case NV_ARCH_03:
@@ -226,12 +227,12 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	case NV_ARCH_30:
 		if(chipset == NV_CHIP_IGEFORCE2) {
 
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x7C, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 6) & 31) + 1) * 1024;
 		} else if (chipset == NV_CHIP_0x01F0) {
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x84, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 4) & 127) + 1) * 1024;
@@ -417,6 +418,6 @@ unsigned long riva_get_maxdclk(struct riva_par *par)
 	}
 	par->riva.flatPanel = (par->FlatPanel > 0) ? TRUE : FALSE;
 
-	RivaGetConfig(&par->riva, par->Chipset);
+	RivaGetConfig(&par->riva, par->pdev, par->Chipset);
 }
 
diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 8bdf37f..0601c13 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -1108,7 +1108,8 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned      pixelDepth,
     unsigned     *burst,
     unsigned     *lwm,
-    RIVA_HW_INST *chip
+    RIVA_HW_INST *chip,
+    struct pci_dev *pdev
 )
 {
     nv10_fifo_info fifo_data;
@@ -1116,8 +1117,9 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned int M, N, P, pll, MClk, NVClk;
     unsigned int uMClkPostDiv;
     struct pci_dev *dev;
+    int domain = pci_domain_nr(pdev->bus);
 
-    dev = pci_get_bus_and_slot(0, 3);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 3);
     pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
     pci_dev_put(dev);
     uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
@@ -1132,7 +1134,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     sim_data.enable_video   = 0;
     sim_data.enable_mp      = 0;
 
-    dev = pci_get_bus_and_slot(0, 1);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 1);
     pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
     pci_dev_put(dev);
     sim_data.memory_type    = (sim_data.memory_type >> 12) & 1;
@@ -1234,6 +1236,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -1300,7 +1303,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
                                           pixelDepth * 8,
                                          &(state->arbitration0),
                                          &(state->arbitration1),
-                                          chip);
+                                          chip, pdev);
             } else {
                 nv10UpdateArbitrationSettings(VClk, 
                                           pixelDepth * 8, 
@@ -2102,10 +2105,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 static void nv10GetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
     struct pci_dev* dev;
+    int domain = pci_domain_nr(pdev->bus);
     u32 amt;
 
 #ifdef __BIG_ENDIAN
@@ -2118,12 +2123,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
      * Fill in chip configuration.
      */
     if(chipset == NV_CHIP_IGEFORCE2) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x7C, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024;
     } else if(chipset == NV_CHIP_0x01F0) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x84, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024;
@@ -2224,6 +2229,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 int RivaGetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
@@ -2245,7 +2251,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
         case NV_ARCH_10:
         case NV_ARCH_20:
         case NV_ARCH_30:
-            nv10GetConfig(chip, chipset);
+            nv10GetConfig(chip, pdev, chipset);
             break;
         default:
             return (-1);
diff --git a/drivers/video/fbdev/riva/riva_hw.h b/drivers/video/fbdev/riva/riva_hw.h
index c2769f7..5e7b354 100644
--- a/drivers/video/fbdev/riva/riva_hw.h
+++ b/drivers/video/fbdev/riva/riva_hw.h
@@ -536,6 +536,7 @@
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -546,7 +547,7 @@
 /*
  * External routines.
  */
-int RivaGetConfig(RIVA_HW_INST *, unsigned int);
+int RivaGetConfig(RIVA_HW_INST *chip, struct pci_dev *pdev, unsigned int c);
 /*
  * FIFO Free Count. Should attempt to yield processor if RIVA is busy.
  */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 27/29] video: fbdev: riva: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: open list:NVIDIA rivafb and nvidiafb FRAMEBUFFER DRIVER,
	Antonino Daplas, Bartlomiej Zolnierkiewicz, linux-arm-msm,
	intel-gfx, open list, linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct riva_par has a pointer to struct pci_dev. Use the pci_dev member
to extract the domain information.

Change the function signature for CalcStateExt and RivaGetConfig to pass
in struct pci_dev in addition to RIVA_HW_INST so that code inside the
riva_hw.c can also calculate domain number and pass it to
pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/riva/fbdev.c     |  2 +-
 drivers/video/fbdev/riva/nv_driver.c |  7 ++++---
 drivers/video/fbdev/riva/riva_hw.c   | 20 +++++++++++++-------
 drivers/video/fbdev/riva/riva_hw.h   |  3 ++-
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 1ea78bb..ff82823 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -780,7 +780,7 @@ static int riva_load_video_mode(struct fb_info *info)
 	else
 		newmode.misc_output |= 0x80;	
 
-	rc = CalcStateExt(&par->riva, &newmode.ext, bpp, width,
+	rc = CalcStateExt(&par->riva, &newmode.ext, par->pdev, bpp, width,
 			  hDisplaySize, height, dotClock);
 	if (rc)
 		goto out;
diff --git a/drivers/video/fbdev/riva/nv_driver.c b/drivers/video/fbdev/riva/nv_driver.c
index f3694cf..a3d9c66 100644
--- a/drivers/video/fbdev/riva/nv_driver.c
+++ b/drivers/video/fbdev/riva/nv_driver.c
@@ -159,6 +159,7 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	unsigned int chipset = par->Chipset;
 	struct pci_dev* dev;
 	u32 amt;
+	int domain = pci_domain_nr(par->pdev->bus);
 
 	switch (chip->Architecture) {
 	case NV_ARCH_03:
@@ -226,12 +227,12 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	case NV_ARCH_30:
 		if(chipset = NV_CHIP_IGEFORCE2) {
 
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x7C, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 6) & 31) + 1) * 1024;
 		} else if (chipset = NV_CHIP_0x01F0) {
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x84, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 4) & 127) + 1) * 1024;
@@ -417,6 +418,6 @@ unsigned long riva_get_maxdclk(struct riva_par *par)
 	}
 	par->riva.flatPanel = (par->FlatPanel > 0) ? TRUE : FALSE;
 
-	RivaGetConfig(&par->riva, par->Chipset);
+	RivaGetConfig(&par->riva, par->pdev, par->Chipset);
 }
 
diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 8bdf37f..0601c13 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -1108,7 +1108,8 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned      pixelDepth,
     unsigned     *burst,
     unsigned     *lwm,
-    RIVA_HW_INST *chip
+    RIVA_HW_INST *chip,
+    struct pci_dev *pdev
 )
 {
     nv10_fifo_info fifo_data;
@@ -1116,8 +1117,9 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned int M, N, P, pll, MClk, NVClk;
     unsigned int uMClkPostDiv;
     struct pci_dev *dev;
+    int domain = pci_domain_nr(pdev->bus);
 
-    dev = pci_get_bus_and_slot(0, 3);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 3);
     pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
     pci_dev_put(dev);
     uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
@@ -1132,7 +1134,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     sim_data.enable_video   = 0;
     sim_data.enable_mp      = 0;
 
-    dev = pci_get_bus_and_slot(0, 1);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 1);
     pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
     pci_dev_put(dev);
     sim_data.memory_type    = (sim_data.memory_type >> 12) & 1;
@@ -1234,6 +1236,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -1300,7 +1303,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
                                           pixelDepth * 8,
                                          &(state->arbitration0),
                                          &(state->arbitration1),
-                                          chip);
+                                          chip, pdev);
             } else {
                 nv10UpdateArbitrationSettings(VClk, 
                                           pixelDepth * 8, 
@@ -2102,10 +2105,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 static void nv10GetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
     struct pci_dev* dev;
+    int domain = pci_domain_nr(pdev->bus);
     u32 amt;
 
 #ifdef __BIG_ENDIAN
@@ -2118,12 +2123,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
      * Fill in chip configuration.
      */
     if(chipset = NV_CHIP_IGEFORCE2) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x7C, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024;
     } else if(chipset = NV_CHIP_0x01F0) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x84, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024;
@@ -2224,6 +2229,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 int RivaGetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
@@ -2245,7 +2251,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
         case NV_ARCH_10:
         case NV_ARCH_20:
         case NV_ARCH_30:
-            nv10GetConfig(chip, chipset);
+            nv10GetConfig(chip, pdev, chipset);
             break;
         default:
             return (-1);
diff --git a/drivers/video/fbdev/riva/riva_hw.h b/drivers/video/fbdev/riva/riva_hw.h
index c2769f7..5e7b354 100644
--- a/drivers/video/fbdev/riva/riva_hw.h
+++ b/drivers/video/fbdev/riva/riva_hw.h
@@ -536,6 +536,7 @@
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -546,7 +547,7 @@
 /*
  * External routines.
  */
-int RivaGetConfig(RIVA_HW_INST *, unsigned int);
+int RivaGetConfig(RIVA_HW_INST *chip, struct pci_dev *pdev, unsigned int c);
 /*
  * FIFO Free Count. Should attempt to yield processor if RIVA is busy.
  */
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 27/29] video: fbdev: riva: deprecate pci_get_bus_and_slot()
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

struct riva_par has a pointer to struct pci_dev. Use the pci_dev member
to extract the domain information.

Change the function signature for CalcStateExt and RivaGetConfig to pass
in struct pci_dev in addition to RIVA_HW_INST so that code inside the
riva_hw.c can also calculate domain number and pass it to
pci_get_domain_bus_and_slot().

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 drivers/video/fbdev/riva/fbdev.c     |  2 +-
 drivers/video/fbdev/riva/nv_driver.c |  7 ++++---
 drivers/video/fbdev/riva/riva_hw.c   | 20 +++++++++++++-------
 drivers/video/fbdev/riva/riva_hw.h   |  3 ++-
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/drivers/video/fbdev/riva/fbdev.c b/drivers/video/fbdev/riva/fbdev.c
index 1ea78bb..ff82823 100644
--- a/drivers/video/fbdev/riva/fbdev.c
+++ b/drivers/video/fbdev/riva/fbdev.c
@@ -780,7 +780,7 @@ static int riva_load_video_mode(struct fb_info *info)
 	else
 		newmode.misc_output |= 0x80;	
 
-	rc = CalcStateExt(&par->riva, &newmode.ext, bpp, width,
+	rc = CalcStateExt(&par->riva, &newmode.ext, par->pdev, bpp, width,
 			  hDisplaySize, height, dotClock);
 	if (rc)
 		goto out;
diff --git a/drivers/video/fbdev/riva/nv_driver.c b/drivers/video/fbdev/riva/nv_driver.c
index f3694cf..a3d9c66 100644
--- a/drivers/video/fbdev/riva/nv_driver.c
+++ b/drivers/video/fbdev/riva/nv_driver.c
@@ -159,6 +159,7 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	unsigned int chipset = par->Chipset;
 	struct pci_dev* dev;
 	u32 amt;
+	int domain = pci_domain_nr(par->pdev->bus);
 
 	switch (chip->Architecture) {
 	case NV_ARCH_03:
@@ -226,12 +227,12 @@ unsigned long riva_get_memlen(struct riva_par *par)
 	case NV_ARCH_30:
 		if(chipset == NV_CHIP_IGEFORCE2) {
 
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x7C, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 6) & 31) + 1) * 1024;
 		} else if (chipset == NV_CHIP_0x01F0) {
-			dev = pci_get_bus_and_slot(0, 1);
+			dev = pci_get_domain_bus_and_slot(domain, 0, 1);
 			pci_read_config_dword(dev, 0x84, &amt);
 			pci_dev_put(dev);
 			memlen = (((amt >> 4) & 127) + 1) * 1024;
@@ -417,6 +418,6 @@ unsigned long riva_get_maxdclk(struct riva_par *par)
 	}
 	par->riva.flatPanel = (par->FlatPanel > 0) ? TRUE : FALSE;
 
-	RivaGetConfig(&par->riva, par->Chipset);
+	RivaGetConfig(&par->riva, par->pdev, par->Chipset);
 }
 
diff --git a/drivers/video/fbdev/riva/riva_hw.c b/drivers/video/fbdev/riva/riva_hw.c
index 8bdf37f..0601c13 100644
--- a/drivers/video/fbdev/riva/riva_hw.c
+++ b/drivers/video/fbdev/riva/riva_hw.c
@@ -1108,7 +1108,8 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned      pixelDepth,
     unsigned     *burst,
     unsigned     *lwm,
-    RIVA_HW_INST *chip
+    RIVA_HW_INST *chip,
+    struct pci_dev *pdev
 )
 {
     nv10_fifo_info fifo_data;
@@ -1116,8 +1117,9 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     unsigned int M, N, P, pll, MClk, NVClk;
     unsigned int uMClkPostDiv;
     struct pci_dev *dev;
+    int domain = pci_domain_nr(pdev->bus);
 
-    dev = pci_get_bus_and_slot(0, 3);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 3);
     pci_read_config_dword(dev, 0x6C, &uMClkPostDiv);
     pci_dev_put(dev);
     uMClkPostDiv = (uMClkPostDiv >> 8) & 0xf;
@@ -1132,7 +1134,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
     sim_data.enable_video   = 0;
     sim_data.enable_mp      = 0;
 
-    dev = pci_get_bus_and_slot(0, 1);
+    dev = pci_get_domain_bus_and_slot(domain, 0, 1);
     pci_read_config_dword(dev, 0x7C, &sim_data.memory_type);
     pci_dev_put(dev);
     sim_data.memory_type    = (sim_data.memory_type >> 12) & 1;
@@ -1234,6 +1236,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -1300,7 +1303,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
                                           pixelDepth * 8,
                                          &(state->arbitration0),
                                          &(state->arbitration1),
-                                          chip);
+                                          chip, pdev);
             } else {
                 nv10UpdateArbitrationSettings(VClk, 
                                           pixelDepth * 8, 
@@ -2102,10 +2105,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 static void nv10GetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
     struct pci_dev* dev;
+    int domain = pci_domain_nr(pdev->bus);
     u32 amt;
 
 #ifdef __BIG_ENDIAN
@@ -2118,12 +2123,12 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
      * Fill in chip configuration.
      */
     if(chipset == NV_CHIP_IGEFORCE2) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x7C, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 6) & 31) + 1) * 1024;
     } else if(chipset == NV_CHIP_0x01F0) {
-        dev = pci_get_bus_and_slot(0, 1);
+        dev = pci_get_domain_bus_and_slot(domain, 0, 1);
         pci_read_config_dword(dev, 0x84, &amt);
         pci_dev_put(dev);
         chip->RamAmountKBytes = (((amt >> 4) & 127) + 1) * 1024;
@@ -2224,6 +2229,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
 int RivaGetConfig
 (
     RIVA_HW_INST *chip,
+    struct pci_dev *pdev,
     unsigned int chipset
 )
 {
@@ -2245,7 +2251,7 @@ static char nv3_get_param(nv3_fifo_info *res_info, nv3_sim_state * state, nv3_ar
         case NV_ARCH_10:
         case NV_ARCH_20:
         case NV_ARCH_30:
-            nv10GetConfig(chip, chipset);
+            nv10GetConfig(chip, pdev, chipset);
             break;
         default:
             return (-1);
diff --git a/drivers/video/fbdev/riva/riva_hw.h b/drivers/video/fbdev/riva/riva_hw.h
index c2769f7..5e7b354 100644
--- a/drivers/video/fbdev/riva/riva_hw.h
+++ b/drivers/video/fbdev/riva/riva_hw.h
@@ -536,6 +536,7 @@
 (
     RIVA_HW_INST  *chip,
     RIVA_HW_STATE *state,
+    struct pci_dev *pdev,
     int            bpp,
     int            width,
     int            hDisplaySize,
@@ -546,7 +547,7 @@
 /*
  * External routines.
  */
-int RivaGetConfig(RIVA_HW_INST *, unsigned int);
+int RivaGetConfig(RIVA_HW_INST *chip, struct pci_dev *pdev, unsigned int c);
 /*
  * FIFO Free Count. Should attempt to yield processor if RIVA is busy.
  */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 28/29] i7300_idle: remove unused file
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:58   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: Kate Stewart, Greg Kroah-Hartman, linux-arm-msm, intel-gfx,
	open list, Philippe Ombredanne, Thomas Gleixner,
	linux-arm-kernel

i7300_idle.h is not being called by any source file and contains calls to
pci_get_bus_and_slot() that we are trying to deprecate. Remove unused file.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 include/linux/i7300_idle.h | 84 ----------------------------------------------
 1 file changed, 84 deletions(-)
 delete mode 100644 include/linux/i7300_idle.h

diff --git a/include/linux/i7300_idle.h b/include/linux/i7300_idle.h
deleted file mode 100644
index 4dbe651..0000000
--- a/include/linux/i7300_idle.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef I7300_IDLE_H
-#define I7300_IDLE_H
-
-#include <linux/pci.h>
-
-/*
- * I/O AT controls (PCI bus 0 device 8 function 0)
- * DIMM controls (PCI bus 0 device 16 function 1)
- */
-#define IOAT_BUS 0
-#define IOAT_DEVFN PCI_DEVFN(8, 0)
-#define MEMCTL_BUS 0
-#define MEMCTL_DEVFN PCI_DEVFN(16, 1)
-
-struct fbd_ioat {
-	unsigned int vendor;
-	unsigned int ioat_dev;
-	unsigned int enabled;
-};
-
-/*
- * The i5000 chip-set has the same hooks as the i7300
- * but it is not enabled by default and must be manually
- * manually enabled with "forceload=1" because it is
- * only lightly validated.
- */
-
-static const struct fbd_ioat fbd_ioat_list[] = {
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0},
-	{0, 0}
-};
-
-/* table of devices that work with this driver */
-static const struct pci_device_id pci_tbl[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
-	{ } /* Terminating entry */
-};
-
-/* Check for known platforms with I/O-AT */
-static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
-						struct pci_dev **ioat_dev,
-						int enable_all)
-{
-	int i;
-	struct pci_dev *memdev, *dmadev;
-
-	memdev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN);
-	if (!memdev)
-		return -ENODEV;
-
-	for (i = 0; pci_tbl[i].vendor != 0; i++) {
-		if (memdev->vendor == pci_tbl[i].vendor &&
-		    memdev->device == pci_tbl[i].device) {
-			break;
-		}
-	}
-	if (pci_tbl[i].vendor == 0)
-		return -ENODEV;
-
-	dmadev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN);
-	if (!dmadev)
-		return -ENODEV;
-
-	for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
-		if (dmadev->vendor == fbd_ioat_list[i].vendor &&
-		    dmadev->device == fbd_ioat_list[i].ioat_dev) {
-			if (!(fbd_ioat_list[i].enabled || enable_all))
-				continue;
-			if (fbd_dev)
-				*fbd_dev = memdev;
-			if (ioat_dev)
-				*ioat_dev = dmadev;
-
-			return 0;
-		}
-	}
-	return -ENODEV;
-}
-
-#endif
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 28/29] i7300_idle: remove unused file
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Kate Stewart, Philippe Ombredanne, Greg Kroah-Hartman,
	Thomas Gleixner, open list

i7300_idle.h is not being called by any source file and contains calls to
pci_get_bus_and_slot() that we are trying to deprecate. Remove unused file.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 include/linux/i7300_idle.h | 84 ----------------------------------------------
 1 file changed, 84 deletions(-)
 delete mode 100644 include/linux/i7300_idle.h

diff --git a/include/linux/i7300_idle.h b/include/linux/i7300_idle.h
deleted file mode 100644
index 4dbe651..0000000
--- a/include/linux/i7300_idle.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef I7300_IDLE_H
-#define I7300_IDLE_H
-
-#include <linux/pci.h>
-
-/*
- * I/O AT controls (PCI bus 0 device 8 function 0)
- * DIMM controls (PCI bus 0 device 16 function 1)
- */
-#define IOAT_BUS 0
-#define IOAT_DEVFN PCI_DEVFN(8, 0)
-#define MEMCTL_BUS 0
-#define MEMCTL_DEVFN PCI_DEVFN(16, 1)
-
-struct fbd_ioat {
-	unsigned int vendor;
-	unsigned int ioat_dev;
-	unsigned int enabled;
-};
-
-/*
- * The i5000 chip-set has the same hooks as the i7300
- * but it is not enabled by default and must be manually
- * manually enabled with "forceload=1" because it is
- * only lightly validated.
- */
-
-static const struct fbd_ioat fbd_ioat_list[] = {
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0},
-	{0, 0}
-};
-
-/* table of devices that work with this driver */
-static const struct pci_device_id pci_tbl[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
-	{ } /* Terminating entry */
-};
-
-/* Check for known platforms with I/O-AT */
-static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
-						struct pci_dev **ioat_dev,
-						int enable_all)
-{
-	int i;
-	struct pci_dev *memdev, *dmadev;
-
-	memdev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN);
-	if (!memdev)
-		return -ENODEV;
-
-	for (i = 0; pci_tbl[i].vendor != 0; i++) {
-		if (memdev->vendor == pci_tbl[i].vendor &&
-		    memdev->device == pci_tbl[i].device) {
-			break;
-		}
-	}
-	if (pci_tbl[i].vendor == 0)
-		return -ENODEV;
-
-	dmadev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN);
-	if (!dmadev)
-		return -ENODEV;
-
-	for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
-		if (dmadev->vendor == fbd_ioat_list[i].vendor &&
-		    dmadev->device == fbd_ioat_list[i].ioat_dev) {
-			if (!(fbd_ioat_list[i].enabled || enable_all))
-				continue;
-			if (fbd_dev)
-				*fbd_dev = memdev;
-			if (ioat_dev)
-				*ioat_dev = dmadev;
-
-			return 0;
-		}
-	}
-	return -ENODEV;
-}
-
-#endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 28/29] i7300_idle: remove unused file
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

i7300_idle.h is not being called by any source file and contains calls to
pci_get_bus_and_slot() that we are trying to deprecate. Remove unused file.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 include/linux/i7300_idle.h | 84 ----------------------------------------------
 1 file changed, 84 deletions(-)
 delete mode 100644 include/linux/i7300_idle.h

diff --git a/include/linux/i7300_idle.h b/include/linux/i7300_idle.h
deleted file mode 100644
index 4dbe651..0000000
--- a/include/linux/i7300_idle.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0 */
-
-#ifndef I7300_IDLE_H
-#define I7300_IDLE_H
-
-#include <linux/pci.h>
-
-/*
- * I/O AT controls (PCI bus 0 device 8 function 0)
- * DIMM controls (PCI bus 0 device 16 function 1)
- */
-#define IOAT_BUS 0
-#define IOAT_DEVFN PCI_DEVFN(8, 0)
-#define MEMCTL_BUS 0
-#define MEMCTL_DEVFN PCI_DEVFN(16, 1)
-
-struct fbd_ioat {
-	unsigned int vendor;
-	unsigned int ioat_dev;
-	unsigned int enabled;
-};
-
-/*
- * The i5000 chip-set has the same hooks as the i7300
- * but it is not enabled by default and must be manually
- * manually enabled with "forceload=1" because it is
- * only lightly validated.
- */
-
-static const struct fbd_ioat fbd_ioat_list[] = {
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT_CNB, 1},
-	{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_IOAT, 0},
-	{0, 0}
-};
-
-/* table of devices that work with this driver */
-static const struct pci_device_id pci_tbl[] = {
-	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_FBD_CNB) },
-	{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_5000_ERR) },
-	{ } /* Terminating entry */
-};
-
-/* Check for known platforms with I/O-AT */
-static inline int i7300_idle_platform_probe(struct pci_dev **fbd_dev,
-						struct pci_dev **ioat_dev,
-						int enable_all)
-{
-	int i;
-	struct pci_dev *memdev, *dmadev;
-
-	memdev = pci_get_bus_and_slot(MEMCTL_BUS, MEMCTL_DEVFN);
-	if (!memdev)
-		return -ENODEV;
-
-	for (i = 0; pci_tbl[i].vendor != 0; i++) {
-		if (memdev->vendor == pci_tbl[i].vendor &&
-		    memdev->device == pci_tbl[i].device) {
-			break;
-		}
-	}
-	if (pci_tbl[i].vendor == 0)
-		return -ENODEV;
-
-	dmadev = pci_get_bus_and_slot(IOAT_BUS, IOAT_DEVFN);
-	if (!dmadev)
-		return -ENODEV;
-
-	for (i = 0; fbd_ioat_list[i].vendor != 0; i++) {
-		if (dmadev->vendor == fbd_ioat_list[i].vendor &&
-		    dmadev->device == fbd_ioat_list[i].ioat_dev) {
-			if (!(fbd_ioat_list[i].enabled || enable_all))
-				continue;
-			if (fbd_dev)
-				*fbd_dev = memdev;
-			if (ioat_dev)
-				*ioat_dev = dmadev;
-
-			return 0;
-		}
-	}
-	return -ENODEV;
-}
-
-#endif
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 29/29] PCI: remove pci_get_bus_and_slot() function
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-27 16:58   ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, intel-gfx, open list, Bjorn Helgaas, linux-arm-kernel

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.

Now that all users of pci_get_bus_and_slot() switched to
pci_get_domain_bus_and_slot(), it is now safe to remove this function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 include/linux/pci.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index d16a7c0..8c1b650 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -957,11 +957,6 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
 struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
 struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus,
 					    unsigned int devfn);
-static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
-						   unsigned int devfn)
-{
-	return pci_get_domain_bus_and_slot(0, bus, devfn);
-}
 struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
 int pci_dev_present(const struct pci_device_id *ids);
 
@@ -1676,9 +1671,6 @@ static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
 						unsigned int devfn)
 { return NULL; }
-static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
-						unsigned int devfn)
-{ return NULL; }
 
 static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
 static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 29/29] PCI: remove pci_get_bus_and_slot() function
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Sinan Kaya,
	Bjorn Helgaas, 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.

Now that all users of pci_get_bus_and_slot() switched to
pci_get_domain_bus_and_slot(), it is now safe to remove this function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 include/linux/pci.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index d16a7c0..8c1b650 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -957,11 +957,6 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
 struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
 struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus,
 					    unsigned int devfn);
-static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
-						   unsigned int devfn)
-{
-	return pci_get_domain_bus_and_slot(0, bus, devfn);
-}
 struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
 int pci_dev_present(const struct pci_device_id *ids);
 
@@ -1676,9 +1671,6 @@ static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
 						unsigned int devfn)
 { return NULL; }
-static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
-						unsigned int devfn)
-{ return NULL; }
 
 static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
 static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* [PATCH V3 29/29] PCI: remove pci_get_bus_and_slot() function
@ 2017-11-27 16:58   ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 16:58 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Now that all users of pci_get_bus_and_slot() switched to
pci_get_domain_bus_and_slot(), it is now safe to remove this function.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
---
 include/linux/pci.h | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/include/linux/pci.h b/include/linux/pci.h
index d16a7c0..8c1b650 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -957,11 +957,6 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device,
 struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn);
 struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus,
 					    unsigned int devfn);
-static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
-						   unsigned int devfn)
-{
-	return pci_get_domain_bus_and_slot(0, bus, devfn);
-}
 struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from);
 int pci_dev_present(const struct pci_device_id *ids);
 
@@ -1676,9 +1671,6 @@ static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
 static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
 						unsigned int devfn)
 { return NULL; }
-static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
-						unsigned int devfn)
-{ return NULL; }
 
 static inline int pci_domain_nr(struct pci_bus *bus) { return 0; }
 static inline struct pci_dev *pci_dev_get(struct pci_dev *dev) { return NULL; }
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 08/29] drm/gma500: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
  (?)
@ 2017-11-27 18:49     ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:49 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Patrik Jakobsson,
	David Airlie, open list, dri-devel

+dri-devel@lists.freedesktop.org

On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Add domain parameter to CDV_MSG_READ32, CDV_MSG_WRITE32, MRST_MSG_READ32,
> MRST_MSG_WRITE32, MDFLD_MSG_READ32, MDFLD_MSG_WRITE32.
> 
> Extract pci_dev from struct drm_device and use pdev to find the domain
> number while calling pci_get_domain_bus_and_slot().
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/gma500/cdv_device.c | 16 +++++++++-------
>  drivers/gpu/drm/gma500/gma_device.c |  4 +++-
>  drivers/gpu/drm/gma500/mid_bios.c   | 12 +++++++++---
>  drivers/gpu/drm/gma500/psb_drv.c    | 10 ++++++++--
>  drivers/gpu/drm/gma500/psb_drv.h    | 18 ++++++++++--------
>  5 files changed, 39 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
> index 8745971..3a3bf75 100644
> --- a/drivers/gpu/drm/gma500/cdv_device.c
> +++ b/drivers/gpu/drm/gma500/cdv_device.c
> @@ -185,21 +185,22 @@ static int cdv_backlight_init(struct drm_device *dev)
>   *	for this and the MID devices.
>   */
>  
> -static inline u32 CDV_MSG_READ32(uint port, uint offset)
> +static inline u32 CDV_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
>  
> -static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset,
> +				   u32 value)
>  {
>  	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
> @@ -216,11 +217,12 @@ static void cdv_init_pm(struct drm_device *dev)
>  {
>  	struct drm_psb_private *dev_priv = dev->dev_private;
>  	u32 pwr_cnt;
> +	int domain = pci_domain_nr(dev->pdev->bus);
>  	int i;
>  
> -	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
> +	dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
>  							PSB_APMBA) & 0xFFFF;
> -	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
> +	dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
>  							PSB_OSPMBA) & 0xFFFF;
>  
>  	/* Power status */
> @@ -251,7 +253,7 @@ static void cdv_errata(struct drm_device *dev)
>  	 *	Bonus Launch to work around the issue, by degrading
>  	 *	performance.
>  	 */
> -	 CDV_MSG_WRITE32(3, 0x30, 0x08027108);
> +	 CDV_MSG_WRITE32(pci_domain_nr(dev->pdev->bus), 3, 0x30, 0x08027108);
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/gma500/gma_device.c b/drivers/gpu/drm/gma500/gma_device.c
> index 4a295f9..a7fb6de 100644
> --- a/drivers/gpu/drm/gma500/gma_device.c
> +++ b/drivers/gpu/drm/gma500/gma_device.c
> @@ -19,7 +19,9 @@
>  void gma_get_core_freq(struct drm_device *dev)
>  {
>  	uint32_t clock;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, 0);
>  	struct drm_psb_private *dev_priv = dev->dev_private;
>  
>  	/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
> diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
> index d75ecb3..5c23d4e 100644
> --- a/drivers/gpu/drm/gma500/mid_bios.c
> +++ b/drivers/gpu/drm/gma500/mid_bios.c
> @@ -32,7 +32,9 @@
>  static void mid_get_fuse_settings(struct drm_device *dev)
>  {
>  	struct drm_psb_private *dev_priv = dev->dev_private;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, 0);
>  	uint32_t fuse_value = 0;
>  	uint32_t fuse_value_tmp = 0;
>  
> @@ -104,7 +106,9 @@ static void mid_get_fuse_settings(struct drm_device *dev)
>  static void mid_get_pci_revID(struct drm_psb_private *dev_priv)
>  {
>  	uint32_t platform_rev_id = 0;
> -	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> +	int domain = pci_domain_nr(dev_priv->dev->pdev->bus);
> +	struct pci_dev *pci_gfx_root =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(2, 0));
>  
>  	if (pci_gfx_root == NULL) {
>  		WARN_ON(1);
> @@ -281,7 +285,9 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
>  	u32 addr;
>  	u8 __iomem *vbt_virtual;
>  	struct mid_vbt_header vbt_header;
> -	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> +	struct pci_dev *pci_gfx_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, PCI_DEVFN(2, 0));
>  	int ret = -1;
>  
>  	/* Get the address of the platform config vbt */
> diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
> index 37a3be7..99d6527 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.c
> +++ b/drivers/gpu/drm/gma500/psb_drv.c
> @@ -261,7 +261,11 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
>  		goto out_err;
>  
>  	if (IS_MRST(dev)) {
> -		dev_priv->aux_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(3, 0));
> +		int domain = pci_domain_nr(dev->pdev->bus);
> +
> +		dev_priv->aux_pdev =
> +			pci_get_domain_bus_and_slot(domain, 0,
> +						    PCI_DEVFN(3, 0));
>  
>  		if (dev_priv->aux_pdev) {
>  			resource_start = pci_resource_start(dev_priv->aux_pdev,
> @@ -281,7 +285,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
>  		}
>  		dev_priv->gmbus_reg = dev_priv->aux_reg;
>  
> -		dev_priv->lpc_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(31, 0));
> +		dev_priv->lpc_pdev =
> +			pci_get_domain_bus_and_slot(domain, 0,
> +						    PCI_DEVFN(31, 0));
>  		if (dev_priv->lpc_pdev) {
>  			pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
>  				&dev_priv->lpc_gpio_base);
> diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
> index 821497d..d409e02 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.h
> +++ b/drivers/gpu/drm/gma500/psb_drv.h
> @@ -781,38 +781,40 @@ extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
>  extern int drm_idle_check_interval;
>  
>  /* Utilities */
> -static inline u32 MRST_MSG_READ32(uint port, uint offset)
> +static inline u32 MRST_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0xD0<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
> -static inline void MRST_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset,
> +				    u32 value)
>  {
>  	int mcr = (0xE0<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
>  }
> -static inline u32 MDFLD_MSG_READ32(uint port, uint offset)
> +static inline u32 MDFLD_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
> -static inline void MDFLD_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void MDFLD_MSG_WRITE32(int domain, uint port, uint offset,
> +				     u32 value)
>  {
>  	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
> 


-- 
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] 172+ messages in thread

* Re: [PATCH V3 08/29] drm/gma500: deprecate pci_get_bus_and_slot()
@ 2017-11-27 18:49     ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:49 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list,
	Patrik Jakobsson, dri-devel, linux-arm-kernel

+dri-devel@lists.freedesktop.org

On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Add domain parameter to CDV_MSG_READ32, CDV_MSG_WRITE32, MRST_MSG_READ32,
> MRST_MSG_WRITE32, MDFLD_MSG_READ32, MDFLD_MSG_WRITE32.
> 
> Extract pci_dev from struct drm_device and use pdev to find the domain
> number while calling pci_get_domain_bus_and_slot().
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/gma500/cdv_device.c | 16 +++++++++-------
>  drivers/gpu/drm/gma500/gma_device.c |  4 +++-
>  drivers/gpu/drm/gma500/mid_bios.c   | 12 +++++++++---
>  drivers/gpu/drm/gma500/psb_drv.c    | 10 ++++++++--
>  drivers/gpu/drm/gma500/psb_drv.h    | 18 ++++++++++--------
>  5 files changed, 39 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
> index 8745971..3a3bf75 100644
> --- a/drivers/gpu/drm/gma500/cdv_device.c
> +++ b/drivers/gpu/drm/gma500/cdv_device.c
> @@ -185,21 +185,22 @@ static int cdv_backlight_init(struct drm_device *dev)
>   *	for this and the MID devices.
>   */
>  
> -static inline u32 CDV_MSG_READ32(uint port, uint offset)
> +static inline u32 CDV_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
>  
> -static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset,
> +				   u32 value)
>  {
>  	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
> @@ -216,11 +217,12 @@ static void cdv_init_pm(struct drm_device *dev)
>  {
>  	struct drm_psb_private *dev_priv = dev->dev_private;
>  	u32 pwr_cnt;
> +	int domain = pci_domain_nr(dev->pdev->bus);
>  	int i;
>  
> -	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
> +	dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
>  							PSB_APMBA) & 0xFFFF;
> -	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
> +	dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
>  							PSB_OSPMBA) & 0xFFFF;
>  
>  	/* Power status */
> @@ -251,7 +253,7 @@ static void cdv_errata(struct drm_device *dev)
>  	 *	Bonus Launch to work around the issue, by degrading
>  	 *	performance.
>  	 */
> -	 CDV_MSG_WRITE32(3, 0x30, 0x08027108);
> +	 CDV_MSG_WRITE32(pci_domain_nr(dev->pdev->bus), 3, 0x30, 0x08027108);
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/gma500/gma_device.c b/drivers/gpu/drm/gma500/gma_device.c
> index 4a295f9..a7fb6de 100644
> --- a/drivers/gpu/drm/gma500/gma_device.c
> +++ b/drivers/gpu/drm/gma500/gma_device.c
> @@ -19,7 +19,9 @@
>  void gma_get_core_freq(struct drm_device *dev)
>  {
>  	uint32_t clock;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, 0);
>  	struct drm_psb_private *dev_priv = dev->dev_private;
>  
>  	/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
> diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
> index d75ecb3..5c23d4e 100644
> --- a/drivers/gpu/drm/gma500/mid_bios.c
> +++ b/drivers/gpu/drm/gma500/mid_bios.c
> @@ -32,7 +32,9 @@
>  static void mid_get_fuse_settings(struct drm_device *dev)
>  {
>  	struct drm_psb_private *dev_priv = dev->dev_private;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, 0);
>  	uint32_t fuse_value = 0;
>  	uint32_t fuse_value_tmp = 0;
>  
> @@ -104,7 +106,9 @@ static void mid_get_fuse_settings(struct drm_device *dev)
>  static void mid_get_pci_revID(struct drm_psb_private *dev_priv)
>  {
>  	uint32_t platform_rev_id = 0;
> -	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> +	int domain = pci_domain_nr(dev_priv->dev->pdev->bus);
> +	struct pci_dev *pci_gfx_root =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(2, 0));
>  
>  	if (pci_gfx_root == NULL) {
>  		WARN_ON(1);
> @@ -281,7 +285,9 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
>  	u32 addr;
>  	u8 __iomem *vbt_virtual;
>  	struct mid_vbt_header vbt_header;
> -	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> +	struct pci_dev *pci_gfx_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, PCI_DEVFN(2, 0));
>  	int ret = -1;
>  
>  	/* Get the address of the platform config vbt */
> diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
> index 37a3be7..99d6527 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.c
> +++ b/drivers/gpu/drm/gma500/psb_drv.c
> @@ -261,7 +261,11 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
>  		goto out_err;
>  
>  	if (IS_MRST(dev)) {
> -		dev_priv->aux_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(3, 0));
> +		int domain = pci_domain_nr(dev->pdev->bus);
> +
> +		dev_priv->aux_pdev =
> +			pci_get_domain_bus_and_slot(domain, 0,
> +						    PCI_DEVFN(3, 0));
>  
>  		if (dev_priv->aux_pdev) {
>  			resource_start = pci_resource_start(dev_priv->aux_pdev,
> @@ -281,7 +285,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
>  		}
>  		dev_priv->gmbus_reg = dev_priv->aux_reg;
>  
> -		dev_priv->lpc_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(31, 0));
> +		dev_priv->lpc_pdev =
> +			pci_get_domain_bus_and_slot(domain, 0,
> +						    PCI_DEVFN(31, 0));
>  		if (dev_priv->lpc_pdev) {
>  			pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
>  				&dev_priv->lpc_gpio_base);
> diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
> index 821497d..d409e02 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.h
> +++ b/drivers/gpu/drm/gma500/psb_drv.h
> @@ -781,38 +781,40 @@ extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
>  extern int drm_idle_check_interval;
>  
>  /* Utilities */
> -static inline u32 MRST_MSG_READ32(uint port, uint offset)
> +static inline u32 MRST_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0xD0<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
> -static inline void MRST_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset,
> +				    u32 value)
>  {
>  	int mcr = (0xE0<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
>  }
> -static inline u32 MDFLD_MSG_READ32(uint port, uint offset)
> +static inline u32 MDFLD_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
> -static inline void MDFLD_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void MDFLD_MSG_WRITE32(int domain, uint port, uint offset,
> +				     u32 value)
>  {
>  	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
> 


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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 08/29] drm/gma500: deprecate pci_get_bus_and_slot()
@ 2017-11-27 18:49     ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:49 UTC (permalink / raw)
  To: linux-arm-kernel

+dri-devel at lists.freedesktop.org

On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Add domain parameter to CDV_MSG_READ32, CDV_MSG_WRITE32, MRST_MSG_READ32,
> MRST_MSG_WRITE32, MDFLD_MSG_READ32, MDFLD_MSG_WRITE32.
> 
> Extract pci_dev from struct drm_device and use pdev to find the domain
> number while calling pci_get_domain_bus_and_slot().
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/gma500/cdv_device.c | 16 +++++++++-------
>  drivers/gpu/drm/gma500/gma_device.c |  4 +++-
>  drivers/gpu/drm/gma500/mid_bios.c   | 12 +++++++++---
>  drivers/gpu/drm/gma500/psb_drv.c    | 10 ++++++++--
>  drivers/gpu/drm/gma500/psb_drv.h    | 18 ++++++++++--------
>  5 files changed, 39 insertions(+), 21 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
> index 8745971..3a3bf75 100644
> --- a/drivers/gpu/drm/gma500/cdv_device.c
> +++ b/drivers/gpu/drm/gma500/cdv_device.c
> @@ -185,21 +185,22 @@ static int cdv_backlight_init(struct drm_device *dev)
>   *	for this and the MID devices.
>   */
>  
> -static inline u32 CDV_MSG_READ32(uint port, uint offset)
> +static inline u32 CDV_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
>  
> -static inline void CDV_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void CDV_MSG_WRITE32(int domain, uint port, uint offset,
> +				   u32 value)
>  {
>  	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
> @@ -216,11 +217,12 @@ static void cdv_init_pm(struct drm_device *dev)
>  {
>  	struct drm_psb_private *dev_priv = dev->dev_private;
>  	u32 pwr_cnt;
> +	int domain = pci_domain_nr(dev->pdev->bus);
>  	int i;
>  
> -	dev_priv->apm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
> +	dev_priv->apm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
>  							PSB_APMBA) & 0xFFFF;
> -	dev_priv->ospm_base = CDV_MSG_READ32(PSB_PUNIT_PORT,
> +	dev_priv->ospm_base = CDV_MSG_READ32(domain, PSB_PUNIT_PORT,
>  							PSB_OSPMBA) & 0xFFFF;
>  
>  	/* Power status */
> @@ -251,7 +253,7 @@ static void cdv_errata(struct drm_device *dev)
>  	 *	Bonus Launch to work around the issue, by degrading
>  	 *	performance.
>  	 */
> -	 CDV_MSG_WRITE32(3, 0x30, 0x08027108);
> +	 CDV_MSG_WRITE32(pci_domain_nr(dev->pdev->bus), 3, 0x30, 0x08027108);
>  }
>  
>  /**
> diff --git a/drivers/gpu/drm/gma500/gma_device.c b/drivers/gpu/drm/gma500/gma_device.c
> index 4a295f9..a7fb6de 100644
> --- a/drivers/gpu/drm/gma500/gma_device.c
> +++ b/drivers/gpu/drm/gma500/gma_device.c
> @@ -19,7 +19,9 @@
>  void gma_get_core_freq(struct drm_device *dev)
>  {
>  	uint32_t clock;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, 0);
>  	struct drm_psb_private *dev_priv = dev->dev_private;
>  
>  	/*pci_write_config_dword(pci_root, 0xD4, 0x00C32004);*/
> diff --git a/drivers/gpu/drm/gma500/mid_bios.c b/drivers/gpu/drm/gma500/mid_bios.c
> index d75ecb3..5c23d4e 100644
> --- a/drivers/gpu/drm/gma500/mid_bios.c
> +++ b/drivers/gpu/drm/gma500/mid_bios.c
> @@ -32,7 +32,9 @@
>  static void mid_get_fuse_settings(struct drm_device *dev)
>  {
>  	struct drm_psb_private *dev_priv = dev->dev_private;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, 0);
>  	uint32_t fuse_value = 0;
>  	uint32_t fuse_value_tmp = 0;
>  
> @@ -104,7 +106,9 @@ static void mid_get_fuse_settings(struct drm_device *dev)
>  static void mid_get_pci_revID(struct drm_psb_private *dev_priv)
>  {
>  	uint32_t platform_rev_id = 0;
> -	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> +	int domain = pci_domain_nr(dev_priv->dev->pdev->bus);
> +	struct pci_dev *pci_gfx_root =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(2, 0));
>  
>  	if (pci_gfx_root == NULL) {
>  		WARN_ON(1);
> @@ -281,7 +285,9 @@ static void mid_get_vbt_data(struct drm_psb_private *dev_priv)
>  	u32 addr;
>  	u8 __iomem *vbt_virtual;
>  	struct mid_vbt_header vbt_header;
> -	struct pci_dev *pci_gfx_root = pci_get_bus_and_slot(0, PCI_DEVFN(2, 0));
> +	struct pci_dev *pci_gfx_root =
> +		pci_get_domain_bus_and_slot(pci_domain_nr(dev->pdev->bus),
> +					    0, PCI_DEVFN(2, 0));
>  	int ret = -1;
>  
>  	/* Get the address of the platform config vbt */
> diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
> index 37a3be7..99d6527 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.c
> +++ b/drivers/gpu/drm/gma500/psb_drv.c
> @@ -261,7 +261,11 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
>  		goto out_err;
>  
>  	if (IS_MRST(dev)) {
> -		dev_priv->aux_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(3, 0));
> +		int domain = pci_domain_nr(dev->pdev->bus);
> +
> +		dev_priv->aux_pdev =
> +			pci_get_domain_bus_and_slot(domain, 0,
> +						    PCI_DEVFN(3, 0));
>  
>  		if (dev_priv->aux_pdev) {
>  			resource_start = pci_resource_start(dev_priv->aux_pdev,
> @@ -281,7 +285,9 @@ static int psb_driver_load(struct drm_device *dev, unsigned long flags)
>  		}
>  		dev_priv->gmbus_reg = dev_priv->aux_reg;
>  
> -		dev_priv->lpc_pdev = pci_get_bus_and_slot(0, PCI_DEVFN(31, 0));
> +		dev_priv->lpc_pdev =
> +			pci_get_domain_bus_and_slot(domain, 0,
> +						    PCI_DEVFN(31, 0));
>  		if (dev_priv->lpc_pdev) {
>  			pci_read_config_word(dev_priv->lpc_pdev, PSB_LPC_GBA,
>  				&dev_priv->lpc_gpio_base);
> diff --git a/drivers/gpu/drm/gma500/psb_drv.h b/drivers/gpu/drm/gma500/psb_drv.h
> index 821497d..d409e02 100644
> --- a/drivers/gpu/drm/gma500/psb_drv.h
> +++ b/drivers/gpu/drm/gma500/psb_drv.h
> @@ -781,38 +781,40 @@ extern int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
>  extern int drm_idle_check_interval;
>  
>  /* Utilities */
> -static inline u32 MRST_MSG_READ32(uint port, uint offset)
> +static inline u32 MRST_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0xD0<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
> -static inline void MRST_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void MRST_MSG_WRITE32(int domain, uint port, uint offset,
> +				    u32 value)
>  {
>  	int mcr = (0xE0<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
>  }
> -static inline u32 MDFLD_MSG_READ32(uint port, uint offset)
> +static inline u32 MDFLD_MSG_READ32(int domain, uint port, uint offset)
>  {
>  	int mcr = (0x10<<24) | (port << 16) | (offset << 8);
>  	uint32_t ret_val = 0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_read_config_dword(pci_root, 0xD4, &ret_val);
>  	pci_dev_put(pci_root);
>  	return ret_val;
>  }
> -static inline void MDFLD_MSG_WRITE32(uint port, uint offset, u32 value)
> +static inline void MDFLD_MSG_WRITE32(int domain, uint port, uint offset,
> +				     u32 value)
>  {
>  	int mcr = (0x11<<24) | (port << 16) | (offset << 8) | 0xF0;
> -	struct pci_dev *pci_root = pci_get_bus_and_slot(0, 0);
> +	struct pci_dev *pci_root = pci_get_domain_bus_and_slot(domain, 0, 0);
>  	pci_write_config_dword(pci_root, 0xD4, value);
>  	pci_write_config_dword(pci_root, 0xD0, mcr);
>  	pci_dev_put(pci_root);
> 


-- 
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] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
  (?)
@ 2017-11-27 18:50     ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:50 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list, dri-devel,
	Rodrigo Vivi, linux-arm-kernel

+dri-devel@lists.freedesktop.org

On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> 


-- 
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.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-27 18:50     ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:50 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Jani Nikula,
	Joonas Lahtinen, Rodrigo Vivi, David Airlie,
	open list:DRM DRIVERS, open list, dri-devel

+dri-devel@lists.freedesktop.org

On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> 


-- 
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] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-27 18:50     ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:50 UTC (permalink / raw)
  To: linux-arm-kernel

+dri-devel at lists.freedesktop.org

On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> 


-- 
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] 172+ messages in thread

* Re: [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 18:52       ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:52 UTC (permalink / raw)
  To: linux-pci-u79uwXL29TY76Z2rM5mHXA, timur-sgV2jX0FEOL9JmXXK+q4OQ
  Cc: linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, David Airlie,
	linux-arm-msm-u79uwXL29TY76Z2rM5mHXA,
	intel-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, open list,
	open list:DRM DRIVERS, Ben Skeggs,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

+nouveau@lists.freedesktop.org


On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
> and extract the domain number from
> 1. struct pci_dev
> 2. struct pci_dev through drm_device->pdev
> 3. struct pci_dev through fb->subdev->drm_device->pdev
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/nouveau/dispnv04/arb.c           |  4 +++-
>  drivers/gpu/drm/nouveau/dispnv04/hw.c            | 10 +++++++---
>  drivers/gpu/drm/nouveau/nouveau_drm.c            |  3 ++-
>  drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +++++++++-
>  4 files changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> index 90075b6..c79160c 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> @@ -213,8 +213,10 @@ struct nv_sim_state {
>  	if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
>  	    (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
>  		uint32_t type;
> +		int domain = pci_domain_nr(dev->pdev->bus);
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
> +				      0x7c, &type);
>  
>  		sim_data.memory_type = (type >> 12) & 1;
>  		sim_data.memory_width = 64;
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> index b985990..0c9bdf0 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> @@ -216,12 +216,15 @@
>  {
>  	struct nvkm_pll_vals pllvals;
>  	int ret;
> +	int domain;
> +
> +	domain = pci_domain_nr(dev->pdev->bus);
>  
>  	if (plltype == PLL_MEMORY &&
>  	    (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
>  		uint32_t mpllP;
> -
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
> +				      0x6c, &mpllP);
>  		mpllP = (mpllP >> 8) & 0xf;
>  		if (!mpllP)
>  			mpllP = 4;
> @@ -232,7 +235,8 @@
>  	    (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
>  		uint32_t clock;
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
> +				      0x4c, &clock);
>  		return clock / 1000;
>  	}
>  
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 595630d..0b6c639 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* subfunction one is a hdmi audio device? */
> -	drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
> +	drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> +						(unsigned int)pdev->bus->number,
>  						PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
>  
>  	if (!drm->hdmi_device) {
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> index 3c6a871..8849b71 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> @@ -28,8 +28,16 @@
>  {
>  	struct pci_dev *bridge;
>  	u32 mem, mib;
> +	int domain = 0;
> +	struct pci_dev *pdev = NULL;
>  
> -	bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
> +	if (dev_is_pci(fb->subdev.device->dev))
> +		pdev = to_pci_dev(fb->subdev.device->dev);
> +
> +	if (pdev)
> +		domain = pci_domain_nr(pdev->bus);
> +
> +	bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
>  	if (!bridge) {
>  		nvkm_error(&fb->subdev, "no bridge device\n");
>  		return -ENODEV;
> 


-- 
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.
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
@ 2017-11-27 18:52       ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:52 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Ben Skeggs,
	David Airlie, Ilia Mirkin,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS,
	open list:DRM DRIVER FOR NVIDIA GEFORCE/QUADRO GPUS, open list,
	open list:DRM DRIVERS, nouveau

+nouveau@lists.freedesktop.org


On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
> and extract the domain number from
> 1. struct pci_dev
> 2. struct pci_dev through drm_device->pdev
> 3. struct pci_dev through fb->subdev->drm_device->pdev
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/nouveau/dispnv04/arb.c           |  4 +++-
>  drivers/gpu/drm/nouveau/dispnv04/hw.c            | 10 +++++++---
>  drivers/gpu/drm/nouveau/nouveau_drm.c            |  3 ++-
>  drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +++++++++-
>  4 files changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> index 90075b6..c79160c 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> @@ -213,8 +213,10 @@ struct nv_sim_state {
>  	if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
>  	    (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
>  		uint32_t type;
> +		int domain = pci_domain_nr(dev->pdev->bus);
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
> +				      0x7c, &type);
>  
>  		sim_data.memory_type = (type >> 12) & 1;
>  		sim_data.memory_width = 64;
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> index b985990..0c9bdf0 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> @@ -216,12 +216,15 @@
>  {
>  	struct nvkm_pll_vals pllvals;
>  	int ret;
> +	int domain;
> +
> +	domain = pci_domain_nr(dev->pdev->bus);
>  
>  	if (plltype == PLL_MEMORY &&
>  	    (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
>  		uint32_t mpllP;
> -
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
> +				      0x6c, &mpllP);
>  		mpllP = (mpllP >> 8) & 0xf;
>  		if (!mpllP)
>  			mpllP = 4;
> @@ -232,7 +235,8 @@
>  	    (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
>  		uint32_t clock;
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
> +				      0x4c, &clock);
>  		return clock / 1000;
>  	}
>  
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 595630d..0b6c639 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* subfunction one is a hdmi audio device? */
> -	drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
> +	drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> +						(unsigned int)pdev->bus->number,
>  						PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
>  
>  	if (!drm->hdmi_device) {
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> index 3c6a871..8849b71 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> @@ -28,8 +28,16 @@
>  {
>  	struct pci_dev *bridge;
>  	u32 mem, mib;
> +	int domain = 0;
> +	struct pci_dev *pdev = NULL;
>  
> -	bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
> +	if (dev_is_pci(fb->subdev.device->dev))
> +		pdev = to_pci_dev(fb->subdev.device->dev);
> +
> +	if (pdev)
> +		domain = pci_domain_nr(pdev->bus);
> +
> +	bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
>  	if (!bridge) {
>  		nvkm_error(&fb->subdev, "no bridge device\n");
>  		return -ENODEV;
> 


-- 
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] 172+ messages in thread

* Re: [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
@ 2017-11-27 18:52       ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:52 UTC (permalink / raw)
  To: linux-pci, timur
  Cc: linux-arm-kernel, David Airlie, linux-arm-msm, intel-gfx,
	open list, open list:DRM DRIVERS, Ben Skeggs, nouveau,
	Ilia Mirkin

+nouveau@lists.freedesktop.org


On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
> and extract the domain number from
> 1. struct pci_dev
> 2. struct pci_dev through drm_device->pdev
> 3. struct pci_dev through fb->subdev->drm_device->pdev
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/nouveau/dispnv04/arb.c           |  4 +++-
>  drivers/gpu/drm/nouveau/dispnv04/hw.c            | 10 +++++++---
>  drivers/gpu/drm/nouveau/nouveau_drm.c            |  3 ++-
>  drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +++++++++-
>  4 files changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> index 90075b6..c79160c 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> @@ -213,8 +213,10 @@ struct nv_sim_state {
>  	if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
>  	    (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
>  		uint32_t type;
> +		int domain = pci_domain_nr(dev->pdev->bus);
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
> +				      0x7c, &type);
>  
>  		sim_data.memory_type = (type >> 12) & 1;
>  		sim_data.memory_width = 64;
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> index b985990..0c9bdf0 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> @@ -216,12 +216,15 @@
>  {
>  	struct nvkm_pll_vals pllvals;
>  	int ret;
> +	int domain;
> +
> +	domain = pci_domain_nr(dev->pdev->bus);
>  
>  	if (plltype == PLL_MEMORY &&
>  	    (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
>  		uint32_t mpllP;
> -
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
> +				      0x6c, &mpllP);
>  		mpllP = (mpllP >> 8) & 0xf;
>  		if (!mpllP)
>  			mpllP = 4;
> @@ -232,7 +235,8 @@
>  	    (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
>  		uint32_t clock;
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
> +				      0x4c, &clock);
>  		return clock / 1000;
>  	}
>  
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 595630d..0b6c639 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* subfunction one is a hdmi audio device? */
> -	drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
> +	drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> +						(unsigned int)pdev->bus->number,
>  						PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
>  
>  	if (!drm->hdmi_device) {
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> index 3c6a871..8849b71 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> @@ -28,8 +28,16 @@
>  {
>  	struct pci_dev *bridge;
>  	u32 mem, mib;
> +	int domain = 0;
> +	struct pci_dev *pdev = NULL;
>  
> -	bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
> +	if (dev_is_pci(fb->subdev.device->dev))
> +		pdev = to_pci_dev(fb->subdev.device->dev);
> +
> +	if (pdev)
> +		domain = pci_domain_nr(pdev->bus);
> +
> +	bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
>  	if (!bridge) {
>  		nvkm_error(&fb->subdev, "no bridge device\n");
>  		return -ENODEV;
> 


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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
@ 2017-11-27 18:52       ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-27 18:52 UTC (permalink / raw)
  To: linux-arm-kernel

+nouveau at lists.freedesktop.org


On 11/27/2017 11:57 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Replace pci_get_bus_and_slot() with pci_get_domain_bus_and_slot()
> and extract the domain number from
> 1. struct pci_dev
> 2. struct pci_dev through drm_device->pdev
> 3. struct pci_dev through fb->subdev->drm_device->pdev
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/nouveau/dispnv04/arb.c           |  4 +++-
>  drivers/gpu/drm/nouveau/dispnv04/hw.c            | 10 +++++++---
>  drivers/gpu/drm/nouveau/nouveau_drm.c            |  3 ++-
>  drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c | 10 +++++++++-
>  4 files changed, 21 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/arb.c b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> index 90075b6..c79160c 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/arb.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/arb.c
> @@ -213,8 +213,10 @@ struct nv_sim_state {
>  	if ((dev->pdev->device & 0xffff) == 0x01a0 /*CHIPSET_NFORCE*/ ||
>  	    (dev->pdev->device & 0xffff) == 0x01f0 /*CHIPSET_NFORCE2*/) {
>  		uint32_t type;
> +		int domain = pci_domain_nr(dev->pdev->bus);
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 1), 0x7c, &type);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 1),
> +				      0x7c, &type);
>  
>  		sim_data.memory_type = (type >> 12) & 1;
>  		sim_data.memory_width = 64;
> diff --git a/drivers/gpu/drm/nouveau/dispnv04/hw.c b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> index b985990..0c9bdf0 100644
> --- a/drivers/gpu/drm/nouveau/dispnv04/hw.c
> +++ b/drivers/gpu/drm/nouveau/dispnv04/hw.c
> @@ -216,12 +216,15 @@
>  {
>  	struct nvkm_pll_vals pllvals;
>  	int ret;
> +	int domain;
> +
> +	domain = pci_domain_nr(dev->pdev->bus);
>  
>  	if (plltype == PLL_MEMORY &&
>  	    (dev->pdev->device & 0x0ff0) == CHIPSET_NFORCE) {
>  		uint32_t mpllP;
> -
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 3), 0x6c, &mpllP);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 3),
> +				      0x6c, &mpllP);
>  		mpllP = (mpllP >> 8) & 0xf;
>  		if (!mpllP)
>  			mpllP = 4;
> @@ -232,7 +235,8 @@
>  	    (dev->pdev->device & 0xff0) == CHIPSET_NFORCE2) {
>  		uint32_t clock;
>  
> -		pci_read_config_dword(pci_get_bus_and_slot(0, 5), 0x4c, &clock);
> +		pci_read_config_dword(pci_get_domain_bus_and_slot(domain, 0, 5),
> +				      0x4c, &clock);
>  		return clock / 1000;
>  	}
>  
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 595630d..0b6c639 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
> @@ -406,7 +406,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
>  	}
>  
>  	/* subfunction one is a hdmi audio device? */
> -	drm->hdmi_device = pci_get_bus_and_slot((unsigned int)pdev->bus->number,
> +	drm->hdmi_device = pci_get_domain_bus_and_slot(pci_domain_nr(pdev->bus),
> +						(unsigned int)pdev->bus->number,
>  						PCI_DEVFN(PCI_SLOT(pdev->devfn), 1));
>  
>  	if (!drm->hdmi_device) {
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> index 3c6a871..8849b71 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv1a.c
> @@ -28,8 +28,16 @@
>  {
>  	struct pci_dev *bridge;
>  	u32 mem, mib;
> +	int domain = 0;
> +	struct pci_dev *pdev = NULL;
>  
> -	bridge = pci_get_bus_and_slot(0, PCI_DEVFN(0, 1));
> +	if (dev_is_pci(fb->subdev.device->dev))
> +		pdev = to_pci_dev(fb->subdev.device->dev);
> +
> +	if (pdev)
> +		domain = pci_domain_nr(pdev->bus);
> +
> +	bridge = pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 1));
>  	if (!bridge) {
>  		nvkm_error(&fb->subdev, "no bridge device\n");
>  		return -ENODEV;
> 


-- 
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] 172+ messages in thread

* Re: [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
  2017-11-27 16:58   ` Sinan Kaya
                       ` (2 preceding siblings ...)
  (?)
@ 2017-11-27 19:46     ` Jingoo Han
  -1 siblings, 0 replies; 172+ messages in thread
From: Jingoo Han @ 2017-11-27 19:46 UTC (permalink / raw)
  To: 'Sinan Kaya', linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, 'Lee Jones',
	'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	'open list:FRAMEBUFFER LAYER', 'open list'

On Monday, November 27, 2017 11:58 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.

I think that this will be useful. I introduced multi domains into
ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
domain will be used later.

> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Hard-coding the domain as 0.
> 
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/apple_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/apple_bl.c
> b/drivers/video/backlight/apple_bl.c
> index d843296..6a34ab9 100644
> --- a/drivers/video/backlight/apple_bl.c
> +++ b/drivers/video/backlight/apple_bl.c
> @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
>  	struct pci_dev *host;
>  	int intensity;
> 
> -	host = pci_get_bus_and_slot(0, 0);
> +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> 
>  	if (!host) {
>  		pr_err("unable to find PCI host\n");
> --
> 1.9.1

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-27 19:46     ` Jingoo Han
  0 siblings, 0 replies; 172+ messages in thread
From: Jingoo Han @ 2017-11-27 19:46 UTC (permalink / raw)
  To: 'Sinan Kaya', linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, 'Lee Jones',
	'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	'open list:FRAMEBUFFER LAYER', 'open list'

On Monday, November 27, 2017 11:58 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.

I think that this will be useful. I introduced multi domains into
ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
domain will be used later.

> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Hard-coding the domain as 0.
> 
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/apple_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/apple_bl.c
> b/drivers/video/backlight/apple_bl.c
> index d843296..6a34ab9 100644
> --- a/drivers/video/backlight/apple_bl.c
> +++ b/drivers/video/backlight/apple_bl.c
> @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
>  	struct pci_dev *host;
>  	int intensity;
> 
> -	host = pci_get_bus_and_slot(0, 0);
> +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> 
>  	if (!host) {
>  		pr_err("unable to find PCI host\n");
> --
> 1.9.1

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-27 19:46     ` Jingoo Han
  0 siblings, 0 replies; 172+ messages in thread
From: Jingoo Han @ 2017-11-27 19:46 UTC (permalink / raw)
  To: 'Sinan Kaya', linux-pci, timur
  Cc: 'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	linux-arm-msm, intel-gfx, 'open list:FRAMEBUFFER LAYER',
	'open list', 'Lee Jones',
	linux-arm-kernel

On Monday, November 27, 2017 11:58 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.

I think that this will be useful. I introduced multi domains into
ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
domain will be used later.

> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Hard-coding the domain as 0.
> 
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/apple_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/apple_bl.c
> b/drivers/video/backlight/apple_bl.c
> index d843296..6a34ab9 100644
> --- a/drivers/video/backlight/apple_bl.c
> +++ b/drivers/video/backlight/apple_bl.c
> @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
>  	struct pci_dev *host;
>  	int intensity;
> 
> -	host = pci_get_bus_and_slot(0, 0);
> +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> 
>  	if (!host) {
>  		pr_err("unable to find PCI host\n");
> --
> 1.9.1



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-27 19:46     ` Jingoo Han
  0 siblings, 0 replies; 172+ messages in thread
From: Jingoo Han @ 2017-11-27 19:46 UTC (permalink / raw)
  To: 'Sinan Kaya', linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, 'Lee Jones',
	'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	'open list:FRAMEBUFFER LAYER', 'open list'

On Monday, November 27, 2017 11:58 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.

I think that this will be useful. I introduced multi domains into
ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
domain will be used later.

> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Hard-coding the domain as 0.
> 
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/apple_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/apple_bl.c
> b/drivers/video/backlight/apple_bl.c
> index d843296..6a34ab9 100644
> --- a/drivers/video/backlight/apple_bl.c
> +++ b/drivers/video/backlight/apple_bl.c
> @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
>  	struct pci_dev *host;
>  	int intensity;
> 
> -	host = pci_get_bus_and_slot(0, 0);
> +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> 
>  	if (!host) {
>  		pr_err("unable to find PCI host\n");
> --
> 1.9.1



^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-27 19:46     ` Jingoo Han
  0 siblings, 0 replies; 172+ messages in thread
From: Jingoo Han @ 2017-11-27 19:46 UTC (permalink / raw)
  To: linux-arm-kernel

On Monday, November 27, 2017 11:58 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.

I think that this will be useful. I introduced multi domains into
ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
domain will be used later.

> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Hard-coding the domain as 0.
> 
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Jingoo Han <jingoohan1@gmail.com>

Best regards,
Jingoo Han

> ---
>  drivers/video/backlight/apple_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/video/backlight/apple_bl.c
> b/drivers/video/backlight/apple_bl.c
> index d843296..6a34ab9 100644
> --- a/drivers/video/backlight/apple_bl.c
> +++ b/drivers/video/backlight/apple_bl.c
> @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
>  	struct pci_dev *host;
>  	int intensity;
> 
> -	host = pci_get_bus_and_slot(0, 0);
> +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> 
>  	if (!host) {
>  		pr_err("unable to find PCI host\n");
> --
> 1.9.1

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 04/29] ata: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
  (?)
  (?)
@ 2017-11-27 19:50     ` Tejun Heo
  -1 siblings, 0 replies; 172+ messages in thread
From: Tejun Heo @ 2017-11-27 19:50 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: Bartlomiej Zolnierkiewicz, linux-pci, timur, open list,
	open list:LIBATA PATA DRIVERS, linux-arm-msm, intel-gfx,
	linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:41AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use pci_get_domain_bus_and_slot() and extract the actual domain number
> from the pdev passed in.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Tejun Heo <tj@kernel.org>

Please feel free to route with the rest of the series.

Thanks.

-- 
tejun
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 04/29] ata: deprecate pci_get_bus_and_slot()
@ 2017-11-27 19:50     ` Tejun Heo
  0 siblings, 0 replies; 172+ messages in thread
From: Tejun Heo @ 2017-11-27 19:50 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx,
	Bartlomiej Zolnierkiewicz, open list:LIBATA PATA DRIVERS,
	open list

On Mon, Nov 27, 2017 at 11:57:41AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use pci_get_domain_bus_and_slot() and extract the actual domain number
> from the pdev passed in.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Tejun Heo <tj@kernel.org>

Please feel free to route with the rest of the series.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 04/29] ata: deprecate pci_get_bus_and_slot()
@ 2017-11-27 19:50     ` Tejun Heo
  0 siblings, 0 replies; 172+ messages in thread
From: Tejun Heo @ 2017-11-27 19:50 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: Bartlomiej Zolnierkiewicz, linux-pci, timur, open list,
	open list:LIBATA PATA DRIVERS, linux-arm-msm, intel-gfx,
	linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:41AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use pci_get_domain_bus_and_slot() and extract the actual domain number
> from the pdev passed in.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Tejun Heo <tj@kernel.org>

Please feel free to route with the rest of the series.

Thanks.

-- 
tejun

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 04/29] ata: deprecate pci_get_bus_and_slot()
@ 2017-11-27 19:50     ` Tejun Heo
  0 siblings, 0 replies; 172+ messages in thread
From: Tejun Heo @ 2017-11-27 19:50 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:41AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use pci_get_domain_bus_and_slot() and extract the actual domain number
> from the pdev passed in.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Tejun Heo <tj@kernel.org>

Please feel free to route with the rest of the series.

Thanks.

-- 
tejun

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
  2017-11-27 19:46     ` Jingoo Han
  (?)
  (?)
@ 2017-11-28  8:13       ` Lee Jones
  -1 siblings, 0 replies; 172+ messages in thread
From: Lee Jones @ 2017-11-28  8:13 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Sinan Kaya',
	linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx,
	'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	'open list:FRAMEBUFFER LAYER', 'open list'

On Mon, 27 Nov 2017, Jingoo Han wrote:
> On Monday, November 27, 2017 11:58 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.
> 
> I think that this will be useful. I introduced multi domains into
> ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
> domain will be used later.
> 
> > 
> > Getting ready to remove pci_get_bus_and_slot() function in favor of
> > pci_get_domain_bus_and_slot().
> > 
> > Hard-coding the domain as 0.
> > 
> > Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> > Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> 
> Acked-by: Jingoo Han <jingoohan1@gmail.com>

I can't apply this.

It looks like I was missing from the list of addressees.

Please resend v3 with all the Acks you've acquired.

> > ---
> >  drivers/video/backlight/apple_bl.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/video/backlight/apple_bl.c
> > b/drivers/video/backlight/apple_bl.c
> > index d843296..6a34ab9 100644
> > --- a/drivers/video/backlight/apple_bl.c
> > +++ b/drivers/video/backlight/apple_bl.c
> > @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
> >  	struct pci_dev *host;
> >  	int intensity;
> > 
> > -	host = pci_get_bus_and_slot(0, 0);
> > +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> > 
> >  	if (!host) {
> >  		pr_err("unable to find PCI host\n");
> 
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-28  8:13       ` Lee Jones
  0 siblings, 0 replies; 172+ messages in thread
From: Lee Jones @ 2017-11-28  8:13 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	linux-pci, timur, 'open list:FRAMEBUFFER LAYER',
	'open list', 'Sinan Kaya',
	linux-arm-msm, intel-gfx, linux-arm-kernel

T24gTW9uLCAyNyBOb3YgMjAxNywgSmluZ29vIEhhbiB3cm90ZToKPiBPbiBNb25kYXksIE5vdmVt
YmVyIDI3LCAyMDE3IDExOjU4IEFNLCBTaW5hbiBLYXlhIHdyb3RlOgo+ID4gCj4gPiBwY2lfZ2V0
X2J1c19hbmRfc2xvdCgpIGlzIHJlc3RyaWN0aXZlIHN1Y2ggdGhhdCBpdCBhc3N1bWVzIGRvbWFp
bj0wIGFzCj4gPiB3aGVyZSBhIFBDSSBkZXZpY2UgaXMgcHJlc2VudC4gVGhpcyByZXN0cmljdHMg
dGhlIGRldmljZSBkcml2ZXJzIHRvIGJlCj4gPiByZXVzZWQgZm9yIG90aGVyIGRvbWFpbiBudW1i
ZXJzLgo+IAo+IEkgdGhpbmsgdGhhdCB0aGlzIHdpbGwgYmUgdXNlZnVsLiBJIGludHJvZHVjZWQg
bXVsdGkgZG9tYWlucyBpbnRvCj4gQVJNLWJhc2VkIFBDSWUgZHJpdmVyLiAoZS5nLiBkb21haW4g
MCwgYW5kIGRvbWFpbiAxKSBTbywgQVBJcyB0byBjaG9vc2UKPiBkb21haW4gd2lsbCBiZSB1c2Vk
IGxhdGVyLgo+IAo+ID4gCj4gPiBHZXR0aW5nIHJlYWR5IHRvIHJlbW92ZSBwY2lfZ2V0X2J1c19h
bmRfc2xvdCgpIGZ1bmN0aW9uIGluIGZhdm9yIG9mCj4gPiBwY2lfZ2V0X2RvbWFpbl9idXNfYW5k
X3Nsb3QoKS4KPiA+IAo+ID4gSGFyZC1jb2RpbmcgdGhlIGRvbWFpbiBhcyAwLgo+ID4gCj4gPiBB
Y2tlZC1ieTogRGFuaWVsIFRob21wc29uIDxkYW5pZWwudGhvbXBzb25AbGluYXJvLm9yZz4KPiA+
IFNpZ25lZC1vZmYtYnk6IFNpbmFuIEtheWEgPG9rYXlhQGNvZGVhdXJvcmEub3JnPgo+IAo+IEFj
a2VkLWJ5OiBKaW5nb28gSGFuIDxqaW5nb29oYW4xQGdtYWlsLmNvbT4KCkkgY2FuJ3QgYXBwbHkg
dGhpcy4KCkl0IGxvb2tzIGxpa2UgSSB3YXMgbWlzc2luZyBmcm9tIHRoZSBsaXN0IG9mIGFkZHJl
c3NlZXMuCgpQbGVhc2UgcmVzZW5kIHYzIHdpdGggYWxsIHRoZSBBY2tzIHlvdSd2ZSBhY3F1aXJl
ZC4KCj4gPiAtLS0KPiA+ICBkcml2ZXJzL3ZpZGVvL2JhY2tsaWdodC9hcHBsZV9ibC5jIHwgMiAr
LQo+ID4gIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlvbigrKSwgMSBkZWxldGlvbigtKQo+ID4g
Cj4gPiBkaWZmIC0tZ2l0IGEvZHJpdmVycy92aWRlby9iYWNrbGlnaHQvYXBwbGVfYmwuYwo+ID4g
Yi9kcml2ZXJzL3ZpZGVvL2JhY2tsaWdodC9hcHBsZV9ibC5jCj4gPiBpbmRleCBkODQzMjk2Li42
YTM0YWI5IDEwMDY0NAo+ID4gLS0tIGEvZHJpdmVycy92aWRlby9iYWNrbGlnaHQvYXBwbGVfYmwu
Ywo+ID4gKysrIGIvZHJpdmVycy92aWRlby9iYWNrbGlnaHQvYXBwbGVfYmwuYwo+ID4gQEAgLTE0
Myw3ICsxNDMsNyBAQCBzdGF0aWMgaW50IGFwcGxlX2JsX2FkZChzdHJ1Y3QgYWNwaV9kZXZpY2Ug
KmRldikKPiA+ICAJc3RydWN0IHBjaV9kZXYgKmhvc3Q7Cj4gPiAgCWludCBpbnRlbnNpdHk7Cj4g
PiAKPiA+IC0JaG9zdCA9IHBjaV9nZXRfYnVzX2FuZF9zbG90KDAsIDApOwo+ID4gKwlob3N0ID0g
cGNpX2dldF9kb21haW5fYnVzX2FuZF9zbG90KDAsIDAsIDApOwo+ID4gCj4gPiAgCWlmICghaG9z
dCkgewo+ID4gIAkJcHJfZXJyKCJ1bmFibGUgdG8gZmluZCBQQ0kgaG9zdFxuIik7Cj4gCj4gCgot
LSAKTGVlIEpvbmVzCkxpbmFybyBTVE1pY3JvZWxlY3Ryb25pY3MgTGFuZGluZyBUZWFtIExlYWQK
TGluYXJvLm9yZyDilIIgT3BlbiBzb3VyY2Ugc29mdHdhcmUgZm9yIEFSTSBTb0NzCkZvbGxvdyBM
aW5hcm86IEZhY2Vib29rIHwgVHdpdHRlciB8IEJsb2cKCl9fX19fX19fX19fX19fX19fX19fX19f
X19fX19fX19fX19fX19fX19fX19fX19fCmxpbnV4LWFybS1rZXJuZWwgbWFpbGluZyBsaXN0Cmxp
bnV4LWFybS1rZXJuZWxAbGlzdHMuaW5mcmFkZWFkLm9yZwpodHRwOi8vbGlzdHMuaW5mcmFkZWFk
Lm9yZy9tYWlsbWFuL2xpc3RpbmZvL2xpbnV4LWFybS1rZXJuZWwK

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-28  8:13       ` Lee Jones
  0 siblings, 0 replies; 172+ messages in thread
From: Lee Jones @ 2017-11-28  8:13 UTC (permalink / raw)
  To: Jingoo Han
  Cc: 'Sinan Kaya',
	linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx,
	'Daniel Thompson', 'Bartlomiej Zolnierkiewicz',
	'open list:FRAMEBUFFER LAYER', 'open list'

On Mon, 27 Nov 2017, Jingoo Han wrote:
> On Monday, November 27, 2017 11:58 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.
> 
> I think that this will be useful. I introduced multi domains into
> ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
> domain will be used later.
> 
> > 
> > Getting ready to remove pci_get_bus_and_slot() function in favor of
> > pci_get_domain_bus_and_slot().
> > 
> > Hard-coding the domain as 0.
> > 
> > Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> > Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> 
> Acked-by: Jingoo Han <jingoohan1@gmail.com>

I can't apply this.

It looks like I was missing from the list of addressees.

Please resend v3 with all the Acks you've acquired.

> > ---
> >  drivers/video/backlight/apple_bl.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/video/backlight/apple_bl.c
> > b/drivers/video/backlight/apple_bl.c
> > index d843296..6a34ab9 100644
> > --- a/drivers/video/backlight/apple_bl.c
> > +++ b/drivers/video/backlight/apple_bl.c
> > @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
> >  	struct pci_dev *host;
> >  	int intensity;
> > 
> > -	host = pci_get_bus_and_slot(0, 0);
> > +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> > 
> >  	if (!host) {
> >  		pr_err("unable to find PCI host\n");
> 
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot()
@ 2017-11-28  8:13       ` Lee Jones
  0 siblings, 0 replies; 172+ messages in thread
From: Lee Jones @ 2017-11-28  8:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 27 Nov 2017, Jingoo Han wrote:
> On Monday, November 27, 2017 11:58 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.
> 
> I think that this will be useful. I introduced multi domains into
> ARM-based PCIe driver. (e.g. domain 0, and domain 1) So, APIs to choose
> domain will be used later.
> 
> > 
> > Getting ready to remove pci_get_bus_and_slot() function in favor of
> > pci_get_domain_bus_and_slot().
> > 
> > Hard-coding the domain as 0.
> > 
> > Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
> > Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> 
> Acked-by: Jingoo Han <jingoohan1@gmail.com>

I can't apply this.

It looks like I was missing from the list of addressees.

Please resend v3 with all the Acks you've acquired.

> > ---
> >  drivers/video/backlight/apple_bl.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/video/backlight/apple_bl.c
> > b/drivers/video/backlight/apple_bl.c
> > index d843296..6a34ab9 100644
> > --- a/drivers/video/backlight/apple_bl.c
> > +++ b/drivers/video/backlight/apple_bl.c
> > @@ -143,7 +143,7 @@ static int apple_bl_add(struct acpi_device *dev)
> >  	struct pci_dev *host;
> >  	int intensity;
> > 
> > -	host = pci_get_bus_and_slot(0, 0);
> > +	host = pci_get_domain_bus_and_slot(0, 0, 0);
> > 
> >  	if (!host) {
> >  		pr_err("unable to find PCI host\n");
> 
> 

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org ? Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
  (?)
  (?)
@ 2017-11-28 13:45     ` Thomas Gleixner
  -1 siblings, 0 replies; 172+ messages in thread
From: Thomas Gleixner @ 2017-11-28 13:45 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	linux-pci, timur, H. Peter Anvin,
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	Ingo Molnar, linux-arm-msm, Bjorn Helgaas, intel-gfx,
	linux-arm-kernel


On Mon, 27 Nov 2017, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use domain number of 0 as the domain number is not available in struct
> irq_routing_table.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Thomas Gleixner <tglx@linutronix.de>

> ---
>  arch/x86/pci/irq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
> index 04526291..52e5510 100644
> --- a/arch/x86/pci/irq.c
> +++ b/arch/x86/pci/irq.c
> @@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
>  	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
>  	    rt->rtr_vendor, rt->rtr_device);
>  
> -	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
> +	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
> +						      rt->rtr_devfn);
>  	if (!pirq_router_dev) {
>  		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
>  			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
> -- 
> 1.9.1
> 
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-28 13:45     ` Thomas Gleixner
  0 siblings, 0 replies; 172+ messages in thread
From: Thomas Gleixner @ 2017-11-28 13:45 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx,
	Bjorn Helgaas, Ingo Molnar, H. Peter Anvin,
	maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)


On Mon, 27 Nov 2017, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use domain number of 0 as the domain number is not available in struct
> irq_routing_table.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Thomas Gleixner <tglx@linutronix.de>

> ---
>  arch/x86/pci/irq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
> index 04526291..52e5510 100644
> --- a/arch/x86/pci/irq.c
> +++ b/arch/x86/pci/irq.c
> @@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
>  	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
>  	    rt->rtr_vendor, rt->rtr_device);
>  
> -	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
> +	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
> +						      rt->rtr_devfn);
>  	if (!pirq_router_dev) {
>  		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
>  			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
> -- 
> 1.9.1
> 
> 

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-28 13:45     ` Thomas Gleixner
  0 siblings, 0 replies; 172+ messages in thread
From: Thomas Gleixner @ 2017-11-28 13:45 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	linux-pci, timur, H. Peter Anvin,
	open list:X86 ARCHITECTURE (32-BIT AND 64-BIT),
	Ingo Molnar, linux-arm-msm, Bjorn Helgaas, intel-gfx,
	linux-arm-kernel


On Mon, 27 Nov 2017, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use domain number of 0 as the domain number is not available in struct
> irq_routing_table.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Thomas Gleixner <tglx@linutronix.de>

> ---
>  arch/x86/pci/irq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
> index 04526291..52e5510 100644
> --- a/arch/x86/pci/irq.c
> +++ b/arch/x86/pci/irq.c
> @@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
>  	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
>  	    rt->rtr_vendor, rt->rtr_device);
>  
> -	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
> +	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
> +						      rt->rtr_devfn);
>  	if (!pirq_router_dev) {
>  		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
>  			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
> -- 
> 1.9.1
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 03/29] x86/PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-28 13:45     ` Thomas Gleixner
  0 siblings, 0 replies; 172+ messages in thread
From: Thomas Gleixner @ 2017-11-28 13:45 UTC (permalink / raw)
  To: linux-arm-kernel


On Mon, 27 Nov 2017, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Use domain number of 0 as the domain number is not available in struct
> irq_routing_table.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

Acked-by: Thomas Gleixner <tglx@linutronix.de>

> ---
>  arch/x86/pci/irq.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/pci/irq.c b/arch/x86/pci/irq.c
> index 04526291..52e5510 100644
> --- a/arch/x86/pci/irq.c
> +++ b/arch/x86/pci/irq.c
> @@ -839,7 +839,8 @@ static void __init pirq_find_router(struct irq_router *r)
>  	DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for [%04x:%04x]\n",
>  	    rt->rtr_vendor, rt->rtr_device);
>  
> -	pirq_router_dev = pci_get_bus_and_slot(rt->rtr_bus, rt->rtr_devfn);
> +	pirq_router_dev = pci_get_domain_bus_and_slot(0, rt->rtr_bus,
> +						      rt->rtr_devfn);
>  	if (!pirq_router_dev) {
>  		DBG(KERN_DEBUG "PCI: Interrupt router not found at "
>  			"%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn);
> -- 
> 1.9.1
> 
> 

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
  (?)
  (?)
@ 2017-11-28 15:30     ` Ville Syrjälä
  -1 siblings, 0 replies; 172+ messages in thread
From: Ville Syrjälä @ 2017-11-28 15:30 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: David Airlie, linux-pci, timur, Rodrigo Vivi, open list,
	open list:DRM DRIVERS, linux-arm-msm, intel-gfx,
	linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));

Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?

I guess if we want to be pedantic we could go for:

bus = pci_find_host_bridge(pdev->bus)->bus;
pci_get_slot(bus, PCI_DEVFN(0, 0))

but I think the GPU should always be on the root bus, so the simpler
form should be fine.

>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-28 15:30     ` Ville Syrjälä
  0 siblings, 0 replies; 172+ messages in thread
From: Ville Syrjälä @ 2017-11-28 15:30 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, David Airlie, linux-arm-msm, intel-gfx,
	open list, open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));

Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?

I guess if we want to be pedantic we could go for:

bus = pci_find_host_bridge(pdev->bus)->bus;
pci_get_slot(bus, PCI_DEVFN(0, 0))

but I think the GPU should always be on the root bus, so the simpler
form should be fine.

>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-28 15:30     ` Ville Syrjälä
  0 siblings, 0 replies; 172+ messages in thread
From: Ville Syrjälä @ 2017-11-28 15:30 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: David Airlie, linux-pci, timur, Rodrigo Vivi, open list,
	open list:DRM DRIVERS, linux-arm-msm, intel-gfx,
	linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:46AM -0500, Sinan Kaya wrote:
> pci_get_bus_and_slot() is restrictive such that it assumes domain=3D0 as
> where a PCI device is present. This restricts the device drivers to be
> reused for other domain numbers.
> =

> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> =

> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> =

> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> =

> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_=
drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, voi=
d *data,
>  =

>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev =3D pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain =3D pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =3D
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));

Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?

I guess if we want to be pedantic we could go for:

bus =3D pci_find_host_bridge(pdev->bus)->bus;
pci_get_slot(bus, PCI_DEVFN(0, 0))

but I think the GPU should always be on the root bus, so the simpler
form should be fine.

>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> -- =

> 1.9.1
> =

> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- =

Ville Syrj=E4l=E4
Intel OTC

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-28 15:30     ` Ville Syrjälä
  0 siblings, 0 replies; 172+ messages in thread
From: Ville Syrjälä @ 2017-11-28 15:30 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));

Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?

I guess if we want to be pedantic we could go for:

bus = pci_find_host_bridge(pdev->bus)->bus;
pci_get_slot(bus, PCI_DEVFN(0, 0))

but I think the GPU should always be on the root bus, so the simpler
form should be fine.

>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> -- 
> 1.9.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrj?l?
Intel OTC

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-28 15:30     ` Ville Syrjälä
  (?)
@ 2017-11-28 16:29       ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-28 16:29 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: linux-pci, timur, David Airlie, linux-arm-msm, intel-gfx,
	open list, open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

On 11/28/2017 10:30 AM, Ville Syrjälä wrote:
>> +	dev_priv->bridge_dev =
>> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
> Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?
> 
> I guess if we want to be pedantic we could go for:
> 
> bus = pci_find_host_bridge(pdev->bus)->bus;
> pci_get_slot(bus, PCI_DEVFN(0, 0))
> 
> but I think the GPU should always be on the root bus, so the simpler
> form should be fine.
> 

All three of these should be correct. 

I'll use pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) as you suggested.

-- 
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] 172+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-28 16:29       ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-28 16:29 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: David Airlie, linux-pci, timur, Rodrigo Vivi, open list,
	open list:DRM DRIVERS, linux-arm-msm, intel-gfx,
	linux-arm-kernel

T24gMTEvMjgvMjAxNyAxMDozMCBBTSwgVmlsbGUgU3lyasOkbMOkIHdyb3RlOgo+PiArCWRldl9w
cml2LT5icmlkZ2VfZGV2ID0KPj4gKwkJcGNpX2dldF9kb21haW5fYnVzX2FuZF9zbG90KGRvbWFp
biwgMCwgUENJX0RFVkZOKDAsIDApKTsKPiBNYXliZSBqdXN0IHBjaV9nZXRfc2xvdChwZGV2LT5i
dXMsIFBDSV9ERVZGTigwLCAwKSkgPwo+IAo+IEkgZ3Vlc3MgaWYgd2Ugd2FudCB0byBiZSBwZWRh
bnRpYyB3ZSBjb3VsZCBnbyBmb3I6Cj4gCj4gYnVzID0gcGNpX2ZpbmRfaG9zdF9icmlkZ2UocGRl
di0+YnVzKS0+YnVzOwo+IHBjaV9nZXRfc2xvdChidXMsIFBDSV9ERVZGTigwLCAwKSkKPiAKPiBi
dXQgSSB0aGluayB0aGUgR1BVIHNob3VsZCBhbHdheXMgYmUgb24gdGhlIHJvb3QgYnVzLCBzbyB0
aGUgc2ltcGxlcgo+IGZvcm0gc2hvdWxkIGJlIGZpbmUuCj4gCgpBbGwgdGhyZWUgb2YgdGhlc2Ug
c2hvdWxkIGJlIGNvcnJlY3QuIAoKSSdsbCB1c2UgcGNpX2dldF9zbG90KHBkZXYtPmJ1cywgUENJ
X0RFVkZOKDAsIDApKSBhcyB5b3Ugc3VnZ2VzdGVkLgoKLS0gClNpbmFuIEtheWEKUXVhbGNvbW0g
RGF0YWNlbnRlciBUZWNobm9sb2dpZXMsIEluYy4gYXMgYW4gYWZmaWxpYXRlIG9mIFF1YWxjb21t
IFRlY2hub2xvZ2llcywgSW5jLgpRdWFsY29tbSBUZWNobm9sb2dpZXMsIEluYy4gaXMgYSBtZW1i
ZXIgb2YgdGhlIENvZGUgQXVyb3JhIEZvcnVtLCBhIExpbnV4IEZvdW5kYXRpb24gQ29sbGFib3Jh
dGl2ZSBQcm9qZWN0LgoKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f
X19fX18KbGludXgtYXJtLWtlcm5lbCBtYWlsaW5nIGxpc3QKbGludXgtYXJtLWtlcm5lbEBsaXN0
cy5pbmZyYWRlYWQub3JnCmh0dHA6Ly9saXN0cy5pbmZyYWRlYWQub3JnL21haWxtYW4vbGlzdGlu
Zm8vbGludXgtYXJtLWtlcm5lbAo=

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-11-28 16:29       ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-11-28 16:29 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/28/2017 10:30 AM, Ville Syrj?l? wrote:
>> +	dev_priv->bridge_dev =
>> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
> Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?
> 
> I guess if we want to be pedantic we could go for:
> 
> bus = pci_find_host_bridge(pdev->bus)->bus;
> pci_get_slot(bus, PCI_DEVFN(0, 0))
> 
> but I think the GPU should always be on the root bus, so the simpler
> form should be fine.
> 

All three of these should be correct. 

I'll use pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) as you suggested.

-- 
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] 172+ messages in thread

* Re: [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
                       ` (2 preceding siblings ...)
  (?)
@ 2017-11-29  8:36     ` Sakari Ailus
  -1 siblings, 0 replies; 172+ messages in thread
From: Sakari Ailus @ 2017-11-29  8:36 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Alan Cox,
	Hans Verkuil, kbuild test robot, Dan Carpenter, Arnd Bergmann,
	Arushi Singhal, Avraham Shukron, Philippe Ombredanne,
	Valentin Vidic, open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
	open list:STAGING SUBSYSTEM

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:59AM -0500, Sinan Kaya wrote:
> diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> index 4631b1d..51dcef57 100644
> --- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> +++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> @@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
>  
>  static int intel_mid_msgbus_init(void)
>  {
> -	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
>  	if (!pci_root) {
>  		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
>  		return -ENODEV;

This file has been removed, I'm applying the rest of the patch.

Please use the media tree as the base in the future. Thanks.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
@ 2017-11-29  8:36     ` Sakari Ailus
  0 siblings, 0 replies; 172+ messages in thread
From: Sakari Ailus @ 2017-11-29  8:36 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Alan Cox,
	Hans Verkuil, kbuild test robot, Dan Carpenter, Arnd Bergmann,
	Arushi Singhal, Avraham Shukron, Philippe Ombredanne,
	Valentin Vidic, open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
	open list:STAGING SUBSYSTEM, open list

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:59AM -0500, Sinan Kaya wrote:
> diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> index 4631b1d..51dcef57 100644
> --- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> +++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> @@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
>  
>  static int intel_mid_msgbus_init(void)
>  {
> -	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
>  	if (!pci_root) {
>  		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
>  		return -ENODEV;

This file has been removed, I'm applying the rest of the patch.

Please use the media tree as the base in the future. Thanks.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
@ 2017-11-29  8:36     ` Sakari Ailus
  0 siblings, 0 replies; 172+ messages in thread
From: Sakari Ailus @ 2017-11-29  8:36 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Alan Cox,
	Hans Verkuil, kbuild test robot, Dan Carpenter, Arnd Bergmann,
	Arushi Singhal, Avraham Shukron, Philippe Ombredanne,
	Valentin Vidic, open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
	open list:STAGING SUBSYSTEM, open list

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:59AM -0500, Sinan Kaya wrote:
> diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> index 4631b1d..51dcef57 100644
> --- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> +++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> @@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
>  
>  static int intel_mid_msgbus_init(void)
>  {
> -	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
>  	if (!pci_root) {
>  		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
>  		return -ENODEV;

This file has been removed, I'm applying the rest of the patch.

Please use the media tree as the base in the future. Thanks.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
@ 2017-11-29  8:36     ` Sakari Ailus
  0 siblings, 0 replies; 172+ messages in thread
From: Sakari Ailus @ 2017-11-29  8:36 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: Arushi Singhal, open list:STAGING SUBSYSTEM, kbuild test robot,
	Arnd Bergmann, Greg Kroah-Hartman, linux-pci, timur,
	Philippe Ombredanne,
	open list:MEDIA INPUT INFRASTRUCTURE (V4L/DVB),
	open list, Avraham Shukron, Hans Verkuil, Dan Carpenter,
	linux-arm-msm, Valentin Vidic, Mauro Carvalho Chehab, intel-gfx,
	linux-arm-kernel, Alan Cox

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:59AM -0500, Sinan Kaya wrote:
> diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> index 4631b1d..51dcef57 100644
> --- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> +++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> @@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
>  
>  static int intel_mid_msgbus_init(void)
>  {
> -	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
>  	if (!pci_root) {
>  		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
>  		return -ENODEV;

This file has been removed, I'm applying the rest of the patch.

Please use the media tree as the base in the future. Thanks.

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 22/29] [media] atomisp: deprecate pci_get_bus_and_slot()
@ 2017-11-29  8:36     ` Sakari Ailus
  0 siblings, 0 replies; 172+ messages in thread
From: Sakari Ailus @ 2017-11-29  8:36 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:59AM -0500, Sinan Kaya wrote:
> diff --git a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> index 4631b1d..51dcef57 100644
> --- a/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> +++ b/drivers/staging/media/atomisp/platform/intel-mid/intel_mid_pcihelpers.c
> @@ -39,7 +39,7 @@ static inline int platform_is(u8 model)
>  
>  static int intel_mid_msgbus_init(void)
>  {
> -	pci_root = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	pci_root = pci_get_domain_bus_and_slot(0, 0, PCI_DEVFN(0, 0));
>  	if (!pci_root) {
>  		pr_err("%s: Error: msgbus PCI handle NULL\n", __func__);
>  		return -ENODEV;

This file has been removed, I'm applying the rest of the patch.

Please use the media tree as the base in the future. Thanks.

-- 
Sakari Ailus
e-mail: sakari.ailus at iki.fi

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` Sinan Kaya
  (?)
@ 2017-11-29 17:09   ` Bjorn Helgaas
  -1 siblings, 0 replies; 172+ messages in thread
From: Bjorn Helgaas @ 2017-11-29 17:09 UTC (permalink / raw)
  To: Sinan Kaya; +Cc: linux-pci, timur, intel-gfx, linux-arm-kernel, linux-arm-msm

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:37AM -0500, Sinan Kaya wrote:
> Deprecate pci_get_bus_and_slot() in favor of pci_get_domain_bus_and_slot()
> in order to remove domain 0 assumptions in the kernel.
> 
> 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.
> 
> Changes from v2:
> * commit text cleanups
> * remove implicit busfn assignments and use PCI_DEVFN call in place.
> * change storage type for local copy of pci_domain_nr() value to int
> 
> Sinan Kaya (29):
>   alpha/PCI: deprecate pci_get_bus_and_slot()
>   powerpc/PCI: deprecate pci_get_bus_and_slot()
>   x86/PCI: deprecate pci_get_bus_and_slot()
>   ata: deprecate pci_get_bus_and_slot()
>   agp: nvidia: deprecate pci_get_bus_and_slot()
>   edd: deprecate pci_get_bus_and_slot()
>   ibft: deprecate pci_get_bus_and_slot()
>   drm/gma500: deprecate pci_get_bus_and_slot()
>   drm/i915: deprecate pci_get_bus_and_slot()
>   drm/nouveau: deprecate pci_get_bus_and_slot()
>   Drivers: ide: deprecate pci_get_bus_and_slot()
>   iommu/amd: deprecate pci_get_bus_and_slot()
>   powerpc/powermac: deprecate pci_get_bus_and_slot()
>   bnx2x: deprecate pci_get_bus_and_slot()
>   pch_gbe: deprecate pci_get_bus_and_slot()
>   PCI: cpqhp: deprecate pci_get_bus_and_slot()
>   PCI: ibmphp: deprecate pci_get_bus_and_slot()
>   PCI/quirks: deprecate pci_get_bus_and_slot()
>   PCI/syscall: deprecate pci_get_bus_and_slot()
>   xen: deprecate pci_get_bus_and_slot()
>   openprom: deprecate pci_get_bus_and_slot()
>   [media] atomisp: deprecate pci_get_bus_and_slot()
>   staging: rts5208: remove rtsx_read_pci_cfg_byte()
>   backlight: deprecate pci_get_bus_and_slot()
>   video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
>   video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
>   video: fbdev: riva: deprecate pci_get_bus_and_slot()
>   i7300_idle: remove unused file
>   PCI: remove pci_get_bus_and_slot() function

Thanks for doing this work!

I see other maintainers are picking up some of these.  I'll wait until
later in the cycle and pick up any remaining ones and the PCI core
parts.

If you repost the series for any reason, please capitalize the first
word of the changelog summary to match the drivers/pci convention (for
non PCI patches, follow *their* convention, of course) and put the
acks/reviewed-by tags after your signed-off-by.  I use this order:

  Reported-by:
  Tested-by:
  Signed-off-by: (author)
  Signed-off-by: (chain)
  Reviewed-by:
  Acked-by:
  Cc: stable@vger.kernel.org        # 3.4+
  Cc: (other)

But don't bother reposting the series just for this reason; I can fix
these up myself.

Bjorn
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-29 17:09   ` Bjorn Helgaas
  0 siblings, 0 replies; 172+ messages in thread
From: Bjorn Helgaas @ 2017-11-29 17:09 UTC (permalink / raw)
  To: Sinan Kaya; +Cc: linux-pci, timur, intel-gfx, linux-arm-kernel, linux-arm-msm

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:37AM -0500, Sinan Kaya wrote:
> Deprecate pci_get_bus_and_slot() in favor of pci_get_domain_bus_and_slot()
> in order to remove domain 0 assumptions in the kernel.
> 
> 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.
> 
> Changes from v2:
> * commit text cleanups
> * remove implicit busfn assignments and use PCI_DEVFN call in place.
> * change storage type for local copy of pci_domain_nr() value to int
> 
> Sinan Kaya (29):
>   alpha/PCI: deprecate pci_get_bus_and_slot()
>   powerpc/PCI: deprecate pci_get_bus_and_slot()
>   x86/PCI: deprecate pci_get_bus_and_slot()
>   ata: deprecate pci_get_bus_and_slot()
>   agp: nvidia: deprecate pci_get_bus_and_slot()
>   edd: deprecate pci_get_bus_and_slot()
>   ibft: deprecate pci_get_bus_and_slot()
>   drm/gma500: deprecate pci_get_bus_and_slot()
>   drm/i915: deprecate pci_get_bus_and_slot()
>   drm/nouveau: deprecate pci_get_bus_and_slot()
>   Drivers: ide: deprecate pci_get_bus_and_slot()
>   iommu/amd: deprecate pci_get_bus_and_slot()
>   powerpc/powermac: deprecate pci_get_bus_and_slot()
>   bnx2x: deprecate pci_get_bus_and_slot()
>   pch_gbe: deprecate pci_get_bus_and_slot()
>   PCI: cpqhp: deprecate pci_get_bus_and_slot()
>   PCI: ibmphp: deprecate pci_get_bus_and_slot()
>   PCI/quirks: deprecate pci_get_bus_and_slot()
>   PCI/syscall: deprecate pci_get_bus_and_slot()
>   xen: deprecate pci_get_bus_and_slot()
>   openprom: deprecate pci_get_bus_and_slot()
>   [media] atomisp: deprecate pci_get_bus_and_slot()
>   staging: rts5208: remove rtsx_read_pci_cfg_byte()
>   backlight: deprecate pci_get_bus_and_slot()
>   video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
>   video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
>   video: fbdev: riva: deprecate pci_get_bus_and_slot()
>   i7300_idle: remove unused file
>   PCI: remove pci_get_bus_and_slot() function

Thanks for doing this work!

I see other maintainers are picking up some of these.  I'll wait until
later in the cycle and pick up any remaining ones and the PCI core
parts.

If you repost the series for any reason, please capitalize the first
word of the changelog summary to match the drivers/pci convention (for
non PCI patches, follow *their* convention, of course) and put the
acks/reviewed-by tags after your signed-off-by.  I use this order:

  Reported-by:
  Tested-by:
  Signed-off-by: (author)
  Signed-off-by: (chain)
  Reviewed-by:
  Acked-by:
  Cc: stable@vger.kernel.org        # 3.4+
  Cc: (other)

But don't bother reposting the series just for this reason; I can fix
these up myself.

Bjorn

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
@ 2017-11-29 17:09   ` Bjorn Helgaas
  0 siblings, 0 replies; 172+ messages in thread
From: Bjorn Helgaas @ 2017-11-29 17:09 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Sinan,

On Mon, Nov 27, 2017 at 11:57:37AM -0500, Sinan Kaya wrote:
> Deprecate pci_get_bus_and_slot() in favor of pci_get_domain_bus_and_slot()
> in order to remove domain 0 assumptions in the kernel.
> 
> 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.
> 
> Changes from v2:
> * commit text cleanups
> * remove implicit busfn assignments and use PCI_DEVFN call in place.
> * change storage type for local copy of pci_domain_nr() value to int
> 
> Sinan Kaya (29):
>   alpha/PCI: deprecate pci_get_bus_and_slot()
>   powerpc/PCI: deprecate pci_get_bus_and_slot()
>   x86/PCI: deprecate pci_get_bus_and_slot()
>   ata: deprecate pci_get_bus_and_slot()
>   agp: nvidia: deprecate pci_get_bus_and_slot()
>   edd: deprecate pci_get_bus_and_slot()
>   ibft: deprecate pci_get_bus_and_slot()
>   drm/gma500: deprecate pci_get_bus_and_slot()
>   drm/i915: deprecate pci_get_bus_and_slot()
>   drm/nouveau: deprecate pci_get_bus_and_slot()
>   Drivers: ide: deprecate pci_get_bus_and_slot()
>   iommu/amd: deprecate pci_get_bus_and_slot()
>   powerpc/powermac: deprecate pci_get_bus_and_slot()
>   bnx2x: deprecate pci_get_bus_and_slot()
>   pch_gbe: deprecate pci_get_bus_and_slot()
>   PCI: cpqhp: deprecate pci_get_bus_and_slot()
>   PCI: ibmphp: deprecate pci_get_bus_and_slot()
>   PCI/quirks: deprecate pci_get_bus_and_slot()
>   PCI/syscall: deprecate pci_get_bus_and_slot()
>   xen: deprecate pci_get_bus_and_slot()
>   openprom: deprecate pci_get_bus_and_slot()
>   [media] atomisp: deprecate pci_get_bus_and_slot()
>   staging: rts5208: remove rtsx_read_pci_cfg_byte()
>   backlight: deprecate pci_get_bus_and_slot()
>   video: fbdev: intelfb: deprecate pci_get_bus_and_slot()
>   video: fbdev: nvidia: deprecate pci_get_bus_and_slot()
>   video: fbdev: riva: deprecate pci_get_bus_and_slot()
>   i7300_idle: remove unused file
>   PCI: remove pci_get_bus_and_slot() function

Thanks for doing this work!

I see other maintainers are picking up some of these.  I'll wait until
later in the cycle and pick up any remaining ones and the PCI core
parts.

If you repost the series for any reason, please capitalize the first
word of the changelog summary to match the drivers/pci convention (for
non PCI patches, follow *their* convention, of course) and put the
acks/reviewed-by tags after your signed-off-by.  I use this order:

  Reported-by:
  Tested-by:
  Signed-off-by: (author)
  Signed-off-by: (chain)
  Reviewed-by:
  Acked-by:
  Cc: stable at vger.kernel.org        # 3.4+
  Cc: (other)

But don't bother reposting the series just for this reason; I can fix
these up myself.

Bjorn

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
  2017-11-29 17:09   ` Bjorn Helgaas
@ 2017-12-01  2:15     ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-01  2:15 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: linux-pci, timur, linux-arm-msm, linux-arm-kernel, intel-gfx

On 11/29/2017 12:09 PM, Bjorn Helgaas wrote:
> I see other maintainers are picking up some of these.  I'll wait until
> later in the cycle and pick up any remaining ones and the PCI core
> parts.

I'm also waiting for ACKs from maintainers at this moment. I'll pay attention
to the rules. Sorry about that.

-- 
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] 172+ messages in thread

* [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot()
@ 2017-12-01  2:15     ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-01  2:15 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/29/2017 12:09 PM, Bjorn Helgaas wrote:
> I see other maintainers are picking up some of these.  I'll wait until
> later in the cycle and pick up any remaining ones and the PCI core
> parts.

I'm also waiting for ACKs from maintainers at this moment. I'll pay attention
to the rules. Sorry about that.

-- 
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] 172+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-28 16:29       ` Sinan Kaya
  (?)
@ 2017-12-03 19:29         ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-03 19:29 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: linux-pci, timur, David Airlie, linux-arm-msm, intel-gfx,
	open list, open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

On 11/28/2017 11:29 AM, Sinan Kaya wrote:
> On 11/28/2017 10:30 AM, Ville Syrjälä wrote:
>>> +	dev_priv->bridge_dev =
>>> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>> Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?
>>
>> I guess if we want to be pedantic we could go for:
>>
>> bus = pci_find_host_bridge(pdev->bus)->bus;
>> pci_get_slot(bus, PCI_DEVFN(0, 0))
>>
>> but I think the GPU should always be on the root bus, so the simpler
>> form should be fine.
>>
> 
> All three of these should be correct. 
> 
> I'll use pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) as you suggested.
> 

Now that I think about this more, I think my version is a simpler change
and does not introduce "new features" by assuming GPU and host to be
on the same bus similar to the original code. 

Original code could have used pci_get_slot() too. Since all of them are
correct, mine is slightly more correct; I'd like to keep mine.

-- 
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] 172+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-03 19:29         ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-03 19:29 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: David Airlie, linux-pci, timur, Rodrigo Vivi, open list,
	open list:DRM DRIVERS, linux-arm-msm, intel-gfx,
	linux-arm-kernel

T24gMTEvMjgvMjAxNyAxMToyOSBBTSwgU2luYW4gS2F5YSB3cm90ZToKPiBPbiAxMS8yOC8yMDE3
IDEwOjMwIEFNLCBWaWxsZSBTeXJqw6Rsw6Qgd3JvdGU6Cj4+PiArCWRldl9wcml2LT5icmlkZ2Vf
ZGV2ID0KPj4+ICsJCXBjaV9nZXRfZG9tYWluX2J1c19hbmRfc2xvdChkb21haW4sIDAsIFBDSV9E
RVZGTigwLCAwKSk7Cj4+IE1heWJlIGp1c3QgcGNpX2dldF9zbG90KHBkZXYtPmJ1cywgUENJX0RF
VkZOKDAsIDApKSA/Cj4+Cj4+IEkgZ3Vlc3MgaWYgd2Ugd2FudCB0byBiZSBwZWRhbnRpYyB3ZSBj
b3VsZCBnbyBmb3I6Cj4+Cj4+IGJ1cyA9IHBjaV9maW5kX2hvc3RfYnJpZGdlKHBkZXYtPmJ1cykt
PmJ1czsKPj4gcGNpX2dldF9zbG90KGJ1cywgUENJX0RFVkZOKDAsIDApKQo+Pgo+PiBidXQgSSB0
aGluayB0aGUgR1BVIHNob3VsZCBhbHdheXMgYmUgb24gdGhlIHJvb3QgYnVzLCBzbyB0aGUgc2lt
cGxlcgo+PiBmb3JtIHNob3VsZCBiZSBmaW5lLgo+Pgo+IAo+IEFsbCB0aHJlZSBvZiB0aGVzZSBz
aG91bGQgYmUgY29ycmVjdC4gCj4gCj4gSSdsbCB1c2UgcGNpX2dldF9zbG90KHBkZXYtPmJ1cywg
UENJX0RFVkZOKDAsIDApKSBhcyB5b3Ugc3VnZ2VzdGVkLgo+IAoKTm93IHRoYXQgSSB0aGluayBh
Ym91dCB0aGlzIG1vcmUsIEkgdGhpbmsgbXkgdmVyc2lvbiBpcyBhIHNpbXBsZXIgY2hhbmdlCmFu
ZCBkb2VzIG5vdCBpbnRyb2R1Y2UgIm5ldyBmZWF0dXJlcyIgYnkgYXNzdW1pbmcgR1BVIGFuZCBo
b3N0IHRvIGJlCm9uIHRoZSBzYW1lIGJ1cyBzaW1pbGFyIHRvIHRoZSBvcmlnaW5hbCBjb2RlLiAK
Ck9yaWdpbmFsIGNvZGUgY291bGQgaGF2ZSB1c2VkIHBjaV9nZXRfc2xvdCgpIHRvby4gU2luY2Ug
YWxsIG9mIHRoZW0gYXJlCmNvcnJlY3QsIG1pbmUgaXMgc2xpZ2h0bHkgbW9yZSBjb3JyZWN0OyBJ
J2QgbGlrZSB0byBrZWVwIG1pbmUuCgotLSAKU2luYW4gS2F5YQpRdWFsY29tbSBEYXRhY2VudGVy
IFRlY2hub2xvZ2llcywgSW5jLiBhcyBhbiBhZmZpbGlhdGUgb2YgUXVhbGNvbW0gVGVjaG5vbG9n
aWVzLCBJbmMuClF1YWxjb21tIFRlY2hub2xvZ2llcywgSW5jLiBpcyBhIG1lbWJlciBvZiB0aGUg
Q29kZSBBdXJvcmEgRm9ydW0sIGEgTGludXggRm91bmRhdGlvbiBDb2xsYWJvcmF0aXZlIFByb2pl
Y3QuCgpfX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpsaW51
eC1hcm0ta2VybmVsIG1haWxpbmcgbGlzdApsaW51eC1hcm0ta2VybmVsQGxpc3RzLmluZnJhZGVh
ZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9saW51eC1h
cm0ta2VybmVsCg==

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-03 19:29         ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-03 19:29 UTC (permalink / raw)
  To: linux-arm-kernel

On 11/28/2017 11:29 AM, Sinan Kaya wrote:
> On 11/28/2017 10:30 AM, Ville Syrj?l? wrote:
>>> +	dev_priv->bridge_dev =
>>> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>> Maybe just pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) ?
>>
>> I guess if we want to be pedantic we could go for:
>>
>> bus = pci_find_host_bridge(pdev->bus)->bus;
>> pci_get_slot(bus, PCI_DEVFN(0, 0))
>>
>> but I think the GPU should always be on the root bus, so the simpler
>> form should be fine.
>>
> 
> All three of these should be correct. 
> 
> I'll use pci_get_slot(pdev->bus, PCI_DEVFN(0, 0)) as you suggested.
> 

Now that I think about this more, I think my version is a simpler change
and does not introduce "new features" by assuming GPU and host to be
on the same bus similar to the original code. 

Original code could have used pci_get_slot() too. Since all of them are
correct, mine is slightly more correct; I'd like to keep mine.

-- 
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] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 18:50     ` Sinan Kaya
  (?)
  (?)
@ 2017-12-12 14:04       ` Joonas Lahtinen
  -1 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-12 14:04 UTC (permalink / raw)
  To: Sinan Kaya, linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list,
	open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

Hi,

I sent this individual i915 patch to our CI, and it is passing on all platforms:

https://patchwork.freedesktop.org/series/34822/

Is it ok if I merge this to drm-tip already?

Regards, Joonas

On Mon, 2017-11-27 at 13:50 -0500, Sinan Kaya wrote:
> +dri-devel@lists.freedesktop.org
> 
> On 11/27/2017 11:57 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.
> > 
> > Getting ready to remove pci_get_bus_and_slot() function in favor of
> > pci_get_domain_bus_and_slot().
> > 
> > Extract the domain number from drm_device and pass it into
> > pci_get_domain_bus_and_slot() function.
> > 
> > Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 9f45cfe..5a8cb79 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
> >  
> >  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
> >  {
> > -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> > +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> > +
> > +	dev_priv->bridge_dev =
> > +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
> >  	if (!dev_priv->bridge_dev) {
> >  		DRM_ERROR("bridge device not found\n");
> >  		return -1;
> > 
> 
> 
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-12 14:04       ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-12 14:04 UTC (permalink / raw)
  To: Sinan Kaya, linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Jani Nikula,
	Rodrigo Vivi, David Airlie, open list:DRM DRIVERS, open list

Hi,

I sent this individual i915 patch to our CI, and it is passing on all platforms:

https://patchwork.freedesktop.org/series/34822/

Is it ok if I merge this to drm-tip already?

Regards, Joonas

On Mon, 2017-11-27 at 13:50 -0500, Sinan Kaya wrote:
> +dri-devel@lists.freedesktop.org
> 
> On 11/27/2017 11:57 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.
> > 
> > Getting ready to remove pci_get_bus_and_slot() function in favor of
> > pci_get_domain_bus_and_slot().
> > 
> > Extract the domain number from drm_device and pass it into
> > pci_get_domain_bus_and_slot() function.
> > 
> > Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 9f45cfe..5a8cb79 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
> >  
> >  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
> >  {
> > -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> > +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> > +
> > +	dev_priv->bridge_dev =
> > +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
> >  	if (!dev_priv->bridge_dev) {
> >  		DRM_ERROR("bridge device not found\n");
> >  		return -1;
> > 
> 
> 
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-12 14:04       ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-12 14:04 UTC (permalink / raw)
  To: Sinan Kaya, linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list, Jani Nikula,
	open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

Hi,

I sent this individual i915 patch to our CI, and it is passing on all platforms:

https://patchwork.freedesktop.org/series/34822/

Is it ok if I merge this to drm-tip already?

Regards, Joonas

On Mon, 2017-11-27 at 13:50 -0500, Sinan Kaya wrote:
> +dri-devel@lists.freedesktop.org
> 
> On 11/27/2017 11:57 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.
> > 
> > Getting ready to remove pci_get_bus_and_slot() function in favor of
> > pci_get_domain_bus_and_slot().
> > 
> > Extract the domain number from drm_device and pass it into
> > pci_get_domain_bus_and_slot() function.
> > 
> > Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 9f45cfe..5a8cb79 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
> >  
> >  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
> >  {
> > -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> > +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> > +
> > +	dev_priv->bridge_dev =
> > +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
> >  	if (!dev_priv->bridge_dev) {
> >  		DRM_ERROR("bridge device not found\n");
> >  		return -1;
> > 
> 
> 
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-12 14:04       ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-12 14:04 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

I sent this individual i915 patch to our CI, and it is passing on all platforms:

https://patchwork.freedesktop.org/series/34822/

Is it ok if I merge this to drm-tip already?

Regards, Joonas

On Mon, 2017-11-27 at 13:50 -0500, Sinan Kaya wrote:
> +dri-devel at lists.freedesktop.org
> 
> On 11/27/2017 11:57 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.
> > 
> > Getting ready to remove pci_get_bus_and_slot() function in favor of
> > pci_get_domain_bus_and_slot().
> > 
> > Extract the domain number from drm_device and pass it into
> > pci_get_domain_bus_and_slot() function.
> > 
> > Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> > index 9f45cfe..5a8cb79 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.c
> > +++ b/drivers/gpu/drm/i915/i915_drv.c
> > @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
> >  
> >  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
> >  {
> > -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> > +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> > +
> > +	dev_priv->bridge_dev =
> > +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
> >  	if (!dev_priv->bridge_dev) {
> >  		DRM_ERROR("bridge device not found\n");
> >  		return -1;
> > 
> 
> 
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-12-12 14:04       ` Joonas Lahtinen
  (?)
@ 2017-12-13  0:07         ` Sinan Kaya
  -1 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-13  0:07 UTC (permalink / raw)
  To: Joonas Lahtinen, linux-pci, timur
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Jani Nikula,
	Rodrigo Vivi, David Airlie, open list:DRM DRIVERS, open list

On 12/12/2017 9:04 AM, Joonas Lahtinen wrote:
> Hi,
> 
> I sent this individual i915 patch to our CI, and it is passing on all platforms:
> 
> https://patchwork.freedesktop.org/series/34822/
> 
> Is it ok if I merge this to drm-tip already?

As long as you have this change in your tree, it should be safe.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/pci.h?id=7912af5c835bd86f2b0347a480e0f40e2fab30d0


> 
> Regards, Joonas
> 


-- 
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] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-13  0:07         ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-13  0:07 UTC (permalink / raw)
  To: Joonas Lahtinen, linux-pci, timur
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list, Jani Nikula,
	open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

On 12/12/2017 9:04 AM, Joonas Lahtinen wrote:
> Hi,
> 
> I sent this individual i915 patch to our CI, and it is passing on all platforms:
> 
> https://patchwork.freedesktop.org/series/34822/
> 
> Is it ok if I merge this to drm-tip already?

As long as you have this change in your tree, it should be safe.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/pci.h?id=7912af5c835bd86f2b0347a480e0f40e2fab30d0


> 
> Regards, Joonas
> 


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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-13  0:07         ` Sinan Kaya
  0 siblings, 0 replies; 172+ messages in thread
From: Sinan Kaya @ 2017-12-13  0:07 UTC (permalink / raw)
  To: linux-arm-kernel

On 12/12/2017 9:04 AM, Joonas Lahtinen wrote:
> Hi,
> 
> I sent this individual i915 patch to our CI, and it is passing on all platforms:
> 
> https://patchwork.freedesktop.org/series/34822/
> 
> Is it ok if I merge this to drm-tip already?

As long as you have this change in your tree, it should be safe.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/pci.h?id=7912af5c835bd86f2b0347a480e0f40e2fab30d0


> 
> Regards, Joonas
> 


-- 
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] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-12-13  0:07         ` Sinan Kaya
  (?)
  (?)
@ 2017-12-13  8:01           ` Joonas Lahtinen
  -1 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-13  8:01 UTC (permalink / raw)
  To: Sinan Kaya, linux-pci, timur, Rodrigo Vivi
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list,
	open list:DRM DRIVERS, linux-arm-kernel

On Tue, 2017-12-12 at 19:07 -0500, Sinan Kaya wrote:
> On 12/12/2017 9:04 AM, Joonas Lahtinen wrote:
> > Hi,
> > 
> > I sent this individual i915 patch to our CI, and it is passing on
> > all platforms:
> > 
> > https://patchwork.freedesktop.org/series/34822/
> > 
> > Is it ok if I merge this to drm-tip already?
> 
> As long as you have this change in your tree, it should be safe.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/pci.h?id=7912af5c835bd86f2b0347a480e0f40e2fab30d0
> 

We don't yet.

Rodrigo, can you please pull the above patch in once we get a
backmerge?

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-13  8:01           ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-13  8:01 UTC (permalink / raw)
  To: Sinan Kaya, linux-pci, timur, Rodrigo Vivi
  Cc: linux-arm-msm, linux-arm-kernel, intel-gfx, Jani Nikula,
	David Airlie, open list:DRM DRIVERS, open list

On Tue, 2017-12-12 at 19:07 -0500, Sinan Kaya wrote:
> On 12/12/2017 9:04 AM, Joonas Lahtinen wrote:
> > Hi,
> > 
> > I sent this individual i915 patch to our CI, and it is passing on
> > all platforms:
> > 
> > https://patchwork.freedesktop.org/series/34822/
> > 
> > Is it ok if I merge this to drm-tip already?
> 
> As long as you have this change in your tree, it should be safe.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/pci.h?id=7912af5c835bd86f2b0347a480e0f40e2fab30d0
> 

We don't yet.

Rodrigo, can you please pull the above patch in once we get a
backmerge?

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-13  8:01           ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-13  8:01 UTC (permalink / raw)
  To: Sinan Kaya, linux-pci, timur, Rodrigo Vivi
  Cc: David Airlie, linux-arm-msm, intel-gfx, open list,
	open list:DRM DRIVERS, Jani Nikula, linux-arm-kernel

On Tue, 2017-12-12 at 19:07 -0500, Sinan Kaya wrote:
> On 12/12/2017 9:04 AM, Joonas Lahtinen wrote:
> > Hi,
> > 
> > I sent this individual i915 patch to our CI, and it is passing on
> > all platforms:
> > 
> > https://patchwork.freedesktop.org/series/34822/
> > 
> > Is it ok if I merge this to drm-tip already?
> 
> As long as you have this change in your tree, it should be safe.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/pci.h?id=7912af5c835bd86f2b0347a480e0f40e2fab30d0
> 

We don't yet.

Rodrigo, can you please pull the above patch in once we get a
backmerge?

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2017-12-13  8:01           ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2017-12-13  8:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 2017-12-12 at 19:07 -0500, Sinan Kaya wrote:
> On 12/12/2017 9:04 AM, Joonas Lahtinen wrote:
> > Hi,
> > 
> > I sent this individual i915 patch to our CI, and it is passing on
> > all platforms:
> > 
> > https://patchwork.freedesktop.org/series/34822/
> > 
> > Is it ok if I merge this to drm-tip already?
> 
> As long as you have this change in your tree, it should be safe.
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/include/linux/pci.h?id=7912af5c835bd86f2b0347a480e0f40e2fab30d0
> 

We don't yet.

Rodrigo, can you please pull the above patch in once we get a
backmerge?

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57   ` Sinan Kaya
  (?)
@ 2018-02-16 14:54     ` Bjorn Helgaas
  -1 siblings, 0 replies; 172+ messages in thread
From: Bjorn Helgaas @ 2018-02-16 14:54 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: linux-pci, timur, David Airlie, linux-arm-msm, intel-gfx,
	Joonas Lahtinen, open list, Jani Nikula, open list:DRM DRIVERS,
	Rodrigo Vivi, linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

I don't know what happened to this, and it didn't make it into
v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
along with the patch that actually removes pci_get_bus_and_slot().

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2018-02-16 14:54     ` Bjorn Helgaas
  0 siblings, 0 replies; 172+ messages in thread
From: Bjorn Helgaas @ 2018-02-16 14:54 UTC (permalink / raw)
  To: Sinan Kaya
  Cc: David Airlie, linux-pci, timur, Joonas Lahtinen, open list,
	Jani Nikula, Rodrigo Vivi, open list:DRM DRIVERS, linux-arm-msm,
	intel-gfx, linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

I don't know what happened to this, and it didn't make it into
v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
along with the patch that actually removes pci_get_bus_and_slot().

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2018-02-16 14:54     ` Bjorn Helgaas
  0 siblings, 0 replies; 172+ messages in thread
From: Bjorn Helgaas @ 2018-02-16 14:54 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> 
> Getting ready to remove pci_get_bus_and_slot() function in favor of
> pci_get_domain_bus_and_slot().
> 
> Extract the domain number from drm_device and pass it into
> pci_get_domain_bus_and_slot() function.
> 
> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>

I don't know what happened to this, and it didn't make it into
v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
along with the patch that actually removes pci_get_bus_and_slot().

> ---
>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index 9f45cfe..5a8cb79 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>  
>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>  {
> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
> +
> +	dev_priv->bridge_dev =
> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>  	if (!dev_priv->bridge_dev) {
>  		DRM_ERROR("bridge device not found\n");
>  		return -1;
> -- 
> 1.9.1
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2018-02-16 14:54     ` Bjorn Helgaas
  (?)
@ 2018-02-19  9:34       ` Jani Nikula
  -1 siblings, 0 replies; 172+ messages in thread
From: Jani Nikula @ 2018-02-19  9:34 UTC (permalink / raw)
  To: Bjorn Helgaas, Sinan Kaya
  Cc: David Airlie, linux-pci, timur, open list, open list:DRM DRIVERS,
	Rodrigo Vivi, linux-arm-msm, intel-gfx, linux-arm-kernel

On Fri, 16 Feb 2018, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
>> 
>> Getting ready to remove pci_get_bus_and_slot() function in favor of
>> pci_get_domain_bus_and_slot().
>> 
>> Extract the domain number from drm_device and pass it into
>> pci_get_domain_bus_and_slot() function.
>> 
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>
> I don't know what happened to this, and it didn't make it into
> v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
> along with the patch that actually removes pci_get_bus_and_slot().

It fell between the cracks as we couldn't apply it before getting a
backmerge on the dependency. Sorry about that.

Ack for merging through your tree.

Thanks,
Jani.


>
>> ---
>>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index 9f45cfe..5a8cb79 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>>  
>>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>>  {
>> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
>> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
>> +
>> +	dev_priv->bridge_dev =
>> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>>  	if (!dev_priv->bridge_dev) {
>>  		DRM_ERROR("bridge device not found\n");
>>  		return -1;
>> -- 
>> 1.9.1
>> 
>> 
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2018-02-19  9:34       ` Jani Nikula
  0 siblings, 0 replies; 172+ messages in thread
From: Jani Nikula @ 2018-02-19  9:34 UTC (permalink / raw)
  To: Bjorn Helgaas, Sinan Kaya
  Cc: linux-pci, timur, David Airlie, linux-arm-msm, intel-gfx,
	Joonas Lahtinen, open list, open list:DRM DRIVERS, Rodrigo Vivi,
	linux-arm-kernel

On Fri, 16 Feb 2018, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
>> 
>> Getting ready to remove pci_get_bus_and_slot() function in favor of
>> pci_get_domain_bus_and_slot().
>> 
>> Extract the domain number from drm_device and pass it into
>> pci_get_domain_bus_and_slot() function.
>> 
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>
> I don't know what happened to this, and it didn't make it into
> v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
> along with the patch that actually removes pci_get_bus_and_slot().

It fell between the cracks as we couldn't apply it before getting a
backmerge on the dependency. Sorry about that.

Ack for merging through your tree.

Thanks,
Jani.


>
>> ---
>>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index 9f45cfe..5a8cb79 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>>  
>>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>>  {
>> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
>> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
>> +
>> +	dev_priv->bridge_dev =
>> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>>  	if (!dev_priv->bridge_dev) {
>>  		DRM_ERROR("bridge device not found\n");
>>  		return -1;
>> -- 
>> 1.9.1
>> 
>> 
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel@lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2018-02-19  9:34       ` Jani Nikula
  0 siblings, 0 replies; 172+ messages in thread
From: Jani Nikula @ 2018-02-19  9:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, 16 Feb 2018, Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
>> 
>> Getting ready to remove pci_get_bus_and_slot() function in favor of
>> pci_get_domain_bus_and_slot().
>> 
>> Extract the domain number from drm_device and pass it into
>> pci_get_domain_bus_and_slot() function.
>> 
>> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
>
> I don't know what happened to this, and it didn't make it into
> v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
> along with the patch that actually removes pci_get_bus_and_slot().

It fell between the cracks as we couldn't apply it before getting a
backmerge on the dependency. Sorry about that.

Ack for merging through your tree.

Thanks,
Jani.


>
>> ---
>>  drivers/gpu/drm/i915/i915_drv.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
>> index 9f45cfe..5a8cb79 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.c
>> +++ b/drivers/gpu/drm/i915/i915_drv.c
>> @@ -419,7 +419,10 @@ static int i915_getparam(struct drm_device *dev, void *data,
>>  
>>  static int i915_get_bridge_dev(struct drm_i915_private *dev_priv)
>>  {
>> -	dev_priv->bridge_dev = pci_get_bus_and_slot(0, PCI_DEVFN(0, 0));
>> +	int domain = pci_domain_nr(dev_priv->drm.pdev->bus);
>> +
>> +	dev_priv->bridge_dev =
>> +		pci_get_domain_bus_and_slot(domain, 0, PCI_DEVFN(0, 0));
>>  	if (!dev_priv->bridge_dev) {
>>  		DRM_ERROR("bridge device not found\n");
>>  		return -1;
>> -- 
>> 1.9.1
>> 
>> 
>> _______________________________________________
>> linux-arm-kernel mailing list
>> linux-arm-kernel at lists.infradead.org
>> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2018-02-19  9:34       ` Jani Nikula
  (?)
  (?)
@ 2018-02-19  9:47         ` Joonas Lahtinen
  -1 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2018-02-19  9:47 UTC (permalink / raw)
  To: Bjorn Helgaas, Jani Nikula, Sinan Kaya
  Cc: David Airlie, linux-pci, timur, Rodrigo Vivi, open list,
	open list:DRM DRIVERS, linux-arm-msm, intel-gfx,
	linux-arm-kernel

Quoting Jani Nikula (2018-02-19 11:34:34)
> On Fri, 16 Feb 2018, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> >> 
> >> Getting ready to remove pci_get_bus_and_slot() function in favor of
> >> pci_get_domain_bus_and_slot().
> >> 
> >> Extract the domain number from drm_device and pass it into
> >> pci_get_domain_bus_and_slot() function.
> >> 
> >> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> >
> > I don't know what happened to this, and it didn't make it into
> > v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
> > along with the patch that actually removes pci_get_bus_and_slot().
> 
> It fell between the cracks as we couldn't apply it before getting a
> backmerge on the dependency. Sorry about that.
> 
> Ack for merging through your tree.

I just retested the patch and it still passes CI. We also now have the
dependency in our tree through the backmerge, so I can send this for the
next drm-next pull request. Either way suits me.

Regards, Joonas
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2018-02-19  9:47         ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2018-02-19  9:47 UTC (permalink / raw)
  To: Bjorn Helgaas, Jani Nikula, Sinan Kaya
  Cc: linux-pci, timur, David Airlie, linux-arm-msm, intel-gfx,
	open list, open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

Quoting Jani Nikula (2018-02-19 11:34:34)
> On Fri, 16 Feb 2018, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> >> 
> >> Getting ready to remove pci_get_bus_and_slot() function in favor of
> >> pci_get_domain_bus_and_slot().
> >> 
> >> Extract the domain number from drm_device and pass it into
> >> pci_get_domain_bus_and_slot() function.
> >> 
> >> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> >
> > I don't know what happened to this, and it didn't make it into
> > v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
> > along with the patch that actually removes pci_get_bus_and_slot().
> 
> It fell between the cracks as we couldn't apply it before getting a
> backmerge on the dependency. Sorry about that.
> 
> Ack for merging through your tree.

I just retested the patch and it still passes CI. We also now have the
dependency in our tree through the backmerge, so I can send this for the
next drm-next pull request. Either way suits me.

Regards, Joonas

^ permalink raw reply	[flat|nested] 172+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2018-02-19  9:47         ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2018-02-19  9:47 UTC (permalink / raw)
  To: Bjorn Helgaas, Jani Nikula, Sinan Kaya
  Cc: linux-pci, timur, David Airlie, linux-arm-msm, intel-gfx,
	open list, open list:DRM DRIVERS, Rodrigo Vivi, linux-arm-kernel

Quoting Jani Nikula (2018-02-19 11:34:34)
> On Fri, 16 Feb 2018, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Mon, Nov 27, 2017 at 11:57:46AM -0500, Sinan Kaya wrote:
> >> pci_get_bus_and_slot() is restrictive such that it assumes domain=3D0 =
as
> >> where a PCI device is present. This restricts the device drivers to be
> >> reused for other domain numbers.
> >> =

> >> Getting ready to remove pci_get_bus_and_slot() function in favor of
> >> pci_get_domain_bus_and_slot().
> >> =

> >> Extract the domain number from drm_device and pass it into
> >> pci_get_domain_bus_and_slot() function.
> >> =

> >> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> >
> > I don't know what happened to this, and it didn't make it into
> > v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
> > along with the patch that actually removes pci_get_bus_and_slot().
> =

> It fell between the cracks as we couldn't apply it before getting a
> backmerge on the dependency. Sorry about that.
> =

> Ack for merging through your tree.

I just retested the patch and it still passes CI. We also now have the
dependency in our tree through the backmerge, so I can send this for the
next drm-next pull request. Either way suits me.

Regards, Joonas

^ permalink raw reply	[flat|nested] 172+ messages in thread

* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
@ 2018-02-19  9:47         ` Joonas Lahtinen
  0 siblings, 0 replies; 172+ messages in thread
From: Joonas Lahtinen @ 2018-02-19  9:47 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Jani Nikula (2018-02-19 11:34:34)
> On Fri, 16 Feb 2018, Bjorn Helgaas <helgaas@kernel.org> wrote:
> > On Mon, Nov 27, 2017 at 11:57:46AM -0500, 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.
> >> 
> >> Getting ready to remove pci_get_bus_and_slot() function in favor of
> >> pci_get_domain_bus_and_slot().
> >> 
> >> Extract the domain number from drm_device and pass it into
> >> pci_get_domain_bus_and_slot() function.
> >> 
> >> Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
> >
> > I don't know what happened to this, and it didn't make it into
> > v4.16-rc1.  I applied it to pci/deprecate-get-bus-and-slot for v4.17
> > along with the patch that actually removes pci_get_bus_and_slot().
> 
> It fell between the cracks as we couldn't apply it before getting a
> backmerge on the dependency. Sorry about that.
> 
> Ack for merging through your tree.

I just retested the patch and it still passes CI. We also now have the
dependency in our tree through the backmerge, so I can send this for the
next drm-next pull request. Either way suits me.

Regards, Joonas

^ permalink raw reply	[flat|nested] 172+ messages in thread

end of thread, other threads:[~2018-02-19  9:47 UTC | newest]

Thread overview: 172+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27 16:57 [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot() Sinan Kaya
2017-11-27 16:57 ` Sinan Kaya
2017-11-27 16:57 ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 01/29] alpha/PCI: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 02/29] powerpc/PCI: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 03/29] x86/PCI: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-28 13:45   ` Thomas Gleixner
2017-11-28 13:45     ` Thomas Gleixner
2017-11-28 13:45     ` Thomas Gleixner
2017-11-28 13:45     ` Thomas Gleixner
2017-11-27 16:57 ` [PATCH V3 04/29] ata: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 19:50   ` Tejun Heo
2017-11-27 19:50     ` Tejun Heo
2017-11-27 19:50     ` Tejun Heo
2017-11-27 19:50     ` Tejun Heo
2017-11-27 16:57 ` [PATCH V3 05/29] agp: nvidia: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 06/29] edd: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 07/29] ibft: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 08/29] drm/gma500: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 18:49   ` Sinan Kaya
2017-11-27 18:49     ` Sinan Kaya
2017-11-27 18:49     ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 09/29] drm/i915: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 18:50   ` Sinan Kaya
2017-11-27 18:50     ` Sinan Kaya
2017-11-27 18:50     ` Sinan Kaya
2017-12-12 14:04     ` Joonas Lahtinen
2017-12-12 14:04       ` Joonas Lahtinen
2017-12-12 14:04       ` Joonas Lahtinen
2017-12-12 14:04       ` Joonas Lahtinen
2017-12-13  0:07       ` Sinan Kaya
2017-12-13  0:07         ` Sinan Kaya
2017-12-13  0:07         ` Sinan Kaya
2017-12-13  8:01         ` Joonas Lahtinen
2017-12-13  8:01           ` Joonas Lahtinen
2017-12-13  8:01           ` Joonas Lahtinen
2017-12-13  8:01           ` Joonas Lahtinen
2017-11-28 15:30   ` [Intel-gfx] " Ville Syrjälä
2017-11-28 15:30     ` Ville Syrjälä
2017-11-28 15:30     ` Ville Syrjälä
2017-11-28 15:30     ` Ville Syrjälä
2017-11-28 16:29     ` Sinan Kaya
2017-11-28 16:29       ` Sinan Kaya
2017-11-28 16:29       ` Sinan Kaya
2017-12-03 19:29       ` Sinan Kaya
2017-12-03 19:29         ` Sinan Kaya
2017-12-03 19:29         ` Sinan Kaya
2018-02-16 14:54   ` Bjorn Helgaas
2018-02-16 14:54     ` Bjorn Helgaas
2018-02-16 14:54     ` Bjorn Helgaas
2018-02-19  9:34     ` Jani Nikula
2018-02-19  9:34       ` Jani Nikula
2018-02-19  9:34       ` Jani Nikula
2018-02-19  9:47       ` Joonas Lahtinen
2018-02-19  9:47         ` Joonas Lahtinen
2018-02-19  9:47         ` Joonas Lahtinen
2018-02-19  9:47         ` Joonas Lahtinen
2017-11-27 16:57 ` [PATCH V3 10/29] drm/nouveau: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
     [not found]   ` <1511801886-6753-11-git-send-email-okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-11-27 18:52     ` Sinan Kaya
2017-11-27 18:52       ` Sinan Kaya
2017-11-27 18:52       ` Sinan Kaya
2017-11-27 18:52       ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 11/29] Drivers: ide: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 12/29] iommu/amd: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 13/29] powerpc/powermac: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 14/29] bnx2x: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 15/29] pch_gbe: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 16/29] PCI: cpqhp: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 17/29] PCI: ibmphp: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 18/29] PCI/quirks: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 19/29] PCI/syscall: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 20/29] xen: " Sinan Kaya
2017-11-27 16:57 ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 21/29] openprom: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57 ` [PATCH V3 22/29] [media] atomisp: " Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-27 16:57   ` Sinan Kaya
2017-11-29  8:36   ` Sakari Ailus
2017-11-29  8:36     ` Sakari Ailus
2017-11-29  8:36     ` Sakari Ailus
2017-11-29  8:36     ` Sakari Ailus
2017-11-29  8:36     ` Sakari Ailus
2017-11-27 16:58 ` [PATCH V3 23/29] staging: rts5208: remove rtsx_read_pci_cfg_byte() Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58 ` [PATCH V3 24/29] backlight: deprecate pci_get_bus_and_slot() Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 19:46   ` Jingoo Han
2017-11-27 19:46     ` Jingoo Han
2017-11-27 19:46     ` Jingoo Han
2017-11-27 19:46     ` Jingoo Han
2017-11-27 19:46     ` Jingoo Han
2017-11-28  8:13     ` Lee Jones
2017-11-28  8:13       ` Lee Jones
2017-11-28  8:13       ` Lee Jones
2017-11-28  8:13       ` Lee Jones
2017-11-27 16:58 ` [PATCH V3 25/29] video: fbdev: intelfb: " Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58 ` [PATCH V3 26/29] video: fbdev: nvidia: " Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58 ` [PATCH V3 27/29] video: fbdev: riva: " Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58 ` [PATCH V3 28/29] i7300_idle: remove unused file Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58 ` [PATCH V3 29/29] PCI: remove pci_get_bus_and_slot() function Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-27 16:58   ` Sinan Kaya
2017-11-29 17:09 ` [PATCH V3 00/29] PCI: deprecate pci_get_bus_and_slot() Bjorn Helgaas
2017-11-29 17:09   ` Bjorn Helgaas
2017-11-29 17:09   ` Bjorn Helgaas
2017-12-01  2:15   ` Sinan Kaya
2017-12-01  2:15     ` Sinan Kaya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.