Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753801AbaGPVLb (ORCPT ); Wed, 16 Jul 2014 17:11:31 -0400 Received: from mail-ie0-f172.google.com ([209.85.223.172]:60353 "EHLO mail-ie0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753660AbaGPVK4 (ORCPT ); Wed, 16 Jul 2014 17:10:56 -0400 Date: Wed, 16 Jul 2014 15:10:52 -0600 From: Bjorn Helgaas To: Sebastian Ott Cc: Frank Haverkamp , Greg Kroah-Hartman , Alexander Gordeev , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: Re: [PATCH] misc/GenWQE: fix pci_enable_msi usage Message-ID: <20140716211052.GC14366@google.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc linux-pci] On Wed, Jul 09, 2014 at 12:46:39PM +0200, Sebastian Ott wrote: > GenWQE used to call pci_enable_msi_block to allocate a desired number > of MSI's. If that was not possible pci_enable_msi_block returned with a > smaller number which might be possible to allocate. GenWQE then called > pci_enable_msi_block with that number. > > Since commit a30d0108b > "GenWQE: Use pci_enable_msi_exact() instead of pci_enable_msi_block()" > pci_enable_msi_exact is used which fails if the desired number of MSI's > was not possible to allocate. Change GenWQE to use pci_enable_msi_range > to restore the old behavior. > > Signed-off-by: Sebastian Ott Since this fixes a30d0108b09a, which we merged via my tree in v3.16-rc1, I applied this with Alexander and Frank's acks to for-linus for v3.16, thanks! > --- > drivers/misc/genwqe/card_ddcb.c | 4 +--- > drivers/misc/genwqe/card_utils.c | 10 ++++++---- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/misc/genwqe/card_ddcb.c b/drivers/misc/genwqe/card_ddcb.c > index c8046db..f66d43d 100644 > --- a/drivers/misc/genwqe/card_ddcb.c > +++ b/drivers/misc/genwqe/card_ddcb.c > @@ -1237,9 +1237,7 @@ int genwqe_setup_service_layer(struct genwqe_dev *cd) > } > > rc = genwqe_set_interrupt_capability(cd, GENWQE_MSI_IRQS); > - if (rc > 0) > - rc = genwqe_set_interrupt_capability(cd, rc); > - if (rc != 0) { > + if (rc) { > rc = -ENODEV; > goto stop_kthread; > } > diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c > index 62cc6bb..6abc437 100644 > --- a/drivers/misc/genwqe/card_utils.c > +++ b/drivers/misc/genwqe/card_utils.c > @@ -718,10 +718,12 @@ int genwqe_set_interrupt_capability(struct genwqe_dev *cd, int count) > int rc; > struct pci_dev *pci_dev = cd->pci_dev; > > - rc = pci_enable_msi_exact(pci_dev, count); > - if (rc == 0) > - cd->flags |= GENWQE_FLAG_MSI_ENABLED; > - return rc; > + rc = pci_enable_msi_range(pci_dev, 1, count); > + if (rc < 0) > + return rc; > + > + cd->flags |= GENWQE_FLAG_MSI_ENABLED; > + return 0; > } > > /** > -- > 1.9.3 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/