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: 5252541 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E1B829F387 for ; Fri, 7 Nov 2014 13:28:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EEF0E20149 for ; Fri, 7 Nov 2014 13:28:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 16E3820173 for ; Fri, 7 Nov 2014 13:28:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752826AbaKGN2W (ORCPT ); Fri, 7 Nov 2014 08:28:22 -0500 Received: from mail-wg0-f53.google.com ([74.125.82.53]:45741 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbaKGN2R (ORCPT ); Fri, 7 Nov 2014 08:28:17 -0500 Received: by mail-wg0-f53.google.com with SMTP id b13so3722896wgh.12 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=Ar6eZtNMJWjmDqX+enBjng74+0XppN3CY9tNE5PIQ32xwjXr/19ApHcoRatIaQ82y7 1LjBeT14ItAOiUEzs9vR6tMhfzJT6bqUb5E6wytl4mess9eyykVw6Xb0wiTe4SfyxEW3 /ibrsP+fu/MM58v18ATVe9sq55sd6I20muCykGuNQoTu1j5oCSV+UwcV44Mef/NZHJv6 LS2f3vgH3g+5q7ay6nAJci5eE/CFIUKsb9kYoHPMOT1b0hgL12jr1NHf894RVgE1XOZk WhbL39K8jwUCv7vFSqEmhn/CsmhLEOnsSA+WRE0ScDU22zPN+mlwrrWm3IH6pkPXgSOT 5e7A== X-Gm-Message-State: ALoCoQm8WmmxaCL+NbheYY22CqJqdOksUwCSQ0c/DyFX9I0zT8YtUZc2hb23/dKSIM1w/i1HAOxk 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, linaro-acpi@lists.linaro.org, Tomasz Nowicki 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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; }