From: Mark Brown <broonie@kernel.org>
To: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Serge Semin <fancer.lancer@gmail.com>,
linux-spi@vger.kernel.org
Subject: Re: [PATCH] spi: Make spi_delay_exec() warn if called from atomic context
Date: Fri, 22 May 2020 17:18:55 +0100 [thread overview]
Message-ID: <20200522161855.GO5801@sirena.org.uk> (raw)
In-Reply-To: <20200522161001.s4pzjvzq6vwdivo3@mobilestation>
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
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 #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2020-05-22 16:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-22 15:50 [PATCH] spi: Make spi_delay_exec() warn if called from atomic context Mark Brown
2020-05-22 16:02 ` Andy Shevchenko
2020-05-22 16:04 ` Andy Shevchenko
2020-05-22 16:10 ` Serge Semin
2020-05-22 16:18 ` Mark Brown [this message]
2020-05-25 14:57 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200522161855.GO5801@sirena.org.uk \
--to=broonie@kernel.org \
--cc=Sergey.Semin@baikalelectronics.ru \
--cc=andriy.shevchenko@linux.intel.com \
--cc=fancer.lancer@gmail.com \
--cc=linux-spi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox