Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753356AbbLXNXA (ORCPT ); Thu, 24 Dec 2015 08:23:00 -0500 Received: from rtits2.realtek.com ([60.250.210.242]:46409 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753026AbbLXNW4 (ORCPT ); Thu, 24 Dec 2015 08:22:56 -0500 X-SpamFilter-By: BOX Solutions SpamTrap 5.56 with qID tBODFgUn007375, This message is accepted by code: ctloc85258 From: Chunhao Lin To: CC: , , Chunhao Lin Subject: [PATCH net-next 2/2] r8169:Update the way of reading RTL8168H PHY register "rg_saw_cnt" Date: Thu, 24 Dec 2015 21:15:27 +0800 Message-ID: <1450962927-19077-3-git-send-email-hau@realtek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1450962927-19077-1-git-send-email-hau@realtek.com> References: <1450962927-19077-1-git-send-email-hau@realtek.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.21.177.90] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1078 Lines: 29 The vlaue of RTL8168H PHY register "rg_saw_cnt" only valid from bit0 to bit13. When read this register, add bitwise-anding its value with 0x3fff. Signed-off-by: Chunhao Lin --- drivers/net/ethernet/realtek/r8169.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index 11cc32b..58365bc 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -6136,7 +6136,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp) rtl_pcie_state_l2l3_enable(tp, false); rtl_writephy(tp, 0x1f, 0x0c42); - rg_saw_cnt = rtl_readphy(tp, 0x13); + rg_saw_cnt = (rtl_readphy(tp, 0x13) & 0x3fff); rtl_writephy(tp, 0x1f, 0x0000); if (rg_saw_cnt > 0) { u16 sw_cnt_1ms_ini; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/