fm10k: print error code when pci_enable_device_mem fails during probe
Subsystems (2)
PATCH v2 1/1 fm10k: print error code when pci_enable_device_mem fails during probe
--- drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/fm10k/fm10k_pci.c +4 -1
@@ -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)
Signature · 1 line
2.9.0.rc1.405.g81f467e
PATCH v2 1/1 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.
--- drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_pci.c +6 -0
@@ -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,
Signature · 1 line
2.9.0.rc1.405.g81f467e
PATCH v2 1/1 fm10k: print error code when pci_enable_device_mem fails during probe
In reply to Jacob Keller--- drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/fm10k/fm10k_pci.c +4 -1
@@ -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)
Signature · 1 line
2.9.0.rc1.405.g81f467e
PATCH v2 1/1 fm10k: don't continue probe if PCI device not in normal IO state
In reply to Jacob KellerIn 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.
--- drivers/net/ethernet/intel/fm10k/fm10k_pci.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_pci.c +6 -0
@@ -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,
Signature · 1 line
2.9.0.rc1.405.g81f467e
Singh
PATCH v2 1/1 fm10k: print error code when pci_enable_device_mem fails during probe
In reply to Jacob Keller-----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 <[email protected]>
Subject: [Intel-wired-lan] [PATCH v2] fm10k: print error code when pci_enable_device_mem fails during probe
---
Singh
PATCH v2 1/1 fm10k: don't continue probe if PCI device not in normal IO state
In reply to Jacob Keller-----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 <[email protected]>
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.
---
Singh
PATCH v2 1/1 fm10k: don't continue probe if PCI device not in normal IO state
In reply to Jacob Keller-----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 <[email protected]>
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.
---