Re: [PATCH 4/4] soc: marvell: rvu-pf: Handle function level reset (FLR) IRQs for VFs
From: Anshumali Gaur
Date: Wed Sep 25 2024 - 10:29:27 EST
> -----Original Message-----
> From: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
> Sent: Wednesday, September 25, 2024 2:49 PM
> To: Anshumali Gaur <agaur@xxxxxxxxxxx>; conor.dooley@xxxxxxxxxxxxx;
> ulf.hansson@xxxxxxxxxx; arnd@xxxxxxxx; linus.walleij@xxxxxxxxxx;
> nikita.shubin@xxxxxxxxxxx; vkoul@xxxxxxxxxx; cyy@xxxxxxxxxxxx;
> krzysztof.kozlowski@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Sunil Kovvuri
> Goutham <sgoutham@xxxxxxxxxxx>
> Subject: Re: [PATCH 4/4] soc: marvell: rvu-pf: Handle function level
> reset (FLR) IRQs for VFs
>
> Hi Anshumali! On Wed, 2024-09-25 at 09: 13 +0000, Anshumali Gaur wrote: > > >
> +static irqreturn_t rvu_gen_pf_me_intr_handler(int irq, void *pf_irq) > > > +{ > > >
> + struct gen_pf_dev *pfdev = (struct gen_pf_dev *)pf_irq;
> Hi Anshumali!
>
> On Wed, 2024-09-25 at 09:13 +0000, Anshumali Gaur wrote:
> > > > +static irqreturn_t rvu_gen_pf_me_intr_handler(int irq, void
> > > > +*pf_irq) {
> > > > + struct gen_pf_dev *pfdev = (struct gen_pf_dev *)pf_irq;
> > > > + int vf, reg, num_reg = 1;
> > > > + u64 intr;
> > > > +
> > > > + if (pfdev->total_vfs > 64)
> > > > + num_reg = 2;
> > > > +
> > > > + for (reg = 0; reg < num_reg; reg++) {
> > > > + intr = readq(pfdev->reg_base + RVU_PF_VFME_INTX(reg));
> > > > + if (!intr)
> > > > + continue;
> > > > + for (vf = 0; vf < 64; vf++) {
> > > > + if (!(intr & BIT_ULL(vf)))
> > > > + continue;
> > > > + /* clear trpend bit */
> > > > + writeq(BIT_ULL(vf), pfdev->reg_base +
> > > RVU_PF_VFTRPENDX(reg));
> > > > + /* clear interrupt */
> > > > + writeq(BIT_ULL(vf), pfdev->reg_base +
> > > RVU_PF_VFME_INTX(reg));
> > > > + }
> > > > + }
> > >
> > > Should anything else have been performed in the IRQ handler besides
> > > acknowledging the IRQ request?
> > >
> > We are just acknowledging the IRQ request here.
>
> But what's the goal of requesting the IRQ in the first place then?
>
In this PCIe Master enable intr handler we are clearing the PCI Transaction pending bits of PFVF devices
until it is cleared
This API is called whenever the device gets reset.
Thanks and Regards,
Anshumali Gaur
> --
> Alexander Sverdlin.