[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50b5b51e31d9497dbb84c52e11d0d1547d4804f4.camel@ew.tq-group.com>
Date: Tue, 25 Aug 2020 13:24:10 +0200
From: Matthias Schiffer <matthias.schiffer@...tq-group.com>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Sascha Hauer <s.hauer@...gutronix.de>,
"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: (EXT) Re: [PATCH mmc-next v2] mmc: allow setting slot index via
device tree alias
On Tue, 2020-08-25 at 11:39 +0200, Matthias Schiffer wrote:
> On Tue, 2020-08-25 at 11:14 +0200, Ulf Hansson wrote:
> > On Thu, 20 Aug 2020 at 09:59, Matthias Schiffer
> > <matthias.schiffer@...tq-group.com> wrote:
> > > +
> > > +static void __init mmc_of_reserve_idx(void)
> > > +{
> > > + int max;
> > > +
> > > + max = of_alias_get_highest_id("mmc");
> >
> > Is calling of_alias_get_highest_id("mmc") costly from an execution
> > point of view?
> >
> > If not, we might as well call it directly from mmc_alloc_host()
> > each
> > time a host is allocated instead, to simplify the code a bit.
>
> It's not particularly costly (it just walks the list of aliases once
> and does a string comparison for each entry), but it does so while
> holding the of_mutex.
>
> Both variants exist in the current kernel: The I2C core stores the
> hightest index in a global variable, while of_alias_get_highest_id()
> is
> called once for each registered SPI controller. I have a slight
> preference for the global variable solution.
Looking at this again, it's pretty much the same as of_alias_get_id().
I'll remove the extra functions and global variable.
Kind regards,
Matthias
Powered by blists - more mailing lists