liquidio: fix bug in soft reset failure detection
authorDerek Chickles <derek.chickles@cavium.com>
Wed, 5 Jul 2017 18:59:27 +0000 (11:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Jul 2017 09:36:03 +0000 (10:36 +0100)
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, which is any non-zero value.

Fixes: f21fb3ed364b ("Add support of Cavium Liquidio ethernet adapters")
Fixes: c0eab5b3580a ("liquidio: CN23XX firmware download")
Signed-off-by: Derek Chickles <derek.chickles@cavium.com>
Signed-off-by: Satanand Burla <satananda.burla@cavium.com>
Signed-off-by: Raghu Vatsavayi <raghu.vatsavayi@cavium.com>
Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c
drivers/net/ethernet/cavium/liquidio/cn66xx_device.c

index 6081c3132135f78215357a15b443db8c94350dce..4b0ca9fb2cb4578b9c74b775d33d4fa638beb21a 100644 (file)
@@ -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)) {
                dev_err(&oct->pci_dev->dev, "OCTEON[%d]: Soft reset failed\n",
                        oct->octeon_id);
                return 1;
index b28253c96d9751f65db3a6e8b4683c918a200bfd..2df7440f58df556d0a8f0fb14f8525d196a2a122 100644 (file)
@@ -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)) {
                dev_err(&oct->pci_dev->dev, "Soft reset failed\n");
                return 1;
        }