Thread (13 messages) 13 messages, 3 authors, 2018-08-12

[PATCH v4 2/2] tpm: add support for nonblocking operation

From: Tadeusz Struk <hidden>
Date: 2018-08-10 19:14:56
Also in: linux-integrity, lkml

On 08/10/2018 12:00 PM, James Bottomley wrote:
On Fri, 2018-08-10 at 11:56 -0700, Tadeusz Struk wrote:
quoted
On 08/10/2018 11:48 AM, James Bottomley wrote:
quoted
On Fri, 2018-08-10 at 11:21 -0700, Tadeusz Struk wrote:
quoted
and the feedback I got from Jason was:

"I wonder if it is worth creating this when the first file is
opened.. Lots of systems have TPMs but few use the userspace.."

so I changed this to allocate the WQ on first open. I think it
makes sense, but I leave it to you to decide.
If the reason is to not create a wq unless it's needed, shouldn't
the condition actually be first open with flag O_NONBLOCK?
Not really because one can do:

int fd = open("/dev/tpm0", O_RDWR);
fcntl(fd, F_SETFL, O_NONBLOCK);
so move the condition to first need to queue ...
That would work, even though this is not how this is usually done.
The first open looks like the sweet spot between module init
and first need to queue.
Thanks,
-- 
Tadeusz
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help