lkml.org 
[lkml]   [2016]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v3 1/9] staging: fsl-mc: move bus driver out of staging
Date
> > > Where is the device freed?  I see you trying to do some "odd" stuff in
> > > fsl_mc_device_remove() by deleting and then putting a device structure.
> > > I can't find a "release()" callback anywhere for your bus, where is it?
> > >
> > > What happens when the reference count falls to 0 for your struct device?
> >
> > Hrm...something seems wrong in free path, and I think this needs to
> > be refactored.
> >
> > IIRC, when German (former maintainer) wrote that code he loosely based
> > it on the register/unregister platform bus code:
> >
> > int platform_device_register(struct platform_device *pdev)
> > {
> > device_initialize(&pdev->dev);
> > arch_setup_pdev_archdata(pdev);
> > return platform_device_add(pdev);
> > }
> > void platform_device_unregister(struct platform_device *pdev)
> > {
> > platform_device_del(pdev);
> > platform_device_put(pdev);
> > }
> >
> > ...I'm puzzling over how that code handles a refcount of zero
> > as I see no 'release' callback anywhere, but I must be missing
> > something.
> >
> > In any case, we'll get this refactored.
>
> Have you tried removing a device? The kernel should complain loudly
> about there not being a release function for your device.

Yes, device removal has been working from day 1. A brief look
seems to indicate that the ref count never goes to zero, which
needs to be debugged.

Thanks,
Stuart

\
 
 \ /
  Last update: 2016-12-09 18:26    [W:0.080 / U:0.652 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site