Skip to content

Commit

Permalink
[PATCH] fix rio_copy_to_card() for OLDPCI case
Browse files Browse the repository at this point in the history
It replaced old rio_pcicopy().  That puppy did _not_ do readb() (unlike
rio_memcpy_toio()) and current implementation is simply broken - readb(NULL)
is never a valid thing to do.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 27, 2006
1 parent bfa6b7b commit ae5b28a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/char/rio/rio_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ int RIODelay_ni(struct Port *PortP, int njiffies)

void rio_copy_to_card(void *from, void __iomem *to, int len)
{
rio_memcpy_toio(NULL, to, from, len);
rio_copy_toio(to, from, len);
}

int rio_minor(struct tty_struct *tty)
Expand Down
14 changes: 13 additions & 1 deletion drivers/char/rio/rio_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,23 @@ static inline void __iomem *rio_memcpy_toio(void __iomem *dummy, void __iomem *d

while (n--) {
writeb(*src++, dst++);
(void) readb(dummy); /* WTF? */
(void) readb(dummy);
}

return dest;
}

static inline void __iomem *rio_copy_toio(void __iomem *dest, void *source, int n)
{
char __iomem *dst = dest;
char *src = source;

while (n--)
writeb(*src++, dst++);

return dest;
}


static inline void *rio_memcpy_fromio(void *dest, void __iomem *source, int n)
{
Expand All @@ -158,6 +169,7 @@ static inline void *rio_memcpy_fromio(void *dest, void __iomem *source, int n)

#else
#define rio_memcpy_toio(dummy,dest,source,n) memcpy_toio(dest, source, n)
#define rio_copy_toio memcpy_toio
#define rio_memcpy_fromio memcpy_fromio
#endif

Expand Down

0 comments on commit ae5b28a

Please sign in to comment.