Re: [PATCH] tpm: don't destroy chip device prematurely
From: Jarkko Sakkinen
Date: Thu Oct 06 2016 - 07:25:26 EST
On Wed, Oct 05, 2016 at 10:27:41AM -0600, Jason Gunthorpe wrote:
> On Wed, Oct 05, 2016 at 01:02:34PM +0300, Jarkko Sakkinen wrote:
>
> > I'll repeat my question: what worse can happen than returning -EPIPE? I
> > though the whole rw lock scheme was introduced just for this purpose.
>
> I thought I explained this, if device_del is moved after ops = null
> then if sysfs looses the race it will oops the kernel. device_del hard
> fences sysfs.
Sorry, I missed that comment somehow. Looking at the code it is like
that.
I think that they should be fenced then for the sake of consistency.
I do not see why sysfs code is privileged not to do fencing while other
peers have to do it.
/Jarkko