Re: [PATCH v2] tpm: fix an invalid condition in tpm_common_poll

2019-03-21 Thread Jarkko Sakkinen
On Wed, Mar 20, 2019 at 12:18:42PM -0700, Tadeusz Struk wrote: > On 3/20/19 11:51 AM, Mantas Mikulėnas wrote: > > Thanks, this patch seems to work, and I apologize for not responding > > to test the patches earlier. > > Thanks for testing. > > > > > Any chance it'll be submitted for stable

Re: [PATCH v2] tpm: fix an invalid condition in tpm_common_poll

2019-03-21 Thread Jarkko Sakkinen
On Tue, Mar 19, 2019 at 01:31:34PM -0700, Tadeusz Struk wrote: > The poll condition should only check response_length, > because reads should only be issued if there is data to read. > The response_read flag only prevents double writes. > The problem was that the write set the response_read to

Re: [PATCH v2] tpm: fix an invalid condition in tpm_common_poll

2019-03-20 Thread Tadeusz Struk
On 3/20/19 11:51 AM, Mantas Mikulėnas wrote: > Thanks, this patch seems to work, and I apologize for not responding > to test the patches earlier. Thanks for testing. > > Any chance it'll be submitted for stable 5.0.x as well? Yes, it's a regression. I included the "Fixes" tag so it should be

Re: [PATCH v2] tpm: fix an invalid condition in tpm_common_poll

2019-03-20 Thread Mantas Mikulėnas
On Tue, Mar 19, 2019 at 10:31 PM Tadeusz Struk wrote: > > The poll condition should only check response_length, > because reads should only be issued if there is data to read. > The response_read flag only prevents double writes. > The problem was that the write set the response_read to false, >

Re: [PATCH v2] tpm: fix an invalid condition in tpm_common_poll

2019-03-20 Thread Tadeusz Struk
On 3/20/19 7:30 AM, James Bottomley wrote: > Just an observation on this: the mutex is now no-longer necessary > because a read on a size_t quantity is always atomic. True, that's why it wasn't there at the beginning, but then things changed and I forgot to add it, so let's put it there just in

Re: [PATCH v2] tpm: fix an invalid condition in tpm_common_poll

2019-03-20 Thread James Bottomley
On Tue, 2019-03-19 at 13:31 -0700, Tadeusz Struk wrote: > The poll condition should only check response_length, > because reads should only be issued if there is data to read. > The response_read flag only prevents double writes. > The problem was that the write set the response_read to false, >

[PATCH v2] tpm: fix an invalid condition in tpm_common_poll

2019-03-19 Thread Tadeusz Struk
The poll condition should only check response_length, because reads should only be issued if there is data to read. The response_read flag only prevents double writes. The problem was that the write set the response_read to false, enqued a tpm job, and returned. Then application called poll which