Commit c8751e4c authored by Daniel Ritz's avatar Daniel Ritz Committed by Linus Torvalds

[PATCH] pcmcia/yenta: avoid PCI write posting problem

extend cb_writel(), exca_writeb(), exca_writel() to do a read[lb]() after
the write[lb]() to avoid possible problem with PCI write posting.

Seems to fix Bug #5061.
Signed-off-by: default avatarDaniel Ritz <daniel.ritz@gmx.ch>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c181e0e0
...@@ -72,6 +72,7 @@ static inline void cb_writel(struct yenta_socket *socket, unsigned reg, u32 val) ...@@ -72,6 +72,7 @@ static inline void cb_writel(struct yenta_socket *socket, unsigned reg, u32 val)
{ {
debug("%p %04x %08x\n", socket, reg, val); debug("%p %04x %08x\n", socket, reg, val);
writel(val, socket->base + reg); writel(val, socket->base + reg);
readl(socket->base + reg); /* avoid problems with PCI write posting */
} }
static inline u8 config_readb(struct yenta_socket *socket, unsigned offset) static inline u8 config_readb(struct yenta_socket *socket, unsigned offset)
...@@ -136,6 +137,7 @@ static inline void exca_writeb(struct yenta_socket *socket, unsigned reg, u8 val ...@@ -136,6 +137,7 @@ static inline void exca_writeb(struct yenta_socket *socket, unsigned reg, u8 val
{ {
debug("%p %04x %02x\n", socket, reg, val); debug("%p %04x %02x\n", socket, reg, val);
writeb(val, socket->base + 0x800 + reg); writeb(val, socket->base + 0x800 + reg);
readb(socket->base + 0x800 + reg); /* PCI write posting... */
} }
static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val) static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val)
...@@ -143,6 +145,10 @@ static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val) ...@@ -143,6 +145,10 @@ static void exca_writew(struct yenta_socket *socket, unsigned reg, u16 val)
debug("%p %04x %04x\n", socket, reg, val); debug("%p %04x %04x\n", socket, reg, val);
writeb(val, socket->base + 0x800 + reg); writeb(val, socket->base + 0x800 + reg);
writeb(val >> 8, socket->base + 0x800 + reg + 1); writeb(val >> 8, socket->base + 0x800 + reg + 1);
/* PCI write posting... */
readb(socket->base + 0x800 + reg);
readb(socket->base + 0x800 + reg + 1);
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment