diff mbox

[v2,3/3] serial: 8250_mid: set PCI master only for private DMA

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

Commit Message

Andy Shevchenko Jan. 10, 2017, 4:31 p.m. UTC
There is no need to set PCI bus mastering when device is not doing any DMA.
Though on Intel Denverton DMA is a part of UART IP and thus shares same device
in Linux kernel.

Enable bus mastering only for Denverton case.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/tty/serial/8250/8250_mid.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jan Kiszka Jan. 10, 2017, 4:40 p.m. UTC | #1
On 2017-01-10 17:31, Andy Shevchenko wrote:
> There is no need to set PCI bus mastering when device is not doing any DMA.
> Though on Intel Denverton DMA is a part of UART IP and thus shares same device
> in Linux kernel.
> 
> Enable bus mastering only for Denverton case.

This line looks ok, so does the code now, but subject and the first
paragraph are out of sync. If you update that, feel free to add my
reviewed-by.

Jan

> 
> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/tty/serial/8250/8250_mid.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c
> index 85011c9ac0ee..ec957cce8c9a 100644
> --- a/drivers/tty/serial/8250/8250_mid.c
> +++ b/drivers/tty/serial/8250/8250_mid.c
> @@ -164,6 +164,8 @@ static int dnv_setup(struct mid8250 *mid, struct uart_port *p)
>  	unsigned int bar = FL_GET_BASE(mid->board->flags);
>  	int ret;
>  
> +	pci_set_master(pdev);
> +
>  	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
>  	if (ret < 0)
>  		return ret;
> @@ -289,8 +291,6 @@ static int mid8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
>  	if (ret)
>  		return ret;
>  
> -	pci_set_master(pdev);
> -
>  	mid = devm_kzalloc(&pdev->dev, sizeof(*mid), GFP_KERNEL);
>  	if (!mid)
>  		return -ENOMEM;
>
Andy Shevchenko Jan. 10, 2017, 4:45 p.m. UTC | #2
On Tue, 2017-01-10 at 17:40 +0100, Jan Kiszka wrote:
> On 2017-01-10 17:31, Andy Shevchenko wrote:
> > There is no need to set PCI bus mastering when device is not doing
> > any DMA.
> > Though on Intel Denverton DMA is a part of UART IP and thus shares
> > same device
> > in Linux kernel.
> > 
> > Enable bus mastering only for Denverton case.
> 
> This line looks ok, so does the code now, but subject and the first
> paragraph are out of sync. If you update that, feel free to add my
> reviewed-by.

Thanks! I will wait a bit more for possible comments and resend v3.
diff mbox

Patch

diff --git a/drivers/tty/serial/8250/8250_mid.c b/drivers/tty/serial/8250/8250_mid.c
index 85011c9ac0ee..ec957cce8c9a 100644
--- a/drivers/tty/serial/8250/8250_mid.c
+++ b/drivers/tty/serial/8250/8250_mid.c
@@ -164,6 +164,8 @@  static int dnv_setup(struct mid8250 *mid, struct uart_port *p)
 	unsigned int bar = FL_GET_BASE(mid->board->flags);
 	int ret;
 
+	pci_set_master(pdev);
+
 	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
 	if (ret < 0)
 		return ret;
@@ -289,8 +291,6 @@  static int mid8250_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 	if (ret)
 		return ret;
 
-	pci_set_master(pdev);
-
 	mid = devm_kzalloc(&pdev->dev, sizeof(*mid), GFP_KERNEL);
 	if (!mid)
 		return -ENOMEM;