mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Remove unneded lock_kernel() in drivers/pci/syscall.c.
@ 2007-11-03 23:19 Diego Woitasen
  0 siblings, 0 replies; only message in thread
From: Diego Woitasen @ 2007-11-03 23:19 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-pci, Diego Woitasen

sys_pciconfig_{read,write}() are protected against PCI removal with the reference count in struct pci_dev. The concurrency of pci_user_{read,write}_config_* functions are already protected by pci_lock in drivers/pci/access.c.

Signed-off-by: Diego Woitasen <diego@woitasen.com.ar>
---
 drivers/pci/syscall.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/pci/syscall.c b/drivers/pci/syscall.c
index 2ac050d..645d7a6 100644
--- a/drivers/pci/syscall.c
+++ b/drivers/pci/syscall.c
@@ -34,7 +34,6 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
 	if (!dev)
 		goto error;
 
-	lock_kernel();
 	switch (len) {
 	case 1:
 		cfg_ret = pci_user_read_config_byte(dev, off, &byte);
@@ -47,10 +46,8 @@ sys_pciconfig_read(unsigned long bus, unsigned long dfn,
 		break;
 	default:
 		err = -EINVAL;
-		unlock_kernel();
 		goto error;
 	};
-	unlock_kernel();
 
 	err = -EIO;
 	if (cfg_ret != PCIBIOS_SUCCESSFUL)
@@ -107,7 +104,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
 	if (!dev)
 		return -ENODEV;
 
-	lock_kernel();
 	switch(len) {
 	case 1:
 		err = get_user(byte, (u8 __user *)buf);
@@ -140,7 +136,6 @@ sys_pciconfig_write(unsigned long bus, unsigned long dfn,
 		err = -EINVAL;
 		break;
 	}
-	unlock_kernel();
 	pci_dev_put(dev);
 	return err;
 }
-- 
1.5.2.4


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-11-03 23:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-03 23:19 [PATCH] Remove unneded lock_kernel() in drivers/pci/syscall.c Diego Woitasen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®