From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 1410927A476; Thu, 28 May 2026 20:03:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998584; cv=none; b=QBfG8/3sQzdW/bO7l3kxZHs+KGIMleGNGgc19rzmQ3NoJ+Q/hB8lTUJkMG/E64QNtRoA4ven/Ssa981Bjo9txIiFdkfZuPxGlVTdxARoBc0sh0FKClBvkUooeyvrI0bST/4tgw2+VJA/tmRBIm6Ma+R+fwlQZU+hi/+54L7Fhws= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779998584; c=relaxed/simple; bh=Je0xWzyFwNSqtcL3LMGMVFyL4B0WhT1l1HAOjwSZLAs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XF6xJl94KWmgcXmd/Gwp6WxJXB+o/ga0390LPl1gHW/zGFwxLixuuhRcKerjtjkJLw1fUizmht1UKByR2fvsfR+1V3Lmzk3LFCPlWrE5BERyNsCwA1iW3qE0HwN/9pnOJF/TSY/EEnceH1+cxf+IJwmwhnWMt/w3lA/gL6P5VI4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=tKZ5k6Y2; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="tKZ5k6Y2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1B11E1F000E9; Thu, 28 May 2026 20:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779998582; bh=jNK0zmXKsfzSdEP0ApVFYcr4k6QPuWlIRGWJUO4mlzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=tKZ5k6Y2qqFa0pdTdIpQB6iMndslqiYVUZZB/aaEX9BaJ/JGodFPs7g7+t/fpA3cN AzHI3fyRXGgSCa9gBmMHu+xs/F6ggpXNOfnel6wmwhebbC+vfP6Y1DKAsoFURaOYdX 1H61bueIRhkvzGOP/aYxFFg8/t/mHOCAPFDpTOWs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, intel-wired-lan@lists.osuosl.org, Bart Van Assche , Aleksandr Loktionov , Przemek Kitszel , Arpana Arland , Jacob Keller , Jakub Kicinski , Sasha Levin Subject: [PATCH 7.0 224/461] ice: fix locking in ice_dcb_rebuild() Date: Thu, 28 May 2026 21:45:53 +0200 Message-ID: <20260528194653.616151233@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260528194646.819809818@linuxfoundation.org> References: <20260528194646.819809818@linuxfoundation.org> User-Agent: quilt/0.69 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 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bart Van Assche [ Upstream commit 0ded1f36ba4021cba50513e80be6b6e173710168 ] Move the mutex_lock() call up to prevent that DCB settings change after the first ice_query_port_ets() call. The second ice_query_port_ets() call in ice_dcb_rebuild() is already protected by pf->tc_mutex. This also fixes a bug in an error path, as before taking the first "goto dcb_error" in the function jumped over mutex_lock() to mutex_unlock(). This bug has been detected by the clang thread-safety analyzer. Cc: intel-wired-lan@lists.osuosl.org Fixes: 242b5e068b25 ("ice: Fix DCB rebuild after reset") Signed-off-by: Bart Van Assche Reviewed-by: Aleksandr Loktionov Reviewed-by: Przemek Kitszel Tested-by: Arpana Arland Signed-off-by: Jacob Keller Link: https://patch.msgid.link/20260506-jk-iwl-net-2026-05-04-v2-6-a5ea4dc837a9@intel.com Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c index 16aa255351523..0bc6dd3756879 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c @@ -537,14 +537,14 @@ void ice_dcb_rebuild(struct ice_pf *pf) struct ice_dcbx_cfg *err_cfg; int ret; + mutex_lock(&pf->tc_mutex); + ret = ice_query_port_ets(pf->hw.port_info, &buf, sizeof(buf), NULL); if (ret) { dev_err(dev, "Query Port ETS failed\n"); goto dcb_error; } - mutex_lock(&pf->tc_mutex); - if (!pf->hw.port_info->qos_cfg.is_sw_lldp) ice_cfg_etsrec_defaults(pf->hw.port_info); -- 2.53.0