[parisc-linux-cvs] DIFF -pa10 lba swapping bytes too much

Grant Grundler grundler@puffin.external.hp.com
Mon, 03 Dec 2001 11:01:46 -0700


Grant Grundler wrote:
> Log message:
> -pa10
> Removed extra endian correction (byte swapping) for READ_REGx() variants.
> This code should have used __raw_readX() functions instead of readX()
> and this wouldn't have shown up...


I just deleted the leXX_to_cpu() calls to make things simple.
The alternative would have been to use __raw_readX() variants and
keep the swapping explicit. I just occurred to me that I should have
used __raw_XX() calls since I'm not explicitly doing anything to map
these addresses....hmmmm.

Index: Makefile
===================================================================
RCS file: /var/cvs/linux/Makefile,v
retrieving revision 1.214
retrieving revision 1.215
diff -u -p -r1.214 -r1.215
--- Makefile    2001/12/03 05:10:00     1.214
+++ Makefile    2001/12/03 07:44:52     1.215
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 16
-EXTRAVERSION = -pa9
+EXTRAVERSION = -pa10
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
Index: arch/parisc/kernel/lba_pci.c
===================================================================
RCS file: /var/cvs/linux/arch/parisc/kernel/lba_pci.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -p -r1.45 -r1.46
--- arch/parisc/kernel/lba_pci.c	2001/11/26 08:19:37	1.45
+++ arch/parisc/kernel/lba_pci.c	2001/12/03 07:44:52	1.46
@@ -237,14 +237,14 @@ static u32 lba_t32;
 #define WRITE_U32(value, addr) __raw_writel(value, addr)
 
 #define READ_REG8(addr)  readb(addr)
-#define READ_REG16(addr) le16_to_cpu(readw(addr))
-#define READ_REG32(addr) le32_to_cpu(readl(addr))
+#define READ_REG16(addr) readw(addr)
+#define READ_REG32(addr) readl(addr)
 #if BITS_PER_LONG > 32
-#define READ_REG64(addr) le64_to_cpu(readq(addr))
+#define READ_REG64(addr) readq(addr)
 #endif
 #define WRITE_REG8(value, addr)  writeb(value, addr)
-#define WRITE_REG16(value, addr) writew(cpu_to_le16(value), addr)
-#define WRITE_REG32(value, addr) writel(cpu_to_le32(value), addr)
+#define WRITE_REG16(value, addr) writew(value, addr)
+#define WRITE_REG32(value, addr) writel(value, addr)
 
 
 #define LBA_CFG_TOK(bus,dfn) ((u32) ((bus)<<16 | (dfn)<<8))
@@ -512,12 +512,6 @@ lba_rd_cfg(struct lba_device *d, u32 tok
 }
 
 
-
-/* XXX FIXME the '1 ||' in the if() below triggers the 'broken elroy'
- * code always.  This was required on B2000 and probably other PA-8600
- * boxes even they have un-broken elroy's.  ggg thinks firmware leaves
- * things in a state for which we are unprepared.  This is the wrong fix
- * but works for now. -PB */
 #define LBA_CFG_RD(size, mask) \
 static int lba_cfg_read##size (struct pci_dev *dev, int pos, u##size *data) \
 { \
@@ -525,7 +519,7 @@ static int lba_cfg_read##size (struct pc
 	u32 local_bus = (dev->bus->parent == NULL) ? 0 : dev->bus->secondary; \
 	u32 tok = LBA_CFG_TOK(local_bus,dev->devfn); \
  \
-/* FIXME:B2K/C3600 workaround is always use old method... */ \
+/* FIXME: B2K/C3600 workaround is always use old method... */ \
 	/* if (!LBA_TR4PLUS(d) && !LBA_SKIP_PROBE(d)) */ { \
 		/* original - Generate config cycle on broken elroy \
 		  with risk we will miss PCI bus errors. */ \