Return-Path: Received: from mail-by2nam01on0111.outbound.protection.outlook.com ([104.47.34.111]:9825 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966590AbeCSQKO (ORCPT ); Mon, 19 Mar 2018 12:10:14 -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.4 118/167] cxgb4: fix incorrect cim_la output for T6 Date: Mon, 19 Mar 2018 16:07:50 +0000 Message-ID: <20180319160513.16384-118-alexander.levin@microsoft.com> References: <20180319160513.16384-1-alexander.levin@microsoft.com> In-Reply-To: <20180319160513.16384-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 a1b9d6c74309..de23f23b41de 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c @@ -7711,7 +7711,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