On Thu, 2018-10-18 at 07:11 +0200, Greg Kroah-Hartman wrote:
> On Wed, Oct 17, 2018 at 04:40:01PM -0700, Bart Van Assche wrote:
> > Make sure that a complaint appears in the kernel log if the driver core
> > locking assumptions are violated.
> > 
> > Cc: Lee Duncan <[email protected]>
> > Cc: Hannes Reinecke <[email protected]>
> > Cc: Luis Chamberlain <[email protected]>
> > Cc: Johannes Thumshirn <[email protected]>
> > Cc: Christoph Hellwig <[email protected]>
> > Cc: Greg Kroah-Hartman <[email protected]>
> > Signed-off-by: Bart Van Assche <[email protected]>
> > ---
> >  drivers/base/dd.c     | 16 ++++++++++++++++
> >  drivers/base/memory.c |  4 ++++
> >  2 files changed, 20 insertions(+)
> > 
> > diff --git a/drivers/base/dd.c b/drivers/base/dd.c
> > index b4212154a94b..033382421351 100644
> > --- a/drivers/base/dd.c
> > +++ b/drivers/base/dd.c
> > @@ -315,11 +315,15 @@ __exitcall(deferred_probe_exit);
> >   */
> >  bool device_is_bound(struct device *dev)
> >  {
> > +   lockdep_assert_held(&dev->mutex);
> 
> With this patch applied, are you seeing lockdep messages anywhere?

No lockdep complaints appeared in my tests with this patch applied. I have
checked whether all callers of the modified functions hold dev->mutex. This
patch is most useful to check new callers of the modified functions. I came
up with this patch to verify the new code I added myself in the drivers/base
directory.

Bart.

Reply via email to