From patchwork Mon Jan 2 09:23:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 9493239 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DC08460414 for ; Mon, 2 Jan 2017 09:23:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDBDA205AB for ; Mon, 2 Jan 2017 09:23:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C25AD25D9E; Mon, 2 Jan 2017 09:23:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 43E03205AB for ; Mon, 2 Jan 2017 09:23:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755400AbdABJXs (ORCPT ); Mon, 2 Jan 2017 04:23:48 -0500 Received: from mga03.intel.com ([134.134.136.65]:16277 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755156AbdABJXr (ORCPT ); Mon, 2 Jan 2017 04:23:47 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP; 02 Jan 2017 01:23:46 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,432,1477983600"; d="scan'208";a="1078319043" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 02 Jan 2017 01:23:45 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 66180F8; Mon, 2 Jan 2017 11:23:44 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , linux-serial@vger.kernel.org, Vinod Koul , dmaengine@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v1 3/3] serial: 8250_mid: set PCI master only for private DMA Date: Mon, 2 Jan 2017 11:23:43 +0200 Message-Id: <20170102092343.87106-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170102092343.87106-1-andriy.shevchenko@linux.intel.com> References: <20170102092343.87106-1-andriy.shevchenko@linux.intel.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Andy Shevchenko --- 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..5fee143f6578 100644 --- a/drivers/tty/serial/8250/8250_mid.c +++ b/drivers/tty/serial/8250/8250_mid.c @@ -181,6 +181,8 @@ static int dnv_setup(struct mid8250 *mid, struct uart_port *p) if (ret) return 0; + pci_set_master(pdev); + mid->dma_dev = pdev; p->handle_irq = dnv_handle_irq; @@ -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;