- pmf_register_irq_client-gives-sleep-with-locks-held-warning.patch removed from -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  the -mm tree.  Its filename is

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

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
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-06-04 02:51:15.000000000 -0700
+++ devel-akpm/arch/powerpc/platforms/powermac/pfunc_core.c	2006-06-04 02:51:15.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

macintosh-mangle-caps-lock-events-on-adb-keyboards.patch
via-pmu-add-input-device.patch
fix-make-rpm-for-powerpc.patch
git-netdev-all.patch
powerpc-kbuild-warning-fix.patch
powerpc-vdso-updates.patch
work-around-ppc64-bootup-bug-by-making-mutex-debugging-save-restore-irqs.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-msi-fixes-2.patch
genirq-add-irq-chip-support-fix.patch
genirq-add-chip-eoi-fastack-fasteoi.patch
genirq-add-chip-eoi-fastack-fasteoi-fix.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