From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 35CC4194A76; Wed, 3 Jul 2024 10:58:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004324; cv=none; b=VxG/YjCkFCPBJKP2hyBohjO0SJW/oYRGx6xpF/i32juXjXLrY9rW2FDZM/qqEQi7+W8rR0LFJgRjG9qlUyE83iIo3TshMMDgf+kj2t0x05i1YAOv2q98Fd41cIovmVQt1ucuXVP4j0M6YWTG/V/dxa/YA5sbZEuY76HrOPlra0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720004324; c=relaxed/simple; bh=s1i48l2kFAxbHGFkBfxkKj6WEqnwF1jYryIawp0RCNc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N7kRINZOn1XL/8jEtF4BFnWhkczDC7EvlueoXS8Ia3fHlaLwGD1y0WXt8cTi63aH5y3oTFRjyGEWF6TXAlG7NhfQeFtvWVC3HAd4KLIjcCC3Vfb+ecoUtI72zf6LlTfU0hJz8oZ9diUzt6w1eHnGDEutE8vcDAMyzuORp1T6Jb8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=A5Ktgeye; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="A5Ktgeye" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B28B4C32781; Wed, 3 Jul 2024 10:58:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720004324; bh=s1i48l2kFAxbHGFkBfxkKj6WEqnwF1jYryIawp0RCNc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A5KtgeyeMOrZ/tuSZyBf8/SPvyIDGaGaRH3qUJ5i9NH8EsZDRuo3WF18DBaQ5jSKE XlL4XQyKGGTx+gEbkMGnjAJqmmBereEr4pxqyVgfklp5Efp+dFKhot8gl3HyDzDY+U e5vMZUhkXn1GcNpa5ynbjH0Qta4Z8WdfWrg2sadk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jose Ignacio Tornos Martinez , Simon Horman , "David S. Miller" Subject: [PATCH 5.4 165/189] net: usb: ax88179_178a: improve link status logs Date: Wed, 3 Jul 2024 12:40:26 +0200 Message-ID: <20240703102847.695811465@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703102841.492044697@linuxfoundation.org> References: <20240703102841.492044697@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jose Ignacio Tornos Martinez commit 058722ee350c0bdd664e467156feb2bf5d9cc271 upstream. Avoid spurious link status logs that may ultimately be wrong; for example, if the link is set to down with the cable plugged, then the cable is unplugged and after this the link is set to up, the last new log that is appearing is incorrectly telling that the link is up. In order to avoid errors, show link status logs after link_reset processing, and in order to avoid spurious as much as possible, only show the link loss when some link status change is detected. cc: stable@vger.kernel.org Fixes: e2ca90c276e1 ("ax88179_178a: ASIX AX88179_178A USB 3.0/2.0 to gigabit ethernet adapter driver") Signed-off-by: Jose Ignacio Tornos Martinez Reviewed-by: Simon Horman Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/usb/ax88179_178a.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -345,7 +345,8 @@ static void ax88179_status(struct usbnet if (netif_carrier_ok(dev->net) != link) { usbnet_link_change(dev, link, 1); - netdev_info(dev->net, "ax88179 - Link status is: %d\n", link); + if (!link) + netdev_info(dev->net, "ax88179 - Link status is: 0\n"); } } @@ -1532,6 +1533,7 @@ static int ax88179_link_reset(struct usb GMII_PHY_PHYSR, 2, &tmp16); if (!(tmp16 & GMII_PHY_PHYSR_LINK)) { + netdev_info(dev->net, "ax88179 - Link status is: 0\n"); return 0; } else if (GMII_PHY_PHYSR_GIGA == (tmp16 & GMII_PHY_PHYSR_SMASK)) { mode |= AX_MEDIUM_GIGAMODE | AX_MEDIUM_EN_125MHZ; @@ -1569,6 +1571,8 @@ static int ax88179_link_reset(struct usb netif_carrier_on(dev->net); + netdev_info(dev->net, "ax88179 - Link status is: 1\n"); + return 0; }