]> git.itanic.dy.fi Git - linux-stable/commitdiff
cxgb4: fix incorrect cim_la output for T6
authorGanesh Goudar <ganeshgr@chelsio.com>
Wed, 31 May 2017 13:40:21 +0000 (19:10 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 13 Apr 2018 17:50:17 +0000 (19:50 +0200)
[ Upstream commit a97051f4553551d13e586ab3cb6ae13093a44a81 ]

take care of UpDbgLaRdPtr[0-3] restriction for T6.

Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c

index a1b9d6c74309a53461b3259ecbc49c6b0d3be56a..de23f23b41de6ce3ca2670bb45e76e47b0cc9670 100644 (file)
@@ -7711,7 +7711,16 @@ int t4_cim_read_la(struct adapter *adap, u32 *la_buf, unsigned int *wrptr)
                ret = t4_cim_read(adap, UP_UP_DBG_LA_DATA_A, 1, &la_buf[i]);
                if (ret)
                        break;
-               idx = (idx + 1) & UPDBGLARDPTR_M;
+
+               /* Bits 0-3 of UpDbgLaRdPtr can be between 0000 to 1001 to
+                * identify the 32-bit portion of the full 312-bit data
+                */
+               if (is_t6(adap->params.chip) && (idx & 0xf) >= 9)
+                       idx = (idx & 0xff0) + 0x10;
+               else
+                       idx++;
+               /* address can't exceed 0xfff */
+               idx &= UPDBGLARDPTR_M;
        }
 restart:
        if (cfg & UPDBGLAEN_F) {