Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6271829imu; Mon, 21 Jan 2019 06:10:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7+d7/MYwLwHBaJvQ6QitdSDaQWnp528JaEajKS93VIiZZkrwowxPvT1AvN6iRlA4jqI/7W X-Received: by 2002:aa7:81d0:: with SMTP id c16mr29629062pfn.153.1548079838431; Mon, 21 Jan 2019 06:10:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548079838; cv=none; d=google.com; s=arc-20160816; b=03E9sPKi/8Vez/2MHetVw7XSGPaNqPxRNbaPmyGvrg9gP9+P6TpZgTbvueF9v43TDa 0yorPytAbBHprJdjB6w+mn5+Ay94u0Yjede0Hm7PgEkxQ+yAl25WirMHKkw0a9CFG4q1 WXcA9qghZjKfSKOMNdW9oNN4PvAoc1F1TvR4fz17e0uYQ8EbJARcTTJk+kkorRqU3xD5 DnQ5O+cqTD0ax5MPY/qDu92d7v7KIurxkIXe2Q2tkNVhqZ7myoHs4bibxZgWoUkwOVvD wyM2WcMFmu/FDCaVZOCkquUQ6yiUH6A/n6w/R9CtnEOFBfUHZWeqvwb52lDhLUlXRrH6 mxHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Cs2kK7JOjbipD3aIGh2RZWlKb9RvXX63jUd+4ykEWz0=; b=MG1uNLJdjINtL7P6HhiEU9bsJZQdTvSH5rn5PwoGLXYB+8eZx2vMOdI8QVMKSz6/Oe Y4Awm0FUCHKcyvWmqZbyFaYebMh9GJO48JTNLpwvVm4Mk+BQDnMHLCpfZsGpNZtrJp9+ 36uVd+rDPp18GTNhgm9slaDNLyw/AwiXPa9crYZl++3gmHKSTs4UyfDK8NN6mH47Pt3/ gz2Y7HNWAaPcX5ZZeas6EkmSK3tj3i2MSoNm581Sjs9uzqk/VGMdNnlJEHHBTaY0UIDs eX/NUlCU1bASGl3cFiiCUDnmmt0IU6DzaMpkzJViTg7fgEpfCgFUUmwSqX6EDEhVTO0o pAiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="mn/Kd5+L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i1si10220862pgr.569.2019.01.21.06.10.14; Mon, 21 Jan 2019 06:10:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="mn/Kd5+L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731523AbfAUOHw (ORCPT + 99 others); Mon, 21 Jan 2019 09:07:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:45232 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731232AbfAUN7P (ORCPT ); Mon, 21 Jan 2019 08:59:15 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D55E420879; Mon, 21 Jan 2019 13:59:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548079155; bh=43ScXGLxG58Jr5mcpNj0LdztajWysj1Qxrn157gJLRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mn/Kd5+LYng6fl8y1tu/ysSNDelAu94mHu24g4t3aOCU75UgRKVl0iUmMt+BBaFdo LGibrlxWIZdu1Iht1M2WMF8H7rTtHy4bB+WP7hBBfii1+ZwEUC2GfZ7rOHuN3WwgCj qbdsMV7Yi/A93vd1m7KeRysLQIVIfTMHGxw5nK4c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Heiner Kallweit , "David S. Miller" Subject: [PATCH 4.19 27/99] r8169: dont try to read counters if chip is in a PCI power-save state Date: Mon, 21 Jan 2019 14:48:19 +0100 Message-Id: <20190121134914.937013491@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190121134913.924726465@linuxfoundation.org> References: <20190121134913.924726465@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Heiner Kallweit [ Upstream commit 10262b0b53666cbc506989b17a3ead1e9c3b43b4 ] Avoid log spam caused by trying to read counters from the chip whilst it is in a PCI power-save state. Reference: https://bugzilla.kernel.org/show_bug.cgi?id=107421 Fixes: 1ef7286e7f36 ("r8169: Dereference MMIO address immediately before use") Signed-off-by: Heiner Kallweit Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/realtek/r8169.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c @@ -1730,11 +1730,13 @@ static bool rtl8169_reset_counters(struc static bool rtl8169_update_counters(struct rtl8169_private *tp) { + u8 val = RTL_R8(tp, ChipCmd); + /* * Some chips are unable to dump tally counters when the receiver - * is disabled. + * is disabled. If 0xff chip may be in a PCI power-save state. */ - if ((RTL_R8(tp, ChipCmd) & CmdRxEnb) == 0) + if (!(val & CmdRxEnb) || val == 0xff) return true; return rtl8169_do_counters(tp, CounterDump);