[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221012213113.fop4kqqtu43hka4b@mobilestation>
Date: Thu, 13 Oct 2022 00:31:13 +0300
From: Serge Semin <fancer.lancer@...il.com>
To: Tony Luck <tony.luck@...el.com>
Cc: Borislav Petkov <bp@...en8.de>,
Serge Semin <Sergey.Semin@...kalelectronics.ru>,
Michal Simek <michal.simek@...inx.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
James Morse <james.morse@....com>,
Robert Richter <rric@...nel.org>,
Alexey Malahov <Alexey.Malahov@...kalelectronics.ru>,
Michail Ivanov <Michail.Ivanov@...kalelectronics.ru>,
Pavel Parkhomenko <Pavel.Parkhomenko@...kalelectronics.ru>,
Punnaiah Choudary Kalluri
<punnaiah.choudary.kalluri@...inx.com>,
Manish Narani <manish.narani@...inx.com>,
Dinh Nguyen <dinguyen@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski@...aro.org>,
devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RESEND v3 13/17] EDAC/mc: Add MC unique index allocation
procedure
On Wed, Oct 12, 2022 at 01:44:59PM -0700, Tony Luck wrote:
> On Wed, Oct 12, 2022 at 10:33:35PM +0200, Borislav Petkov wrote:
> > On Wed, Oct 12, 2022 at 11:01:54PM +0300, Serge Semin wrote:
>
> > "A new special MC index is introduced here. It's defined by the
> > EDAC_AUTO_MC_NUM macro with a value specifically chosen as the least
> > probable value used for the real MC index. In case if the EDAC_AUTO_MC_NUM
> > index is specified by the EDAC LLDD, the MC index will be either retrieved
> > from the MC device OF-node alias index ("mc[:number:]") or automatically
> > generated as the next-free MC index found by the ID allocation procedure."
>
> Just curious.If I have an EDAC driver using EDAC_AUTO_MC_NUM, and I
> unload and reload the driver a bunch of times. Do I get the same memory
> controller numbers each reload, or get an ever increasing set each time?
You'll get the same numbers if no other device-driver allocated them
(which we already established isn't relevant to EDAC since only one
driver per system is supposed to work). In order to implement what you
said I should have called idr_alloc_cyclic() instead.
Here is what the suggested implementation implies:
1. If there is a particular ID assigned in the framework of the dts aliases
(i.e. mcX = &ddr0) then that value will be selected for the controller.
2. If no particular ID is assigned but there are mcX-like aliases
defined in DTS, then the next free id greater than the last mcX value
will be assigned.
3. If none if the above is relevant the first free ID in the pool will be
allocated.
4. On the driver unload the driver remove method will be called thus
the allocated ID will be freed on the MC-controller de-registration.
Thus on the next driver loading the freed IDs will be reused by the
idr_alloc() method design.
-Sergey
>
> -Tony
Powered by blists - more mailing lists