From: Derek Chickles <derek.chick...@cavium.com>

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.

Signed-off-by: Derek Chickles <derek.chick...@cavium.com>
Signed-off-by: Satanand Burla <satananda.bu...@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlu...@cavium.com>
---
 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(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c 
b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
index 6081c31..3ab311f 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
@@ -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;
diff --git a/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c 
b/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
index b28253c..effd7ac 100644
--- a/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
+++ b/drivers/net/ethernet/cavium/liquidio/cn66xx_device.c
@@ -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;
        }

Reply via email to