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 E57AC2DE70D; Tue, 17 Mar 2026 16:53:49 +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=1773766430; cv=none; b=JNKvV4TM2OITWJ1HnJJgt2HhUcshfHz/VrMwMbawTwkqcB1v6WPo3KVvafJWOXTDBhw0o7DFeVQ20iyJOuFVxI9MLwZ/nSfguErmw1xqpRStI6mO9Y6G937ZPIi+0NH2M5Z1JVPcWuox/YhqwE4bxfjwJKB7YjqVCxHymmre3CY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773766430; c=relaxed/simple; bh=eP0sbEv9kwqJBhJhLEFp5bQys+GX9dTjMYgFSzi4ZHw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rymXMScXowedYwf3XWB0XL87KnjjaXSyXtOWYdYFysRFGiXp7zAr1gdtvL8Uu0uCp2UEtrODNOw2Du76Ef64sqPPmcKFfgj05og+lYEsF801Ysftut4kS+6zLXegSLPy+pfcY3a89Yoa/3WV7BtV58Z7tZX5X3nE+1SORZPqksk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uujkLyTv; 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="uujkLyTv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B300C2BC86; Tue, 17 Mar 2026 16:53:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1773766429; bh=eP0sbEv9kwqJBhJhLEFp5bQys+GX9dTjMYgFSzi4ZHw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uujkLyTvH78njImtE1/DvBgW474ieheQDwmyRzIgB8DDv3o/ScnucmIpX0jaC+Oov n8ss4RIXts9ZAhNCbc6+RD/lvesg2+mKCJe9+7wxm2n/aShDjW3yc4w9IbPIZvWfvV fRTmNujRbfjd0+4G8oWa/9kvW9YID5nKEgntXt8c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michal Schmidt , Jakub Staniszewski , Dawid Osuchowski , Aleksandr Loktionov , Przemek Kitszel , Paul Menzel , Tony Nguyen , Rinitha S Subject: [PATCH 6.19 245/378] ice: reintroduce retry mechanism for indirect AQ Date: Tue, 17 Mar 2026 17:33:22 +0100 Message-ID: <20260317163016.033615377@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260317163006.959177102@linuxfoundation.org> References: <20260317163006.959177102@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jakub Staniszewski commit 326256c0a72d4877cec1d4df85357da106233128 upstream. Add retry mechanism for indirect Admin Queue (AQ) commands. To do so we need to keep the command buffer. This technically reverts commit 43a630e37e25 ("ice: remove unused buffer copy code in ice_sq_send_cmd_retry()"), but combines it with a fix in the logic by using a kmemdup() call, making it more robust and less likely to break in the future due to programmer error. Cc: Michal Schmidt Cc: stable@vger.kernel.org Fixes: 3056df93f7a8 ("ice: Re-send some AQ commands, as result of EBUSY AQ error") Signed-off-by: Jakub Staniszewski Co-developed-by: Dawid Osuchowski Signed-off-by: Dawid Osuchowski Reviewed-by: Aleksandr Loktionov Reviewed-by: Przemek Kitszel Reviewed-by: Paul Menzel Tested-by: Rinitha S (A Contingent worker at Intel) Signed-off-by: Tony Nguyen Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/ice/ice_common.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1879,6 +1879,7 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, { struct libie_aq_desc desc_cpy; bool is_cmd_for_retry; + u8 *buf_cpy = NULL; u8 idx = 0; u16 opcode; int status; @@ -1888,8 +1889,11 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, memset(&desc_cpy, 0, sizeof(desc_cpy)); if (is_cmd_for_retry) { - /* All retryable cmds are direct, without buf. */ - WARN_ON(buf); + if (buf) { + buf_cpy = kmemdup(buf, buf_size, GFP_KERNEL); + if (!buf_cpy) + return -ENOMEM; + } memcpy(&desc_cpy, desc, sizeof(desc_cpy)); } @@ -1901,12 +1905,14 @@ ice_sq_send_cmd_retry(struct ice_hw *hw, hw->adminq.sq_last_status != LIBIE_AQ_RC_EBUSY) break; + if (buf_cpy) + memcpy(buf, buf_cpy, buf_size); memcpy(desc, &desc_cpy, sizeof(desc_cpy)); - msleep(ICE_SQ_SEND_DELAY_TIME_MS); } while (++idx < ICE_SQ_SEND_MAX_EXECUTE); + kfree(buf_cpy); return status; }