All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH iwl-net] idpf: check vport state instead of link_up in hwtstamp get/set
@ 2026-11-14  1:55 Rafael Castillo
  0 siblings, 0 replies; only message in thread
From: Rafael Castillo @ 2026-11-14  1:55 UTC (permalink / raw)
  To: Tony Nguyen, Przemek Kitszel, intel-wired-lan
  Cc: David S. Miller, Jakub Kicinski, Eric Dumazet, David Decotigny,
	Madhu Chittim, Emil Tantilov, Sridhar Samudrala, Brian Vazquez,
	Li Li, Naman Gulati, Rafael Castillo

vport->link_up is cleared on vport stop and only restored asynchronously
when the Control Plane delivers VIRTCHNL2_EVENT_LINK_CHANGE, causing
SIOCSHWTSTAMP and SIOCGHWTSTAMP to fail with -EPERM right after open or
soft reset or while physical link is down. Check test_bit(IDPF_VPORT_UP,
np->state) instead so hardware timestamping can be queried and configured
whenever the vport is administratively up.

Fixes: 1a49cf814fe1 ("idpf: add Tx timestamp flows")
Signed-off-by: Rafael Castillo <rafaelcl@google.com>
---
 drivers/net/ethernet/intel/idpf/idpf_lib.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_lib.c b/drivers/net/ethernet/intel/idpf/idpf_lib.c
index 523c0e0be884..bfe08f5f74a7 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_lib.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_lib.c
@@ -2598,13 +2598,14 @@ static int idpf_hwtstamp_set(struct net_device *netdev,
 			     struct kernel_hwtstamp_config *config,
 			     struct netlink_ext_ack *extack)
 {
+	struct idpf_netdev_priv *np = netdev_priv(netdev);
 	struct idpf_vport *vport;
 	int err;
 
 	idpf_vport_ctrl_lock(netdev);
 	vport = idpf_netdev_to_vport(netdev);
 
-	if (!vport->link_up) {
+	if (!test_bit(IDPF_VPORT_UP, np->state)) {
 		idpf_vport_ctrl_unlock(netdev);
 		return -EPERM;
 	}
@@ -2625,12 +2626,13 @@ static int idpf_hwtstamp_set(struct net_device *netdev,
 static int idpf_hwtstamp_get(struct net_device *netdev,
 			     struct kernel_hwtstamp_config *config)
 {
+	struct idpf_netdev_priv *np = netdev_priv(netdev);
 	struct idpf_vport *vport;
 
 	idpf_vport_ctrl_lock(netdev);
 	vport = idpf_netdev_to_vport(netdev);
 
-	if (!vport->link_up) {
+	if (!test_bit(IDPF_VPORT_UP, np->state)) {
 		idpf_vport_ctrl_unlock(netdev);
 		return -EPERM;
 	}
-- 
2.56.0.611.g1030f0b940-goog


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-16 16:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-14  1:55 [PATCH iwl-net] idpf: check vport state instead of link_up in hwtstamp get/set Rafael Castillo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.