From nobody Thu Dec 18 05:16:17 2025 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 EB5F01AD3F0 for ; Thu, 20 Jun 2024 13:34:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718890493; cv=none; b=Mn2uxwA8kiRjjjeLWcGP+XjHHZxSjzTewVX/QzpyGP3nGuAPm/1y8D6VHAHb+sJWqX3edMkNQQjI30WewxeufBchOgPa1ICorz6riHsMNDKhxUGxOcjDgYCh8yXa090p+MjXN87L2QG9QQRQxLRdRQU9hqEAkBbOZm71l8jyTDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718890493; c=relaxed/simple; bh=Njjq6gWZ1RniPhVTD4fsI1ZonK0a/YGk1tsEsH4AL2A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=dw3xZ5//g1p8DKDIgPGi6suGqTGlGsolfv5HmddRWFaa0oad3KVf0Fu9MN2vvKWCRx8PwgOcyts6uwiino6283ymUcRdNwDwW/9kFmyDvgW0SZ2OUtrujBA+DxEtaMIhHmh7+TbANhRfFan6JQOcV4Uk8AlurR6+yNLVyqtEMN0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=C6ApqxKq; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="C6ApqxKq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718890490; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=rp2JJ5EfDeQKcGdQd+pvP1QoDtSuq6Czg3J9GG7cfMk=; b=C6ApqxKqPVbCWkjn7LwO59XAoDmokRx45jWqIUIUFnhBe0IMyRfrjJ84rMN5WVP/GVYEHi QnSBDUrlt7KlTGbvNoeXoNOxDBxbA9AUEGXON3E5OKqXuMvGK3sUk6YzcisJ8j/xV8IwSA Cp1b2jNNF7q4cl/PYFspAWam0ujH0f8= Received: from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-374-92sGqPXVMHW72ZfF7W5c2Q-1; Thu, 20 Jun 2024 09:34:48 -0400 X-MC-Unique: 92sGqPXVMHW72ZfF7W5c2Q-1 Received: from mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.40]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1E62319560A3; Thu, 20 Jun 2024 13:34:47 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.104]) by mx-prod-int-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 3C4E319560AF; Thu, 20 Jun 2024 13:34:42 +0000 (UTC) From: Jose Ignacio Tornos Martinez To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jtornosm@redhat.com, stable@vger.kernel.org Subject: [PATCH net v3] net: usb: ax88179_178a: improve link status logs Date: Thu, 20 Jun 2024 15:34:31 +0200 Message-ID: <20240620133439.102296-1-jtornosm@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.40 Content-Type: text/plain; charset="utf-8" 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 gigabi= t ethernet adapter driver") Signed-off-by: Jose Ignacio Tornos Martinez Reviewed-by: Simon Horman --- v3: - Add net as target tree in the subject. - Use constant string instead of variable because no other value is possi= ble. v2: https://lore.kernel.org/netdev/20240618115054.101577-1-jtornosm@redhat.= com/ - Fix the nits v1: https://lore.kernel.org/netdev/20240617103405.654567-1-jtornosm@redhat.= com/ drivers/net/usb/ax88179_178a.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index c2fb736f78b2..b034ef8a73ea 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c @@ -326,7 +326,8 @@ static void ax88179_status(struct usbnet *dev, struct u= rb *urb) =20 if (netif_carrier_ok(dev->net) !=3D 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"); } } =20 @@ -1542,6 +1543,7 @@ static int ax88179_link_reset(struct usbnet *dev) GMII_PHY_PHYSR, 2, &tmp16); =20 if (!(tmp16 & GMII_PHY_PHYSR_LINK)) { + netdev_info(dev->net, "ax88179 - Link status is: 0\n"); return 0; } else if (GMII_PHY_PHYSR_GIGA =3D=3D (tmp16 & GMII_PHY_PHYSR_SMASK)) { mode |=3D AX_MEDIUM_GIGAMODE | AX_MEDIUM_EN_125MHZ; @@ -1579,6 +1581,8 @@ static int ax88179_link_reset(struct usbnet *dev) =20 netif_carrier_on(dev->net); =20 + netdev_info(dev->net, "ax88179 - Link status is: 1\n"); + return 0; } =20 --=20 2.45.1