]> git.dujemihanovic.xyz Git - linux.git/commitdiff
serial: 8250_mid: set PCI master only for DMA capable device
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 11 Jan 2017 14:31:37 +0000 (16:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jan 2017 13:20:23 +0000 (14:20 +0100)
There is no need to set PCI bus mastering when device is not doing any DMA. It
includes MSI type of interrupts. Currently only UART on Denverton, which is DMA
capable, might have MSI enabled.

Taking above into account enable bus mastering for Denverton case only.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Reviewed-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_mid.c

index 85011c9ac0ee2263f2842c93034116cfe9f3287d..ec957cce8c9a72662d838edf3b915e50b4524da4 100644 (file)
@@ -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;