Skip to contentSkip to conversation

siimage: fix wrong ->swdma_mask

PATCH In review Bartlomiej Zolnierkiewicz 2 participants 4 messages Mar 10, 2007 – Mar 12, 2007 libata

lore
Share & tools
lore
#0 lore raw

PATCH 3/13 siimage: fix wrong ->swdma_mask

[PATCH] siimage: fix wrong ->swdma_mask

This driver doesn't support SWDMA so use the correct ->swdma_mask.

While at it:

* no need to call config_chipset_for_pio() in config_chipset_for_dma(), if DMA is not available config_chipset_for_pio() will be called by siimage_config_drive_for_dma() and if DMA is available config_siimage_chipset_for_pio() will be called by siimage_tune_chipset()

* remove needless config_chipset_for_pio() wrapper

* bump driver version

---

 drivers/ide/pci/siimage.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/ide/pci/siimage.c +2 -10
Index: b/drivers/ide/pci/siimage.c
===================================================================
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/siimage.c		Version 1.11	Jan 27, 2007
+ * linux/drivers/ide/pci/siimage.c		Version 1.12	Mar 10 2007
  *
  * Copyright (C) 2001-2002	Andre Hedrick <[email protected]>
  * Copyright (C) 2003		Red Hat <[email protected]>
@@ -283,11 +283,6 @@ static void config_siimage_chipset_for_p
 		(void) ide_config_drive_speed(drive, speed);
 }
 
