Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 10262b0b authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller
Browse files

r8169: don't try to read counters if chip is in a PCI power-save state

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: 1ef7286e ("r8169: Dereference MMIO address immediately before use")
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0aaa8137
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1681,11 +1681,13 @@ static bool rtl8169_reset_counters(struct rtl8169_private *tp)

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);