All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cxl: Ignore probes for virtual afu pci devices
@ 2016-02-29  5:40 Vaibhav Jain
  2016-03-02 16:09 ` Frederic Barrat
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Vaibhav Jain @ 2016-02-29  5:40 UTC (permalink / raw)
  To: linuxppc-dev
  Cc: mpe, mikey, Benjamin Herrenschmidt, Vaibhav Jain, Ian Munsie,
	Frederic Barrat

Add a check at the beginning of cxl_probe function to ignore virtual pci
devices created for each afu registered. This fixes the the errors
messages logged about missing CXL vsec, when cxl probe is unable to
find necessary vsec entries in device pci config space. The error
message logged are of the form :

cxl-pci 0004:00:00.0: ABORTING: CXL VSEC not found!
cxl-pci 0004:00:00.0: cxl_init_adapter failed: -19

Cc: Ian Munsie <imunsie@au1.ibm.com>
Cc: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
---
 drivers/misc/cxl/cxl.h  | 2 ++
 drivers/misc/cxl/pci.c  | 5 +++++
 drivers/misc/cxl/vphb.c | 9 +++++++++
 3 files changed, 16 insertions(+)

diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
index a521bc7..68d39f5 100644
--- a/drivers/misc/cxl/cxl.h
+++ b/drivers/misc/cxl/cxl.h
@@ -764,4 +764,6 @@ unsigned int afu_poll(struct file *file, struct poll_table_struct *poll);
 ssize_t afu_read(struct file *file, char __user *buf, size_t count, loff_t *off);
 extern const struct file_operations afu_fops;
 
+/* check if the given pci_dev is on the the cxl vphb bus */
+bool cxl_pci_is_vphb_device(struct pci_dev *dev);
 #endif
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index 4c1903f..2f219c1 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -1278,6 +1278,11 @@ static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id)
 	int slice;
 	int rc;
 
+	if (cxl_pci_is_vphb_device(dev)) {
+		dev_dbg(&dev->dev, "cxl_init_adapter: Ignoring cxl vphb device\n");
+		return -ENODEV;
+	}
+
 	if (cxl_verbose)
 		dump_cxl_config_space(dev);
 
diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
index cbd4331..e76a42a 100644
--- a/drivers/misc/cxl/vphb.c
+++ b/drivers/misc/cxl/vphb.c
@@ -296,6 +296,15 @@ void cxl_pci_vphb_remove(struct cxl_afu *afu)
 	pcibios_free_controller(phb);
 }
 
+bool cxl_pci_is_vphb_device(struct pci_dev *dev)
+{
+	struct pci_controller *phb;
+
+	phb = pci_bus_to_host(dev->bus);
+
+	return (phb->ops == &cxl_pcie_pci_ops);
+}
+
 struct cxl_afu *cxl_pci_to_afu(struct pci_dev *dev)
 {
 	struct pci_controller *phb;
-- 
2.7.0.dirty

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

* Re: [PATCH] cxl: Ignore probes for virtual afu pci devices
  2016-02-29  5:40 [PATCH] cxl: Ignore probes for virtual afu pci devices Vaibhav Jain
@ 2016-03-02 16:09 ` Frederic Barrat
  2016-03-03 23:19 ` Andrew Donnellan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Frederic Barrat @ 2016-03-02 16:09 UTC (permalink / raw)
  To: Vaibhav Jain, linuxppc-dev; +Cc: mikey, Ian Munsie

Hi Vaibhav,

Looks ok to me.
Reviewed-by: fbarrat@linux.vnet.ibm.com

   Fred

Le 29/02/2016 06:40, Vaibhav Jain a écrit :
> Add a check at the beginning of cxl_probe function to ignore virtual pci
> devices created for each afu registered. This fixes the the errors
> messages logged about missing CXL vsec, when cxl probe is unable to
> find necessary vsec entries in device pci config space. The error
> message logged are of the form :
>
> cxl-pci 0004:00:00.0: ABORTING: CXL VSEC not found!
> cxl-pci 0004:00:00.0: cxl_init_adapter failed: -19
>
> Cc: Ian Munsie <imunsie@au1.ibm.com>
> Cc: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
> ---
>   drivers/misc/cxl/cxl.h  | 2 ++
>   drivers/misc/cxl/pci.c  | 5 +++++
>   drivers/misc/cxl/vphb.c | 9 +++++++++
>   3 files changed, 16 insertions(+)
>
> diff --git a/drivers/misc/cxl/cxl.h b/drivers/misc/cxl/cxl.h
> index a521bc7..68d39f5 100644
> --- a/drivers/misc/cxl/cxl.h
> +++ b/drivers/misc/cxl/cxl.h
> @@ -764,4 +764,6 @@ unsigned int afu_poll(struct file *file, struct poll_table_struct *poll);
>   ssize_t afu_read(struct file *file, char __user *buf, size_t count, loff_t *off);
>   extern const struct file_operations afu_fops;
>
> +/* check if the given pci_dev is on the the cxl vphb bus */
> +bool cxl_pci_is_vphb_device(struct pci_dev *dev);
>   #endif
> diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
> index 4c1903f..2f219c1 100644
> --- a/drivers/misc/cxl/pci.c
> +++ b/drivers/misc/cxl/pci.c
> @@ -1278,6 +1278,11 @@ static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id)
>   	int slice;
>   	int rc;
>
> +	if (cxl_pci_is_vphb_device(dev)) {
> +		dev_dbg(&dev->dev, "cxl_init_adapter: Ignoring cxl vphb device\n");
> +		return -ENODEV;
> +	}
> +
>   	if (cxl_verbose)
>   		dump_cxl_config_space(dev);
>
> diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
> index cbd4331..e76a42a 100644
> --- a/drivers/misc/cxl/vphb.c
> +++ b/drivers/misc/cxl/vphb.c
> @@ -296,6 +296,15 @@ void cxl_pci_vphb_remove(struct cxl_afu *afu)
>   	pcibios_free_controller(phb);
>   }
>
> +bool cxl_pci_is_vphb_device(struct pci_dev *dev)
> +{
> +	struct pci_controller *phb;
> +
> +	phb = pci_bus_to_host(dev->bus);
> +
> +	return (phb->ops == &cxl_pcie_pci_ops);
> +}
> +
>   struct cxl_afu *cxl_pci_to_afu(struct pci_dev *dev)
>   {
>   	struct pci_controller *phb;
>

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

* Re: [PATCH] cxl: Ignore probes for virtual afu pci devices
  2016-02-29  5:40 [PATCH] cxl: Ignore probes for virtual afu pci devices Vaibhav Jain
  2016-03-02 16:09 ` Frederic Barrat
