[PATCH v2 01/10] firmware: raspberrypi: Introduce rpi_firmware_put()

Nicolas Saenz Julienne nsaenzjulienne at suse.de
Mon Oct 26 16:26:17 UTC 2020

On Thu, 2020-10-22 at 21:46 +0300, Andy Shevchenko wrote:
> On Thu, Oct 22, 2020 at 9:06 PM Nicolas Saenz Julienne
> <nsaenzjulienne at suse.de> wrote:
> > When unbinding the firmware device we need to make sure it has no
> > consumers left. Otherwise we'd leave them with a firmware handle
> > pointing at freed memory.
> > 
> > Keep a reference count of all consumers and make sure they all finished
> > unbinding before we do.
> Wait, if it's a device, why do we need all these?
> get_device() / put_device() along with module_get() / module_put()
> should be sufficient, no?

Could you expand here a little, I do see how I could use get_device()'s
reference count. But it seems to me I'd be digging way too deep into kobj in
order to get the functionality I need.

If you meant to say that it should be automatically taken care by the platform
bus, just FYI we're using 'simple-mfd' in DT. Where firmware supplier is the
parent and all consumers are children.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: This is a digitally signed message part
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20201026/a133b02c/attachment.asc>

More information about the devel mailing list