Re: [EXT] Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc

From: Lorenzo Pieralisi
Date: Fri Feb 14 2020 - 12:50:03 EST


On Fri, Feb 14, 2020 at 04:35:10PM +0000, Pankaj Bansal wrote:

[...]

> > -----Original Message-----
> > From: Lorenzo Pieralisi <lorenzo.pieralisi@xxxxxxx>
> > Sent: Friday, February 14, 2020 9:50 PM
> > To: Pankaj Bansal <pankaj.bansal@xxxxxxx>
> > Cc: Marc Zyngier <maz@xxxxxxxxxx>; Ard Biesheuvel
> > <ard.biesheuvel@xxxxxxxxxx>; Makarand Pawagi <makarand.pawagi@xxxxxxx>;
> > Calvin Johnson <calvin.johnson@xxxxxxx>; stuyoder@xxxxxxxxx;
> > nleeder@xxxxxxxxxxxxxx; Ioana Ciornei <ioana.ciornei@xxxxxxx>; Cristi
> > Sovaiala <cristian.sovaiala@xxxxxxx>; Hanjun Guo <guohanjun@xxxxxxxxxx>;
> > Will Deacon <will@xxxxxxxxxx>; jon@xxxxxxxxxxxxx; Russell King
> > <linux@xxxxxxxxxxxxxxx>; ACPI Devel Maling List <linux-acpi@xxxxxxxxxxxxxxx>;
> > Len Brown <lenb@xxxxxxxxxx>; Jason Cooper <jason@xxxxxxxxxxxxxx>; Andy
> > Wang <Andy.Wang@xxxxxxx>; Varun Sethi <V.Sethi@xxxxxxx>; Thomas
> > Gleixner <tglx@xxxxxxxxxxxxx>; linux-arm-kernel <linux-arm-
> > kernel@xxxxxxxxxxxxxxxxxxx>; Laurentiu Tudor <laurentiu.tudor@xxxxxxx>; Paul
> > Yang <Paul.Yang@xxxxxxx>; netdev@xxxxxxxxxxxxxxx; Rafael J. Wysocki
> > <rjw@xxxxxxxxxxxxx>; Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>;
> > Shameerali Kolothum Thodi <shameerali.kolothum.thodi@xxxxxxxxxx>;
> > Sudeep Holla <sudeep.holla@xxxxxxx>; Robin Murphy
> > <robin.murphy@xxxxxxx>
> > Subject: Re: [EXT] Re: [PATCH] bus: fsl-mc: Add ACPI support for fsl-mc
Side note: would you mind removing the email headers (as above) in your
replies please ?

> > On Fri, Feb 14, 2020 at 03:58:14PM +0000, Pankaj Bansal wrote:
> >
> > [...]
> >
> > > > Why should the device know about its own ID? That's a bus/interconnect
> > thing.
> > > > And nothing should be passed *to* IORT. IORT is the source.
> > >
> > > IORT is translation between Input IDs <-> Output IDs. The Input ID is still
> > expected to be passed to parse IORT table.
> >
> > Named components use an array of single mappings (as in entries with single
> > mapping flag set) - Input ID is irrelevant.
> >
> > Not sure what your named component is though and what you want to do with
> > it, the fact that IORT allows mapping for named components do not necessarily
> > mean that it can describe what your system really is, on that you need to
> > elaborate for us to be able to help.
>
> Details about MC bus can be read from here:
> https://elixir.bootlin.com/linux/latest/source/Documentation/networking/device_drivers/freescale/dpaa2/overview.rst#L324
>
> As stated above, in Linux MC is a bus (just like PCI bus, AMBA bus etc)
> There can be multiple devices attached to this bus. Moreover, we can dynamically create/destroy these devices.
> Now, we want to represent this BUS (not individual devices connected to bus) in IORT table.
> The only possible way right now we see is that we describe it as Named components having a pool of ID mappings.
> As and when devices are created and attached to bus, we sift through this pool to correctly determine the output ID for the device.
> Now the input ID that we provide, can come from device itself.
> Then we can use the Platform MSI framework for MC bus devices.

So are you asking me if that's OK ? Or there is something you can't
describe with IORT ?

Side note: can you explain to me please how the MSI allocation flow
and kernel data structures/drivers are modeled in DT ? I had a quick
look at:

drivers/irqchip/irq-gic-v3-its-fsl-mc-msi.c

and to start with, does that code imply that we create a
DOMAIN_BUS_FSL_MC_MSI on ALL DT systems with an ITS device node ?

I *think* you have a specific API to allocate MSIs for MC devices:

fsl_mc_msi_domain_alloc_irqs()

which hook into the IRQ domain created in the file above that handles
the cascading to an ITS domain, correct ?

Thanks,
Lorenzo