[RFC] PCMCIA locking updates for 2.6.34

Dominik Brodowski linux at dominikbrodowski.net
Sat Jan 16 15:40:04 EST 2010


Hey Wolfram,

On Sat, Jan 16, 2010 at 08:41:21PM +0100, Wolfram Sang wrote:
> On Sat, Jan 16, 2010 at 01:41:43PM +0100, Dominik Brodowski wrote:
> 
> > 
> > on top of what had already been discussed for 2.6.34, here are 12 patches
> > trying to fix the locking mess the PCMCIA subsystem used to be. As a
> > side-effect, the PCMCIA ioctl will be disabled for all except the ARM
> > architecture, and even there you need !SMP and !PREEMPT. Hopefully, we'll be
> > able to remove the ioctl from ARM too.
> > 
> > Everything is available in the git repository at:
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git#locking
> 
> I pulled and tested this branch. Sadly, it doesn't work for me. If I insert a
> (previously working) network card, io-resources get allocated, but the driver
> does not even print its success-string. Luckily, I had hung-task detection
> enabled:

Thanks for testing -- might it be the following one-liner?

> A deadlock? At this stage, the pcmcia-host is stuck. Card removal is detected,
> but the resources don't get freed. Let me know if I can provide more info or
> can do more testing.

If it doesn't help, could you enable lockdep, please, and check with

"echo d > /proc/sysrq-trigger"

which lock is held where by which task?

Best,
	Dominik

From: Dominik Brodowski <linux at dominikbrodowski.net>
Date: Sat, 16 Jan 2010 21:19:57 +0100
Subject: [PATCH] pcmcia: fix pcmcia_request_io locking

Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index 052b6ca..44cb7fa 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -689,9 +689,10 @@ int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req)
 	c->io = *req;
 	c->state |= CONFIG_IO_REQ;
 	p_dev->_io = 1;
-	mutex_unlock(&s->ops_mutex);
 
 out:
+	mutex_unlock(&s->ops_mutex);
+
 	return ret;
 } /* pcmcia_request_io */
 EXPORT_SYMBOL(pcmcia_request_io);



More information about the linux-pcmcia mailing list