From patchwork Thu Feb 20 21:41:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Murray X-Patchwork-Id: 322362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B83DB2C031A for ; Fri, 21 Feb 2014 08:41:51 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752874AbaBTVlt (ORCPT ); Thu, 20 Feb 2014 16:41:49 -0500 Received: from mail-we0-f175.google.com ([74.125.82.175]:37121 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbaBTVls (ORCPT ); Thu, 20 Feb 2014 16:41:48 -0500 Received: by mail-we0-f175.google.com with SMTP id q59so1909960wes.6 for ; Thu, 20 Feb 2014 13:41:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=J0kUMKtJWdZRQwHiR6379hptZwdk57ZeMqbVlldm0bw=; b=cV4bLasUDndl5Zmtb3C4ohzpYBLhPRBZzd3784DCSKqkyoAYtrjFQnSJmTwnouyGaJ J6yVK25jbgYVL1L3c+HGDgLbxxcy/mTBD7quz8E29AL/3osPHxw1MSDJJ0p0+K/PJAhH QXE2lprEahspEdIkB8bo+2AuYxPCGxClBdRQqbtdXPe/itTQfYbOZsJUCuVlGO2skiVs kmWv19ULlQhoyXtnzJSFn7IwtxZRIjvrnTlUCmMaaOj4qtt6heC8/8jM2o9YyE2ycqu6 PkBvvQ79wIPX+imjXNt6legR0wd3vLgqRSZGxAmZSVC6F/hKqfvw0GFSwlSUSFMicJc6 brkA== X-Gm-Message-State: ALoCoQk9Ofo/8/1yik11AZbHfrkvYFXgI7pAI+kXHS7sAdfKZm3LuePEHfzay1DnYIwpASQR9Uyf X-Received: by 10.180.87.164 with SMTP id az4mr460254wib.2.1392932507434; Thu, 20 Feb 2014 13:41:47 -0800 (PST) Received: from localhost.localdomain (host-78-145-137-174.as13285.net. [78.145.137.174]) by mx.google.com with ESMTPSA id t6sm1903855wix.4.2014.02.20.13.41.45 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 13:41:46 -0800 (PST) From: Andrew Murray To: linux-pci@vger.kernel.org Cc: mohit.kumar@st.com, jg1.han@samsung.com, Andrew Murray Subject: [PATCH] PCI: designware: Remove unnecessary use of 'conf_lock' spinlock Date: Thu, 20 Feb 2014 21:41:34 +0000 Message-Id: <1392932494-21630-1-git-send-email-amurray@embedded-bits.co.uk> X-Mailer: git-send-email 1.8.3.2 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Serialization of configuration accesses is provided by 'pci_lock' in drivers/pci/access.c thus making the driver's 'conf_lock' superfluous. Signed-off-by: Andrew Murray --- drivers/pci/host/pci-exynos.c | 1 - drivers/pci/host/pci-imx6.c | 1 - drivers/pci/host/pcie-designware.c | 6 ------ drivers/pci/host/pcie-designware.h | 1 - 4 files changed, 9 deletions(-) diff --git a/drivers/pci/host/pci-exynos.c b/drivers/pci/host/pci-exynos.c index 3de6bfb..32c6d56 100644 --- a/drivers/pci/host/pci-exynos.c +++ b/drivers/pci/host/pci-exynos.c @@ -546,7 +546,6 @@ static int add_pcie_port(struct pcie_port *pp, struct platform_device *pdev) pp->root_bus_nr = -1; pp->ops = &exynos_pcie_host_ops; - spin_lock_init(&pp->conf_lock); ret = dw_pcie_host_init(pp); if (ret) { dev_err(&pdev->dev, "failed to initialize host\n"); diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index e8663a8..77588f1 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -480,7 +480,6 @@ static int imx6_add_pcie_port(struct pcie_port *pp, pp->root_bus_nr = -1; pp->ops = &imx6_pcie_host_ops; - spin_lock_init(&pp->conf_lock); ret = dw_pcie_host_init(pp); if (ret) { dev_err(&pdev->dev, "failed to initialize host\n"); diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c index 17ce88f..b25adb8 100644 --- a/drivers/pci/host/pcie-designware.c +++ b/drivers/pci/host/pcie-designware.c @@ -640,7 +640,6 @@ static int dw_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, int size, u32 *val) { struct pcie_port *pp = sys_to_pcie(bus->sysdata); - unsigned long flags; int ret; if (!pp) { @@ -653,13 +652,11 @@ static int dw_pcie_rd_conf(struct pci_bus *bus, u32 devfn, int where, return PCIBIOS_DEVICE_NOT_FOUND; } - spin_lock_irqsave(&pp->conf_lock, flags); if (bus->number != pp->root_bus_nr) ret = dw_pcie_rd_other_conf(pp, bus, devfn, where, size, val); else ret = dw_pcie_rd_own_conf(pp, where, size, val); - spin_unlock_irqrestore(&pp->conf_lock, flags); return ret; } @@ -668,7 +665,6 @@ static int dw_pcie_wr_conf(struct pci_bus *bus, u32 devfn, int where, int size, u32 val) { struct pcie_port *pp = sys_to_pcie(bus->sysdata); - unsigned long flags; int ret; if (!pp) { @@ -679,13 +675,11 @@ static int dw_pcie_wr_conf(struct pci_bus *bus, u32 devfn, if (dw_pcie_valid_config(pp, bus, PCI_SLOT(devfn)) == 0) return PCIBIOS_DEVICE_NOT_FOUND; - spin_lock_irqsave(&pp->conf_lock, flags); if (bus->number != pp->root_bus_nr) ret = dw_pcie_wr_other_conf(pp, bus, devfn, where, size, val); else ret = dw_pcie_wr_own_conf(pp, where, size, val); - spin_unlock_irqrestore(&pp->conf_lock, flags); return ret; } diff --git a/drivers/pci/host/pcie-designware.h b/drivers/pci/host/pcie-designware.h index 3063b35..a10747d 100644 --- a/drivers/pci/host/pcie-designware.h +++ b/drivers/pci/host/pcie-designware.h @@ -41,7 +41,6 @@ struct pcie_port { void __iomem *va_cfg1_base; u64 io_base; u64 mem_base; - spinlock_t conf_lock; struct resource cfg; struct resource io; struct resource mem;