linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Jonathan McDowell <noodles@earth.li>
Cc: Peter Huewe <peterhuewe@gmx.de>, Jason Gunthorpe <jgg@ziepe.ca>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Stefan Berger <stefanb@linux.ibm.com>,
	linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] tpm, tpm_tis: Workaround failed command reception on Infineon devices
Date: Sat, 22 Mar 2025 23:10:08 +0200	[thread overview]
Message-ID: <Z98nMDH5Anhwuwox@kernel.org> (raw)
In-Reply-To: <Z92YiwubEvzsm1SO@earth.li>

On Fri, Mar 21, 2025 at 04:49:15PM +0000, Jonathan McDowell wrote:
> Jarkko, I've realised I've somehow introduced a typo in the patch below that
> means it doesn't fire correctly; I'm not sure how this happened as my local
> copy I was testing on is definitely correct. Would you like a one line fix
> up patch, or can you manually fix it up in your tree?
> 
> This hunk:
> 
> > @@ -545,9 +551,11 @@ static int tpm_tis_send_main(struct tpm_chip *chip, const u8 *buf, size_t len)
> > 		if (rc >= 0)
> > 			/* Data transfer done successfully */
> > 			break;
> > -		else if (rc != -EIO)
> > +		else if (rc != EAGAIN && rc != -EIO)
> > 			/* Data transfer failed, not recoverable */
> > 			return rc;
> > +
> > +		usleep_range(priv->timeout_min, priv->timeout_max);
> > 	}
> > 	/* go and do it */
> 
> should be "rc != -EAGAIN" - the "-" sign has somehow been lost.
> 
> Apologies for this, let me know what's easiest for you in terms of resolving
> it.

NP, I missed it too so we're in the same boat ;-)

I did:

$ git -P diff
diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c
index 4ab69c3e103c..ed0d3d8449b3 100644
--- a/drivers/char/tpm/tpm_tis_core.c
+++ b/drivers/char/tpm/tpm_tis_core.c
@@ -551,7 +551,7 @@ static int tpm_tis_send_main(struct tpm_chip *chip, const u8 *buf, size_t len)
 		if (rc >= 0)
 			/* Data transfer done successfully */
 			break;
-		else if (rc != EAGAIN && rc != -EIO)
+		else if (rc != -EAGAIN && rc != -EIO)
 			/* Data transfer failed, not recoverable */
 			return rc;

Ping, if anything else.

BR, Jarkko

      reply	other threads:[~2025-03-22 21:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06  9:00 [PATCH] tpm, tpm_tis: Workaround failed command reception on Infineon devices Jonathan McDowell
2025-03-06 22:23 ` Jarkko Sakkinen
2025-03-07 16:36   ` Jonathan McDowell
2025-03-07 16:45     ` Jarkko Sakkinen
2025-03-10 12:19       ` [PATCH v2] " Jonathan McDowell
2025-03-10 14:12         ` Paul Menzel
2025-03-11  9:46         ` Jarkko Sakkinen
2025-03-21 16:49         ` Jonathan McDowell
2025-03-22 21:10           ` Jarkko Sakkinen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z98nMDH5Anhwuwox@kernel.org \
    --to=jarkko@kernel.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=jgg@ziepe.ca \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noodles@earth.li \
    --cc=peterhuewe@gmx.de \
    --cc=stefanb@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).