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 3D631319847 for ; Sun, 3 May 2026 11:47:35 +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=1777808855; cv=none; b=C4YZ1iwiJpUI5bzjWEmUNoJXR0qV7PON5OZRY+GCF8sryR+vq/LLem67lpbJr/kKbYYZ9jJHjAogEkUNSVi6bNdArvXu1dWwqNh/KdpT73bfyFxHRXRNj6CuFNCHXA2pseMc8kFAV/5UAPudReuRxtcm5YnVxYZpeCgLilu4olw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777808855; c=relaxed/simple; bh=3YxKaQG4Mj+EQh7OxWPls3IsVtRa3ZYBo+NubzO1spE=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=T9wah927kBc6gQh9ffBkZiXpWKFp+O1NZp6MR/KmRh9i5Nw/iPSatOR7Og1oaZ/Uec3aAXdfn4d2ppTgncar9I2RNfHcG7KEgbu2IIvWkZnImJEe5DUmQ8/vNFfLWm/Ew7xvmkDAwX3M+lQZAAcHhA0vGt2jfBMHFzlWlyhhAU0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=woybmZFB; 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="woybmZFB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB45EC2BCB4; Sun, 3 May 2026 11:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1777808855; bh=3YxKaQG4Mj+EQh7OxWPls3IsVtRa3ZYBo+NubzO1spE=; h=Subject:To:Cc:From:Date:From; b=woybmZFBrPY+uQ1VwibLU+9ZpQSGvG6xQc4h/yvTP7reMSRTslFcRZVsIJ9yfLOQ5 wmakJ3cm2ovLEX5tURPhgf9a0NThWIePRCS3qjvxZM9c6UXY1sJCbXt7Nnh2tjMQ4W SfCvjRIizCJFffr8Tq9aw91U30MuywrnSwYYH3T0= Subject: FAILED: patch "[PATCH] tpm: tpm_tis: stop transmit if retries are exhausted" failed to apply to 5.15-stable tree To: jacqwong@google.com,jarkko@kernel.org,jhand@google.com Cc: From: Date: Sun, 03 May 2026 13:47:24 +0200 Message-ID: <2026050324-engulf-headset-e9c2@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 5.15-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-5.15.y git checkout FETCH_HEAD git cherry-pick -x 949692da7211572fac419b2986b6abc0cd1aeb76 # git commit -s git send-email --to '' --in-reply-to '2026050324-engulf-headset-e9c2@gregkh' --subject-prefix 'PATCH 5.15.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 949692da7211572fac419b2986b6abc0cd1aeb76 Mon Sep 17 00:00:00 2001 From: Jacqueline Wong Date: Wed, 15 Apr 2026 16:00:06 +0000 Subject: [PATCH] tpm: tpm_tis: stop transmit if retries are exhausted tpm_tis_send_main() will attempt to retry sending data TPM_RETRY times. Currently, if those retries are exhausted, the driver will attempt to call execute. The TPM will be in the wrong state, leading to the operation simply timing out. Instead, if there is still an error after retries are exhausted, return that error immediately. Cc: stable@vger.kernel.org # v6.6+ Fixes: 280db21e153d8 ("tpm_tis: Resend command to recover from data transfer errors") Signed-off-by: Jacqueline Wong Signed-off-by: Jordan Hand Link: https://lore.kernel.org/r/20260415160006.2275325-3-jacqwong@google.com Signed-off-by: Jarkko Sakkinen diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index acb91bf1e5f5..21d79ad3b164 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -556,11 +556,16 @@ static int tpm_tis_send_main(struct tpm_chip *chip, const u8 *buf, size_t len) break; else if (rc != -EAGAIN && rc != -EIO) /* Data transfer failed, not recoverable */ - return rc; + goto out_err; usleep_range(priv->timeout_min, priv->timeout_max); } + if (rc == -EAGAIN || rc == -EIO) { + dev_err(&chip->dev, "Exhausted %d tpm_tis_send_data retries\n", TPM_RETRY); + goto out_err; + } + /* go and do it */ rc = tpm_tis_write8(priv, TPM_STS(priv->locality), TPM_STS_GO); if (rc < 0)