[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20091103171538.GP1966@obsidianresearch.com>
Date: Tue, 3 Nov 2009 10:15:38 -0700
From: Jason Gunthorpe <jgunthorpe@...idianresearch.com>
To: Alan Cox <alan@...rguk.ukuu.org.uk>
Cc: tpmdd-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
srajiv@...ux.vnet.ibm.com
Subject: Re: [PATCH] TPM: Let the tpm char device be openable multiple times
On Tue, Nov 03, 2009 at 10:43:52AM +0000, Alan Cox wrote:
> > - Move the user space data buffer and related goop into a
> > struct tpm_file, create one struct tpm_file per open file.
>
> Is that really sufficient ?
Yes, I think so. Basically, all I did was take the per-device locking
that was already there and make it per-file. The locking hasn't
changed. If there was a multi-threading bug in the old code, it is
still in this version - but I looked for such a thing and didn't
see anything.
> You can open a file once, dup it (or inherit it and get multiple callers
> from the same file handle. Ditto consider threated apps
Yes, I did, I think it is OK. All the operations involving the file's
buffer are atomic or protected by a per-file mutex. Do you see
something specific?
It would be dangerous to do that anyhow, the way the TPM interface
works requires matched write/read pairs. The driver has a hacky way to
halt a write until the matching write happens, but it is based on
timeouts and probably isn't 100% reliable.
Thanks,
Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists