Linux Serial subsystem development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Felipe Balbi <felipe.balbi@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH] serial: 8250_lpss: Switch over to MSI interrupts
Date: Tue, 1 Oct 2019 11:59:40 +0300	[thread overview]
Message-ID: <20191001085940.GE32742@smile.fi.intel.com> (raw)
In-Reply-To: <20191001081617.766084-1-felipe.balbi@linux.intel.com>

On Tue, Oct 01, 2019 at 11:16:17AM +0300, Felipe Balbi wrote:
> Some devices support MSI interrupts. Let's at least try to use them in
> platforms that provide MSI capability.

Thanks for the patch!

I think you may clean up qrk_serial_setup() as well.

> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
> ---
>  drivers/tty/serial/8250/8250_lpss.c | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
> index 5f72ef3ea574..f0f7a2777557 100644
> --- a/drivers/tty/serial/8250/8250_lpss.c
> +++ b/drivers/tty/serial/8250/8250_lpss.c
> @@ -293,16 +293,22 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	if (ret)
>  		return ret;
>  
> +	pci_set_master(pdev);
> +
>  	lpss = devm_kzalloc(&pdev->dev, sizeof(*lpss), GFP_KERNEL);
>  	if (!lpss)
>  		return -ENOMEM;
>  
> +	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> +	if (ret < 0)
> +		return ret;
> +
>  	lpss->board = (struct lpss8250_board *)id->driver_data;
>  
>  	memset(&uart, 0, sizeof(struct uart_8250_port));
>  
>  	uart.port.dev = &pdev->dev;
> -	uart.port.irq = pdev->irq;
> +	uart.port.irq = pci_irq_vector(pdev, 0);
>  	uart.port.private_data = &lpss->data;
>  	uart.port.type = PORT_16550A;
>  	uart.port.iotype = UPIO_MEM;
> @@ -337,6 +343,7 @@ static int lpss8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  err_exit:
>  	if (lpss->board->exit)
>  		lpss->board->exit(lpss);
> +	pci_free_irq_vectors(pdev);
>  	return ret;
>  }
>  
> @@ -348,6 +355,7 @@ static void lpss8250_remove(struct pci_dev *pdev)
>  
>  	if (lpss->board->exit)
>  		lpss->board->exit(lpss);
> +	pci_free_irq_vectors(pdev);
>  }
>  
>  static const struct lpss8250_board byt_board = {
> -- 
> 2.23.0
> 

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2019-10-01  8:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-01  8:16 [PATCH] serial: 8250_lpss: Switch over to MSI interrupts Felipe Balbi
2019-10-01  8:59 ` Andy Shevchenko [this message]
2019-10-01  9:35   ` Felipe Balbi
2019-10-01 11:09     ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191001085940.GE32742@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=felipe.balbi@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox