Parcourir la source

ide: add IDE_HFLAG_MMIO host flag (take 2)

* Add IDE_HFLAG_MMIO host flag and set it for hosts which use
  default_hwif_mmiops().

v2:
* Fix kernel panic in pmac host driver (',' should be '|').

  Thanks to Kamalesh for reporting it + testing the fix
  and to Andrew for hinting me about the source of the issue.

Cc: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Bartlomiej Zolnierkiewicz il y a 17 ans
Parent
commit
c5dd43ec65

+ 1 - 1
drivers/ide/arm/icside.c

@@ -483,7 +483,7 @@ static const struct ide_port_info icside_v6_port_info __initdata = {
 	.init_dma		= icside_dma_off_init,
 	.init_dma		= icside_dma_off_init,
 	.port_ops		= &icside_v6_no_dma_port_ops,
 	.port_ops		= &icside_v6_no_dma_port_ops,
 	.dma_ops		= &icside_v6_dma_ops,
 	.dma_ops		= &icside_v6_dma_ops,
-	.host_flags		= IDE_HFLAG_SERIALIZE,
+	.host_flags		= IDE_HFLAG_SERIALIZE | IDE_HFLAG_MMIO,
 	.mwdma_mask		= ATA_MWDMA2,
 	.mwdma_mask		= ATA_MWDMA2,
 	.swdma_mask		= ATA_SWDMA2,
 	.swdma_mask		= ATA_SWDMA2,
 };
 };

+ 1 - 0
drivers/ide/arm/palm_bk3710.c

@@ -342,6 +342,7 @@ static const struct ide_port_ops palm_bk3710_ports_ops = {
 static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
 static const struct ide_port_info __devinitdata palm_bk3710_port_info = {
 	.init_dma		= palm_bk3710_init_dma,
 	.init_dma		= palm_bk3710_init_dma,
 	.port_ops		= &palm_bk3710_ports_ops,
 	.port_ops		= &palm_bk3710_ports_ops,
+	.host_flags		= IDE_HFLAG_MMIO,
 	.pio_mask		= ATA_PIO4,
 	.pio_mask		= ATA_PIO4,
 	.udma_mask		= ATA_UDMA4,	/* (input clk 99MHz) */
 	.udma_mask		= ATA_UDMA4,	/* (input clk 99MHz) */
 	.mwdma_mask		= ATA_MWDMA2,
 	.mwdma_mask		= ATA_MWDMA2,

+ 1 - 0
drivers/ide/arm/rapide.c

@@ -53,6 +53,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
 
 
 		ide_init_port_hw(hwif, &hw);
 		ide_init_port_hw(hwif, &hw);
 
 
+		hwif->host_flags = IDE_HFLAG_MMIO;
 		default_hwif_mmiops(hwif);
 		default_hwif_mmiops(hwif);
 
 
 		idx[0] = hwif->index;
 		idx[0] = hwif->index;

+ 3 - 1
drivers/ide/legacy/ide_platform.c

@@ -101,8 +101,10 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
 
 
 	ide_init_port_hw(hwif, &hw);
 	ide_init_port_hw(hwif, &hw);
 
 
-	if (mmio)
+	if (mmio) {
+		hwif->host_flags = IDE_HFLAG_MMIO;
 		default_hwif_mmiops(hwif);
 		default_hwif_mmiops(hwif);
+	}
 
 
 	idx[0] = hwif->index;
 	idx[0] = hwif->index;
 
 

+ 1 - 0
drivers/ide/mips/swarm.c

@@ -109,6 +109,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
 	base = ioremap(offset, size);
 	base = ioremap(offset, size);
 
 
 	/* Setup MMIO ops.  */
 	/* Setup MMIO ops.  */
+	hwif->host_flags = IDE_HFLAG_MMIO;
 	default_hwif_mmiops(hwif);
 	default_hwif_mmiops(hwif);
 
 
 	hwif->chipset = ide_generic;
 	hwif->chipset = ide_generic;

+ 1 - 0
drivers/ide/pci/sgiioc4.c

@@ -573,6 +573,7 @@ static const struct ide_port_info sgiioc4_port_info __devinitdata = {
 	.init_dma		= ide_dma_sgiioc4,
 	.init_dma		= ide_dma_sgiioc4,
 	.port_ops		= &sgiioc4_port_ops,
 	.port_ops		= &sgiioc4_port_ops,
 	.dma_ops		= &sgiioc4_dma_ops,
 	.dma_ops		= &sgiioc4_dma_ops,
+	.host_flags		= IDE_HFLAG_MMIO,
 	.mwdma_mask		= ATA_MWDMA2_ONLY,
 	.mwdma_mask		= ATA_MWDMA2_ONLY,
 };
 };
 
 

+ 1 - 0
drivers/ide/pci/siimage.c

@@ -630,6 +630,7 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
 	 *	Fill in the basic HWIF bits
 	 *	Fill in the basic HWIF bits
 	 */
 	 */
 
 
+	hwif->host_flags |= IDE_HFLAG_MMIO;
 	default_hwif_mmiops(hwif);
 	default_hwif_mmiops(hwif);
 	hwif->hwif_data			= addr;
 	hwif->hwif_data			= addr;
 
 

+ 1 - 0
drivers/ide/ppc/pmac.c

@@ -941,6 +941,7 @@ static const struct ide_port_info pmac_port_info = {
 	.port_ops		= &pmac_ide_port_ops,
 	.port_ops		= &pmac_ide_port_ops,
 	.host_flags		= IDE_HFLAG_SET_PIO_MODE_KEEP_DMA |
 	.host_flags		= IDE_HFLAG_SET_PIO_MODE_KEEP_DMA |
 				  IDE_HFLAG_POST_SET_MODE |
 				  IDE_HFLAG_POST_SET_MODE |
+				  IDE_HFLAG_MMIO |
 				  IDE_HFLAG_UNMASK_IRQS,
 				  IDE_HFLAG_UNMASK_IRQS,
 	.pio_mask		= ATA_PIO4,
 	.pio_mask		= ATA_PIO4,
 	.mwdma_mask		= ATA_MWDMA2,
 	.mwdma_mask		= ATA_MWDMA2,

+ 2 - 0
include/linux/ide.h

@@ -1069,6 +1069,8 @@ enum {
 	IDE_HFLAG_NO_DMA		= (1 << 14),
 	IDE_HFLAG_NO_DMA		= (1 << 14),
 	/* check if host is PCI IDE device before allowing DMA */
 	/* check if host is PCI IDE device before allowing DMA */
 	IDE_HFLAG_NO_AUTODMA		= (1 << 15),
 	IDE_HFLAG_NO_AUTODMA		= (1 << 15),
+	/* host uses MMIO */
+	IDE_HFLAG_MMIO			= (1 << 16),
 	/* host is CS5510/CS5520 */
 	/* host is CS5510/CS5520 */
 	IDE_HFLAG_CS5520		= IDE_HFLAG_VDMA,
 	IDE_HFLAG_CS5520		= IDE_HFLAG_VDMA,
 	/* no LBA48 */
 	/* no LBA48 */