On Fri, Jun 01, 2018 at 09:55:52AM -0700, Tadeusz Struk wrote: > On 06/01/2018 07:37 AM, Jason Gunthorpe wrote: > >> +struct tpm_dev_work { > >> + struct work_struct work; > >> + struct file_priv *priv; > >> + struct tpm_space *space; > >> + ssize_t resp_size; > >> + bool nonblocking; > >> +}; > > There can only be one operation going at once, so why not put this in > > the file_priv? Which might be needed because.. > > I need the *space as well, which doesn't really belong to file_priv > that's why I added this new struct. You are right the file_priv > isn't really needed here. I used it to have the priv->data_pending > but I can have just a ptr to data_pending in tpm_dev_work. I mean in the sense that each file_priv can have exactly one async work outstanding, so you can just add this struct to file_priv instead of allocing it everytime.. Jason