Re: [PATCH v3] PCI: xilinx-nwl: Fix Multi MSI data programming

From: Marc Zyngier
Date: Thu Jun 06 2019 - 03:22:37 EST


On Thu, 06 Jun 2019 05:49:45 +0100,
Bharat Kumar Gogada <bharatku@xxxxxxxxxx> wrote:
>
> > On 31/05/2019 17:09, Lorenzo Pieralisi wrote:
> > > [+Marc]
> > >
> > > On Wed, May 29, 2019 at 06:07:49PM +0530, Bharat Kumar Gogada wrote:
> > >> The current Multi MSI data programming fails if multiple end points
> > >> requesting MSI and multi MSI are connected with switch, i.e the
> > >> current multi MSI data being given is not considering the number of
> > >> vectors being requested in case of multi MSI.
> > >> Ex: Two EP's connected via switch, EP1 requesting single MSI first,
> > >> EP2 requesting Multi MSI of count four. The current code gives MSI
> > >> data 0x0 to EP1 and 0x1 to EP2, but EP2 can modify lower two bits due
> > >> to which EP2 also sends interrupt with MSI data 0x0 which results in
> > >> always invoking virq of EP1 due to which EP2 MSI interrupt never gets
> > >> handled.
> > >
> > > If this is a problem it is not the only driver where it should be
> > > fixed it seems. CC'ed Marc in case I have missed something in relation
> > > to MSI IRQs but AFAIU it looks like HW is allowed to toggled bits
> > > (according to bits[6:4] in Message Control for MSI) in the MSI data,
> > > given that the data written is the hwirq number (in this specific MSI
> > > controller) it ought to be fixed.
> >
> > Yeah, it looks like a number of MSI controllers could be quite broken in this
> > particular area.
> >
> > >
> > > The commit log and patch should be rewritten (I will do that) but
> > > first I would like to understand if there are more drivers to be
> > > updated.
> > >
> > >
> Hi Lorenzo and Marc, thanks for your time.
> Marc, I'm yet to test the below suggested solution,
> GIC v2m and GIC v3 supports multi MSI, do we see above issue in
> these MSI controllers ?

To the best of my knowledge, these drivers do support MultiMSI
correctly. GICv2m actually gained the support pretty recently (see
de337ee30142). The GICv3 ITS never ha an issue with that, given that
per device EventIDs are always 0-based.

Thanks,

M.

--
Jazz is not dead, it just smells funny.