Re: [PATCH] iommu/amd: print out "tag" in INVALID_PPR_REQUEST

From: Qian Cai
Date: Tue May 14 2019 - 10:57:29 EST


On Tue, 2019-05-07 at 13:47 +0000, Gary R Hook wrote:
> On 5/5/19 11:11 PM, Qian Cai wrote:
> > [CAUTION: External Email]
> >
> > The commit e7f63ffc1bf1 ("iommu/amd: Update logging information for new
> > event type") introduced a variable "tag" but had never used it which
> > generates a warning below,
> >
> > drivers/iommu/amd_iommu.c: In function 'iommu_print_event':
> > drivers/iommu/amd_iommu.c:567:33: warning: variable 'tag' set but not
> > used [-Wunused-but-set-variable]
> > ÂÂÂint type, devid, pasid, flags, tag;
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ^~~
> > so just use it during the logging.
> >
> > Signed-off-by: Qian Cai <cai@xxxxxx>
> > ---
> > Â drivers/iommu/amd_iommu.c | 4 ++--
> > Â 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> > index f7cdd2ab7f11..52f41369c5b3 100644
> > --- a/drivers/iommu/amd_iommu.c
> > +++ b/drivers/iommu/amd_iommu.c
> > @@ -631,9 +631,9 @@ static void iommu_print_event(struct amd_iommu *iommu,
> > void *__evt)
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂpasid = ((event[0] >> 16) & 0xFFFF)
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ| ((event[1] << 6) & 0xF0000);
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtag = event[1] & 0x03FF;
> > -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdev_err(dev, "Event logged [INVALID_PPR_REQUEST
> > device=%02x:%02x.%x pasid=0x%05x address=0x%llx flags=0x%04x]\n",
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdev_err(dev, "Event logged [INVALID_PPR_REQUEST
> > device=%02x:%02x.%x pasid=0x%05x tag=0x%04x address=0x%llx flags=0x%04x]\n",
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂPCI_BUS_NUM(devid), PCI_SLOT(devid),
> > PCI_FUNC(devid),
> > -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂpasid, address, flags);
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂpasid, tag, address, flags);
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂbreak;
> > ÂÂÂÂÂÂÂÂÂdefault:
> > ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdev_err(dev, "Event logged [UNKNOWN event[0]=0x%08x
> > event[1]=0x%08x event[2]=0x%08x event[3]=0x%08x\n",
>
> I did manage to overlook that variable when I posted the original patch.Â
> But it looks to me like 41e59a41fc5d1 (iommu tree) already fixed this...Â
> I'm not sure why it never got pushed to the main tree.

Jroedel, I am wondering what the plan for 41e59a41fc5d1 (iommu tree) or this
patch to be pushed to the linux-next or mainline...