Re: [PATCH 2/2] IB/qib: Allow driver to load if PCIe advanced error reporting fails

2010-10-25 Thread Jason Gunthorpe
On Mon, Oct 25, 2010 at 09:19:47PM -0700, Roland Dreier wrote:
> OK, I got those 3 patches.

Thanks

While you are looking at patches, did you have any comment on:

https://patchwork.kernel.org/patch/151491/
https://patchwork.kernel.org/patch/151501/

?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] IB/qib: Allow driver to load if PCIe advanced error reporting fails

2010-10-25 Thread Roland Dreier
OK, I got those 3 patches.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] IB/qib: Allow driver to load if PCIe advanced error reporting fails

2010-10-25 Thread Jason Gunthorpe
On Mon, Oct 25, 2010 at 01:35:33PM -0700, Ralph Campbell wrote:
> On Sat, 2010-10-23 at 13:54 -0700, Roland Dreier wrote:
> > I'm lost on which initialization / cleanup fixes are the right ones to
> > take for qib.  Can someone point me to the definitive set of patches?
> 
> If Jason agrees, they are the attached.
> There are probably more error paths that need fixing
> but I think separate patches make sense for those.

Yes, there are more error paths that leak things, but this fixes up
some obvious ones and makes the driver work (and not leak) on older
PCI-E systems.

Please include the 3 patches from Ralph in this round.

Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] IB/qib: Allow driver to load if PCIe advanced error reporting fails

2010-10-25 Thread Ralph Campbell
On Sat, 2010-10-23 at 13:54 -0700, Roland Dreier wrote:
> I'm lost on which initialization / cleanup fixes are the right ones to
> take for qib.  Can someone point me to the definitive set of patches?
> 
>  - R.

If Jason agrees, they are the attached.
There are probably more error paths that need fixing
but I think separate patches make sense for those.
--- Begin Message ---
If CONFIG_PCI_MSI is not set, and a QLE7140 is present, the
pointer "dd" was uninitialized.

Signed-off-by: Ralph Campbell 
---

 drivers/infiniband/hw/qib/qib_init.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_init.c 
b/drivers/infiniband/hw/qib/qib_init.c
index f1d16d3..f3b5039 100644
--- a/drivers/infiniband/hw/qib/qib_init.c
+++ b/drivers/infiniband/hw/qib/qib_init.c
@@ -1243,6 +1243,7 @@ static int __devinit qib_init_one(struct pci_dev *pdev,
qib_early_err(&pdev->dev, "QLogic PCIE device 0x%x cannot "
  "work if CONFIG_PCI_MSI is not enabled\n",
  ent->device);
+   dd = ERR_PTR(-ENODEV);
 #endif
break;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- End Message ---
--- Begin Message ---
Some PCIe root complex chip sets don't support advanced error reporting.
Allow the driver to load OK if pci_enable_pcie_error_reporting() fails.

Signed-off-by: Ralph Campbell 
---

 drivers/infiniband/hw/qib/qib_pcie.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_pcie.c 
b/drivers/infiniband/hw/qib/qib_pcie.c
index 7fa6e55..8a64426 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -109,10 +109,12 @@ int qib_pcie_init(struct pci_dev *pdev, const struct 
pci_device_id *ent)
 
pci_set_master(pdev);
ret = pci_enable_pcie_error_reporting(pdev);
-   if (ret)
+   if (ret) {
qib_early_err(&pdev->dev,
  "Unable to enable pcie error reporting: %d\n",
  ret);
+   ret = 0;
+   }
goto done;
 
 bail:

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- End Message ---
--- Begin Message ---
From: Jason Gunthorpe 

Clean up properly if pci_set_consistent_dma_mask() fails.

Signed-off-by: Jason Gunthorpe 
---

 drivers/infiniband/hw/qib/qib_pcie.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_pcie.c 
b/drivers/infiniband/hw/qib/qib_pcie.c
index 8a64426..48b6674 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -103,9 +103,11 @@ int qib_pcie_init(struct pci_dev *pdev, const struct 
pci_device_id *ent)
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
} else
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
-   if (ret)
+   if (ret) {
qib_early_err(&pdev->dev,
  "Unable to set DMA consistent mask: %d\n", ret);
+   goto bail;
+   }
 
pci_set_master(pdev);
ret = pci_enable_pcie_error_reporting(pdev);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

--- End Message ---


Re: [PATCH 2/2] IB/qib: Allow driver to load if PCIe advanced error reporting fails

2010-10-23 Thread Roland Dreier
I'm lost on which initialization / cleanup fixes are the right ones to
take for qib.  Can someone point me to the definitive set of patches?

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] IB/qib: Allow driver to load if PCIe advanced error reporting fails

2010-10-22 Thread Jason Gunthorpe
On Fri, Oct 22, 2010 at 03:29:54PM -0700, Ralph Campbell wrote:
> Some PCIe root complex chip sets don't support advanced error reporting.
> Allow the driver to load OK if pci_enable_pcie_error_reporting() fails.

Thanks

If you use this solution you'll want this hunk as well to avoid a leak:

diff --git a/drivers/infiniband/hw/qib/qib_pcie.c 
b/drivers/infiniband/hw/qib/qib_pcie.c
index 16ce9e7..2913af2 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -103,9 +103,11 @@ int qib_pcie_init(struct pci_dev *pdev, const struct 
pci_device_id *ent)
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
} else
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
-   if (ret)
+   if (ret) {
qib_early_err(&pdev->dev,
  "Unable to set DMA consistent mask: %d\n", ret);
+   goto bail;
+   }
 
pci_set_master(pdev);
ret = pci_enable_pcie_error_reporting(pdev);

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] IB/qib: Allow driver to load if PCIe advanced error reporting fails

2010-10-22 Thread Ralph Campbell
Some PCIe root complex chip sets don't support advanced error reporting.
Allow the driver to load OK if pci_enable_pcie_error_reporting() fails.

Signed-off-by: Ralph Campbell 
---

 drivers/infiniband/hw/qib/qib_pcie.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/qib/qib_pcie.c 
b/drivers/infiniband/hw/qib/qib_pcie.c
index 7fa6e55..8a64426 100644
--- a/drivers/infiniband/hw/qib/qib_pcie.c
+++ b/drivers/infiniband/hw/qib/qib_pcie.c
@@ -109,10 +109,12 @@ int qib_pcie_init(struct pci_dev *pdev, const struct 
pci_device_id *ent)
 
pci_set_master(pdev);
ret = pci_enable_pcie_error_reporting(pdev);
-   if (ret)
+   if (ret) {
qib_early_err(&pdev->dev,
  "Unable to enable pcie error reporting: %d\n",
  ret);
+   ret = 0;
+   }
goto done;
 
 bail:

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html