Message ID | 1473600688-24043-7-git-send-email-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Delegated to: | Bjorn Helgaas |
Headers | show |
Hi Christoph, On 09/11/2016 03:31 PM, Christoph Hellwig wrote: > Simply the interrupt setup by using the new PCI layer helpers. > > Despite using pci_enable_msi_range, this driver was only requesting a > single MSI vector anyway. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > drivers/media/pci/cobalt/cobalt-driver.c | 8 ++------ > drivers/media/pci/cobalt/cobalt-driver.h | 2 -- > 2 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c > index 476f7f0..5a0a9e4 100644 > --- a/drivers/media/pci/cobalt/cobalt-driver.c > +++ b/drivers/media/pci/cobalt/cobalt-driver.c > @@ -307,9 +307,7 @@ static void cobalt_pci_iounmap(struct cobalt *cobalt, struct pci_dev *pci_dev) > static void cobalt_free_msi(struct cobalt *cobalt, struct pci_dev *pci_dev) > { > free_irq(pci_dev->irq, (void *)cobalt); > - > - if (cobalt->msi_enabled) > - pci_disable_msi(pci_dev); > + pci_free_irq_vectors(pci_dev); > } > > static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, > @@ -386,14 +384,12 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, > from being generated. */ > cobalt_set_interrupt(cobalt, false); > > - if (pci_enable_msi_range(pci_dev, 1, 1) < 1) { > + if (pci_alloc_irq_vectors(pci_dev, 1, 1, PCI_IRQ_MSI) < 1) { PCI_IRQ_MSI is unknown, I assume that this will appear in 4.9? Looks good otherwise. Regards, Hans > cobalt_err("Could not enable MSI\n"); > - cobalt->msi_enabled = false; > ret = -EIO; > goto err_release; > } > msi_config_show(cobalt, pci_dev); > - cobalt->msi_enabled = true; > > /* Register IRQ */ > if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED, > diff --git a/drivers/media/pci/cobalt/cobalt-driver.h b/drivers/media/pci/cobalt/cobalt-driver.h > index ed00dc9..00f773e 100644 > --- a/drivers/media/pci/cobalt/cobalt-driver.h > +++ b/drivers/media/pci/cobalt/cobalt-driver.h > @@ -287,8 +287,6 @@ struct cobalt { > u32 irq_none; > u32 irq_full_fifo; > > - bool msi_enabled; > - > /* omnitek dma */ > int dma_channels; > int first_fifo_channel; > -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Fri, Sep 16, 2016 at 10:01:42AM +0200, Hans Verkuil wrote:
> PCI_IRQ_MSI is unknown, I assume that this will appear in 4.9?
The flag is in 4.8-rc.
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Hans, just checked the current Linux tree and cobalt still uses the old pci_enable_msi_range call. Did you queue this patch up for 4.10? -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 14/12/16 11:29, Christoph Hellwig wrote: > Hi Hans, > > just checked the current Linux tree and cobalt still uses the old > pci_enable_msi_range call. Did you queue this patch up for 4.10? > -- > To unsubscribe from this list: send the line "unsubscribe linux-media" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Completely forgot this. Is it OK to queue it for 4.11? Or is it blocking other follow-up work you want to do for 4.10? Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Wed, Dec 14, 2016 at 11:37:17AM +0100, Hans Verkuil wrote: > Completely forgot this. Is it OK to queue it for 4.11? Or is it blocking > other follow-up work you want to do for 4.10? My plan was to see if Bjorn would take the patch to do the trivial removal of pci_enable_msix_exact and pci_enable_msix_range even as a late 4.10 patch given it's so harmless, but either way there is follow work pending ASAP so getting it in for 4.10 would be very helpful. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 14/12/16 11:47, Christoph Hellwig wrote: > On Wed, Dec 14, 2016 at 11:37:17AM +0100, Hans Verkuil wrote: >> Completely forgot this. Is it OK to queue it for 4.11? Or is it blocking >> other follow-up work you want to do for 4.10? > > My plan was to see if Bjorn would take the patch to do the trivial removal > of pci_enable_msix_exact and pci_enable_msix_range even as a late 4.10 patch > given it's so harmless, but either way there is follow work pending ASAP > so getting it in for 4.10 would be very helpful. > OK, then I'll make a pull request for 4.10 tomorrow. Regards, Hans -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/media/pci/cobalt/cobalt-driver.c b/drivers/media/pci/cobalt/cobalt-driver.c index 476f7f0..5a0a9e4 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.c +++ b/drivers/media/pci/cobalt/cobalt-driver.c @@ -307,9 +307,7 @@ static void cobalt_pci_iounmap(struct cobalt *cobalt, struct pci_dev *pci_dev) static void cobalt_free_msi(struct cobalt *cobalt, struct pci_dev *pci_dev) { free_irq(pci_dev->irq, (void *)cobalt); - - if (cobalt->msi_enabled) - pci_disable_msi(pci_dev); + pci_free_irq_vectors(pci_dev); } static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, @@ -386,14 +384,12 @@ static int cobalt_setup_pci(struct cobalt *cobalt, struct pci_dev *pci_dev, from being generated. */ cobalt_set_interrupt(cobalt, false); - if (pci_enable_msi_range(pci_dev, 1, 1) < 1) { + if (pci_alloc_irq_vectors(pci_dev, 1, 1, PCI_IRQ_MSI) < 1) { cobalt_err("Could not enable MSI\n"); - cobalt->msi_enabled = false; ret = -EIO; goto err_release; } msi_config_show(cobalt, pci_dev); - cobalt->msi_enabled = true; /* Register IRQ */ if (request_irq(pci_dev->irq, cobalt_irq_handler, IRQF_SHARED, diff --git a/drivers/media/pci/cobalt/cobalt-driver.h b/drivers/media/pci/cobalt/cobalt-driver.h index ed00dc9..00f773e 100644 --- a/drivers/media/pci/cobalt/cobalt-driver.h +++ b/drivers/media/pci/cobalt/cobalt-driver.h @@ -287,8 +287,6 @@ struct cobalt { u32 irq_none; u32 irq_full_fifo; - bool msi_enabled; - /* omnitek dma */ int dma_channels; int first_fifo_channel;
Simply the interrupt setup by using the new PCI layer helpers. Despite using pci_enable_msi_range, this driver was only requesting a single MSI vector anyway. Signed-off-by: Christoph Hellwig <hch@lst.de> --- drivers/media/pci/cobalt/cobalt-driver.c | 8 ++------ drivers/media/pci/cobalt/cobalt-driver.h | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-)