On Thu, Jun 27, 2019 at 12:58 PM Aneesh Kumar K.V <aneesh.ku...@linux.ibm.com> wrote: > > "Oliver O'Halloran" <ooh...@gmail.com> writes: > > >> > + rc = drc_pmem_bind(p); > >> > + } > >> > + > >> > if (rc) > >> > goto err; > >> > > >> > >> I am also not sure about the module reference count here. Should we > >> increment the module reference count after a bind so that we can track > >> failures in ubind and fail the module unload? > > > > I don't really get what you're concerned about here. The error > > handling path calls drc_pmem_unbind() so if there's a bind error we > > should never leave probe with memory still bound. > > > > In the remove callback, if the ubind fail should we allow the module > unload?
If the drc_pmem_unbind() in the driver's remove function fails the driver will still be unbound from the platform device for that DRC. You can try re-bind the driver to the platform device and it'll hit the unbind-then-bind again error path this series introduces (which might also fail), but that's fine. The only reasons I can think of for drc_pmem_unbind() failing are bugs in the hypervisor or bugs in the driver. Forcing the module to stay loaded doesn't help either case so I'm not seeing the benefit. Oliver