[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] PCI/MSI: Correct use of can_mask in msi_add_msi_desc()


  • To: Josef Johansson <josef@xxxxxxxxxxx>, Bjorn Helgaas <bhelgaas@xxxxxxxxxx>
  • From: Jason Gunthorpe <jgg@xxxxxxxxxx>
  • Date: Fri, 5 Aug 2022 09:10:41 -0300
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9xxeV8rR278VqMcf3mIZ8bLAT4CFg7jhy+Oi9B4XdAM=; b=Tppk4QN1wkt4mSwe8rGOwh+Nig5+wlwI49BGOAk4YhVlUoU67fJdb+ZdoU7Twwt8U/G+yrxL8F/ps90NbuQS2FMCY+GQE6vF4gEapi96sDQA89JJn3jXFepvTlSoNQo6BjY5clnUbg5HHVpJofV5ytoT+OLoU9hyEswP+uUiPKmMkOh+9S2L1Cd61jfOWSbi9dpxBwFwYKUkuQ4qBb0K/JHZEJgN8I8aGANoAdwOXf3HjSF5YKa0aX+ncuD8tYfQh1vGsfxhUlJkpeTXq5OP+049t/iW8O/zylaZJ9eA7J2h7a7VSKDQ/zSfn51Y90Q6zoBq/kbHDJpCY0zXSjmWnQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kh7Ue+MJvGMREL2MiPtXKas+SAYp77rsPhWFNPhF181kq4erhOLdILSC4xUvPhLRyRGIFvEymLuHHCMXjK1NVRy6UjatCh5DPvBz0lFjf1AXMOm4vjC/tnJRdPVgksVDVulMqvFmPPMI4yGzdiz2ozqb7WmtkraNX9rxYDrhFGl8ajw6logtnC9aA6BWeBefaSpEahuFi4hHiUjwFZMRfpsa9ZUNfgSFAx4xPMntsiUtnJqpGpjZ7WaLHtsGVqV8qv7VQ4jYpBwcofd5RpAWkH/TAnlyp3vmar1kFzJjuEjRAONXZRlvsunBrleAMoiaXC4TLDMtQ2ej6Jcel19pZA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com;
  • Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>, linux-pci@xxxxxxxxxxxxxxx, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Fri, 05 Aug 2022 12:10:52 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Aug 05, 2022 at 12:03:15PM +0200, Josef Johansson wrote:
> On 2/14/22 11:07, Josef Johansson wrote:
> > From: Josef Johansson <josef@xxxxxxxxxxx>
> > 
> > PCI/MSI: Correct use of can_mask in msi_add_msi_desc()
> > Commit 71020a3c0dff4 ("PCI/MSI: Use msi_add_msi_desc()") modifies
> > the logic of checking msi_attrib.can_mask, without any reason.
> > This commits restores that logic.
> >
> > Fixes: 71020a3c0dff4 ("PCI/MSI: Use msi_add_msi_desc()")
> > Signed-off-by: Josef Johansson <josef@xxxxxxxxxxx>
> > 
> > ---
> > v2: Changing subject line to fit earlier commits.
> > 
> > Trying to fix a NULL BUG in the NVMe MSIX implementation I stumbled upon 
> > this code,
> > which ironically was what my last MSI patch resulted into.
> > 
> > I don't see any reason why this logic was change, and it did not break 
> > anything
> > correcting the logic.
> > 
> > CC xen-devel since it very much relates to Xen kernel (via 
> > pci_msi_ignore_mask).
> > ---
> > 
> > diff --git a/drivers/pci/msi/msi.c b/drivers/pci/msi/msi.c
> > index c19c7ca58186..146e7b9a01cc 100644
> > --- a/drivers/pci/msi/msi.c
> > +++ b/drivers/pci/msi/msi.c
> > @@ -526,7 +526,7 @@ static int msix_setup_msi_descs(struct pci_dev *dev, 
> > void __iomem *base,
> >             desc.pci.msi_attrib.can_mask = !pci_msi_ignore_mask &&
> >                                            !desc.pci.msi_attrib.is_virtual;
> > -           if (!desc.pci.msi_attrib.can_mask) {
> > +           if (desc.pci.msi_attrib.can_mask) {
> >                     addr = pci_msix_desc_addr(&desc);
> >                     desc.pci.msix_ctrl = readl(addr + 
> > PCI_MSIX_ENTRY_VECTOR_CTRL);
> >             }
> > 

Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>

Bjorn, please take it?

Jason



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.