[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AM5PR04MB3299C3A0DCCCE86250BBC696F5580@AM5PR04MB3299.eurprd04.prod.outlook.com>
Date: Mon, 9 Dec 2019 07:03:17 +0000
From: Xiaowei Bao <xiaowei.bao@....com>
To: Laurentiu Tudor <laurentiu.tudor@....com>,
Marc Zyngier <maz@...terjones.org>
CC: Roy Zang <roy.zang@....com>,
"lorenzo.pieralisi@....com" <lorenzo.pieralisi@....com>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
"Z.q. Hou" <zhiqiang.hou@....com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"M.h. Lian" <minghuan.lian@....com>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
"andrew.murray@....com" <andrew.murray@....com>,
"frowand.list@...il.com" <frowand.list@...il.com>,
Mingkai Hu <mingkai.hu@....com>,
Diana Madalina Craciun <diana.craciun@....com>
Subject: RE: [PATCH] PCI: layerscape: Add the SRIOV support in host side
> -----Original Message-----
> From: Laurentiu Tudor <laurentiu.tudor@....com>
> Sent: 2019年12月5日 18:45
> To: Xiaowei Bao <xiaowei.bao@....com>; Marc Zyngier
> <maz@...terjones.org>
> Cc: Roy Zang <roy.zang@....com>; lorenzo.pieralisi@....com;
> devicetree@...r.kernel.org; linux-pci@...r.kernel.org; Z.q. Hou
> <zhiqiang.hou@....com>; linux-kernel@...r.kernel.org; M.h. Lian
> <minghuan.lian@....com>; robh+dt@...nel.org;
> linux-arm-kernel@...ts.infradead.org; bhelgaas@...gle.com;
> andrew.murray@....com; frowand.list@...il.com; Mingkai Hu
> <mingkai.hu@....com>; Diana Madalina Craciun <diana.craciun@....com>
> Subject: RE: [PATCH] PCI: layerscape: Add the SRIOV support in host side
>
> Hi Xiaowei,
>
> > -----Original Message-----
> > From: linux-arm-kernel <linux-arm-kernel-bounces@...ts.infradead.org>
> > On Behalf Of Xiaowei Bao
> >
> > > -----Original Message-----
> > > From: Marc Zyngier <maz@...terjones.org>
> > > Sent: 2019年12月2日 20:48
> > > To: Xiaowei Bao <xiaowei.bao@....com>
> > > Cc: robh+dt@...nel.org; frowand.list@...il.com; M.h. Lian
> > > <minghuan.lian@....com>; Mingkai Hu <mingkai.hu@....com>; Roy
> Zang
> > > <roy.zang@....com>; lorenzo.pieralisi@....com;
> > > andrew.murray@....com; bhelgaas@...gle.com;
> > > devicetree@...r.kernel.org; linux-kernel@...r.kernel.org;
> > > linux-pci@...r.kernel.org; linux-arm-kernel@...ts.infradead.org;
> > > Z.q. Hou <zhiqiang.hou@....com>
> > > Subject: Re: [PATCH] PCI: layerscape: Add the SRIOV support in host
> > > side
> > >
> > > On 2019-12-02 10:45, Xiaowei Bao wrote:
> > > > GIC get the map relations of devid and stream id from the msi-map
> > > > property of DTS, our platform add this property in u-boot base on
> > > > the PCIe device in the bus, but if enable the vf device in kernel,
> > > > the vf device msi-map will not set, so the vf device can't work,
> > > > this patch purpose is that manage the stream id and device id map
> > > > relations dynamically in kernel, and make the new PCIe device work in
> kernel.
> > > >
> > > > Signed-off-by: Xiaowei Bao <xiaowei.bao@....com>
> > > > ---
> > > > drivers/of/irq.c | 9 +++
> > > > drivers/pci/controller/dwc/pci-layerscape.c | 94
> > > > +++++++++++++++++++++++++++++
> > > > drivers/pci/probe.c | 6 ++
> > > > drivers/pci/remove.c | 6 ++
> > > > 4 files changed, 115 insertions(+)
> > > >
> > > > diff --git a/drivers/of/irq.c b/drivers/of/irq.c index
> > > > a296eaf..791e609 100644
> > > > --- a/drivers/of/irq.c
> > > > +++ b/drivers/of/irq.c
> > > > @@ -576,6 +576,11 @@ void __init of_irq_init(const struct
> > > > of_device_id
> > > > *matches)
> > > > }
> > > > }
> > > >
> > > > +u32 __weak ls_pcie_streamid_fix(struct device *dev, u32 rid) {
> > > > + return rid;
> > > > +}
> > > > +
> > > > static u32 __of_msi_map_rid(struct device *dev, struct
> > > > device_node **np,
> > > > u32 rid_in)
> > > > {
> > > > @@ -590,6 +595,10 @@ static u32 __of_msi_map_rid(struct device
> > > > *dev, struct device_node **np,
> > > > if (!of_map_rid(parent_dev->of_node, rid_in, "msi-map",
> > > > "msi-map-mask", np, &rid_out))
> > > > break;
> > > > +
> > > > + if (rid_out == rid_in)
> > > > + rid_out = ls_pcie_streamid_fix(parent_dev, rid_in);
> > >
> > > Over my dead body. Get your firmware to properly program the LUT so
> > > that
> > it
> > > presents the ITS with a reasonable topology. There is absolutely no
> > > way
> > this
> > > kind of change makes it into the kernel.
> >
> > Sorry for this, I know it is not reasonable, but I have no other way,
> > as I know, ARM get the mapping of stream ID to request ID from the
> > msi-map property of DTS, if add a new device which need the stream ID
> > and try to get it from the msi- map of DTS, it will failed and not
> > work, yes? So could you give me a better advice to fix this issue, I
> > would really appreciate any comments or suggestions, thanks a lot.
> >
>
> I agree with the community that this should be tackled in firmware. I actually
> submitted (by mistake, but let's disregard that :-)) a simple proposal in u-boot
> [1] that should take care of it. We can discuss further on it, if you wish.
>
> [1] https://patchwork.ozlabs.org/patch/1033466/
I will do a experiment to verify whether all PCIe request ID map one stream ID,
and I will show the result when I complete the experiment.
Thanks
Xiaowei
>
> ---
> Best Regards, Laurentiu
Powered by blists - more mailing lists