From: Mark Brown <email@example.com>
To: Kirill Kapranov <firstname.lastname@example.org>
Cc: Geert Uytterhoeven <email@example.com>,
Subject: Re: [PATCH -next] spi: Fix double IDR allocation with DT aliases
Date: Sun, 26 Aug 2018 14:24:15 +0100 [thread overview]
Message-ID: <20180826132415.GB2414@sirena.org.uk> (raw)
[-- Attachment #1: Type: text/plain, Size: 1536 bytes --]
On Sat, Aug 25, 2018 at 08:54:53PM +0300, Kirill Kapranov wrote:
> > For DT systems the dynamically allocated IDs start at the maximum
> > positive ID and work down so in practice it is vanishingly unlikely that
> > there will be a collision as idiomatic static DT IDs would be low
> > integers.
> Yes, this algorithm seems really bullet-proof. However, it isn't actually
> used now. The ID allocation algorithm using atomic_dec_return call had been
> introduced 2006-01-08 as . It was being used in the mainline kernel (with
> some improvements) up to 2017-08-16, when it has been replaced with the
> newer algorithm using Linux idr, accordingly .
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.
> Since idr_alloc call works incrementally, the situation of a 'fixed' ID
> squatting by a driver with 'dynamic ID' seems more than possible.
> Therefore it would be justified to use a hardcoded constant
> SPI_DYN_FIRST_BUS_NUM (that was introduced in  and eliminated in ),
> but with a sufficiently greater value of the constant.
Right, that clearly wasn't an intended effect, though - should be using
the max of the big constant and the maximum static ID.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply other threads:[~2018-08-26 13:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-21 9:53 [PATCH -next] spi: Fix double IDR allocation with DT aliases Geert Uytterhoeven
2018-08-21 13:40 ` Greg KH
2018-08-21 17:42 ` Geert Uytterhoeven
2018-08-22 17:51 ` Kirill Kapranov
2018-08-23 10:21 ` Mark Brown
2018-08-25 17:54 ` Kirill Kapranov
2018-08-26 13:24 ` Mark Brown [this message]
2018-08-28 19:47 ` Kirill kapranov
2018-08-27 14:13 ` Fabio Estevam
2018-08-28 20:58 ` Applied "spi: Fix double IDR allocation with DT aliases" to the spi tree Mark Brown
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:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* 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).