* [PATCH] ssb-pcmcia: Fix 32bit register access in early bus scanning
@ 2009-11-06 20:21 Michael Buesch
0 siblings, 0 replies; only message in thread
From: Michael Buesch @ 2009-11-06 20:21 UTC (permalink / raw)
To: John W. Linville; +Cc: Martin Fuzzey, Broadcom Wireless, linux-wireless
From: Martin Fuzzey <mfuzzey@gmail.com>
The scan function was using 32 bit access which does not
work on 16bit CF cards.
This patch corrects this by doing two 16 bit reads like
ssb_pcmcia_read32 already does.
mb -- Removed locking. That early in init there's no need for locking.
Signed-off-by: Martin Fuzzey <mfuzzey@gmail.com>
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
Index: wireless-testing/drivers/ssb/scan.c
===================================================================
--- wireless-testing.orig/drivers/ssb/scan.c 2009-10-09 19:50:16.000000000 +0200
+++ wireless-testing/drivers/ssb/scan.c 2009-11-06 19:24:13.000000000 +0100
@@ -162,6 +162,8 @@ static u8 chipid_to_nrcores(u16 chipid)
static u32 scan_read32(struct ssb_bus *bus, u8 current_coreidx,
u16 offset)
{
+ u32 lo, hi;
+
switch (bus->bustype) {
case SSB_BUSTYPE_SSB:
offset += current_coreidx * SSB_CORE_SIZE;
@@ -174,7 +176,9 @@ static u32 scan_read32(struct ssb_bus *b
offset -= 0x800;
} else
ssb_pcmcia_switch_segment(bus, 0);
- break;
+ lo = readw(bus->mmio + offset);
+ hi = readw(bus->mmio + offset + 2);
+ return lo | (hi << 16);
case SSB_BUSTYPE_SDIO:
offset += current_coreidx * SSB_CORE_SIZE;
return ssb_sdio_scan_read32(bus, offset);
--
Greetings, Michael.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-11-06 20:22 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-06 20:21 [PATCH] ssb-pcmcia: Fix 32bit register access in early bus scanning Michael Buesch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).