[Skiboot] [PATCH 5/7] npu2: Add checks to npu2-only codepaths

Oliver O'Halloran oohall at gmail.com
Tue Jul 2 16:44:13 AEST 2019


On Tue, Jul 2, 2019 at 8:02 AM Reza Arbab <arbab at linux.ibm.com> wrote:
>
> On Wed, Jun 26, 2019 at 03:15:18PM +1000, Alexey Kardashevskiy wrote:
> >On 18/06/2019 17:17, Andrew Donnellan wrote:
> >> No it doesn't, probe_npu2() is npu2 only, probe_npu3() is npu3 only.
> >> They use different device tree compat strings.
> >>
> >
> >A slightly strange pattern then. probe_npu2() is called on every
> >machine, including POWER8NVL. It does not do anything because
> >platform.npu2_device_detect is not defined there. Ahhh whatever...
>
> Isn't that normal for probe functions? You call them on every machine,
> and when there's nothing to do, they return early.

It's fairly standard in skiboot, but it's a little different from the
linux usage where the bus defines a match function and the probe
function is only called on matching devices.

Maybe we should change the naming convention to something like
probe_all_npu3s(). I got tripped up by this other day when I added
verbose eeh support to PHB3. Previously the verbose_eeh flag lived in
phb4.c and probe_phb4() unconditionally set it to true, so you'd
always get verbose EEH enabled even if the nvram option disabled it.

Oliver


More information about the Skiboot mailing list