@ 2016-03-03 23:19 ` Andrew Donnellan
  2016-03-04  3:49 ` Ian Munsie
  2016-03-10  2:03 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Andrew Donnellan @ 2016-03-03 23:19 UTC (permalink / raw)
  To: Vaibhav Jain, linuxppc-dev; +Cc: mikey, Frederic Barrat, Ian Munsie

On 29/02/16 16:40, Vaibhav Jain wrote:
> Add a check at the beginning of cxl_probe function to ignore virtual pci
> devices created for each afu registered. This fixes the the errors
> messages logged about missing CXL vsec, when cxl probe is unable to
> find necessary vsec entries in device pci config space. The error
> message logged are of the form :
>
> cxl-pci 0004:00:00.0: ABORTING: CXL VSEC not found!
> cxl-pci 0004:00:00.0: cxl_init_adapter failed: -19
>
> Cc: Ian Munsie <imunsie@au1.ibm.com>
> Cc: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>

Looks good to me.

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

-- 
Andrew Donnellan              Software Engineer, OzLabs
andrew.donnellan@au1.ibm.com  Australia Development Lab, Canberra
+61 2 6201 8874 (work)        IBM Australia Limited

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

* Re: [PATCH] cxl: Ignore probes for virtual afu pci devices
  2016-02-29  5:40 [PATCH] cxl: Ignore probes for virtual afu pci devices Vaibhav Jain
  2016-03-02 16:09 ` Frederic Barrat
  2016-03-03 23:19 ` Andrew Donnellan
@ 2016-03-04  3:49 ` Ian Munsie
  2016-03-10  2:03 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Ian Munsie @ 2016-03-04  3:49 UTC (permalink / raw)
  To: Vaibhav Jain
  Cc: linuxppc-dev, mpe, mikey, Benjamin Herrenschmidt, Frederic Barrat

Acked-by: Ian Munsie <imunsie@au1.ibm.com>

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

* Re: cxl: Ignore probes for virtual afu pci devices
  2016-02-29  5:40 [PATCH] cxl: Ignore probes for virtual afu pci devices Vaibhav Jain
                   ` (2 preceding siblings ...)
  2016-03-04  3:49 ` Ian Munsie
@ 2016-03-10  2:03 ` Michael Ellerman
  3 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2016-03-10  2:03 UTC (permalink / raw)
  To: Vaibhav Jain, linuxppc-dev
  Cc: mikey, Vaibhav Jain, Frederic Barrat, Ian Munsie

On Mon, 2016-29-02 at 05:40:53 UTC, Vaibhav Jain wrote:
> Add a check at the beginning of cxl_probe function to ignore virtual pci
> devices created for each afu registered. This fixes the the errors
> messages logged about missing CXL vsec, when cxl probe is unable to
> find necessary vsec entries in device pci config space. The error
> message logged are of the form :
> 
> cxl-pci 0004:00:00.0: ABORTING: CXL VSEC not found!
> cxl-pci 0004:00:00.0: cxl_init_adapter failed: -19
> 
> Cc: Ian Munsie <imunsie@au1.ibm.com>
> Cc: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Signed-off-by: Vaibhav Jain <vaibhav@linux.vnet.ibm.com>
> Reviewed-by: fbarrat@linux.vnet.ibm.com
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/17eb3eef19f2c0541a7f04ad37

cheers

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

end of thread, other threads:[~2016-03-10  2:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-29  5:40 [PATCH] cxl: Ignore probes for virtual afu pci devices Vaibhav Jain
2016-03-02 16:09 ` Frederic Barrat
2016-03-03 23:19 ` Andrew Donnellan
2016-03-04  3:49 ` Ian Munsie
2016-03-10  2:03 ` Michael Ellerman

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.