Skip to contentSkip to conversation

IDE/DMA for au1xxx

PATCH In review Daniel Mack 3 participants 4 messages Mar 15, 2007

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

PATCH 1/1 IDE/DMA for au1xxx

Hi,

this makes the DMA part of Au1xxx's IDE interface compile again.

drivers/ide/mips/au1xxx-ide.c +2 -2
index b2dc028..806b6d1 100644
@@ -443,7 +443,6 @@ static void auide_dma_host_on(ide_drive_t *drive)
 static int auide_dma_on(ide_drive_t *drive)
 {
 	drive->using_dma = 1;
-
 	return 0;
 }
 
@@ -638,6 +637,7 @@ static int au_ide_probe(struct device *dev)
 	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;
 
@@ -681,7 +681,7 @@ static int au_ide_probe(struct device *dev)
 	/* 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;
 
include/asm-mips/mach-au1x00/au1xxx_ide.h +3 -3
index e9fa252..e747814 100644
@@ -166,13 +166,13 @@ int __init auide_probe(void);
         static int auide_dma_setup(ide_drive_t *drive);
         static int auide_dma_check(ide_drive_t *drive);
         static int auide_dma_test_irq(ide_drive_t *drive);
-        static int auide_dma_host_off(ide_drive_t *drive);
-        static int auide_dma_host_on(ide_drive_t *drive);
+        static void auide_dma_host_off(ide_drive_t *drive);
+        static void auide_dma_host_on(ide_drive_t *drive);
         static int auide_dma_lostirq(ide_drive_t *drive);
         static int auide_dma_on(ide_drive_t *drive);
         static void auide_ddma_tx_callback(int irq, void *param);
         static void auide_ddma_rx_callback(int irq, void *param);
-        static int auide_dma_off_quietly(ide_drive_t *drive);
+        static void auide_dma_off_quietly(ide_drive_t *drive);
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
 
 /*******************************************************************************
#1 lore raw
Quoted 29 lines · Daniel Mack

Hi,

this makes the DMA part of Au1xxx's IDE interface compile again.

------------------------------------------------------------------------

drivers/ide/mips/au1xxx-ide.c +1 -1
index b2dc028..806b6d1 100644
@@ -443,7 +443,6 @@ static void auide_dma_host_on(ide_drive_t *drive)
 static int auide_dma_on(ide_drive_t *drive)
 {
 	drive->using_dma = 1;
-
 	return 0;
 }
 
@@ -638,6 +637,7 @@ static int au_ide_probe(struct device *dev)
 	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;
 

drivers/ide/mips/au1xxx-ide.c static int au_ide_probe(struct device *dev) · line 686

Quoted 7 lines
drivers/ide/mips/au1xxx-ide.c +1 -1
@@ -681,7 +681,7 @@ static int au_ide_probe(struct device *dev)
 	/* 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;

The patch consisting of these 2 hunks has been already posted to linux-ide
by Ralf... Your patch looks more complete though.

Quoted 9 lines
include/asm-mips/mach-au1x00/au1xxx_ide.h +0 -1
index e9fa252..e747814 100644
@@ -166,13 +166,13 @@ int __init auide_probe(void);
         static int auide_dma_setup(ide_drive_t *drive);
         static int auide_dma_check(ide_drive_t *drive);
         static int auide_dma_test_irq(ide_drive_t *drive);
-        static int auide_dma_host_off(ide_drive_t *drive);

include/asm-mips/mach-au1x00/au1xxx_ide.h int __init auide_probe(void); · line 176

Quoted 10 lines
include/asm-mips/mach-au1x00/au1xxx_ide.h +3 -2
-        static int auide_dma_host_on(ide_drive_t *drive);
+        static void auide_dma_host_off(ide_drive_t *drive);
+        static void auide_dma_host_on(ide_drive_t *drive);
         static int auide_dma_lostirq(ide_drive_t *drive);
         static int auide_dma_on(ide_drive_t *drive);
         static void auide_ddma_tx_callback(int irq, void *param);
         static void auide_ddma_rx_callback(int irq, void *param);
-        static int auide_dma_off_quietly(ide_drive_t *drive);
+        static void auide_dma_off_quietly(ide_drive_t *drive);
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */

WTF these protos are doing in include/asm-mips/ -- being purely IDE
subsystem specific?! :-O
Could you move them into the driver (if they are indeed necessary)?

MBR, Sergei

#2 lore raw
Quoted 16 lines · Sergei Shtylyov
Quoted 16 lines
include/asm-mips/mach-au1x00/au1xxx_ide.h +2 -2
index e9fa252..e747814 100644
@@ -166,13 +166,13 @@ int __init auide_probe(void);
        static int auide_dma_setup(ide_drive_t *drive);
        static int auide_dma_check(ide_drive_t *drive);
        static int auide_dma_test_irq(ide_drive_t *drive);
-        static int auide_dma_host_off(ide_drive_t *drive);
-        static int auide_dma_host_on(ide_drive_t *drive);
+        static void auide_dma_host_off(ide_drive_t *drive);
+        static void auide_dma_host_on(ide_drive_t *drive);
        static int auide_dma_lostirq(ide_drive_t *drive);
        static int auide_dma_on(ide_drive_t *drive);
        static void auide_ddma_tx_callback(int irq, void *param);
Quoted 8 lines

include/asm-mips/mach-au1x00/au1xxx_ide.h int __init auide_probe(void); · line 176

Quoted 4 lines
include/asm-mips/mach-au1x00/au1xxx_ide.h +1 -1
        static void auide_ddma_rx_callback(int irq, void *param);
-        static int auide_dma_off_quietly(ide_drive_t *drive);
+        static void auide_dma_off_quietly(ide_drive_t *drive);
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */

WTF these protos are doing in include/asm-mips/ -- being purely IDE
subsystem specific?! :-O
Could you move them into the driver (if they are indeed necessary)?

You're right.

This patch removes the static prototypes from the au1xxx_ide.h, some of them were not even implemented.

include/asm-mips/mach-au1x00/au1xxx_ide.h +0 -34
index e9fa252..8fcae21 100644
@@ -141,40 +141,6 @@ static int auide_ddma_init( _auide_hwif *auide );
 static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif);
 int __init auide_probe(void);
 
-#ifdef CONFIG_PM
-        int au1200ide_pm_callback( au1xxx_power_dev_t *dev,
-                                   au1xxx_request_t request, void *data);
-        static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_access( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev );
-        static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev );
-#endif
-
-
-/*
- * Multi-Word DMA + DbDMA functions
- */
-#ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
-        static int auide_build_sglist(ide_drive_t *drive,  struct request *rq);
-        static int auide_build_dmatable(ide_drive_t *drive);
-        static int auide_dma_end(ide_drive_t *drive);
-        ide_startstop_t auide_dma_intr (ide_drive_t *drive);
-        static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command);
-        static int auide_dma_setup(ide_drive_t *drive);
-        static int auide_dma_check(ide_drive_t *drive);
-        static int auide_dma_test_irq(ide_drive_t *drive);
-        static int auide_dma_host_off(ide_drive_t *drive);
-        static int auide_dma_host_on(ide_drive_t *drive);
-        static int auide_dma_lostirq(ide_drive_t *drive);
-        static int auide_dma_on(ide_drive_t *drive);
-        static void auide_ddma_tx_callback(int irq, void *param);
-        static void auide_ddma_rx_callback(int irq, void *param);
-        static int auide_dma_off_quietly(ide_drive_t *drive);
-#endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
-
 /*******************************************************************************
 * PIO Mode timing calculation :                                                *
 *                                                                              *
#3 lore raw
In reply to Sergei Shtylyov

Hi,

Quoted 32 lines · Sergei Shtylyov
Quoted 31 lines · Daniel Mack

Hi,

this makes the DMA part of Au1xxx's IDE interface compile again.

------------------------------------------------------------------------

drivers/ide/mips/au1xxx-ide.c +1 -1
index b2dc028..806b6d1 100644
@@ -443,7 +443,6 @@ static void auide_dma_host_on(ide_drive_t *drive)
 static int auide_dma_on(ide_drive_t *drive)
 {
 	drive->using_dma = 1;
-
 	return 0;
 }
 
@@ -638,6 +637,7 @@ static int au_ide_probe(struct device *dev)
 	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;
 
@@ -681,7 +681,7 @@ static int au_ide_probe(struct device *dev)
 	/* FIXME:  This might possibly break PCMCIA IDE devices */
 
Quoted 8 lines

drivers/ide/mips/au1xxx-ide.c static int au_ide_probe(struct device *dev) · line 686

Quoted 5 lines
drivers/ide/mips/au1xxx-ide.c +1 -1
 	hwif                            = &ide_hwifs[pdev->id];
-	hw_regs_t *hw 			= &hwif->hw;
+	hw 				= &hwif->hw;
 	hwif->irq = hw->irq             = ahwif->irq;
 	hwif->chipset                   = ide_au1xxx;

The patch consisting of these 2 hunks has been already posted to linux-ide
by Ralf... Your patch looks more complete though.

I applied Ralf's one and I would merge this one but I'm not on linux-mips ML.

Daniel, please resend the original patch to linux-ide ML.

Quoted 15 lines
Quoted 15 lines
include/asm-mips/mach-au1x00/au1xxx_ide.h +2 -2
index e9fa252..e747814 100644
@@ -166,13 +166,13 @@ int __init auide_probe(void);
         static int auide_dma_setup(ide_drive_t *drive);
         static int auide_dma_check(ide_drive_t *drive);
         static int auide_dma_test_irq(ide_drive_t *drive);
-        static int auide_dma_host_off(ide_drive_t *drive);
-        static int auide_dma_host_on(ide_drive_t *drive);
+        static void auide_dma_host_off(ide_drive_t *drive);
+        static void auide_dma_host_on(ide_drive_t *drive);
         static int auide_dma_lostirq(ide_drive_t *drive);
         static int auide_dma_on(ide_drive_t *drive);
         static void auide_ddma_tx_callback(int irq, void *param);
Quoted 8 lines

include/asm-mips/mach-au1x00/au1xxx_ide.h int __init auide_probe(void); · line 176

Quoted 4 lines
include/asm-mips/mach-au1x00/au1xxx_ide.h +1 -1
         static void auide_ddma_rx_callback(int irq, void *param);
-        static int auide_dma_off_quietly(ide_drive_t *drive);
+        static void auide_dma_off_quietly(ide_drive_t *drive);
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */

WTF these protos are doing in include/asm-mips/ -- being purely IDE
subsystem specific?! :-O
Could you move them into the driver (if they are indeed necessary)?

seconded, this is a good idea

Thanks,
Bart