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: 5252581 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@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 1BCF8C11AC for ; Fri, 7 Nov 2014 13:28:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 31ED12015E for ; Fri, 7 Nov 2014 13:28:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5720720154 for ; Fri, 7 Nov 2014 13:28:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752621AbaKGN2U (ORCPT ); Fri, 7 Nov 2014 08:28:20 -0500 Received: from mail-wi0-f169.google.com ([209.85.212.169]:41895 "EHLO mail-wi0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987AbaKGN2R (ORCPT ); Fri, 7 Nov 2014 08:28:17 -0500 Received: by mail-wi0-f169.google.com with SMTP id n3so4377045wiv.2 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=DGewcT2ZHPhk1j9v0qopOq7MKpHx6o/wVfHH5DHpN+4iTa5rKyuIxJ37AEH+wvjSX5 NRMMUBQdALCGqJDFXcmyTdyqYTp3CxIxpuPTOI4wh+f4lAD5do4BsOcEdbPYKw26ilL8 rJau7MnECO6GYID5tIEP/jbKoV+/jX4GDgkUSIxVAysRdUU1Eo04cOCS+jmYrGg6gAay /Gys9dCzuFh1kLk/2V12hVvVAyDpdITnXErtsjITUlSzNl/eWBMPGU0BjEeHiyAUYRuE mRO2Kmdck27kCJoPM1seiVqDkxWd4AwViVaVEQJ6t6EbvcesybZJJsLn2Q8o7MJMRJEi EVYQ== X-Gm-Message-State: ALoCoQncnfZuaem/AmN89Ks0a7mAPLQ0I4WZFIHLTNnlMn8fh5ldXQZ6hAYHFErkhBhfOGX4HS8i 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-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@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; }