Skip to contentSkip to conversation

liquidio: fix bug in soft reset failure detection

PATCH Superseded Felix Manlunas 2 participants 2 messages Jun 24, 2017 – Jun 25, 2017

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 liquidio: fix bug in soft reset failure detection

From: Derek Chickles <[email protected]>

The code that detects a failed soft reset of Octeon is comparing the wrong value against the reset value of the Octeon SLI_SCRATCH_1 register, resulting in an inability to detect a soft reset failure. Fix it by using the correct value in the comparison.

---
 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 2 +-
 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +1 -1
index 6081c31..3ab311f 100644
@@ -221,7 +221,7 @@ static int cn23xx_pf_soft_reset(struct octeon_device *oct)
 	/* Wait for 100ms as Octeon resets. */
 	mdelay(100);
 
-	if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) == 0x1234ULL) {
+	if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) != 0x0ULL) {
 		dev_err(&oct->pci_dev->dev, "OCTEON[%d]: Soft reset failed\n",
 			oct->octeon_id);
 		return 1;
drivers/net/ethernet/cavium/liquidio/cn66xx_device.c +1 -1
index b28253c..effd7ac 100644
@@ -44,7 +44,7 @@ int lio_cn6xxx_soft_reset(struct octeon_device *oct)
 	/* Wait for 10ms as Octeon resets. */
 	mdelay(100);
 
-	if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) == 0x1234ULL) {
+	if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) != 0x0ULL) {
 		dev_err(&oct->pci_dev->dev, "Soft reset failed\n");
 		return 1;
 	}
#1 lore raw
Quoted 20 lines · Felix Manlunas

From: Derek Chickles <[email protected]>

The code that detects a failed soft reset of Octeon is comparing the wrong value against the reset value of the Octeon SLI_SCRATCH_1 register, resulting in an inability to detect a soft reset failure. Fix it by using the correct value in the comparison.

---
 drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c | 2 +-
 drivers/net/ethernet/cavium/liquidio/cn66xx_device.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +0 -0
index 6081c31..3ab311f 100644

drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c static int cn23xx_pf_soft_reset(struct octeon_device *oct) · line 224

Quoted 5 lines
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +1 -1
@@ -221,7 +221,7 @@ static int cn23xx_pf_soft_reset(struct octeon_device *oct)
 	/* Wait for 100ms as Octeon resets. */
 	mdelay(100);
 
-	if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) == 0x1234ULL) {
+	if (octeon_read_csr64(oct, CN23XX_SLI_SCRATCH1) != 0x0ULL) {

Zero is always zero, please drop this 0x0ULL and add fixes line to the commit message.

Quoted 16 lines
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c +0 -0
 		dev_err(&oct->pci_dev->dev, "OCTEON[%d]: Soft reset failed\n",
 			oct->octeon_id);
 		return 1;
drivers/net/ethernet/cavium/liquidio/cn66xx_device.c +1 -1
index b28253c..effd7ac 100644
@@ -44,7 +44,7 @@ int lio_cn6xxx_soft_reset(struct octeon_device *oct)
 	/* Wait for 10ms as Octeon resets. */
 	mdelay(100);
 
-	if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) == 0x1234ULL) {
+	if (octeon_read_csr64(oct, CN6XXX_SLI_SCRATCH1) != 0x0ULL) {
 		dev_err(&oct->pci_dev->dev, "Soft reset failed\n");
 		return 1;
 	}