Re: PATCH] net: b44.c fix sleeping-with-spinlock-helt during resume

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Michael Buesch
Date: Sunday, June 1, 2008 - 3:03 am

On Sunday 01 June 2008 05:11:30 Arjan van de Ven wrote:

I'm not sure how this is supposed to fix the bug.
I think you will call ssb_pcicore_dev_irqvecs_enable() twice this way.
The call in b44_chip_reset() will still trigger.

Besides that, this only is a theoretical issue, as the function does
only sleep on a PCI-E device. But as b44 PCI-E devices don't exist,
it will never sleep. So I'd rather replace the might_sleep() with a
might_sleep_if() call.
Something like the following:

Index: wireless-testing/drivers/ssb/driver_pcicore.c
===================================================================
--- wireless-testing.orig/drivers/ssb/driver_pcicore.c	2008-04-23 16:06:56.000000000 +0200
+++ wireless-testing/drivers/ssb/driver_pcicore.c	2008-06-01 12:02:33.000000000 +0200
@@ -537,12 +537,12 @@ int ssb_pcicore_dev_irqvecs_enable(struc
 	int err = 0;
 	u32 tmp;
 
-	might_sleep();
-
 	if (!pdev)
 		goto out;
 	bus = pdev->bus;
 
+	might_sleep_if(pdev->id.coreid != SSB_DEV_PCI);
+
 	/* Enable interrupts for this device. */
 	if (bus->host_pci &&
 	    ((pdev->id.revision >= 6) || (pdev->id.coreid == SSB_DEV_PCIE))) {



-- 
Greetings Michael.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: PATCH] net: b44.c fix sleeping-with-spinlock-helt duri ..., Michael Buesch, (Sun Jun 1, 3:03 am)