-static void config_chipset_for_pio (ide_drive_t *drive, byte set_speed)
-{
-	config_siimage_chipset_for_pio(drive, set_speed);
-}
-
 /**
  *	siimage_tune_chipset	-	set controller timings
  *	@drive: Drive to set up
@@ -392,8 +387,6 @@ static int config_chipset_for_dma (ide_d
 {
 	u8 speed = ide_max_dma_mode(drive);
 
-	config_chipset_for_pio(drive, !speed);
-
 	if (!speed)
 		return 0;
 
@@ -419,7 +412,7 @@ static int siimage_config_drive_for_dma 
 		return 0;
 
 	if (ide_use_fast_pio(drive))
-		config_chipset_for_pio(drive, 1);
+		config_siimage_chipset_for_pio(drive, 1);
 
 	return -1;
 }
@@ -1012,7 +1005,6 @@ static void __devinit init_hwif_siimage(
 
 	hwif->ultra_mask = 0x7f;
 	hwif->mwdma_mask = 0x07;
-	hwif->swdma_mask = 0x07;
 
 	if (!is_sata(hwif))
 		hwif->atapi_dma = 1;
#1 lore raw

Hello.

Quoted 10 lines · Bartlomiej Zolnierkiewicz

[PATCH] siimage: fix wrong ->swdma_mask

This driver doesn't support SWDMA so use the correct ->swdma_mask.

While at it:

* no need to call config_chipset_for_pio() in config_chipset_for_dma(), if DMA is not available config_chipset_for_pio() will be called by siimage_config_drive_for_dma() and if DMA is available config_siimage_chipset_for_pio() will be called by siimage_tune_chipset()

Ugh, this driver has such a messy code PIO-wise! There seems to be
completely no point in calling config_siimage_chipset_for_pio() from siimage_tune_chipset(). Not mentioning that tuneproc() method fails to actually control IORDY (it only twiddles IORDY bits for taskfile access). Ah, and tuneproc() fails to set the drive's own mode (as usual)... :-)
I was going to post patches but then figured out that we don't actually
support this driver, so the priority has significatly dropped. :-)

Quoted 59 lines

* remove needless config_chipset_for_pio() wrapper

* bump driver version

---

 drivers/ide/pci/siimage.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

Index: b/drivers/ide/pci/siimage.c
===================================================================

drivers/ide/pci/siimage.c +2 -10
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/siimage.c		Version 1.11	Jan 27, 2007
+ * linux/drivers/ide/pci/siimage.c		Version 1.12	Mar 10 2007
  *
  * Copyright (C) 2001-2002	Andre Hedrick <[email protected]>
  * Copyright (C) 2003		Red Hat <[email protected]>
@@ -283,11 +283,6 @@ static void config_siimage_chipset_for_p
 		(void) ide_config_drive_speed(drive, speed);
 }
 
-static void config_chipset_for_pio (ide_drive_t *drive, byte set_speed)
-{
-	config_siimage_chipset_for_pio(drive, set_speed);
-}
-
 /**
  *	siimage_tune_chipset	-	set controller timings
  *	@drive: Drive to set up
@@ -392,8 +387,6 @@ static int config_chipset_for_dma (ide_d
 {
 	u8 speed = ide_max_dma_mode(drive);
 
-	config_chipset_for_pio(drive, !speed);
-
 	if (!speed)
 		return 0;
 
@@ -419,7 +412,7 @@ static int siimage_config_drive_for_dma 
 		return 0;
 
 	if (ide_use_fast_pio(drive))
-		config_chipset_for_pio(drive, 1);
+		config_siimage_chipset_for_pio(drive, 1);
 
 	return -1;
 }
@@ -1012,7 +1005,6 @@ static void __devinit init_hwif_siimage(
 
 	hwif->ultra_mask = 0x7f;
 	hwif->mwdma_mask = 0x07;
-	hwif->swdma_mask = 0x07;
 
 	if (!is_sata(hwif))
 		hwif->atapi_dma = 1;
#2 lore raw
Quoted 15 lines · Sergei Shtylyov

Hello.

Quoted 10 lines · Bartlomiej Zolnierkiewicz

[PATCH] siimage: fix wrong ->swdma_mask

This driver doesn't support SWDMA so use the correct ->swdma_mask.

While at it:

* no need to call config_chipset_for_pio() in config_chipset_for_dma(), if DMA is not available config_chipset_for_pio() will be called by siimage_config_drive_for_dma() and if DMA is available config_siimage_chipset_for_pio() will be called by siimage_tune_chipset()

Quoted 7 lines

Ugh, this driver has such a messy code PIO-wise! There seems to be
completely no point in calling config_siimage_chipset_for_pio() from siimage_tune_chipset(). Not mentioning that tuneproc() method fails to actually control IORDY (it only twiddles IORDY bits for taskfile access). Ah, and tuneproc() fails to set the drive's own mode (as usual)... :-)
I was going to post patches but then figured out that we don't actually
support this driver, so the priority has significatly dropped. :-)

Does it mean that I should expect more patches for other drivers? ;-)

If so I could take care of this one... :-)

Bart

#3 lore raw

Hello.

Quoted 6 lines · Bartlomiej Zolnierkiewicz
Quoted 5 lines
Quoted 5 lines

[PATCH] siimage: fix wrong ->swdma_mask

This driver doesn't support SWDMA so use the correct ->swdma_mask.

While at it:

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

* no need to call config_chipset_for_pio() in config_chipset_for_dma(), if DMA is not available config_chipset_for_pio() will be called by siimage_config_drive_for_dma() and if DMA is available config_siimage_chipset_for_pio() will be called by siimage_tune_chipset()

Ugh, this driver has such a messy code PIO-wise! There seems to be
completely no point in calling config_siimage_chipset_for_pio() from siimage_tune_chipset(). Not mentioning that tuneproc() method fails to actually control IORDY (it only twiddles IORDY bits for taskfile access). Ah, and tuneproc() fails to set the drive's own mode (as usual)... :-)

Oh, I knew I was going to forget something: it's also limiting the PIO
mode to the one of the slowest drive for no good reason. :-/

Quoted 4 lines
Quoted 2 lines

I was going to post patches but then figured out that we don't actually
support this driver, so the priority has significatly dropped. :-)

Does it mean that I should expect more patches for other drivers? ;-)

Certainly. We're just having a release fever, so I had to switch to fixing
the stupid network drivers (where the breakage wasn't so obvious).

Quoted 1 line

If so I could take care of this one... :-)

Please do. :-)

Quoted 1 line

Bart

MBR, Sergei