diff mbox

[v1,2/3] serial: 8250_mid: enable MSI on Denverton

Message ID 20170102092343.87106-2-andriy.shevchenko@linux.intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Andy Shevchenko Jan. 2, 2017, 9:23 a.m. UTC
Enable MSI type of interrupt if PCI BIOS supports it.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_mid.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Heikki Krogerus Jan. 2, 2017, 10:40 a.m. UTC | #1
On Mon, Jan 02, 2017 at 11:23:42AM +0200, Andy Shevchenko wrote:
> Enable MSI type of interrupt if PCI BIOS supports it.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/tty/serial/8250/8250_mid.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c
> index 6730d9eef81e..85011c9ac0ee 100644
> --- a/drivers/tty/serial/8250/8250_mid.c
> +++ b/drivers/tty/serial/8250/8250_mid.c
> @@ -164,8 +164,14 @@ static int dnv_setup(struct mid8250 *mid, struct uart_port *p)
>  	unsigned int bar = FL_GET_BASE(mid->board->flags);
>  	int ret;
>  
> +	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> +	if (ret < 0)
> +		return ret;

pci_free_irq_vectors() in dnv_exit()?
Andy Shevchenko Jan. 2, 2017, 10:44 a.m. UTC | #2
On Mon, 2017-01-02 at 12:40 +0200, Heikki Krogerus wrote:
> On Mon, Jan 02, 2017 at 11:23:42AM +0200, Andy Shevchenko wrote:
> > Enable MSI type of interrupt if PCI BIOS supports it.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/tty/serial/8250/8250_mid.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/tty/serial/8250/8250_mid.c
> > b/drivers/tty/serial/8250/8250_mid.c
> > index 6730d9eef81e..85011c9ac0ee 100644
> > --- a/drivers/tty/serial/8250/8250_mid.c
> > +++ b/drivers/tty/serial/8250/8250_mid.c
> > @@ -164,8 +164,14 @@ static int dnv_setup(struct mid8250 *mid,
> > struct uart_port *p)
> >  	unsigned int bar = FL_GET_BASE(mid->board->flags);
> >  	int ret;
> >  
> > +	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> > +	if (ret < 0)
> > +		return ret;
> 
> pci_free_irq_vectors() in dnv_exit()?

Seems everyone stumble over pcim_()* stuff. pcim_release() will take
care of this.
Heikki Krogerus Jan. 2, 2017, 10:52 a.m. UTC | #3
On Mon, Jan 02, 2017 at 12:44:47PM +0200, Andy Shevchenko wrote:
> On Mon, 2017-01-02 at 12:40 +0200, Heikki Krogerus wrote:
> > On Mon, Jan 02, 2017 at 11:23:42AM +0200, Andy Shevchenko wrote:
> > > Enable MSI type of interrupt if PCI BIOS supports it.
> > > 
> > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > > ---
> > >  drivers/tty/serial/8250/8250_mid.c | 8 +++++++-
> > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/tty/serial/8250/8250_mid.c
> > > b/drivers/tty/serial/8250/8250_mid.c
> > > index 6730d9eef81e..85011c9ac0ee 100644
> > > --- a/drivers/tty/serial/8250/8250_mid.c
> > > +++ b/drivers/tty/serial/8250/8250_mid.c
> > > @@ -164,8 +164,14 @@ static int dnv_setup(struct mid8250 *mid,
> > > struct uart_port *p)
> > >  	unsigned int bar = FL_GET_BASE(mid->board->flags);
> > >  	int ret;
> > >  
> > > +	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> > > +	if (ret < 0)
> > > +		return ret;
> > 
> > pci_free_irq_vectors() in dnv_exit()?
> 
> Seems everyone stumble over pcim_()* stuff. pcim_release() will take
> care of this.

OK. In that case, FWIW for the whole series:

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>


Thanks,
diff mbox

Patch

diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c
index 6730d9eef81e..85011c9ac0ee 100644
--- a/drivers/tty/serial/8250/8250_mid.c
+++ b/drivers/tty/serial/8250/8250_mid.c
@@ -164,8 +164,14 @@  static int dnv_setup(struct mid8250 *mid, struct uart_port *p)
 	unsigned int bar = FL_GET_BASE(mid->board->flags);
 	int ret;
 
+	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
+	if (ret < 0)
+		return ret;
+
+	p->irq = pci_irq_vector(pdev, 0);
+
 	chip->dev = &pdev->dev;
-	chip->irq = pdev->irq;
+	chip->irq = pci_irq_vector(pdev, 0);
 	chip->regs = p->membase;
 	chip->length = pci_resource_len(pdev, bar);
 	chip->offset = DNV_DMA_CHAN_OFFSET;