Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-21 Thread Dan Williams
On Thu, Jan 21, 2021 at 12:13 AM Greg KH wrote: > > On Wed, Jan 20, 2021 at 11:38:57AM -0800, Dan Williams wrote: > > -void cdev_del(struct cdev *p) > > +void cdev_del(struct cdev *cdev) > > { > > - cdev_unmap(p->dev, p->count); > > - kobject_put(&p->kobj); > > + cdev_unmap(cdev->dev,

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-21 Thread Greg KH
On Wed, Jan 20, 2021 at 11:38:57AM -0800, Dan Williams wrote: > -void cdev_del(struct cdev *p) > +void cdev_del(struct cdev *cdev) > { > - cdev_unmap(p->dev, p->count); > - kobject_put(&p->kobj); > + cdev_unmap(cdev->dev, cdev->count); > + kobject_put(&cdev->kobj); After Christoph

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
On Wed, Jan 20, 2021 at 12:20 PM Dan Williams wrote: > > On Wed, Jan 20, 2021 at 11:46 AM Christoph Hellwig wrote: > > > > The subject doesn't make any sense to me. > > > > But thn again queued sound really weird. You just have a managed > > API with a refcount and synchronization, right? > > Co

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
On Wed, Jan 20, 2021 at 11:51 AM Logan Gunthorpe wrote: > > > > > On 2021-01-20 12:38 p.m., Dan Williams wrote: > > ...common reference count handling scenarios were addressed, but the > > shutdown-synchronization problem was only mentioned as something driver > > developers need to be aware in th

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
On Wed, Jan 20, 2021 at 11:46 AM Christoph Hellwig wrote: > > The subject doesn't make any sense to me. > > But thn again queued sound really weird. You just have a managed > API with a refcount and synchronization, right? Correct. "queue" was in reference to the way q_usage_count behaves, but

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Logan Gunthorpe
On 2021-01-20 12:38 p.m., Dan Williams wrote: > ...common reference count handling scenarios were addressed, but the > shutdown-synchronization problem was only mentioned as something driver > developers need to be aware in the following note: > > NOTE: This guarantees that associated sysf

Re: [PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Christoph Hellwig
The subject doesn't make any sense to me. But thn again queued sound really weird. You just have a managed API with a refcount and synchronization, right? procfs and debugfs already support these kind of managed ops, kinda sad to duplicate this concept yet another time. > +static long cdev_queu

[PATCH 1/3] cdev: Finish the cdev api with queued mode support

2021-01-20 Thread Dan Williams
The cdev api aims to preclude many common mistakes of driver developers with ioctl interface lifetime and lookup. However, one common concern that is left to driver implementers to handle manually is synchronizing device shutdown with in-flight calls to file_operations handlers. Starting with comm