On Sun, Jun 18, 2017 at 9:12 PM, Herbert Xu wrote: > On Fri, May 12, 2017 at 01:49:52PM +0530, PrasannaKumar Muralidharan wrote: > > I leave it to Herbert to decide whether to accept this patch in > > current form or not. > > I think the correct fix would be for the TPM subsystem to signal that > it is ready and then register the tpm-rng device. the TPM subsystem is ready. it's like saying "the USB subsystem should signal when it's ready". the TPM subsystem provides a bus (of sorts) and clients (like tpm-rng) can use whatever backend happens to be available. in order to make tpm-rng react in the way you're implying, the TPM subsystem would need to add a notification chain for transitions from none<->some devices, then tpm-rng could subscribe to that, and during those transition points, it would call hwrng_register/hwrng_unregister to make itself visible accordingly to the hwrng subsystem. maybe someone on the TPM side would be interested in writing all that logic, but it sounds excessive for this minor usage. the current tpm-rng driver is *extremely* simple -- it's 3 funcs, each of which are 1 line. -mike