All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jarkko Sakkinen" <jarkko@kernel.org>
To: "Matt Ochs" <mochs@nvidia.com>
Cc: "peterhuewe@gmx.de" <peterhuewe@gmx.de>,
	"jgg@ziepe.ca" <jgg@ziepe.ca>,
	"Krishna Yarlagadda" <kyarlagadda@nvidia.com>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Vishwaroop A" <va@nvidia.com>, "Carol Soto" <csoto@nvidia.com>
Subject: Re: [PATCH] tpm_tis_spi: Account for SPI header when allocating TPM SPI xfer buffer
Date: Tue, 21 May 2024 21:57:29 +0300	[thread overview]
Message-ID: <D1FJWF5LK0T4.K5YFU4OBSKCI@kernel.org> (raw)
In-Reply-To: <66503B6E-44C3-42DF-B423-7D0214620686@nvidia.com>

On Tue May 21, 2024 at 8:59 PM EEST, Matt Ochs wrote:
> > On May 21, 2024, at 10:55 AM, Jarkko Sakkinen <jarkko@kernel.org> wrote:
> >> 
> >> /*
> >>  * TCG SPI flow control is documented in section 6.4 of the spec[1]. In short,
> >> @@ -247,7 +249,7 @@ static int tpm_tis_spi_write_bytes(struct tpm_tis_data *data, u32 addr,
> >> int tpm_tis_spi_init(struct spi_device *spi, struct tpm_tis_spi_phy *phy,
> >> 		     int irq, const struct tpm_tis_phy_ops *phy_ops)
> >> {
> >> -	phy->iobuf = devm_kmalloc(&spi->dev, MAX_SPI_FRAMESIZE, GFP_KERNEL);
> >> +	phy->iobuf = devm_kmalloc(&spi->dev, MAX_SPI_BUFSIZE, GFP_KERNEL);
> > 
> > It would better to open code here "SPI_HDRSIZE + MAX_SPI_FRAMESIZE".
> > 
> > I.e. less cross-referencing and documents better what is going on at
> > the call site.
>
> Sure, will make this change in a v2.

Yeah, and thanks for spotting the bug and fixing it! Looking forward to
the final fix.

BR, Jarkko

  reply	other threads:[~2024-05-21 18:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 15:40 [PATCH] tpm_tis_spi: Account for SPI header when allocating TPM SPI xfer buffer Matthew R. Ochs
2024-05-21 15:55 ` Jarkko Sakkinen
2024-05-21 17:59   ` Matt Ochs
2024-05-21 18:57     ` Jarkko Sakkinen [this message]
2024-05-22  1:59 ` [PATCH v2] " Matthew R. Ochs
2024-05-22 12:04   ` Jarkko Sakkinen

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=D1FJWF5LK0T4.K5YFU4OBSKCI@kernel.org \
    --to=jarkko@kernel.org \
    --cc=csoto@nvidia.com \
    --cc=jgg@ziepe.ca \
    --cc=kyarlagadda@nvidia.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mochs@nvidia.com \
    --cc=peterhuewe@gmx.de \
    --cc=va@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.