[PATCH 11/18] pcmcia: do not use io_req_t when calling pcmcia_request_io()

Dominik Brodowski linux at dominikbrodowski.net
Sat Sep 18 04:23:21 EDT 2010


Hey,

On Sat, Sep 18, 2010 at 11:48:32AM +0900, Komuro wrote:
> Attached file is dmesg of another multi-function card(fmvj18x_cs)

Thanks for the debug output -- this helps a lot!

> This card works with 2.6.35
> but does not work with 2.6.36rc3(+patch).

does this patch help (at least with the network function?)?

Best,
	Dominik


commit 9e7d4841d766f96a4e28a51c434485695d6a60ca
Author: Dominik Brodowski <linux at dominikbrodowski.net>
Date:   Sat Sep 18 10:19:13 2010 +0200

    pcmcia: preserve configuration information if request_io fails partly
    
    If pcmcia_request_io() only fails partly -- for the second of two
    requested resources -- preserve the configuration settings for the
    first one.
    
    Signed-off-by: Dominik Brodowski <linux at dominikbrodowski.net>

diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index a5c1765..9ba4dad 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -595,7 +595,13 @@ int pcmcia_request_io(struct pcmcia_device *p_dev)
 	if (c->io[1].end) {
 		ret = alloc_io_space(s, &c->io[1], p_dev->io_lines);
 		if (ret) {
+			struct resource tmp = c->io[0];
+			/* release the previously allocated resource */
 			release_io_space(s, &c->io[0]);
+			/* but preserve the settings, for they worked... */
+			c->io[0].end = resource_size(&tmp);
+			c->io[0].start = tmp.start;
+			c->io[0].flags = tmp.flags;
 			goto out;
 		}
 	} else



More information about the linux-pcmcia mailing list