+ pmf_register_irq_client-gives-sleep-with-locks-held-warning.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     pmf_register_irq_client() gives sleep with locks held warning

has been added to the -mm tree.  Its filename is

     pmf_register_irq_client-gives-sleep-with-locks-held-warning.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: pmf_register_irq_client() gives sleep with locks held warning
From: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>


This fixes request_irq() potentially called from atomic context.

Signed-off-by: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 arch/powerpc/platforms/powermac/pfunc_core.c |   18 ++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff -puN arch/powerpc/platforms/powermac/pfunc_core.c~pmf_register_irq_client-gives-sleep-with-locks-held-warning arch/powerpc/platforms/powermac/pfunc_core.c
--- devel/arch/powerpc/platforms/powermac/pfunc_core.c~pmf_register_irq_client-gives-sleep-with-locks-held-warning	2006-05-31 21:46:55.000000000 -0700
+++ devel-akpm/arch/powerpc/platforms/powermac/pfunc_core.c	2006-05-31 21:46:55.000000000 -0700
@@ -11,6 +11,7 @@
 #include <linux/kernel.h>
 #include <linux/spinlock.h>
 #include <linux/module.h>
+#include <linux/mutex.h>
 
 #include <asm/semaphore.h>
 #include <asm/prom.h>
@@ -546,6 +547,7 @@ struct pmf_device {
 
 static LIST_HEAD(pmf_devices);
 static spinlock_t pmf_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_MUTEX(pmf_irq_mutex);
 
 static void pmf_release_device(struct kref *kref)
 {
@@ -864,15 +866,17 @@ int pmf_register_irq_client(struct devic
 
 	spin_lock_irqsave(&pmf_lock, flags);
 	func = __pmf_find_function(target, name, PMF_FLAGS_INT_GEN);
-	if (func == NULL) {
-		spin_unlock_irqrestore(&pmf_lock, flags);
+	if (func)
+		func = pmf_get_function(func);
+	spin_unlock_irqrestore(&pmf_lock, flags);
+	if (func == NULL)
 		return -ENODEV;
-	}
+	mutex_lock(&pmf_irq_mutex);
 	if (list_empty(&func->irq_clients))
 		func->dev->handlers->irq_enable(func);
 	list_add(&client->link, &func->irq_clients);
 	client->func = func;
-	spin_unlock_irqrestore(&pmf_lock, flags);
+	mutex_unlock(&pmf_irq_mutex);
 
 	return 0;
 }
@@ -881,16 +885,16 @@ EXPORT_SYMBOL_GPL(pmf_register_irq_clien
 void pmf_unregister_irq_client(struct pmf_irq_client *client)
 {
 	struct pmf_function *func = client->func;
-	unsigned long flags;
 
 	BUG_ON(func == NULL);
 
-	spin_lock_irqsave(&pmf_lock, flags);
+	mutex_lock(&pmf_irq_mutex);
 	client->func = NULL;
 	list_del(&client->link);
 	if (list_empty(&func->irq_clients))
 		func->dev->handlers->irq_disable(func);
-	spin_unlock_irqrestore(&pmf_lock, flags);
+	mutex_unlock(&pmf_irq_mutex);
+	pmf_put_function(func);
 }
 EXPORT_SYMBOL_GPL(pmf_unregister_irq_client);
 
_

Patches currently in -mm which might be from benh@xxxxxxxxxxxxxxxxxxx are

origin.patch
powerpc-fix-boot-on-emac.patch
macintosh-mangle-caps-lock-events-on-adb-keyboards.patch
via-pmu-add-input-device.patch
via-pmu-add-input-device-tidy.patch
input-powermac-cleanup-of-mac_hid-and-support-for-ctrlclick-and-commandclick.patch
input-powermac-cleanup-of-mac_hid-and-support-for-ctrlclick-and-commandclick-update.patch
git-netdev-all.patch
powerpc-kbuild-warning-fix.patch
pmf_register_irq_client-gives-sleep-with-locks-held-warning.patch
gregkh-usb-usb-serial-mos7720-powerpc-wrokaround.patch
add-poisonh-and-patch-primary-users.patch
x86-powerpc-make-hardirq_ctx-and-softirq_ctx-__read_mostly.patch
rewritten-backlight-infrastructure-for-portable-apple-computers.patch
rewritten-backlight-infrastructure-for-portable-apple-computers-fix.patch
apple-motion-sensor-driver.patch
radeonfb-powerdrain-issue-on-ibm-thinkpads-and-suspend-to-d2.patch
genirq-add-chip-eoi-fastack-fasteoi.patch
lock-validator-add-per_cpu_offset-fix.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux