Return-Path: Received: from mail-by2nam01on0098.outbound.protection.outlook.com ([104.47.34.98]:46928 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932923AbeCSQED (ORCPT ); Mon, 19 Mar 2018 12:04:03 -0400 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Ganesh Goudar , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 191/281] cxgb4: fix incorrect cim_la output for T6 Date: Mon, 19 Mar 2018 16:01:39 +0000 Message-ID: <20180319155742.13731-191-alexander.levin@microsoft.com> References: <20180319155742.13731-1-alexander.levin@microsoft.com> In-Reply-To: <20180319155742.13731-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Ganesh Goudar [ Upstream commit a97051f4553551d13e586ab3cb6ae13093a44a81 ] take care of UpDbgLaRdPtr[0-3] restriction for T6. Signed-off-by: Ganesh Goudar Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ether= net/chelsio/cxgb4/t4_hw.c index 24d391899730..ebeeb3581b9c 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -8088,7 +8088,16 @@ int t4_cim_read_la(struct adapter *adap, u32 *la_buf= , unsigned int *wrptr) ret =3D t4_cim_read(adap, UP_UP_DBG_LA_DATA_A, 1, &la_buf[i]); if (ret) break; - idx =3D (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) >=3D 9) + idx =3D (idx & 0xff0) + 0x10; + else + idx++; + /* address can't exceed 0xfff */ + idx &=3D UPDBGLARDPTR_M; } restart: if (cfg & UPDBGLAEN_F) { --=20 2.14.1