From patchwork Fri Nov 7 13:27:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Nowicki X-Patchwork-Id: 5252661 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 91EC8C11AC for ; Fri, 7 Nov 2014 13:32:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5A8E20107 for ; Fri, 7 Nov 2014 13:32:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2F21200F3 for ; Fri, 7 Nov 2014 13:32:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XmjcO-0005G0-6H; Fri, 07 Nov 2014 13:30:24 +0000 Received: from mail-wi0-f182.google.com ([209.85.212.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Xmjaj-0003kQ-5D for linux-arm-kernel@lists.infradead.org; Fri, 07 Nov 2014 13:28:42 +0000 Received: by mail-wi0-f182.google.com with SMTP id d1so4537639wiv.9 for ; Fri, 07 Nov 2014 05:28:16 -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:in-reply-to :references; bh=AuBb9gU1Sd7jryHwmspi0Y62fGlJ+kM2Gat7Yzi0rHs=; b=VzBAL+8E1cVGgoDEEJFgTsc4RolIZogExUkXXv8OmfMugxst+LWBVv8y55cft4ShS3 eMHyvFvL1J2aPAGW0j09HMksccLx/wV0qdwIrPeVH+XQU5K20wkfPZ4blqb2LxLhxEmz xAx2d1kPawBJqlILrAwV04hWSMpmm8mJnc9sYsxZ6HYjo1M5Ms63uVeO2ZaUwmdm6BIr dRba9JPdqCeU2QYo+pO2CglCKv9Kcoa3s2QUJiGRN543xZqExNMsrXyboFw5KRs80IBx qbRhVeX+UT+VGgdQqGF6/eVtR2m07VKy8abSaMeCwCYF35b/MV7dn9BI8LW8rU9chsUn VDvg== X-Gm-Message-State: ALoCoQnFl7m1KACBAZYYJU5DmOJKfzatOi7RhV5jTulk0rMLH79m78flkCk0n9Oc9BUQDJlbzA/h X-Received: by 10.180.82.170 with SMTP id j10mr5107028wiy.35.1415366896121; Fri, 07 Nov 2014 05:28:16 -0800 (PST) Received: from tn-HP-4.semihalf.com ([80.82.22.190]) by mx.google.com with ESMTPSA id ce1sm11833490wjc.2.2014.11.07.05.28.14 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 07 Nov 2014 05:28:15 -0800 (PST) From: Tomasz Nowicki To: catalin.marinas@arm.com, will.deacon@arm.com, bhelgaas@google.com, Liviu.Dudau@arm.com, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, rjw@rjwysocki.net Subject: [RFC PATCH 2/4] x86, acpi, pci: Isolate new PCI mmconfig entry insertion. Date: Fri, 7 Nov 2014 14:27:54 +0100 Message-Id: <1415366876-30811-3-git-send-email-tomasz.nowicki@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415366876-30811-1-git-send-email-tomasz.nowicki@linaro.org> References: <1415366876-30811-1-git-send-email-tomasz.nowicki@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141107_052841_385263_5E7E883C X-CRM114-Status: GOOD ( 10.44 ) X-Spam-Score: -0.7 (/) Cc: linaro-acpi@lists.linaro.org, linux-pci@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, Tomasz Nowicki , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add special pci_mmcfg_insert_lock mutex since pci_mmcfg_lock was moved to common file. No functional changes. Signed-off-by: Tomasz Nowicki --- arch/x86/pci/mmconfig-shared.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 94c3d38..d1e45e7 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig-shared.c @@ -28,6 +28,7 @@ /* Indicate if the mmcfg resources have been placed into the resource table. */ static bool pci_mmcfg_running_state; static bool pci_mmcfg_arch_init_failed; +static DEFINE_MUTEX(pci_mmcfg_insert_lock); static const char *__init pci_mmcfg_e7520(void) { @@ -566,7 +567,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, if (start > end) return -EINVAL; - mutex_lock(&pci_mmcfg_lock); + mutex_lock(&pci_mmcfg_insert_lock); cfg = pci_mmconfig_lookup(seg, start); if (cfg) { if (cfg->end_bus < end) @@ -575,12 +576,12 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, "domain %04x [bus %02x-%02x] " "only partially covers this bridge\n", cfg->segment, cfg->start_bus, cfg->end_bus); - mutex_unlock(&pci_mmcfg_lock); + mutex_unlock(&pci_mmcfg_insert_lock); return -EEXIST; } if (!addr) { - mutex_unlock(&pci_mmcfg_lock); + mutex_unlock(&pci_mmcfg_insert_lock); return -EINVAL; } @@ -621,7 +622,7 @@ int pci_mmconfig_insert(struct device *dev, u16 seg, u8 start, u8 end, kfree(cfg); } - mutex_unlock(&pci_mmcfg_lock); + mutex_unlock(&pci_mmcfg_insert_lock); return rc; }