Re: [PATCH] spi: Make spi_delay_exec() warn if called from atomic context

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, May 22, 2020 at 07:10:01PM +0300, Serge Semin wrote:
> On Fri, May 22, 2020 at 07:04:17PM +0300, Andy Shevchenko wrote:

> > We may improve it later, though, to be smarter and spill a warning only when it
> > uses non-atomic delays. For now this is good enough.

> IMO this wouldn't be better than the current solution. might_sleep() is called
> "might" to warn that the called method may get to sleep, not shall, not will. As
> I see it it's better to warn about the consequences straight away, but not at the
> point when the sleeping method is actually called in the atomic context.

Yes, this is the whole point of might_sleep() - it's to ensure that we
always get a warning about code that might sleep, rather than only
getting a warning if we happen to go down a path that does actually
sleep.  This means we're less likely to run into bugs at runtime in
unusual use cases.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux