Skip to contentSkip to conversation

Enable MwDMA for AU1200 IDE driver

PATCH In review Jordan Crouse 2 participants 2 messages Feb 10, 2006 – Feb 13, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enable MwDMA for AU1200 IDE driver

Greetings all - the attached patch enables MwDMA mode for the AU1200 IDE driver. If one heavily uses the USB on the DB1200 board with IDE in PIO mode, you may experience hangs from overloading the bus with interrupts - this should help. Since it is obvious that this is the desired mode, I'm adding it to the defconfig to enable by default.

Also, I snuck in a fix for a warning (mixed code and declarations = evil!). Applies against latest lmo git, but it should work for linux-ide as well.

Regards,
Jordan

Signature · 4 lines
Jordan Crouse
Senior Linux Engineer
AMD - Personal Connectivity Solutions Group
<www.amd.com/embeddedprocessors>

[PATCH] Enable MWDMA mode for the AU1200 IDE driver

This enables MwDMA mode for the AU1200 driver - this will benefit anybody using IDE + USB, which together seem to cause hangs when IDE is in PIO due to the large number of interrupts on the same bus.

---

 arch/mips/configs/db1200_defconfig        |    4 ++--
 drivers/ide/mips/au1xxx-ide.c             |   14 ++++++++++++--
 include/asm-mips/mach-au1x00/au1xxx_ide.h |    9 ---------
 3 files changed, 14 insertions(+), 13 deletions(-)
arch/mips/configs/db1200_defconfig +2 -2
index 9288847..355b32f 100644
@@ -497,8 +497,8 @@ CONFIG_BLK_DEV_IDECS=m
 #
 CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_IDE_AU1XXX=y
-CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA=y
-# CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is not set
+#CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA is not set
+CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y
 CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
 # CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
drivers/ide/mips/au1xxx-ide.c +12 -2
index 32431dc..c2bf766 100644
@@ -652,6 +652,7 @@ static int au_ide_probe(struct device *d
 	struct platform_device *pdev = to_platform_device(dev);
 	_auide_hwif *ahwif = &auide_hwif;
 	ide_hwif_t *hwif;
+	hw_regs_t *hw;
 	struct resource *res;
 	int ret = 0;
 
@@ -690,17 +691,26 @@ static int au_ide_probe(struct device *d
 	/* FIXME:  This might possibly break PCMCIA IDE devices */
 
 	hwif                            = &ide_hwifs[pdev->id];
-	hw_regs_t *hw 			= &hwif->hw;
+	hw				= &hwif->hw;
 	hwif->irq = hw->irq             = ahwif->irq;
 	hwif->chipset                   = ide_au1xxx;
 
 	auide_setup_ports(hw, ahwif);
 	memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));
 
+#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
+	hwif->rqsize = CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ;
+	hwif->rqsize = ((hwif->rqsize > AU1XXX_ATA_RQSIZE)
+			|| (hwif->rqsize < 32)) 
+                        ? AU1XXX_ATA_RQSIZE : hwif->rqsize;
+#else /* if kernel config is not set */
+	hwif->rqsize                    = AU1XXX_ATA_RQSIZE;
+#endif
+			
 	hwif->ultra_mask                = 0x0;  /* Disable Ultra DMA */
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
 	hwif->mwdma_mask                = 0x07; /* Multimode-2 DMA  */
-	hwif->swdma_mask                = 0x00;
+	hwif->swdma_mask                = 0x07;
 #else
 	hwif->mwdma_mask                = 0x0;
 	hwif->swdma_mask                = 0x0;
include/asm-mips/mach-au1x00/au1xxx_ide.h +0 -9
index 5dab100..b9713c3 100644
@@ -42,11 +42,6 @@
         #define AU1XXX_ATA_RQSIZE       128
 #endif
 
-/* Disable Burstable-Support for DBDMA */
-#ifndef CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON
-        #define CONFIG_BLK_DEV_IDE_AU1XXX_BURSTABLE_ON  0
-#endif
-
 typedef struct
 {
         u32                     tx_dev_id, rx_dev_id, target_dev_id;
@@ -65,10 +60,6 @@ typedef struct
 } _auide_hwif;
 
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
-struct drive_list_entry {
-	const char *id_model;
-	const char *id_firmware;
-};
 
 /* HD white list */
 static const struct drive_list_entry dma_white_list [] = {
#1 lore raw

Hi,

Quoted 7 lines · Jordan Crouse

Greetings all - the attached patch enables MwDMA mode for the AU1200 IDE driver. If one heavily uses the USB on the DB1200 board with IDE in PIO mode, you may experience hangs from overloading the bus with interrupts - this should help. Since it is obvious that this is the desired mode, I'm adding it to the defconfig to enable by default.

Also, I snuck in a fix for a warning (mixed code and declarations = evil!).

if this refers to drive_list_entry - it is fixed in Linus' tree

Quoted 7 lines

Applies against latest lmo git, but it should work for linux-ide as well.

[PATCH] Enable MWDMA mode for the AU1200 IDE driver

This enables MwDMA mode for the AU1200 driver - this will benefit anybody using IDE + USB, which together seem to cause hangs when IDE is in PIO due to the large number of interrupts on the same bus.

ide-au1xxx driver enables IRQ unmasking unconditionally, could it be that hardware actually needs IRQs to be masked during PIO transfers?

Quoted 46 lines

---

 arch/mips/configs/db1200_defconfig        |    4 ++--
 drivers/ide/mips/au1xxx-ide.c             |   14 ++++++++++++--
 include/asm-mips/mach-au1x00/au1xxx_ide.h |    9 ---------
 3 files changed, 14 insertions(+), 13 deletions(-)
arch/mips/configs/db1200_defconfig +2 -2
index 9288847..355b32f 100644
@@ -497,8 +497,8 @@ CONFIG_BLK_DEV_IDECS=m
 #
 CONFIG_IDE_GENERIC=y
 CONFIG_BLK_DEV_IDE_AU1XXX=y
-CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA=y
-# CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is not set
+#CONFIG_BLK_DEV_IDE_AU1XXX_PIO_DBDMA is not set
+CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA=y
 CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ=128
 # CONFIG_IDE_ARM is not set
 # CONFIG_BLK_DEV_IDEDMA is not set
drivers/ide/mips/au1xxx-ide.c +2 -1
index 32431dc..c2bf766 100644
@@ -652,6 +652,7 @@ static int au_ide_probe(struct device *d
        struct platform_device *pdev = to_platform_device(dev);
        _auide_hwif *ahwif = &auide_hwif;
        ide_hwif_t *hwif;
+       hw_regs_t *hw;
        struct resource *res;
        int ret = 0;
 
@@ -690,17 +691,26 @@ static int au_ide_probe(struct device *d
        /* FIXME:  This might possibly break PCMCIA IDE devices */
 
        hwif                            = &ide_hwifs[pdev->id];
-       hw_regs_t *hw                   = &hwif->hw;
+       hw                              = &hwif->hw;
        hwif->irq = hw->irq             = ahwif->irq;
        hwif->chipset                   = ide_au1xxx;
 
        auide_setup_ports(hw, ahwif);
        memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));

drivers/ide/mips/au1xxx-ide.c static int au_ide_probe(struct device *d · line 709

Quoted 10 lines
drivers/ide/mips/au1xxx-ide.c +9 -0
 
+#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
+       hwif->rqsize = CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ;
+       hwif->rqsize = ((hwif->rqsize > AU1XXX_ATA_RQSIZE)
+                       || (hwif->rqsize < 32))
+                        ? AU1XXX_ATA_RQSIZE : hwif->rqsize;
+#else /* if kernel config is not set */
+       hwif->rqsize                    = AU1XXX_ATA_RQSIZE;
+#endif
+

Patch description says nothing about this change...

NAK. Please don't re-introduce
CONFIG_BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ.

Either this controller works reliably with rqsize > 32 or not.

drivers/ide/mips/au1xxx-ide.c static int au_ide_probe(struct device *d · line 713

Quoted 5 lines
drivers/ide/mips/au1xxx-ide.c +1 -1
        hwif->ultra_mask                = 0x0;  /* Disable Ultra DMA */
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
        hwif->mwdma_mask                = 0x07; /* Multimode-2 DMA  */
-       hwif->swdma_mask                = 0x00;
+       hwif->swdma_mask                = 0x07;

Also not mentioned in the patch description. I don't see any code in the driver to handle SWDMA?

Thanks,
Bartlomiej