From: Mark Brown <broonie@kernel.org>
To: Rich Felker <dalias@libc.org>
Cc: linux-spi@vger.kernel.org, linux-mmc@vger.kernel.org,
"Heiko Stübner" <heiko@sntech.de>,
"Ernst Schwab" <eschwab@online.de>,
"Matt Fleming" <matt@console-pimps.org>,
"Antonio Ospite" <ospite@studenti.unina.it>
Subject: Re: Unsynchronized access to spi bus by mmc_rescan?
Date: Fri, 22 Jul 2016 00:27:37 +0100 [thread overview]
Message-ID: <20160721232737.GW6509@sirena.org.uk> (raw)
In-Reply-To: <20160721230615.GH15995@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 1770 bytes --]
On Thu, Jul 21, 2016 at 07:06:15PM -0400, Rich Felker wrote:
> On Thu, Jul 21, 2016 at 11:43:08PM +0100, Mark Brown wrote:
> > On Thu, Jul 21, 2016 at 05:40:15PM -0400, Rich Felker wrote:
> > spi_sync() shouldn't be reading the flag in the first place as far as I
> > can tell, it should unconditionally have the flag clear as locked
> > callers have to use spi_sync_locked() but that will give us a fast path
> > that doesn't check for the bus lock which starts to reveal the
> > underlying issue.
> Ah, in that case maybe the actual bug is just one line of commit
> 24c8cd1b0812? Reverting just that also seems to make the problem go
> away.
For those playing at home that's "spi: fix possible deadlock between
internal bus locks and bus_lock_flag". That won't work entirely since
that'd mean that we're not doing I/O locking to exclude the message pump
in cases where we push data directly in spi_sync() with the bus lock
held by a caller. That's probably going to work most of the time as
most callers will be single threaded but they might not be. It should
be saved by the checks to see if we're already processing a message
inside the pump function but it's better to be clear about what we're
doing I think, and we can clear cur_msg inside the message pump. But
perhaps it's enough... anyway, I'm not going to think through all the
cases properly at this time of night.
Please include human readable descriptions of things like commits and
issues being discussed in e-mail in your mails, this makes them much
easier for humans to read especially when they have no internet access.
I do frequently catch up on my mail on flights or while otherwise
travelling so this is even more pressing for me than just being about
making things a bit easier to read.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2016-07-21 23:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-22 21:28 Unsynchronized access to spi bus by mmc_rescan? Rich Felker
2016-05-04 22:44 ` Rich Felker
[not found] ` <20160504224445.GW21636-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2016-07-21 20:44 ` Rich Felker
[not found] ` <20160721204451.GE15995-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2016-07-21 21:40 ` Rich Felker
[not found] ` <20160721214015.GG15995-C3MtFaGISjmo6RMmaWD+6Sb1p8zYI1N1@public.gmane.org>
2016-07-21 22:43 ` Mark Brown
[not found] ` <20160721224308.GT6509-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2016-07-21 23:06 ` Rich Felker
2016-07-21 23:27 ` Mark Brown [this message]
2016-07-21 23:12 ` 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=20160721232737.GW6509@sirena.org.uk \
--to=broonie@kernel.org \
--cc=dalias@libc.org \
--cc=eschwab@online.de \
--cc=heiko@sntech.de \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=matt@console-pimps.org \
--cc=ospite@studenti.unina.it \
/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;
as well as URLs for NNTP newsgroup(s).