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 A52B726B08D; Thu, 13 Feb 2025 14:52:41 +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=1739458361; cv=none; b=gYcCO2exvixnYIv143oQ4WEGKTN2wIbfTDewBynGycL2HWBEX/LT4YW3Nb4yi+G3uTOlzecq7d/w2MG8DNdn/NDnJR6uYvZ89wjQTe2n1klxLaLFc3K5uQOkRcIe6009sRxgouab9erGfeeyHkPMJKUu/xknSpnqWfLoCbGhUeM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739458361; c=relaxed/simple; bh=srrjhCbW5NO+7aV/SttpJsTh67h9/cT7ISJYI061GUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Md/bNwDcJdCBNMaexa/7gcd5q30Gfu8LNrI27j1eBnhaoxBWxxMUGwWMMIZIMhwbW6egExVSPX1xLeM4tbtnMAEu/TUNBQMH2+1WN/pNXYL9hqZNz/PL6Q93YNQdjXyqhspCBtyA5Ur17vy3M47ciZ55cosvtLS+gLrkVmhuc28= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=d2DceIaa; 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="d2DceIaa" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19768C4CED1; Thu, 13 Feb 2025 14:52:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739458361; bh=srrjhCbW5NO+7aV/SttpJsTh67h9/cT7ISJYI061GUI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d2DceIaavG0sEtf8Nwyo9+kC+viYt4Trc1Wj67bARi1RLhKuncXODF8zPBlH6DO6K 7gCFpivS4owtLnJs3Wm2bPkqQ61Jr+HRj+PgsVOmrOC+iovTefyRKzNVtVmuHpSXkO MJINDfCWsEsSRw4gR4IwnPpw7qCJwplFD9iZ+RYg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Paul Fertser , Jakub Kicinski Subject: [PATCH 6.12 378/422] net/ncsi: wait for the last response to Deselect Package before configuring channel Date: Thu, 13 Feb 2025 15:28:47 +0100 Message-ID: <20250213142451.134806709@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250213142436.408121546@linuxfoundation.org> References: <20250213142436.408121546@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Paul Fertser commit 6bb194d036c6e1b329dcdff459338cdd9a54802a upstream. The NCSI state machine as it's currently implemented assumes that transition to the next logical state is performed either explicitly by calling `schedule_work(&ndp->work)` to re-queue itself or implicitly after processing the predefined (ndp->pending_req_num) number of replies. Thus to avoid the configuration FSM from advancing prematurely and getting out of sync with the process it's essential to not skip waiting for a reply. This patch makes the code wait for reception of the Deselect Package response for the last package probed before proceeding to channel configuration. Thanks go to Potin Lai and Cosmo Chou for the initial investigation and testing. Fixes: 8e13f70be05e ("net/ncsi: Probe single packages to avoid conflict") Cc: stable@vger.kernel.org Signed-off-by: Paul Fertser Link: https://patch.msgid.link/20250116152900.8656-1-fercerpav@gmail.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/ncsi/ncsi-manage.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) --- a/net/ncsi/ncsi-manage.c +++ b/net/ncsi/ncsi-manage.c @@ -1385,6 +1385,12 @@ static void ncsi_probe_channel(struct nc nd->state = ncsi_dev_state_probe_package; break; case ncsi_dev_state_probe_package: + if (ndp->package_probe_id >= 8) { + /* Last package probed, finishing */ + ndp->flags |= NCSI_DEV_PROBED; + break; + } + ndp->pending_req_num = 1; nca.type = NCSI_PKT_CMD_SP; @@ -1501,13 +1507,8 @@ static void ncsi_probe_channel(struct nc if (ret) goto error; - /* Probe next package */ + /* Probe next package after receiving response */ ndp->package_probe_id++; - if (ndp->package_probe_id >= 8) { - /* Probe finished */ - ndp->flags |= NCSI_DEV_PROBED; - break; - } nd->state = ncsi_dev_state_probe_package; ndp->active_package = NULL; break;