lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1404200488-7809-1-git-send-email-Wei.Yang@windriver.com>
Date:	Tue, 1 Jul 2014 15:41:28 +0800
From:	<Wei.Yang@...driver.com>
To:	<mroberto@...i.cetuc.puc-rio.br>, <rmk+kernel@....linux.org.uk>
CC:	<linux-kernel@...r.kernel.org>,
	<linux-arm-kernel@...ts.infradead.org>, <wei.yang@...driver.com>
Subject: [PATCH v1] ARM:sa1100: Remove a redundant spin lock

From: Yang Wei <Wei.Yang@...driver.com>

The pair read/write of accessing pci confiuration space function
has already protected by pci_lock. so remove nano_lock.

Signed-off-by: Yang Wei <Wei.Yang@...driver.com>
---
 arch/arm/mach-sa1100/pci-nanoengine.c |    9 ---------
 1 file changed, 9 deletions(-)

diff --git a/arch/arm/mach-sa1100/pci-nanoengine.c b/arch/arm/mach-sa1100/pci-nanoengine.c
index ff02e2d..b944c99 100644
--- a/arch/arm/mach-sa1100/pci-nanoengine.c
+++ b/arch/arm/mach-sa1100/pci-nanoengine.c
@@ -30,7 +30,6 @@
 #include <mach/nanoengine.h>
 #include <mach/hardware.h>
 
-static DEFINE_SPINLOCK(nano_lock);
 
 static int nanoengine_get_pci_address(struct pci_bus *bus,
 	unsigned int devfn, int where, unsigned long *address)
@@ -52,7 +51,6 @@ static int nanoengine_read_config(struct pci_bus *bus, unsigned int devfn, int w
 {
 	int ret;
 	unsigned long address;
-	unsigned long flags;
 	u32 v;
 
 	/* nanoEngine PCI bridge does not return -1 for a non-existing
@@ -64,15 +62,12 @@ static int nanoengine_read_config(struct pci_bus *bus, unsigned int devfn, int w
 		goto exit_function;
 	}
 
-	spin_lock_irqsave(&nano_lock, flags);
 
 	ret = nanoengine_get_pci_address(bus, devfn, where, &address);
 	if (ret != PCIBIOS_SUCCESSFUL)
 		return ret;
 	v = __raw_readl(address);
 
-	spin_unlock_irqrestore(&nano_lock, flags);
-
 	v >>= ((where & 3) * 8);
 	v &= (unsigned long)(-1) >> ((4 - size) * 8);
 
@@ -86,13 +81,11 @@ static int nanoengine_write_config(struct pci_bus *bus, unsigned int devfn, int
 {
 	int ret;
 	unsigned long address;
-	unsigned long flags;
 	unsigned shift;
 	u32 v;
 
 	shift = (where & 3) * 8;
 
-	spin_lock_irqsave(&nano_lock, flags);
 
 	ret = nanoengine_get_pci_address(bus, devfn, where, &address);
 	if (ret != PCIBIOS_SUCCESSFUL)
@@ -113,8 +106,6 @@ static int nanoengine_write_config(struct pci_bus *bus, unsigned int devfn, int
 	}
 	__raw_writel(v, address);
 
-	spin_unlock_irqrestore(&nano_lock, flags);
-
 	return PCIBIOS_SUCCESSFUL;
 }
 
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