Skip to contentSkip to conversation

pcmcia/cs.c and SS_CAP_STATIC_MAP

PATCH New David Brownell 1 participant 1 message May 28, 2005 Pcmcia

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcmcia/cs.c and SS_CAP_STATIC_MAP

I traced a puzzling bug down to the combination of SS_CAP_STATIC_MAP, finicky hardware, and a bug fixed by the following patch. The fix is a one-liner that won't affect any socket driver that's yet merged; basically, it stops discarding I/O attributes for static mappings.

- Dave

The PCMCIA card services layer is never setting the i/o map attributes when SS_CAP_STATIC_MAP is specified. Net result, sockets' set_io_map() calls always see requests with most flags clear, meaning 8 bit access.

For hardware that always autosizes, that won't matter; and all current STATIC_MAP drivers ignore those attributes. A new driver (for at91rm9200) suffers badly from this, since this forces everything into 8 bit mode and that breaks both (a) cards requiring 16 bit access, and (b) ide-cs; but of course 8-bit cards work OK (as does accessing card attributes).

So this patch arranges to pass the attributes down, matching the behavior for non-static mappings (using the first/only I/O window).

drivers/pcmcia/cs.c +1 -0
@@ -767,6 +767,7 @@
     }
     if ((s->features & SS_CAP_STATIC_MAP) && s->io_offset) {
 	*base = s->io_offset | (*base & 0x0fff);
+	s->io[0].Attributes = attr;
 	return 0;
     }
     /* Check for an already-allocated window that must conflict with