All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe
@ 2016-06-23 20:31 Jacob Keller
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Jacob Keller @ 2016-06-23 20:31 UTC (permalink / raw)
  To: intel-wired-lan

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 5f4f27337003..552268292ac8 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1951,8 +1951,11 @@ static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int err;
 
 	err = pci_enable_device_mem(pdev);
-	if (err)
+	if (err) {
+		dev_err(&pdev->dev,
+			"PCI enable device failed: %d\n", err);
 		return err;
+	}
 
 	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (err)
-- 
2.9.0.rc1.405.g81f467e


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

* [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state
  2016-06-23 20:31 [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
@ 2016-06-23 20:31 ` Jacob Keller
  2016-08-24 23:01   ` Singh, Krishneil K
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 7+ messages in thread
From: Jacob Keller @ 2016-06-23 20:31 UTC (permalink / raw)
  To: intel-wired-lan

In the event of an uncorrectable AER error occuring when the driver has
not loaded, the recovery routines are not done. This is done because
future loads of the driver may not be aware of the IO state and may not
be able to recover at all. In this case, when we next load the driver it
fails due to what appears to be a surprise remove event. Instead, add
a check to ensure that the device is in the normal IO state before
continuing to probe. This allows us to give a more descriptive message
of what is wrong.

Without this change, the driver will attempt to probe up to our first
call of .reset_hw() which will be unable to read registers and act as if
a surprise remove event occurred.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 552268292ac8..0293eed5005b 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1950,6 +1950,12 @@ static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct fm10k_intfc *interface;
 	int err;
 
+	if (pdev->error_state != pci_channel_io_normal) {
+		dev_err(&pdev->dev,
+			"PCI device still in an error state. Unable to load...\n");
+		return -EIO;
+	}
+
 	err = pci_enable_device_mem(pdev);
 	if (err) {
 		dev_err(&pdev->dev,
-- 
2.9.0.rc1.405.g81f467e


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

* [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe
  2016-06-23 20:31 [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
@ 2016-06-23 20:31 ` Jacob Keller
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
  2016-08-22 22:17 ` [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Singh, Krishneil K
  3 siblings, 0 replies; 7+ messages in thread
From: Jacob Keller @ 2016-06-23 20:31 UTC (permalink / raw)
  To: intel-wired-lan

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 5f4f27337003..552268292ac8 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1951,8 +1951,11 @@ static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	int err;
 
 	err = pci_enable_device_mem(pdev);
-	if (err)
+	if (err) {
+		dev_err(&pdev->dev,
+			"PCI enable device failed: %d\n", err);
 		return err;
+	}
 
 	err = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(48));
 	if (err)
-- 
2.9.0.rc1.405.g81f467e


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

* [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state
  2016-06-23 20:31 [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
@ 2016-06-23 20:31 ` Jacob Keller
  2016-08-22 22:18   ` Singh, Krishneil K
  2016-08-22 22:17 ` [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Singh, Krishneil K
  3 siblings, 1 reply; 7+ messages in thread
From: Jacob Keller @ 2016-06-23 20:31 UTC (permalink / raw)
  To: intel-wired-lan

In the event of an uncorrectable AER error occuring when the driver has
not loaded, the recovery routines are not done. This is done because
future loads of the driver may not be aware of the IO state and may not
be able to recover at all. In this case, when we next load the driver it
fails due to what appears to be a surprise remove event. Instead, add
a check to ensure that the device is in the normal IO state before
continuing to probe. This allows us to give a more descriptive message
of what is wrong.

Without this change, the driver will attempt to probe up to our first
call of .reset_hw() which will be unable to read registers and act as if
a surprise remove event occurred.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
index 552268292ac8..0293eed5005b 100644
--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
+++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c
@@ -1950,6 +1950,12 @@ static int fm10k_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	struct fm10k_intfc *interface;
 	int err;
 
+	if (pdev->error_state != pci_channel_io_normal) {
+		dev_err(&pdev->dev,
+			"PCI device still in an error state. Unable to load...\n");
+		return -EIO;
+	}
+
 	err = pci_enable_device_mem(pdev);
 	if (err) {
 		dev_err(&pdev->dev,
-- 
2.9.0.rc1.405.g81f467e


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

* [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe
  2016-06-23 20:31 [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
                   ` (2 preceding siblings ...)
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
@ 2016-08-22 22:17 ` Singh, Krishneil K
  3 siblings, 0 replies; 7+ messages in thread
From: Singh, Krishneil K @ 2016-08-22 22:17 UTC (permalink / raw)
  To: intel-wired-lan


-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Thursday, June 23, 2016 1:31 PM
To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Subject: [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>


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

* [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
@ 2016-08-22 22:18   ` Singh, Krishneil K
  0 siblings, 0 replies; 7+ messages in thread
From: Singh, Krishneil K @ 2016-08-22 22:18 UTC (permalink / raw)
  To: intel-wired-lan


-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Thursday, June 23, 2016 1:31 PM
To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Subject: [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state

In the event of an uncorrectable AER error occuring when the driver has not loaded, the recovery routines are not done. This is done because future loads of the driver may not be aware of the IO state and may not be able to recover at all. In this case, when we next load the driver it fails due to what appears to be a surprise remove event. Instead, add a check to ensure that the device is in the normal IO state before continuing to probe. This allows us to give a more descriptive message of what is wrong.

Without this change, the driver will attempt to probe up to our first call of .reset_hw() which will be unable to read registers and act as if a surprise remove event occurred.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>


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

* [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state
  2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
@ 2016-08-24 23:01   ` Singh, Krishneil K
  0 siblings, 0 replies; 7+ messages in thread
From: Singh, Krishneil K @ 2016-08-24 23:01 UTC (permalink / raw)
  To: intel-wired-lan

-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Thursday, June 23, 2016 1:31 PM
To: Intel Wired LAN <intel-wired-lan@lists.osuosl.org>
Subject: [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state

In the event of an uncorrectable AER error occuring when the driver has not loaded, the recovery routines are not done. This is done because future loads of the driver may not be aware of the IO state and may not be able to recover at all. In this case, when we next load the driver it fails due to what appears to be a surprise remove event. Instead, add a check to ensure that the device is in the normal IO state before continuing to probe. This allows us to give a more descriptive message of what is wrong.

Without this change, the driver will attempt to probe up to our first call of .reset_hw() which will be unable to read registers and act as if a surprise remove event occurred.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---

Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com>



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

end of thread, other threads:[~2016-08-24 23:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-23 20:31 [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
2016-08-24 23:01   ` Singh, Krishneil K
2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Jacob Keller
2016-06-23 20:31 ` [Intel-wired-lan] [PATCH v2] fm10k: don't continue probe if PCI device not in normal IO state Jacob Keller
2016-08-22 22:18   ` Singh, Krishneil K
2016-08-22 22:17 ` [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe Singh, Krishneil K

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.