linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tomasz Nowicki <tomasz.nowicki@linaro.org>
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 <tomasz.nowicki@linaro.org>
Subject: [RFC PATCH 2/4] x86, acpi, pci: Isolate new PCI mmconfig entry insertion.
Date: Fri,  7 Nov 2014 14:27:54 +0100	[thread overview]
Message-ID: <1415366876-30811-3-git-send-email-tomasz.nowicki@linaro.org> (raw)
In-Reply-To: <1415366876-30811-1-git-send-email-tomasz.nowicki@linaro.org>

Add special pci_mmcfg_insert_lock mutex since pci_mmcfg_lock was moved
to common file. No functional changes.

Signed-off-by: Tomasz Nowicki <tomasz.nowicki@linaro.org>
---
 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;
 }
-- 
1.9.1


  parent reply	other threads:[~2014-11-07 13:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07 13:27 [RFC PATCH 0/4] MMCFG refactoring + PCI ACPI probing for ARM64 Tomasz Nowicki
2014-11-07 13:27 ` [RFC PATCH 1/4] x86, acpi, pci: Move arch-agnostic MMCFG code out of arch/x86/ directory Tomasz Nowicki
2014-11-07 13:27 ` Tomasz Nowicki [this message]
2014-11-07 14:09   ` [RFC PATCH 2/4] x86, acpi, pci: Isolate new PCI mmconfig entry insertion Arnd Bergmann
2014-11-07 14:43     ` Tomasz Nowicki
2014-11-07 13:27 ` [RFC PATCH 3/4] arm64, acpi, pci: Add arch specific functions for mmconfig driver Tomasz Nowicki
2014-11-07 14:12   ` [Linaro-acpi] " Arnd Bergmann
2014-11-07 14:39     ` Tomasz Nowicki
2014-11-07 14:54       ` Arnd Bergmann
2014-11-07 13:27 ` [RFC PATCH 4/4] arm64, acpi, pci: Provide arch-specific calls for PCI host bridge dirver (PNP0A03) Tomasz Nowicki
2014-11-07 14:24   ` Arnd Bergmann
2014-11-14 14:10     ` Tomasz Nowicki
2014-11-14 14:53       ` [Linaro-acpi] " Arnd Bergmann
2014-11-18 10:17         ` Tomasz Nowicki
2014-11-18 10:35           ` Arnd Bergmann
2014-11-07 14:55   ` Liviu Dudau
2014-11-12  8:47     ` Tomasz Nowicki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415366876-30811-3-git-send-email-tomasz.nowicki@linaro.org \
    --to=tomasz.nowicki@linaro.org \
    --cc=Liviu.Dudau@arm.com \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=hpa@zytor.com \
    --cc=linaro-acpi@lists.linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rjw@rjwysocki.net \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).