[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250114-fix-ncsi-mac-v4-1-4f058b7f8a99@gmail.com>
Date: Tue, 14 Jan 2025 10:51:39 +0800
From: Potin Lai <potin.lai.pt@...il.com>
To: Samuel Mendoza-Jonas <sam@...dozajonas.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Simon Horman <horms@...nel.org>, Patrick Williams <patrick@...cx.xyz>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Cosmo Chou <cosmo.chou@...ntatw.com>, Potin Lai <potin.lai@...ntatw.com>,
Cosmo Chou <chou.cosmo@...il.com>, Potin Lai <potin.lai.pt@...il.com>
Subject: [PATCH v4] net/ncsi: fix state race during channel probe
completion
From: Cosmo Chou <chou.cosmo@...il.com>
During channel probing, the last NCSI_PKT_CMD_DP command can trigger
an unnecessary schedule_work() via ncsi_free_request(). We observed
that subsequent config states were triggered before the scheduled
work completed, causing potential state handling issues.
Fix this by clearing req_flags when processing the last package.
Fixes: 8e13f70be05e ("net/ncsi: Probe single packages to avoid conflict")
Signed-off-by: Cosmo Chou <chou.cosmo@...il.com>
---
Fix state race during channel probe completion.
Signed-off-by: Potin Lai <potin.lai.pt@...il.com>
---
Changes in v4:
- Remove Paul's patch due to two patches are solving different issues.
- Link to v3: https://lore.kernel.org/r/20250113-fix-ncsi-mac-v3-0-564c8277eb1d@gmail.com
Changes in v3:
- Fix compile error by removing non-exist variable.
- Link to v2: https://lore.kernel.org/r/20250111-fix-ncsi-mac-v2-0-838e0a1a233a@gmail.com
Changes in v2:
- Add second patch for fixing state handling issue.
- Link to v1: https://lore.kernel.org/all/20250109145054.30925-1-fercerpav@gmail.com/
---
net/ncsi/ncsi-manage.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/ncsi/ncsi-manage.c b/net/ncsi/ncsi-manage.c
index 5cf55bde366d..2feff885eeff 100644
--- a/net/ncsi/ncsi-manage.c
+++ b/net/ncsi/ncsi-manage.c
@@ -1479,7 +1479,10 @@ static void ncsi_probe_channel(struct ncsi_dev_priv *ndp)
}
break;
case ncsi_dev_state_probe_dp:
- ndp->pending_req_num = 1;
+ if (ndp->package_probe_id + 1 < 8)
+ ndp->pending_req_num = 1;
+ else
+ nca.req_flags = 0;
/* Deselect the current package */
nca.type = NCSI_PKT_CMD_DP;
---
base-commit: 56e6a3499e14716b9a28a307bb6d18c10e95301e
change-id: 20250111-fix-ncsi-mac-1e4b3df431f1
Best regards,
--
Potin Lai <potin.lai.pt@...il.com>
Powered by blists - more mailing lists