[PATCH] sgiioc4: use mmio ops instead of port io

From: Jeremy Higdon <jeremy@sgi.com>

This patch fixes a bug in sgiioc4 where it was using the default IDE port
I/O operations instead of MMIO.

The IDE part of the IOC4 chip uses MMIO to map the chip registers.
Unfortunately, the sgiioc4 driver uses the default port IO operations,
which happens to have worked for the past few years. That's about to
change, however, thus this change from inX/outX to readX/writeX.

Signed-off-by: Jeremy Higdon <jeremy@sgi.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by Jeremy Higdon and committed by Linus Torvalds a835fa79 8fd66ab8

+11 -5
+11 -5
drivers/ide/pci/sgiioc4.c
··· 345 static u8 346 sgiioc4_INB(unsigned long port) 347 { 348 - u8 reg = (u8) inb(port); 349 350 if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ 351 if (reg & 0x51) { /* Not busy...check for interrupt */ 352 unsigned long other_ir = port - 0x110; 353 - unsigned int intr_reg = (u32) inl(other_ir); 354 355 /* Clear the Interrupt, Error bits on the IOC4 */ 356 if (intr_reg & 0x03) { 357 - outl(0x03, other_ir); 358 - intr_reg = (u32) inl(other_ir); 359 } 360 } 361 } ··· 606 hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off; 607 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 608 hwif->ide_dma_timeout = &__ide_dma_timeout; 609 hwif->INB = &sgiioc4_INB; 610 } 611 ··· 749 module_init(ioc4_ide_init); 750 module_exit(ioc4_ide_exit); 751 752 - MODULE_AUTHOR("Aniket Malatpure - Silicon Graphics Inc. (SGI)"); 753 MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card"); 754 MODULE_LICENSE("GPL");
··· 345 static u8 346 sgiioc4_INB(unsigned long port) 347 { 348 + u8 reg = (u8) readb((void __iomem *) port); 349 350 if ((port & 0xFFF) == 0x11C) { /* Status register of IOC4 */ 351 if (reg & 0x51) { /* Not busy...check for interrupt */ 352 unsigned long other_ir = port - 0x110; 353 + unsigned int intr_reg = (u32) readl((void __iomem *) other_ir); 354 355 /* Clear the Interrupt, Error bits on the IOC4 */ 356 if (intr_reg & 0x03) { 357 + writel(0x03, (void __iomem *) other_ir); 358 + intr_reg = (u32) readl((void __iomem *) other_ir); 359 } 360 } 361 } ··· 606 hwif->ide_dma_host_off = &sgiioc4_ide_dma_host_off; 607 hwif->ide_dma_lostirq = &sgiioc4_ide_dma_lostirq; 608 hwif->ide_dma_timeout = &__ide_dma_timeout; 609 + 610 + /* 611 + * The IOC4 uses MMIO rather than Port IO. 612 + * It also needs special workarounds for INB. 613 + */ 614 + default_hwif_mmiops(hwif); 615 hwif->INB = &sgiioc4_INB; 616 } 617 ··· 743 module_init(ioc4_ide_init); 744 module_exit(ioc4_ide_exit); 745 746 + MODULE_AUTHOR("Aniket Malatpure/Jeremy Higdon"); 747 MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card"); 748 MODULE_LICENSE("GPL");