2021-05-05 18:06:22

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2] spi: Don't have controller clean up spi device before driver unbind

On Wed, May 5, 2021 at 8:26 PM Saravana Kannan <[email protected]> wrote:
>
> When a spi device is unregistered and triggers a driver unbind, the
> driver might need to access the spi device. So, don't have the
> controller clean up the spi device before the driver is unbound. Clean
> up the spi device after the driver is unbound.
>
> Fixes: c7299fea6769 ("spi: Fix spi device unregister flow")
> Reported-by: Lukas Wunner <[email protected]>

And
Suggested-by: Lukas ...

> Signed-off-by: Saravana Kannan <[email protected]>

...

> Can you test this one your end to make sure you don't have issues
> anymore?

Do you need a test on my setup?

...

> + device_del(&spi->dev);
> + spi_cleanup(spi);
> + put_device(&spi->dev);

This block deserves a comment in the code.

--
With Best Regards,
Andy Shevchenko


2021-05-11 15:59:27

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH v2] spi: Don't have controller clean up spi device before driver unbind

On Wed, May 05, 2021 at 08:53:14PM +0300, Andy Shevchenko wrote:
> On Wed, May 5, 2021 at 8:26 PM Saravana Kannan <[email protected]> wrote:

> > Can you test this one your end to make sure you don't have issues
> > anymore?

> Do you need a test on my setup?

It wouldn't hurt.


Attachments:
(No filename) (291.00 B)
signature.asc (499.00 B)
Download all attachments

2021-05-11 20:32:12

by Andy Shevchenko

[permalink] [raw]
Subject: Re: [PATCH v2] spi: Don't have controller clean up spi device before driver unbind

On Tue, May 11, 2021 at 6:58 PM Mark Brown <[email protected]> wrote:
>
> On Wed, May 05, 2021 at 08:53:14PM +0300, Andy Shevchenko wrote:
> > On Wed, May 5, 2021 at 8:26 PM Saravana Kannan <[email protected]> wrote:
>
> > > Can you test this one your end to make sure you don't have issues
> > > anymore?
>
> > Do you need a test on my setup?
>
> It wouldn't hurt.

Okay, I have reverted first the "spi: Fix spi device unregister flow"
to be sure I can reproduce the lockdep warning, indeed, it's there.

After applying the above mentioned patch it's gone.

On top I applied this ("spi: Don't have controller clean up spi device
before driver unbind") patch to see if there is any changes,
nope, seems everything is fine.

FWIW,
Tested-by: Andy Shevchenko <[email protected]>


--
With Best Regards,
Andy Shevchenko