dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
       [not found] <1511801886-6753-1-git-send-email-okaya@codeaurora.org>
@ 2017-11-27 16:57 ` Sinan Kaya
  2017-11-27 18:50   ` Sinan Kaya
                     ` (2 more replies)
  2017-11-27 16:57 ` [PATCH V3 10/29] drm/nouveau: " Sinan Kaya
       [not found] ` <1511801886-6753-9-git-send-email-okaya@codeaurora.org>
  2 siblings, 3 replies; 14+ 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] 14+ messages in thread

* [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
       [not found] <1511801886-6753-1-git-send-email-okaya@codeaurora.org>
  2017-11-27 16:57 ` [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot() Sinan Kaya
@ 2017-11-27 16:57 ` Sinan Kaya
       [not found]   ` <1511801886-6753-11-git-send-email-okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
       [not found] ` <1511801886-6753-9-git-send-email-okaya@codeaurora.org>
  2 siblings, 1 reply; 14+ 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] 14+ messages in thread

* Re: [PATCH V3 08/29] drm/gma500: deprecate pci_get_bus_and_slot()
       [not found] ` <1511801886-6753-9-git-send-email-okaya@codeaurora.org>
@ 2017-11-27 18:49   ` Sinan Kaya
  0 siblings, 0 replies; 14+ 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] 14+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot() Sinan Kaya
@ 2017-11-27 18:50   ` Sinan Kaya
  2017-12-12 14:04     ` Joonas Lahtinen
  2017-11-28 15:30   ` [Intel-gfx] " Ville Syrjälä
  2018-02-16 14:54   ` Bjorn Helgaas
  2 siblings, 1 reply; 14+ 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] 14+ messages in thread

* Re: [PATCH V3 10/29] drm/nouveau: deprecate pci_get_bus_and_slot()
       [not found]   ` <1511801886-6753-11-git-send-email-okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
@ 2017-11-27 18:52     ` Sinan Kaya
  0 siblings, 0 replies; 14+ 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] 14+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot() Sinan Kaya
  2017-11-27 18:50   ` Sinan Kaya
@ 2017-11-28 15:30   ` Ville Syrjälä
  2017-11-28 16:29     ` Sinan Kaya
  2018-02-16 14:54   ` Bjorn Helgaas
  2 siblings, 1 reply; 14+ 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] 14+ messages in thread

* Re: [Intel-gfx] [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-28 15:30   ` [Intel-gfx] " Ville Syrjälä
@ 2017-11-28 16:29     ` Sinan Kaya
  2017-12-03 19:29       ` Sinan Kaya
  0 siblings, 1 reply; 14+ 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] 14+ 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
  0 siblings, 0 replies; 14+ 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] 14+ 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
  2017-12-13  0:07       ` Sinan Kaya
  0 siblings, 1 reply; 14+ 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] 14+ 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
  2017-12-13  8:01         ` Joonas Lahtinen
  0 siblings, 1 reply; 14+ 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] 14+ 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
  0 siblings, 0 replies; 14+ 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] 14+ messages in thread

* Re: [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot()
  2017-11-27 16:57 ` [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot() Sinan Kaya
  2017-11-27 18:50   ` Sinan Kaya
  2017-11-28 15:30   ` [Intel-gfx] " Ville Syrjälä
@ 2018-02-16 14:54   ` Bjorn Helgaas
  2018-02-19  9:34     ` Jani Nikula
  2 siblings, 1 reply; 14+ 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] 14+ 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
  2018-02-19  9:47       ` Joonas Lahtinen
  0 siblings, 1 reply; 14+ 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] 14+ 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
  0 siblings, 0 replies; 14+ 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] 14+ messages in thread

end of thread, other threads:[~2018-02-19  9:47 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1511801886-6753-1-git-send-email-okaya@codeaurora.org>
2017-11-27 16:57 ` [PATCH V3 09/29] drm/i915: deprecate pci_get_bus_and_slot() Sinan Kaya
2017-11-27 18:50   ` Sinan Kaya
2017-12-12 14:04     ` Joonas Lahtinen
2017-12-13  0:07       ` Sinan Kaya
2017-12-13  8:01         ` Joonas Lahtinen
2017-11-28 15:30   ` [Intel-gfx] " Ville Syrjälä
2017-11-28 16:29     ` Sinan Kaya
2017-12-03 19:29       ` Sinan Kaya
2018-02-16 14:54   ` Bjorn Helgaas
2018-02-19  9:34     ` Jani Nikula
2018-02-19  9:47       ` Joonas Lahtinen
2017-11-27 16:57 ` [PATCH V3 10/29] drm/nouveau: " Sinan Kaya
     [not found]   ` <1511801886-6753-11-git-send-email-okaya-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
2017-11-27 18:52     ` Sinan Kaya
     [not found] ` <1511801886-6753-9-git-send-email-okaya@codeaurora.org>
2017-11-27 18:49   ` [PATCH V3 08/29] drm/gma500: " Sinan Kaya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).