lkml.org 
[lkml]   [2018]   [Nov]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 2/2] tpm: add support for partial reads
On Mon, Nov 19, 2018 at 08:44:49AM -0800, Tadeusz Struk wrote:
> On 11/19/18 5:58 AM, Jarkko Sakkinen wrote:
> > Please explain a scenario where "!ret_size" would no work given that
> > both size and partial_data have always positive value?
>
> Right, I only looked at the one line above before responding.
> I'll change it to !ret_size
>
> >
> > I don't understand. In order to maintain backwards compatibility you can
> > send a new command at any time.
>
> No, currently it is not possible to send a new command until the previous
> response is consumed. -EBUSY is returned if one sends a new command before
> reading the previous response (or at least part of it). See:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/char/tpm/tpm-dev-common.c#n128

Ah, you are correct.

You should add a boolean flag instead of introducing a new variable for
holding amount that has been read because obviously one read operation
is enough for backwards compatibility.

The code could read the code to data_pending and then set

priv->data_read = false;

We do not need the original amount for anything.

/Jarkko

\
 
 \ /
  Last update: 2018-11-19 18:29    [W:0.059 / U:1.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site