diff mbox

[v10,10/11] serial: 8250_lpss: enable MSI for Intel Quark

Message ID 1471017716-44893-11-git-send-email-andriy.shevchenko@linux.intel.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Andy Shevchenko Aug. 12, 2016, 4:01 p.m. UTC
Intel Quark SoC supports MSI for LPSS, in particular for UART. Enable MSI for
Intel Quark.

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

Comments

Bryan O'Donoghue Aug. 15, 2016, 9:04 a.m. UTC | #1
On Fri, 2016-08-12 at 19:01 +0300, Andy Shevchenko wrote:
> Intel Quark SoC supports MSI for LPSS, in particular for UART. Enable
> MSI for
> Intel Quark.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/tty/serial/8250/8250_lpss.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/tty/serial/8250/8250_lpss.c
> b/drivers/tty/serial/8250/8250_lpss.c
> index cad96ee..5ac291c 100644
> --- a/drivers/tty/serial/8250/8250_lpss.c
> +++ b/drivers/tty/serial/8250/8250_lpss.c
> @@ -151,6 +151,17 @@ static int byt_serial_setup(struct lpss8250
> *lpss, struct uart_port *port)
>  	return 0;
>  }
>  
> +static int qrk_serial_setup(struct lpss8250 *lpss, struct uart_port
> *port)
> +{
> +	struct pci_dev *pdev = to_pci_dev(port->dev);
> +
> +	pci_enable_msi(pdev);
> 

Andy,

ret = pci_enable_msi(dev);
if (ret)
    return ret;

once added please add

Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Andy Shevchenko Aug. 15, 2016, 9:35 a.m. UTC | #2
On Mon, 2016-08-15 at 10:04 +0100, Bryan O'Donoghue wrote:
> On Fri, 2016-08-12 at 19:01 +0300, Andy Shevchenko wrote:
> > 
> > Intel Quark SoC supports MSI for LPSS, in particular for UART.
> > Enable
> > MSI for
> > Intel Quark.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >  drivers/tty/serial/8250/8250_lpss.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/drivers/tty/serial/8250/8250_lpss.c
> > b/drivers/tty/serial/8250/8250_lpss.c
> > index cad96ee..5ac291c 100644
> > --- a/drivers/tty/serial/8250/8250_lpss.c
> > +++ b/drivers/tty/serial/8250/8250_lpss.c
> > @@ -151,6 +151,17 @@ static int byt_serial_setup(struct lpss8250
> > *lpss, struct uart_port *port)
> >  	return 0;
> >  }
> >  
> > +static int qrk_serial_setup(struct lpss8250 *lpss, struct uart_port
> > *port)
> > +{
> > +	struct pci_dev *pdev = to_pci_dev(port->dev);
> > +
> > +	pci_enable_msi(pdev);
> > 
> 
> Andy,
> 
> ret = pci_enable_msi(dev);
> if (ret)
>     return ret;
> 
> once added please add

Why? MSI is optional. If we can't do that we just fall back to standard
IRQ signaling.

Okay, since recent APIs [1] I should use another call actually, i.e.
pci_alloc_irq_vectors().

[1] Documentation/PCI/MSI-HOWTO.txt

> 
> Reviewed-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
diff mbox

Patch

diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
index cad96ee..5ac291c 100644
--- a/drivers/tty/serial/8250/8250_lpss.c
+++ b/drivers/tty/serial/8250/8250_lpss.c
@@ -151,6 +151,17 @@  static int byt_serial_setup(struct lpss8250 *lpss, struct uart_port *port)
 	return 0;
 }
 
+static int qrk_serial_setup(struct lpss8250 *lpss, struct uart_port *port)
+{
+	struct pci_dev *pdev = to_pci_dev(port->dev);
+
+	pci_enable_msi(pdev);
+
+	port->irq = pdev->irq;
+
+	return 0;
+}
+
 static bool lpss8250_dma_filter(struct dma_chan *chan, void *param)
 {
 	struct dw_dma_slave *dws = param;
@@ -261,6 +272,7 @@  static const struct lpss8250_board byt_board = {
 static const struct lpss8250_board qrk_board = {
 	.freq = 44236800,
 	.base_baud = 2764800,
+	.setup = qrk_serial_setup,
 };
 
 #define LPSS_DEVICE(id, board) { PCI_VDEVICE(INTEL, id), (kernel_ulong_t)&board }