Skip to content

Commit

Permalink
sh: fix ioreadN_rep and iowriteN_rep
Browse files Browse the repository at this point in the history
This patch is a fix to make sure readsN/writesN are used over insN/outsN for
ioreadN_rep/iowriteN_rep.

The current state of the sh io code is that mmio operations like readN/writeN
and ioreadN/iowriteN are unaffected by the value of generic_io_base. This is
different fom port based io like inN/outN which gets adjusted using the value
in generic_io_base.

Without this patch ioreadN_rep/iowriteN_rep get their addresses adjusted.
The address for mmio access is adjusted using generic_io_base. This is wrong.
The ata core code currently crashes if generic_io_base is set.

This patch changes ioreadN_rep/iowriteN_rep to follow the same rules as the
rest of the mmio operations, ie don't adjust using generic_io_base.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Acked-by: Katsuya MATSUBARA <matsu@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Feb 14, 2008
1 parent e036eaa commit c0ca41a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions include/asm-sh/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ __BUILD_MEMORY_STRING(w, u16)
#define iowrite32(v,a) writel((v),(a))
#define iowrite32be(v,a) __raw_writel(cpu_to_be32((v)),(a))

#define ioread8_rep(a,d,c) insb((a),(d),(c))
#define ioread16_rep(a,d,c) insw((a),(d),(c))
#define ioread32_rep(a,d,c) insl((a),(d),(c))
#define ioread8_rep(a, d, c) readsb((a), (d), (c))
#define ioread16_rep(a, d, c) readsw((a), (d), (c))
#define ioread32_rep(a, d, c) readsl((a), (d), (c))

#define iowrite8_rep(a,s,c) outsb((a),(s),(c))
#define iowrite16_rep(a,s,c) outsw((a),(s),(c))
#define iowrite32_rep(a,s,c) outsl((a),(s),(c))
#define iowrite8_rep(a, s, c) writesb((a), (s), (c))
#define iowrite16_rep(a, s, c) writesw((a), (s), (c))
#define iowrite32_rep(a, s, c) writesl((a), (s), (c))

#define mmiowb() wmb() /* synco on SH-4A, otherwise a nop */

Expand Down

0 comments on commit c0ca41a

Please sign in to comment.