All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] ide: DMA methods cleanups/sanitizations
@ 2009-02-20 17:11 Bartlomiej Zolnierkiewicz
  2009-02-20 17:11 ` [PATCH 01/10] ide: add ->dma_clear method and remove ->dma_timeout one Bartlomiej Zolnierkiewicz
                   ` (9 more replies)
  0 siblings, 10 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:11 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel


Sanitizations of DMA methods and related cleanups (~100 LOC gone)...

[ on top of pata-2.6 tree + http://lkml.org/lkml/2009/2/18/257 ]

diffstat:
 drivers/ide/alim15x3.c     |   10 ++--
 drivers/ide/au1xxx-ide.c   |   17 ------
 drivers/ide/cmd64x.c       |    6 --
 drivers/ide/cs5536.c       |    1 
 drivers/ide/hpt366.c       |   10 ----
 drivers/ide/icside.c       |    8 ---
 drivers/ide/ide-atapi.c    |   31 +++++-------
 drivers/ide/ide-cd.c       |    4 +
 drivers/ide/ide-dma-sff.c  |   10 ----
 drivers/ide/ide-dma.c      |  112 +++++++++++++++++++++++++--------------------
 drivers/ide/ide-taskfile.c |    4 -
 drivers/ide/it821x.c       |    3 -
 drivers/ide/ns87415.c      |   28 ++++-------
 drivers/ide/pdc202xx_old.c |   10 ----
 drivers/ide/pmac.c         |   12 ----
 drivers/ide/sc1200.c       |    4 -
 drivers/ide/scc_pata.c     |   10 ----
 drivers/ide/sgiioc4.c      |   19 ++-----
 drivers/ide/siimage.c      |    1 
 drivers/ide/sl82c105.c     |    7 +-
 drivers/ide/tc86c001.c     |    1 
 drivers/ide/trm290.c       |   41 +++++++---------
 drivers/ide/tx4939ide.c    |   15 ------
 include/linux/ide.h        |   15 +++---
 24 files changed, 144 insertions(+), 235 deletions(-)

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 01/10] ide: add ->dma_clear method and remove ->dma_timeout one
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:11 ` Bartlomiej Zolnierkiewicz
  2009-03-08 22:17   ` Sergei Shtylyov
  2009-02-20 17:11 ` [PATCH 02/10] ide: inline ide_dma_timeout() into ide_dma_timeout_retry() Bartlomiej Zolnierkiewicz
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:11 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: add ->dma_clear method and remove ->dma_timeout one

All custom ->dma_timeout implementations call the generic one thus it is
possible to have only an optional method for resetting DMA engine instead:

* Add ->dma_clear method and convert hpt366, pdc202xx_old and sl82c105
  host drivers to use it.

* Always use ide_dma_timeout() in ide_dma_timeout_retry() and remove
 ->dma_timeout method.

* Make ide_dma_timeout() static.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/alim15x3.c     |    1 -
 drivers/ide/au1xxx-ide.c   |    1 -
 drivers/ide/cmd64x.c       |    3 ---
 drivers/ide/cs5536.c       |    1 -
 drivers/ide/hpt366.c       |   10 +---------
 drivers/ide/icside.c       |    1 -
 drivers/ide/ide-dma-sff.c  |    3 +--
 drivers/ide/ide-dma.c      |   10 ++++++----
 drivers/ide/it821x.c       |    3 +--
 drivers/ide/ns87415.c      |    1 -
 drivers/ide/pdc202xx_old.c |   10 ++--------
 drivers/ide/pmac.c         |    1 -
 drivers/ide/sc1200.c       |    1 -
 drivers/ide/scc_pata.c     |    1 -
 drivers/ide/sgiioc4.c      |    1 -
 drivers/ide/siimage.c      |    1 -
 drivers/ide/sl82c105.c     |    7 +++----
 drivers/ide/tc86c001.c     |    1 -
 drivers/ide/trm290.c       |    1 -
 drivers/ide/tx4939ide.c    |    1 -
 include/linux/ide.h        |    4 ++--
 21 files changed, 16 insertions(+), 47 deletions(-)

Index: b/drivers/ide/alim15x3.c
===================================================================
--- a/drivers/ide/alim15x3.c
+++ b/drivers/ide/alim15x3.c
@@ -509,7 +509,6 @@ static const struct ide_dma_ops ali_dma_
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/au1xxx-ide.c
===================================================================
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -353,7 +353,6 @@ static const struct ide_dma_ops au1xxx_d
 	.dma_end		= auide_dma_end,
 	.dma_test_irq		= auide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
-	.dma_timeout		= ide_dma_timeout,
 };
 
 static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d)
Index: b/drivers/ide/cmd64x.c
===================================================================
--- a/drivers/ide/cmd64x.c
+++ b/drivers/ide/cmd64x.c
@@ -384,7 +384,6 @@ static const struct ide_dma_ops cmd64x_d
 	.dma_test_irq		= cmd64x_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
@@ -396,7 +395,6 @@ static const struct ide_dma_ops cmd646_r
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
@@ -408,7 +406,6 @@ static const struct ide_dma_ops cmd648_d
 	.dma_test_irq		= cmd648_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/cs5536.c
===================================================================
--- a/drivers/ide/cs5536.c
+++ b/drivers/ide/cs5536.c
@@ -236,7 +236,6 @@ static const struct ide_dma_ops cs5536_d
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 };
 
 static const struct ide_port_info cs5536_info = {
Index: b/drivers/ide/hpt366.c
===================================================================
--- a/drivers/ide/hpt366.c
+++ b/drivers/ide/hpt366.c
@@ -835,12 +835,6 @@ static int hpt370_dma_end(ide_drive_t *d
 	return ide_dma_end(drive);
 }
 
-static void hpt370_dma_timeout(ide_drive_t *drive)
-{
-	hpt370_irq_timeout(drive);
-	ide_dma_timeout(drive);
-}
-
 /* returns 1 if DMA IRQ issued, 0 otherwise */
 static int hpt374_dma_test_irq(ide_drive_t *drive)
 {
@@ -1423,7 +1417,6 @@ static const struct ide_dma_ops hpt37x_d
 	.dma_test_irq		= hpt374_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
@@ -1435,7 +1428,7 @@ static const struct ide_dma_ops hpt370_d
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= hpt370_dma_timeout,
+	.dma_clear		= hpt370_irq_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
@@ -1447,7 +1440,6 @@ static const struct ide_dma_ops hpt36x_d
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= hpt366_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/icside.c
===================================================================
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -377,7 +377,6 @@ static const struct ide_dma_ops icside_v
 	.dma_start		= icside_dma_start,
 	.dma_end		= icside_dma_end,
 	.dma_test_irq		= icside_dma_test_irq,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_lost_irq		= ide_dma_lost_irq,
 };
 #else
Index: b/drivers/ide/ide-dma-sff.c
===================================================================
--- a/drivers/ide/ide-dma-sff.c
+++ b/drivers/ide/ide-dma-sff.c
@@ -338,9 +338,8 @@ const struct ide_dma_ops sff_dma_ops = {
 	.dma_start		= ide_dma_start,
 	.dma_end		= ide_dma_end,
 	.dma_test_irq		= ide_dma_test_irq,
-	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_lost_irq		= ide_dma_lost_irq,
+	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 EXPORT_SYMBOL_GPL(sff_dma_ops);
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -456,7 +456,7 @@ void ide_dma_lost_irq(ide_drive_t *drive
 }
 EXPORT_SYMBOL_GPL(ide_dma_lost_irq);
 
-void ide_dma_timeout(ide_drive_t *drive)
+static void ide_dma_timeout(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = drive->hwif;
 
@@ -469,7 +469,6 @@ void ide_dma_timeout(ide_drive_t *drive)
 
 	hwif->dma_ops->dma_end(drive);
 }
-EXPORT_SYMBOL_GPL(ide_dma_timeout);
 
 /*
  * un-busy the port etc, and clear any pending DMA status. we want to
@@ -479,6 +478,7 @@ EXPORT_SYMBOL_GPL(ide_dma_timeout);
 ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error)
 {
 	ide_hwif_t *hwif = drive->hwif;
+	const struct ide_dma_ops *dma_ops = hwif->dma_ops;
 	struct request *rq;
 	ide_startstop_t ret = ide_stopped;
 
@@ -488,12 +488,14 @@ ide_startstop_t ide_dma_timeout_retry(id
 
 	if (error < 0) {
 		printk(KERN_WARNING "%s: DMA timeout error\n", drive->name);
-		(void)hwif->dma_ops->dma_end(drive);
+		(void)dma_ops->dma_end(drive);
 		ret = ide_error(drive, "dma timeout error",
 				hwif->tp_ops->read_status(hwif));
 	} else {
 		printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name);
-		hwif->dma_ops->dma_timeout(drive);
+		if (dma_ops->dma_clear)
+			dma_ops->dma_clear(drive);
+		ide_dma_timeout(drive);
 	}
 
 	/*
Index: b/drivers/ide/it821x.c
===================================================================
--- a/drivers/ide/it821x.c
+++ b/drivers/ide/it821x.c
@@ -512,9 +512,8 @@ static struct ide_dma_ops it821x_pass_th
 	.dma_start		= it821x_dma_start,
 	.dma_end		= it821x_dma_end,
 	.dma_test_irq		= ide_dma_test_irq,
-	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_lost_irq		= ide_dma_lost_irq,
+	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/ns87415.c
===================================================================
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -306,7 +306,6 @@ static const struct ide_dma_ops ns87415_
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= superio_dma_sff_read_status,
 };
 
Index: b/drivers/ide/pdc202xx_old.c
===================================================================
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -258,12 +258,6 @@ static void pdc202xx_dma_lost_irq(ide_dr
 	ide_dma_lost_irq(drive);
 }
 
-static void pdc202xx_dma_timeout(ide_drive_t *drive)
-{
-	pdc202xx_reset(drive);
-	ide_dma_timeout(drive);
-}
-
 static int init_chipset_pdc202xx(struct pci_dev *dev)
 {
 	unsigned long dmabase = pci_resource_start(dev, 4);
@@ -336,7 +330,7 @@ static const struct ide_dma_ops pdc20246
 	.dma_test_irq		= pdc202xx_dma_test_irq,
 	.dma_lost_irq		= pdc202xx_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= pdc202xx_dma_timeout,
+	.dma_clear		= pdc202xx_reset,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
@@ -348,7 +342,7 @@ static const struct ide_dma_ops pdc2026x
 	.dma_test_irq		= pdc202xx_dma_test_irq,
 	.dma_lost_irq		= pdc202xx_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= pdc202xx_dma_timeout,
+	.dma_clear		= pdc202xx_reset,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/pmac.c
===================================================================
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1650,7 +1650,6 @@ static const struct ide_dma_ops pmac_dma
 	.dma_start		= pmac_ide_dma_start,
 	.dma_end		= pmac_ide_dma_end,
 	.dma_test_irq		= pmac_ide_dma_test_irq,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_lost_irq		= pmac_ide_dma_lost_irq,
 };
 
Index: b/drivers/ide/sc1200.c
===================================================================
--- a/drivers/ide/sc1200.c
+++ b/drivers/ide/sc1200.c
@@ -291,7 +291,6 @@ static const struct ide_dma_ops sc1200_d
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -872,7 +872,6 @@ static const struct ide_dma_ops scc_dma_
 	.dma_end		= scc_dma_end,
 	.dma_test_irq		= scc_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
 	.dma_sff_read_status	= scc_dma_sff_read_status,
 };
Index: b/drivers/ide/sgiioc4.c
===================================================================
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -533,7 +533,6 @@ static const struct ide_dma_ops sgiioc4_
 	.dma_end		= sgiioc4_dma_end,
 	.dma_test_irq		= sgiioc4_dma_test_irq,
 	.dma_lost_irq		= sgiioc4_dma_lost_irq,
-	.dma_timeout		= ide_dma_timeout,
 };
 
 static const struct ide_port_info sgiioc4_port_info __devinitconst = {
Index: b/drivers/ide/siimage.c
===================================================================
--- a/drivers/ide/siimage.c
+++ b/drivers/ide/siimage.c
@@ -715,7 +715,6 @@ static const struct ide_dma_ops sil_dma_
 	.dma_end		= ide_dma_end,
 	.dma_test_irq		= siimage_dma_test_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
Index: b/drivers/ide/sl82c105.c
===================================================================
--- a/drivers/ide/sl82c105.c
+++ b/drivers/ide/sl82c105.c
@@ -189,14 +189,13 @@ static void sl82c105_dma_start(ide_drive
 	ide_dma_start(drive);
 }
 
-static void sl82c105_dma_timeout(ide_drive_t *drive)
+static void sl82c105_dma_clear(ide_drive_t *drive)
 {
 	struct pci_dev *dev = to_pci_dev(drive->hwif->dev);
 
-	DBG(("sl82c105_dma_timeout(drive:%s)\n", drive->name));
+	DBG(("sl82c105_dma_clear(drive:%s)\n", drive->name));
 
 	sl82c105_reset_host(dev);
-	ide_dma_timeout(drive);
 }
 
 static int sl82c105_dma_end(ide_drive_t *drive)
@@ -298,7 +297,7 @@ static const struct ide_dma_ops sl82c105
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= sl82c105_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= sl82c105_dma_timeout,
+	.dma_clear		= sl82c105_dma_clear,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/tc86c001.c
===================================================================
--- a/drivers/ide/tc86c001.c
+++ b/drivers/ide/tc86c001.c
@@ -187,7 +187,6 @@ static const struct ide_dma_ops tc86c001
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
Index: b/drivers/ide/trm290.c
===================================================================
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -314,7 +314,6 @@ static struct ide_dma_ops trm290_dma_ops
 	.dma_end		= trm290_dma_end,
 	.dma_test_irq		= trm290_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
-	.dma_timeout		= ide_dma_timeout,
 };
 
 static const struct ide_port_info trm290_chipset __devinitdata = {
Index: b/drivers/ide/tx4939ide.c
===================================================================
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -632,7 +632,6 @@ static const struct ide_dma_ops tx4939id
 	.dma_test_irq		= tx4939ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_timeout		= ide_dma_timeout,
 	.dma_sff_read_status	= tx4939ide_dma_sff_read_status,
 };
 
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -715,8 +715,9 @@ struct ide_dma_ops {
 	int	(*dma_end)(struct ide_drive_s *);
 	int	(*dma_test_irq)(struct ide_drive_s *);
 	void	(*dma_lost_irq)(struct ide_drive_s *);
+	/* below ones are optional */
 	int	(*dma_timer_expiry)(struct ide_drive_s *);
-	void	(*dma_timeout)(struct ide_drive_s *);
+	void	(*dma_clear)(struct ide_drive_s *);
 	/*
 	 * The following method is optional and only required to be
 	 * implemented for the SFF-8038i compatible controllers.
@@ -1458,7 +1459,6 @@ static inline int config_drive_for_dma(i
 #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */
 
 void ide_dma_lost_irq(ide_drive_t *);
-void ide_dma_timeout(ide_drive_t *);
 ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int);
 
 #else

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 02/10] ide: inline ide_dma_timeout() into ide_dma_timeout_retry()
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
  2009-02-20 17:11 ` [PATCH 01/10] ide: add ->dma_clear method and remove ->dma_timeout one Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:11 ` Bartlomiej Zolnierkiewicz
  2009-03-08 22:18   ` Sergei Shtylyov
  2009-02-20 17:12 ` [PATCH 03/10] ide: destroy DMA mappings after ending DMA Bartlomiej Zolnierkiewicz
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:11 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: inline ide_dma_timeout() into ide_dma_timeout_retry()

Since ide_dma_timeout() is only used by ide_dma_timeout_retry()
inline it there.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-dma.c |   21 ++++++---------------
 1 file changed, 6 insertions(+), 15 deletions(-)

Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -456,20 +456,6 @@ void ide_dma_lost_irq(ide_drive_t *drive
 }
 EXPORT_SYMBOL_GPL(ide_dma_lost_irq);
 
-static void ide_dma_timeout(ide_drive_t *drive)
-{
-	ide_hwif_t *hwif = drive->hwif;
-
-	printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name);
-
-	if (hwif->dma_ops->dma_test_irq(drive))
-		return;
-
-	ide_dump_status(drive, "DMA timeout", hwif->tp_ops->read_status(hwif));
-
-	hwif->dma_ops->dma_end(drive);
-}
-
 /*
  * un-busy the port etc, and clear any pending DMA status. we want to
  * retry the current request in pio mode instead of risking tossing it
@@ -495,7 +481,12 @@ ide_startstop_t ide_dma_timeout_retry(id
 		printk(KERN_WARNING "%s: DMA timeout retry\n", drive->name);
 		if (dma_ops->dma_clear)
 			dma_ops->dma_clear(drive);
-		ide_dma_timeout(drive);
+		printk(KERN_ERR "%s: timeout waiting for DMA\n", drive->name);
+		if (dma_ops->dma_test_irq(drive) == 0) {
+			ide_dump_status(drive, "DMA timeout",
+					hwif->tp_ops->read_status(hwif));
+			(void)dma_ops->dma_end(drive);
+		}
 	}
 
 	/*

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 03/10] ide: destroy DMA mappings after ending DMA
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
  2009-02-20 17:11 ` [PATCH 01/10] ide: add ->dma_clear method and remove ->dma_timeout one Bartlomiej Zolnierkiewicz
  2009-02-20 17:11 ` [PATCH 02/10] ide: inline ide_dma_timeout() into ide_dma_timeout_retry() Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  2009-03-09 14:00   ` Sergei Shtylyov
  2009-03-14  7:12   ` Grant Grundler
  2009-02-20 17:12 ` [PATCH 04/10] ide: add ide_dma_prepare() helper Bartlomiej Zolnierkiewicz
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: destroy DMA mappings after ending DMA

Move ide_destroy_dmatable() call out from ->dma_end method to
{ide_pc,cdrom_newpc,ide_dma}_intr(), ide_dma_timeout_retry()
and sgiioc4_resetproc().

This causes minor/safe behavior changes w.r.t.:
* cmd64x.c::cmd64{8,x}_dma_end()
* cs5536.c::cs5536_dma_end()
* icside.c::icside_dma_end()
* it821x.c::it821x_dma_end()
* scc_pata.c::__scc_dma_end()
* sl82c105.c::sl82c105_dma_end()
* tx4939ide.c::tx4939ide_dma_end()

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/au1xxx-ide.c  |    2 --
 drivers/ide/cmd64x.c      |    2 --
 drivers/ide/icside.c      |    3 ---
 drivers/ide/ide-atapi.c   |    7 +++++--
 drivers/ide/ide-cd.c      |    1 +
 drivers/ide/ide-dma-sff.c |    2 --
 drivers/ide/ide-dma.c     |    3 +++
 drivers/ide/ns87415.c     |    2 --
 drivers/ide/pmac.c        |    2 --
 drivers/ide/sc1200.c      |    1 -
 drivers/ide/scc_pata.c    |    2 --
 drivers/ide/sgiioc4.c     |    2 +-
 drivers/ide/trm290.c      |    3 +--
 drivers/ide/tx4939ide.c   |    4 +---
 14 files changed, 12 insertions(+), 24 deletions(-)

Index: b/drivers/ide/au1xxx-ide.c
===================================================================
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -280,8 +280,6 @@ static int auide_build_dmatable(ide_driv
 
 static int auide_dma_end(ide_drive_t *drive)
 {
-	ide_destroy_dmatable(drive);
-
 	return 0;
 }
 
Index: b/drivers/ide/cmd64x.c
===================================================================
--- a/drivers/ide/cmd64x.c
+++ b/drivers/ide/cmd64x.c
@@ -327,8 +327,6 @@ static int cmd646_1_dma_end(ide_drive_t 
 	outb(dma_cmd & ~1, hwif->dma_base + ATA_DMA_CMD);
 	/* clear the INTR & ERROR bits */
 	outb(dma_stat | 6, hwif->dma_base + ATA_DMA_STATUS);
-	/* and free any DMA resources */
-	ide_destroy_dmatable(drive);
 	/* verify good DMA status */
 	return (dma_stat & 7) != 4;
 }
Index: b/drivers/ide/icside.c
===================================================================
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -291,9 +291,6 @@ static int icside_dma_end(ide_drive_t *d
 
 	disable_dma(ec->dma);
 
-	/* Teardown mappings after DMA has completed. */
-	ide_destroy_dmatable(drive);
-
 	return get_dma_residue(ec->dma) != 0;
 }
 
Index: b/drivers/ide/ide-atapi.c
===================================================================
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -322,8 +322,11 @@ static ide_startstop_t ide_pc_intr(ide_d
 	stat = tp_ops->read_status(hwif);
 
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
-		if (hwif->dma_ops->dma_end(drive) ||
-		    (drive->media == ide_tape && (stat & ATA_ERR))) {
+		int rc = hwif->dma_ops->dma_end(drive);
+
+		ide_destroy_dmatable(drive);
+
+		if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) {
 			if (drive->media == ide_floppy)
 				printk(KERN_ERR "%s: DMA %s error\n",
 					drive->name, rq_data_dir(pc->rq)
Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -639,6 +639,7 @@ static ide_startstop_t cdrom_newpc_intr(
 	if (dma) {
 		drive->dma = 0;
 		dma_error = hwif->dma_ops->dma_end(drive);
+		ide_destroy_dmatable(drive);
 		if (dma_error) {
 			printk(KERN_ERR PFX "%s: DMA %s error\n", drive->name,
 					write ? "write" : "read");
Index: b/drivers/ide/ide-dma-sff.c
===================================================================
--- a/drivers/ide/ide-dma-sff.c
+++ b/drivers/ide/ide-dma-sff.c
@@ -310,8 +310,6 @@ int ide_dma_end(ide_drive_t *drive)
 	/* clear INTR & ERROR bits */
 	ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);
 
-	/* purge DMA mappings */
-	ide_destroy_dmatable(drive);
 	wmb();
 
 	/* verify good DMA status */
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -92,6 +92,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t
 	u8 stat = 0, dma_stat = 0;
 
 	dma_stat = hwif->dma_ops->dma_end(drive);
+	ide_destroy_dmatable(drive);
 	stat = hwif->tp_ops->read_status(hwif);
 
 	if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) {
@@ -475,6 +476,7 @@ ide_startstop_t ide_dma_timeout_retry(id
 	if (error < 0) {
 		printk(KERN_WARNING "%s: DMA timeout error\n", drive->name);
 		(void)dma_ops->dma_end(drive);
+		ide_destroy_dmatable(drive);
 		ret = ide_error(drive, "dma timeout error",
 				hwif->tp_ops->read_status(hwif));
 	} else {
@@ -486,6 +488,7 @@ ide_startstop_t ide_dma_timeout_retry(id
 			ide_dump_status(drive, "DMA timeout",
 					hwif->tp_ops->read_status(hwif));
 			(void)dma_ops->dma_end(drive);
+			ide_destroy_dmatable(drive);
 		}
 	}
 
Index: b/drivers/ide/ns87415.c
===================================================================
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -210,8 +210,6 @@ static int ns87415_dma_end(ide_drive_t *
 	/* from ERRATA: clear the INTR & ERROR bits */
 	dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
 	outb(dma_cmd | 6, hwif->dma_base + ATA_DMA_CMD);
-	/* and free any DMA resources */
-	ide_destroy_dmatable(drive);
 	/* verify good DMA status */
 	return (dma_stat & 7) != 4;
 }
Index: b/drivers/ide/pmac.c
===================================================================
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1562,8 +1562,6 @@ pmac_ide_dma_end (ide_drive_t *drive)
 	dstat = readl(&dma->status);
 	writel(((RUN|WAKE|DEAD) << 16), &dma->control);
 
-	ide_destroy_dmatable(drive);
-
 	/* verify good dma status. we don't check for ACTIVE beeing 0. We should...
 	 * in theory, but with ATAPI decices doing buffer underruns, that would
 	 * cause us to disable DMA, which isn't what we want
Index: b/drivers/ide/sc1200.c
===================================================================
--- a/drivers/ide/sc1200.c
+++ b/drivers/ide/sc1200.c
@@ -184,7 +184,6 @@ static int sc1200_dma_end(ide_drive_t *d
 	outb(inb(dma_base)&~1, dma_base);	/* !! DO THIS HERE !! stop DMA */
 
 	drive->waiting_for_dma = 0;
-	ide_destroy_dmatable(drive);		/* purge DMA mappings */
 
 	return (dma_stat & 7) != 4;		/* verify good DMA status */
 }
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -365,8 +365,6 @@ static int __scc_dma_end(ide_drive_t *dr
 	dma_stat = scc_dma_sff_read_status(hwif);
 	/* clear the INTR & ERROR bits */
 	scc_ide_outb(dma_stat | 6, hwif->dma_base + 4);
-	/* purge DMA mappings */
-	ide_destroy_dmatable(drive);
 	/* verify good DMA status */
 	wmb();
 	return (dma_stat & 7) != 4 ? (0x10 | dma_stat) : 0;
Index: b/drivers/ide/sgiioc4.c
===================================================================
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -259,7 +259,6 @@ static int sgiioc4_dma_end(ide_drive_t *
 	}
 
 	drive->waiting_for_dma = 0;
-	ide_destroy_dmatable(drive);
 
 	return dma_stat;
 }
@@ -284,6 +283,7 @@ static void
 sgiioc4_resetproc(ide_drive_t * drive)
 {
 	sgiioc4_dma_end(drive);
+	ide_destroy_dmatable(drive);
 	sgiioc4_clearirq(drive);
 }
 
Index: b/drivers/ide/trm290.c
===================================================================
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -216,8 +216,7 @@ static int trm290_dma_end(ide_drive_t *d
 	u16 status;
 
 	drive->waiting_for_dma = 0;
-	/* purge DMA mappings */
-	ide_destroy_dmatable(drive);
+
 	status = inw(drive->hwif->dma_base + 2);
 
 	return status != 0x00ff;
Index: b/drivers/ide/tx4939ide.c
===================================================================
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -335,11 +335,9 @@ static int tx4939ide_dma_end(ide_drive_t
 	/* read and clear the INTR & ERROR bits */
 	dma_stat = tx4939ide_clear_dma_status(base);
 
-	/* purge DMA mappings */
-	ide_destroy_dmatable(drive);
-	/* verify good DMA status */
 	wmb();
 
+	/* verify good DMA status */
 	if ((dma_stat & (ATA_DMA_INTR | ATA_DMA_ERR | ATA_DMA_ACTIVE)) == 0 &&
 	    (ctl & (TX4939IDE_INT_XFEREND | TX4939IDE_INT_HOST)) ==
 	    (TX4939IDE_INT_XFEREND | TX4939IDE_INT_HOST))

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 04/10] ide: add ide_dma_prepare() helper
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
                   ` (2 preceding siblings ...)
  2009-02-20 17:12 ` [PATCH 03/10] ide: destroy DMA mappings after ending DMA Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  2009-03-09 14:36   ` Sergei Shtylyov
  2009-02-20 17:12 ` [PATCH 05/10] ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive() Bartlomiej Zolnierkiewicz
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: add ide_dma_prepare() helper

* Add ide_dma_prepare() helper.

* Convert ide_issue_pc() and do_rw_taskfile() to use it.

* Make ide_build_sglist() static.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-atapi.c    |   18 ++++--------------
 drivers/ide/ide-dma.c      |   11 ++++++++++-
 drivers/ide/ide-taskfile.c |    4 +---
 include/linux/ide.h        |    7 ++++---
 4 files changed, 19 insertions(+), 21 deletions(-)

Index: b/drivers/ide/ide-atapi.c
===================================================================
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -605,7 +605,6 @@ ide_startstop_t ide_issue_pc(ide_drive_t
 {
 	struct ide_atapi_pc *pc;
 	ide_hwif_t *hwif = drive->hwif;
-	const struct ide_dma_ops *dma_ops = hwif->dma_ops;
 	ide_expiry_t *expiry = NULL;
 	struct request *rq = hwif->rq;
 	unsigned int timeout;
@@ -619,12 +618,8 @@ ide_startstop_t ide_issue_pc(ide_drive_t
 		expiry = ide_cd_expiry;
 		timeout = ATAPI_WAIT_PC;
 
-		if (drive->dma) {
-			if (ide_build_sglist(drive, cmd))
-				drive->dma = !dma_ops->dma_setup(drive, cmd);
-			else
-				drive->dma = 0;
-		}
+		if (drive->dma)
+			drive->dma = !ide_dma_prepare(drive, cmd);
 	} else {
 		pc = drive->pc;
 
@@ -642,13 +637,8 @@ ide_startstop_t ide_issue_pc(ide_drive_t
 			ide_dma_off(drive);
 		}
 
-		if ((pc->flags & PC_FLAG_DMA_OK) &&
-		     (drive->dev_flags & IDE_DFLAG_USING_DMA)) {
-			if (ide_build_sglist(drive, cmd))
-				drive->dma = !dma_ops->dma_setup(drive, cmd);
-			else
-				drive->dma = 0;
-		}
+		if (pc->flags & PC_FLAG_DMA_OK)
+			drive->dma = !ide_dma_prepare(drive, cmd);
 
 		if (!drive->dma)
 			pc->flags &= ~PC_FLAG_DMA_OK;
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -128,7 +128,7 @@ int ide_dma_good_drive(ide_drive_t *driv
  *	operate in a portable fashion.
  */
 
-int ide_build_sglist(ide_drive_t *drive, struct ide_cmd *cmd)
+static int ide_build_sglist(ide_drive_t *drive, struct ide_cmd *cmd)
 {
 	ide_hwif_t *hwif = drive->hwif;
 	struct scatterlist *sg = hwif->sg_table;
@@ -559,3 +559,12 @@ int ide_allocate_dma_engine(ide_hwif_t *
 	return 0;
 }
 EXPORT_SYMBOL_GPL(ide_allocate_dma_engine);
+
+int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd)
+{
+	if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
+	    ide_build_sglist(drive, cmd) == 0 ||
+	    drive->hwif->dma_ops->dma_setup(drive, cmd))
+		return 1;
+	return 0;
+}
Index: b/drivers/ide/ide-taskfile.c
===================================================================
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -100,9 +100,7 @@ ide_startstop_t do_rw_taskfile(ide_drive
 		ide_execute_command(drive, cmd, handler, WAIT_WORSTCASE);
 		return ide_started;
 	case ATA_PROT_DMA:
-		if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
-		    ide_build_sglist(drive, cmd) == 0 ||
-		    dma_ops->dma_setup(drive, cmd))
+		if (ide_dma_prepare(drive, cmd))
 			return ide_stopped;
 		hwif->expiry = dma_ops->dma_timer_expiry;
 		ide_execute_command(drive, cmd, ide_dma_intr, 2 * WAIT_CMD);
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1440,7 +1440,8 @@ ide_startstop_t ide_dma_intr(ide_drive_t
 int ide_allocate_dma_engine(ide_hwif_t *);
 void ide_release_dma_engine(ide_hwif_t *);
 
-int ide_build_sglist(ide_drive_t *, struct ide_cmd *);
+int ide_dma_prepare(ide_drive_t *, struct ide_cmd *);
+
 void ide_destroy_dmatable(ide_drive_t *);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_SFF
@@ -1474,8 +1475,8 @@ static inline void ide_check_dma_crc(ide
 static inline ide_startstop_t ide_dma_intr(ide_drive_t *drive) { return ide_stopped; }
 static inline ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) { return ide_stopped; }
 static inline void ide_release_dma_engine(ide_hwif_t *hwif) { ; }
-static inline int ide_build_sglist(ide_drive_t *drive,
-				   struct ide_cmd *cmd) { return 0; }
+static int ide_dma_prepare(ide_drive_t *drive,
+			   struct ide_cmd *cmd) { return 1; }
 #endif /* CONFIG_BLK_DEV_IDEDMA */
 
 #ifdef CONFIG_BLK_DEV_IDEACPI

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 05/10] ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive()
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
                   ` (3 preceding siblings ...)
  2009-02-20 17:12 ` [PATCH 04/10] ide: add ide_dma_prepare() helper Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  2009-03-08 22:22   ` Sergei Shtylyov
  2009-02-20 17:12 ` [PATCH 06/10] trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive() Bartlomiej Zolnierkiewicz
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive()

Use custom ->dma_{start,end} methods to handle ns87415_prepare_drive()
there instead of in ->dma_setup method.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ns87415.c |   24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

Index: b/drivers/ide/ns87415.c
===================================================================
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -196,6 +196,12 @@ static void ns87415_selectproc (ide_driv
 			      !!(drive->dev_flags & IDE_DFLAG_USING_DMA));
 }
 
+static void ns87415_dma_start(ide_drive_t *drive)
+{
+	ns87415_prepare_drive(drive, 1);
+	ide_dma_start(drive);
+}
+
 static int ns87415_dma_end(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = drive->hwif;
@@ -210,19 +216,11 @@ static int ns87415_dma_end(ide_drive_t *
 	/* from ERRATA: clear the INTR & ERROR bits */
 	dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
 	outb(dma_cmd | 6, hwif->dma_base + ATA_DMA_CMD);
-	/* verify good DMA status */
-	return (dma_stat & 7) != 4;
-}
 
-static int ns87415_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
-{
-	/* select DMA xfer */
-	ns87415_prepare_drive(drive, 1);
-	if (ide_dma_setup(drive, cmd) == 0)
-		return 0;
-	/* DMA failed: select PIO xfer */
 	ns87415_prepare_drive(drive, 0);
-	return 1;
+
+	/* verify good DMA status */
+	return (dma_stat & 7) != 4;
 }
 
 static void __devinit init_hwif_ns87415 (ide_hwif_t *hwif)
@@ -298,8 +296,8 @@ static const struct ide_port_ops ns87415
 
 static const struct ide_dma_ops ns87415_dma_ops = {
 	.dma_host_set		= ide_dma_host_set,
-	.dma_setup		= ns87415_dma_setup,
-	.dma_start		= ide_dma_start,
+	.dma_setup		= ide_dma_setup,
+	.dma_start		= ns87415_dma_start,
 	.dma_end		= ns87415_dma_end,
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 06/10] trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive()
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
                   ` (4 preceding siblings ...)
  2009-02-20 17:12 ` [PATCH 05/10] ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive() Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  2009-03-08 22:26   ` Sergei Shtylyov
  2009-02-20 17:12 ` [PATCH 07/10] ide: add ->dma_check method Bartlomiej Zolnierkiewicz
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive()

Use custom ->dma_{start,end} methods to handle trm290_prepare_drive()
there instead of in ->dma_setup method.

There should be no functional changes caused by this patch
(DMA support is disabled currently in trm290.c).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/trm290.c |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: b/drivers/ide/trm290.c
===================================================================
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -184,7 +184,6 @@ static int trm290_dma_setup(ide_drive_t 
 	if (cmd->tf_flags & IDE_TFLAG_WRITE) {
 #ifdef TRM290_NO_DMA_WRITES
 		/* always use PIO for writes */
-		trm290_prepare_drive(drive, 0);	/* select PIO xfer */
 		return 1;
 #endif
 		rw = 1;
@@ -195,11 +194,8 @@ static int trm290_dma_setup(ide_drive_t 
 	if (count == 0) {
 		ide_map_sg(drive, cmd);
 		/* try PIO instead of DMA */
-		trm290_prepare_drive(drive, 0); /* select PIO xfer */
 		return 1;
 	}
-	/* select DMA xfer */
-	trm290_prepare_drive(drive, 1);
 	outl(hwif->dmatable_dma | rw, hwif->dma_base);
 	drive->waiting_for_dma = 1;
 	/* start DMA */
@@ -209,6 +205,7 @@ static int trm290_dma_setup(ide_drive_t 
 
 static void trm290_dma_start(ide_drive_t *drive)
 {
+	trm290_prepare_drive(drive, 1);
 }
 
 static int trm290_dma_end(ide_drive_t *drive)
@@ -219,6 +216,8 @@ static int trm290_dma_end(ide_drive_t *d
 
 	status = inw(drive->hwif->dma_base + 2);
 
+	trm290_prepare_drive(drive, 0);
+
 	return status != 0x00ff;
 }
 

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 07/10] ide: add ->dma_check method
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
                   ` (5 preceding siblings ...)
  2009-02-20 17:12 ` [PATCH 06/10] trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive() Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  2009-03-08 22:32   ` Sergei Shtylyov
  2009-02-20 17:12 ` [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method Bartlomiej Zolnierkiewicz
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: add ->dma_check method

* Add (an optional) ->dma_check method for checking if DMA can be
  used for a given command and fail DMA setup in ide_dma_prepare()
  if necessary.

* Convert alim15x3 and trm290 host drivers to use ->dma_check.

* Rename ali15x3_dma_setup() to ali_dma_setup() while at it.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/alim15x3.c |    9 +++++----
 drivers/ide/ide-dma.c  |    5 ++++-
 drivers/ide/trm290.c   |   17 ++++++++++-------
 include/linux/ide.h    |    1 +
 4 files changed, 20 insertions(+), 12 deletions(-)

Index: b/drivers/ide/alim15x3.c
===================================================================
--- a/drivers/ide/alim15x3.c
+++ b/drivers/ide/alim15x3.c
@@ -189,20 +189,20 @@ static void ali_set_dma_mode(ide_drive_t
 }
 
 /**
- *	ali15x3_dma_setup	-	begin a DMA phase
+ *	ali_dma_check	-	DMA check
  *	@drive:	target device
  *	@cmd: command
  *
  *	Returns 1 if the DMA cannot be performed, zero on success.
  */
 
-static int ali15x3_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
+static int ali_dma_check(ide_drive_t *drive, struct ide_cmd *cmd)
 {
 	if (m5229_revision < 0xC2 && drive->media != ide_disk) {
 		if (cmd->tf_flags & IDE_TFLAG_WRITE)
 			return 1;	/* try PIO instead of DMA */
 	}
-	return ide_dma_setup(drive, cmd);
+	return 0;
 }
 
 /**
@@ -503,11 +503,12 @@ static const struct ide_port_ops ali_por
 
 static const struct ide_dma_ops ali_dma_ops = {
 	.dma_host_set		= ide_dma_host_set,
-	.dma_setup		= ali15x3_dma_setup,
+	.dma_setup		= ide_dma_setup,
 	.dma_start		= ide_dma_start,
 	.dma_end		= ide_dma_end,
 	.dma_test_irq		= ide_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
+	.dma_check		= ali_dma_check,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -562,9 +562,12 @@ EXPORT_SYMBOL_GPL(ide_allocate_dma_engin
 
 int ide_dma_prepare(ide_drive_t *drive, struct ide_cmd *cmd)
 {
+	const struct ide_dma_ops *dma_ops = drive->hwif->dma_ops;
+
 	if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
+	    (dma_ops->dma_check && dma_ops->dma_check(drive, cmd)) ||
 	    ide_build_sglist(drive, cmd) == 0 ||
-	    drive->hwif->dma_ops->dma_setup(drive, cmd))
+	    dma_ops->dma_setup(drive, cmd))
 		return 1;
 	return 0;
 }
Index: b/drivers/ide/trm290.c
===================================================================
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -176,19 +176,21 @@ static void trm290_selectproc (ide_drive
 	trm290_prepare_drive(drive, !!(drive->dev_flags & IDE_DFLAG_USING_DMA));
 }
 
-static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
+static int trm290_dma_check(ide_drive_t *drive, struct ide_cmd *cmd)
 {
-	ide_hwif_t *hwif = drive->hwif;
-	unsigned int count, rw;
-
 	if (cmd->tf_flags & IDE_TFLAG_WRITE) {
 #ifdef TRM290_NO_DMA_WRITES
 		/* always use PIO for writes */
 		return 1;
 #endif
-		rw = 1;
-	} else
-		rw = 2;
+	}
+	return 0;
+}
+
+static int trm290_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
+{
+	ide_hwif_t *hwif = drive->hwif;
+	unsigned int count, rw = (cmd->tf_flags & IDE_TFLAG_WRITE) ? 1 : 2;
 
 	count = ide_build_dmatable(drive, cmd);
 	if (count == 0) {
@@ -312,6 +314,7 @@ static struct ide_dma_ops trm290_dma_ops
 	.dma_end		= trm290_dma_end,
 	.dma_test_irq		= trm290_dma_test_irq,
 	.dma_lost_irq		= ide_dma_lost_irq,
+	.dma_check		= trm290_dma_check,
 };
 
 static const struct ide_port_info trm290_chipset __devinitdata = {
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -716,6 +716,7 @@ struct ide_dma_ops {
 	int	(*dma_test_irq)(struct ide_drive_s *);
 	void	(*dma_lost_irq)(struct ide_drive_s *);
 	/* below ones are optional */
+	int	(*dma_check)(struct ide_drive_s *, struct ide_cmd *);
 	int	(*dma_timer_expiry)(struct ide_drive_s *);
 	void	(*dma_clear)(struct ide_drive_s *);
 	/*

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
                   ` (6 preceding siblings ...)
  2009-02-20 17:12 ` [PATCH 07/10] ide: add ->dma_check method Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  2009-03-09 14:42   ` Sergei Shtylyov
  2009-02-20 17:12 ` [PATCH 09/10] ide: set/clear drive->waiting_for_dma flag in the core code Bartlomiej Zolnierkiewicz
  2009-02-20 17:12 ` [PATCH 10/10] ide: sanitize ide_build_sglist() and ide_destroy_dmatable() Bartlomiej Zolnierkiewicz
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: move ide_map_sg() call out from ->dma_setup method

Move ide_map_sg() call from ->dma_setup implementations
and ide_destroy_dmatable() one from *_build_dmatable() to
ide_dma_prepare().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/au1xxx-ide.c  |    8 ++------
 drivers/ide/ide-dma-sff.c |    2 --
 drivers/ide/ide-dma.c     |    8 ++++++--
 drivers/ide/pmac.c        |    6 +-----
 drivers/ide/scc_pata.c    |    4 +---
 drivers/ide/sgiioc4.c     |    6 +-----
 drivers/ide/trm290.c      |    5 ++---
 drivers/ide/tx4939ide.c   |    6 +-----
 8 files changed, 14 insertions(+), 31 deletions(-)

Index: b/drivers/ide/au1xxx-ide.c
===================================================================
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -272,9 +272,7 @@ static int auide_build_dmatable(ide_driv
 	if (count)
 		return 1;
 
- use_pio_instead:
-	ide_destroy_dmatable(drive);
-
+use_pio_instead:
 	return 0; /* revert to PIO for this request */
 }
 
@@ -290,10 +288,8 @@ static void auide_dma_start(ide_drive_t 
 
 static int auide_dma_setup(ide_drive_t *drive, struct ide_cmd *cmd)
 {
-	if (auide_build_dmatable(drive, cmd) == 0) {
-		ide_map_sg(drive, cmd);
+	if (auide_build_dmatable(drive, cmd) == 0)
 		return 1;
-	}
 
 	drive->waiting_for_dma = 1;
 	return 0;
Index: b/drivers/ide/ide-dma-sff.c
===================================================================
--- a/drivers/ide/ide-dma-sff.c
+++ b/drivers/ide/ide-dma-sff.c
@@ -166,8 +166,6 @@ use_pio_instead:
 	printk(KERN_ERR "%s: %s\n", drive->name,
 		count ? "DMA table too small" : "empty DMA table?");
 
-	ide_destroy_dmatable(drive);
-
 	return 0; /* revert to PIO for this request */
 }
 EXPORT_SYMBOL_GPL(ide_build_dmatable);
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -566,8 +566,12 @@ int ide_dma_prepare(ide_drive_t *drive, 
 
 	if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
 	    (dma_ops->dma_check && dma_ops->dma_check(drive, cmd)) ||
-	    ide_build_sglist(drive, cmd) == 0 ||
-	    dma_ops->dma_setup(drive, cmd))
+	    ide_build_sglist(drive, cmd) == 0)
 		return 1;
+	if (dma_ops->dma_setup(drive, cmd)) {
+		ide_destroy_dmatable(drive);
+		ide_map_sg(drive, cmd);
+		return 1;
+	}
 	return 0;
 }
Index: b/drivers/ide/pmac.c
===================================================================
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1493,8 +1493,6 @@ static int pmac_ide_build_dmatable(ide_d
 	printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name);
 
 use_pio_instead:
-	ide_destroy_dmatable(drive);
-
 	return 0; /* revert to PIO for this request */
 }
 
@@ -1510,10 +1508,8 @@ static int pmac_ide_dma_setup(ide_drive_
 	u8 unit = drive->dn & 1, ata4 = (pmif->kind == controller_kl_ata4);
 	u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE);
 
-	if (pmac_ide_build_dmatable(drive, cmd) == 0) {
-		ide_map_sg(drive, cmd);
+	if (pmac_ide_build_dmatable(drive, cmd) == 0)
 		return 1;
-	}
 
 	/* Apple adds 60ns to wrDataSetup on reads */
 	if (ata4 && (pmif->timings[unit] & TR_66_UDMA_EN)) {
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -321,10 +321,8 @@ static int scc_dma_setup(ide_drive_t *dr
 	u8 dma_stat;
 
 	/* fall back to pio! */
-	if (ide_build_dmatable(drive, cmd) == 0) {
-		ide_map_sg(drive, cmd);
+	if (ide_build_dmatable(drive, cmd) == 0)
 		return 1;
-	}
 
 	/* PRD table */
 	out_be32((void __iomem *)(hwif->dma_base + 8), hwif->dmatable_dma);
Index: b/drivers/ide/sgiioc4.c
===================================================================
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -478,8 +478,6 @@ static int sgiioc4_build_dmatable(ide_dr
 	}
 
 use_pio_instead:
-	ide_destroy_dmatable(drive);
-
 	return 0;		/* revert to PIO for this request */
 }
 
@@ -488,11 +486,9 @@ static int sgiioc4_dma_setup(ide_drive_t
 	int ddir;
 	u8 write = !!(cmd->tf_flags & IDE_TFLAG_WRITE);
 
-	if (sgiioc4_build_dmatable(drive, cmd) == 0) {
+	if (sgiioc4_build_dmatable(drive, cmd) == 0)
 		/* try PIO instead of DMA */
-		ide_map_sg(drive, cmd);
 		return 1;
-	}
 
 	if (write)
 		/* Writes TO the IOC4 FROM Main Memory */
Index: b/drivers/ide/trm290.c
===================================================================
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -193,11 +193,10 @@ static int trm290_dma_setup(ide_drive_t 
 	unsigned int count, rw = (cmd->tf_flags & IDE_TFLAG_WRITE) ? 1 : 2;
 
 	count = ide_build_dmatable(drive, cmd);
-	if (count == 0) {
-		ide_map_sg(drive, cmd);
+	if (count == 0)
 		/* try PIO instead of DMA */
 		return 1;
-	}
+
 	outl(hwif->dmatable_dma | rw, hwif->dma_base);
 	drive->waiting_for_dma = 1;
 	/* start DMA */
Index: b/drivers/ide/tx4939ide.c
===================================================================
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -279,8 +279,6 @@ use_pio_instead:
 	printk(KERN_ERR "%s: %s\n", drive->name,
 		count ? "DMA table too small" : "empty DMA table?");
 
-	ide_destroy_dmatable(drive);
-
 	return 0; /* revert to PIO for this request */
 }
 #else
@@ -294,10 +292,8 @@ static int tx4939ide_dma_setup(ide_drive
 	u8 rw = (cmd->tf_flags & IDE_TFLAG_WRITE) ? 0 : ATA_DMA_WR;
 
 	/* fall back to PIO! */
-	if (tx4939ide_build_dmatable(drive, cmd) == 0) {
-		ide_map_sg(drive, cmd);
+	if (tx4939ide_build_dmatable(drive, cmd) == 0)
 		return 1;
-	}
 
 	/* PRD table */
 	tx4939ide_writel(hwif->dmatable_dma, base, TX4939IDE_PRD_Ptr);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 09/10] ide: set/clear drive->waiting_for_dma flag in the core code
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
                   ` (7 preceding siblings ...)
  2009-02-20 17:12 ` [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  2009-03-10 15:05   ` Sergei Shtylyov
  2009-02-20 17:12 ` [PATCH 10/10] ide: sanitize ide_build_sglist() and ide_destroy_dmatable() Bartlomiej Zolnierkiewicz
  9 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: set/clear drive->waiting_for_dma flag in the core code

Set/clear drive->waiting_for_dma flag in the core code
instead of in ->dma_setup and ->dma_end methods.

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/au1xxx-ide.c  |    6 ------
 drivers/ide/cmd64x.c      |    1 -
 drivers/ide/icside.c      |    4 ----
 drivers/ide/ide-atapi.c   |    4 +++-
 drivers/ide/ide-cd.c      |    1 +
 drivers/ide/ide-dma-sff.c |    3 ---
 drivers/ide/ide-dma.c     |    4 ++++
 drivers/ide/ns87415.c     |    1 -
 drivers/ide/pmac.c        |    3 ---
 drivers/ide/sc1200.c      |    2 --
 drivers/ide/scc_pata.c    |    3 +--
 drivers/ide/sgiioc4.c     |    3 ---
 drivers/ide/trm290.c      |    8 ++------
 drivers/ide/tx4939ide.c   |    4 ----
 14 files changed, 11 insertions(+), 36 deletions(-)

Index: b/drivers/ide/au1xxx-ide.c
===================================================================
--- a/drivers/ide/au1xxx-ide.c
+++ b/drivers/ide/au1xxx-ide.c
@@ -291,7 +291,6 @@ static int auide_dma_setup(ide_drive_t *
 	if (auide_build_dmatable(drive, cmd) == 0)
 		return 1;
 
-	drive->waiting_for_dma = 1;
 	return 0;
 }
 
@@ -316,16 +315,11 @@ static void auide_dma_host_set(ide_drive
 
 static void auide_ddma_tx_callback(int irq, void *param)
 {
-	_auide_hwif *ahwif = (_auide_hwif*)param;
-	ahwif->drive->waiting_for_dma = 0;
 }
 
 static void auide_ddma_rx_callback(int irq, void *param)
 {
-	_auide_hwif *ahwif = (_auide_hwif*)param;
-	ahwif->drive->waiting_for_dma = 0;
 }
-
 #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
 
 static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 devwidth, u32 flags)
Index: b/drivers/ide/cmd64x.c
===================================================================
--- a/drivers/ide/cmd64x.c
+++ b/drivers/ide/cmd64x.c
@@ -318,7 +318,6 @@ static int cmd646_1_dma_end(ide_drive_t 
 	ide_hwif_t *hwif = drive->hwif;
 	u8 dma_stat = 0, dma_cmd = 0;
 
-	drive->waiting_for_dma = 0;
 	/* get DMA status */
 	dma_stat = inb(hwif->dma_base + ATA_DMA_STATUS);
 	/* read DMA command state */
Index: b/drivers/ide/icside.c
===================================================================
--- a/drivers/ide/icside.c
+++ b/drivers/ide/icside.c
@@ -287,8 +287,6 @@ static int icside_dma_end(ide_drive_t *d
 	ide_hwif_t *hwif = drive->hwif;
 	struct expansion_card *ec = ECARD_DEV(hwif->dev);
 
-	drive->waiting_for_dma = 0;
-
 	disable_dma(ec->dma);
 
 	return get_dma_residue(ec->dma) != 0;
@@ -343,8 +341,6 @@ static int icside_dma_setup(ide_drive_t 
 	set_dma_sg(ec->dma, hwif->sg_table, cmd->sg_nents);
 	set_dma_mode(ec->dma, dma_mode);
 
-	drive->waiting_for_dma = 1;
-
 	return 0;
 }
 
Index: b/drivers/ide/ide-atapi.c
===================================================================
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -322,8 +322,10 @@ static ide_startstop_t ide_pc_intr(ide_d
 	stat = tp_ops->read_status(hwif);
 
 	if (pc->flags & PC_FLAG_DMA_IN_PROGRESS) {
-		int rc = hwif->dma_ops->dma_end(drive);
+		int rc;
 
+		drive->waiting_for_dma = 0;
+		rc = hwif->dma_ops->dma_end(drive);
 		ide_destroy_dmatable(drive);
 
 		if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) {
Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -638,6 +638,7 @@ static ide_startstop_t cdrom_newpc_intr(
 	dma = drive->dma;
 	if (dma) {
 		drive->dma = 0;
+		drive->waiting_for_dma = 0;
 		dma_error = hwif->dma_ops->dma_end(drive);
 		ide_destroy_dmatable(drive);
 		if (dma_error) {
Index: b/drivers/ide/ide-dma-sff.c
===================================================================
--- a/drivers/ide/ide-dma-sff.c
+++ b/drivers/ide/ide-dma-sff.c
@@ -216,7 +216,6 @@ int ide_dma_setup(ide_drive_t *drive, st
 	/* clear INTR & ERROR flags */
 	ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);
 
-	drive->waiting_for_dma = 1;
 	return 0;
 }
 EXPORT_SYMBOL_GPL(ide_dma_setup);
@@ -290,8 +289,6 @@ int ide_dma_end(ide_drive_t *drive)
 	ide_hwif_t *hwif = drive->hwif;
 	u8 dma_stat = 0, dma_cmd = 0, mask;
 
-	drive->waiting_for_dma = 0;
-
 	/* stop DMA */
 	if (hwif->host_flags & IDE_HFLAG_MMIO) {
 		dma_cmd = readb((void __iomem *)(hwif->dma_base + ATA_DMA_CMD));
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -91,6 +91,7 @@ ide_startstop_t ide_dma_intr(ide_drive_t
 	ide_hwif_t *hwif = drive->hwif;
 	u8 stat = 0, dma_stat = 0;
 
+	drive->waiting_for_dma = 0;
 	dma_stat = hwif->dma_ops->dma_end(drive);
 	ide_destroy_dmatable(drive);
 	stat = hwif->tp_ops->read_status(hwif);
@@ -475,6 +476,7 @@ ide_startstop_t ide_dma_timeout_retry(id
 
 	if (error < 0) {
 		printk(KERN_WARNING "%s: DMA timeout error\n", drive->name);
+		drive->waiting_for_dma = 0;
 		(void)dma_ops->dma_end(drive);
 		ide_destroy_dmatable(drive);
 		ret = ide_error(drive, "dma timeout error",
@@ -487,6 +489,7 @@ ide_startstop_t ide_dma_timeout_retry(id
 		if (dma_ops->dma_test_irq(drive) == 0) {
 			ide_dump_status(drive, "DMA timeout",
 					hwif->tp_ops->read_status(hwif));
+			drive->waiting_for_dma = 0;
 			(void)dma_ops->dma_end(drive);
 			ide_destroy_dmatable(drive);
 		}
@@ -573,5 +576,6 @@ int ide_dma_prepare(ide_drive_t *drive, 
 		ide_map_sg(drive, cmd);
 		return 1;
 	}
+	drive->waiting_for_dma = 1;
 	return 0;
 }
Index: b/drivers/ide/ns87415.c
===================================================================
--- a/drivers/ide/ns87415.c
+++ b/drivers/ide/ns87415.c
@@ -207,7 +207,6 @@ static int ns87415_dma_end(ide_drive_t *
 	ide_hwif_t *hwif = drive->hwif;
 	u8 dma_stat = 0, dma_cmd = 0;
 
-	drive->waiting_for_dma = 0;
 	dma_stat = hwif->dma_ops->dma_sff_read_status(hwif);
 	/* get DMA command mode */
 	dma_cmd = inb(hwif->dma_base + ATA_DMA_CMD);
Index: b/drivers/ide/pmac.c
===================================================================
--- a/drivers/ide/pmac.c
+++ b/drivers/ide/pmac.c
@@ -1518,8 +1518,6 @@ static int pmac_ide_dma_setup(ide_drive_
 		(void)readl(PMAC_IDE_REG(IDE_TIMING_CONFIG));
 	}
 
-	drive->waiting_for_dma = 1;
-
 	return 0;
 }
 
@@ -1554,7 +1552,6 @@ pmac_ide_dma_end (ide_drive_t *drive)
 	volatile struct dbdma_regs __iomem *dma = pmif->dma_regs;
 	u32 dstat;
 
-	drive->waiting_for_dma = 0;
 	dstat = readl(&dma->status);
 	writel(((RUN|WAKE|DEAD) << 16), &dma->control);
 
Index: b/drivers/ide/sc1200.c
===================================================================
--- a/drivers/ide/sc1200.c
+++ b/drivers/ide/sc1200.c
@@ -183,8 +183,6 @@ static int sc1200_dma_end(ide_drive_t *d
 	outb(dma_stat|0x1b, dma_base+2);	/* clear the INTR & ERROR bits */
 	outb(inb(dma_base)&~1, dma_base);	/* !! DO THIS HERE !! stop DMA */
 
-	drive->waiting_for_dma = 0;
-
 	return (dma_stat & 7) != 4;		/* verify good DMA status */
 }
 
Index: b/drivers/ide/scc_pata.c
===================================================================
--- a/drivers/ide/scc_pata.c
+++ b/drivers/ide/scc_pata.c
@@ -335,7 +335,7 @@ static int scc_dma_setup(ide_drive_t *dr
 
 	/* clear INTR & ERROR flags */
 	out_be32((void __iomem *)(hwif->dma_base + 4), dma_stat | 6);
-	drive->waiting_for_dma = 1;
+
 	return 0;
 }
 
@@ -354,7 +354,6 @@ static int __scc_dma_end(ide_drive_t *dr
 	ide_hwif_t *hwif = drive->hwif;
 	u8 dma_stat, dma_cmd;
 
-	drive->waiting_for_dma = 0;
 	/* get DMA command mode */
 	dma_cmd = scc_ide_inb(hwif->dma_base);
 	/* stop DMA */
Index: b/drivers/ide/sgiioc4.c
===================================================================
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -258,8 +258,6 @@ static int sgiioc4_dma_end(ide_drive_t *
 		}
 	}
 
-	drive->waiting_for_dma = 0;
-
 	return dma_stat;
 }
 
@@ -412,7 +410,6 @@ sgiioc4_configure_for_dma(int dma_direct
 	writel(ending_dma_addr, (void __iomem *)(dma_base + IOC4_DMA_END_ADDR * 4));
 
 	writel(dma_direction, (void __iomem *)ioc4_dma_addr);
-	drive->waiting_for_dma = 1;
 }
 
 /* IOC4 Scatter Gather list Format 					 */
Index: b/drivers/ide/trm290.c
===================================================================
--- a/drivers/ide/trm290.c
+++ b/drivers/ide/trm290.c
@@ -198,9 +198,9 @@ static int trm290_dma_setup(ide_drive_t 
 		return 1;
 
 	outl(hwif->dmatable_dma | rw, hwif->dma_base);
-	drive->waiting_for_dma = 1;
 	/* start DMA */
 	outw(count * 2 - 1, hwif->dma_base + 2);
+
 	return 0;
 }
 
@@ -211,11 +211,7 @@ static void trm290_dma_start(ide_drive_t
 
 static int trm290_dma_end(ide_drive_t *drive)
 {
-	u16 status;
-
-	drive->waiting_for_dma = 0;
-
-	status = inw(drive->hwif->dma_base + 2);
+	u16 status = inw(drive->hwif->dma_base + 2);
 
 	trm290_prepare_drive(drive, 0);
 
Index: b/drivers/ide/tx4939ide.c
===================================================================
--- a/drivers/ide/tx4939ide.c
+++ b/drivers/ide/tx4939ide.c
@@ -304,8 +304,6 @@ static int tx4939ide_dma_setup(ide_drive
 	/* clear INTR & ERROR flags */
 	tx4939ide_clear_dma_status(base);
 
-	drive->waiting_for_dma = 1;
-
 	tx4939ide_writew(SECTOR_SIZE / 2, base, drive->dn ?
 			 TX4939IDE_Xfer_Cnt_2 : TX4939IDE_Xfer_Cnt_1);
 
@@ -321,8 +319,6 @@ static int tx4939ide_dma_end(ide_drive_t
 	void __iomem *base = TX4939IDE_BASE(hwif);
 	u16 ctl = tx4939ide_readw(base, TX4939IDE_Int_Ctl);
 
-	drive->waiting_for_dma = 0;
-
 	/* get DMA command mode */
 	dma_cmd = tx4939ide_readb(base, TX4939IDE_DMA_Cmd);
 	/* stop DMA */

^ permalink raw reply	[flat|nested] 28+ messages in thread

* [PATCH 10/10] ide: sanitize ide_build_sglist() and ide_destroy_dmatable()
  2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
                   ` (8 preceding siblings ...)
  2009-02-20 17:12 ` [PATCH 09/10] ide: set/clear drive->waiting_for_dma flag in the core code Bartlomiej Zolnierkiewicz
@ 2009-02-20 17:12 ` Bartlomiej Zolnierkiewicz
  9 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-02-20 17:12 UTC (permalink / raw)
  To: linux-ide; +Cc: Bartlomiej Zolnierkiewicz, linux-kernel

From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] ide: sanitize ide_build_sglist() and ide_destroy_dmatable()

* Move ide_map_sg() calls out from ide_build_sglist()
  to ide_dma_prepare().

* Pass command to ide_destroy_dmatable().

* Rename ide_build_sglist() to ide_dma_map_sg()
  and ide_destroy_dmatable() to ide_dma_unmap_sg().

There should be no functional changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---
 drivers/ide/ide-atapi.c |    2 -
 drivers/ide/ide-cd.c    |    2 -
 drivers/ide/ide-dma.c   |   50 ++++++++++++++++++++++++------------------------
 drivers/ide/sgiioc4.c   |    7 +++---
 include/linux/ide.h     |    3 --
 5 files changed, 32 insertions(+), 32 deletions(-)

Index: b/drivers/ide/ide-atapi.c
===================================================================
--- a/drivers/ide/ide-atapi.c
+++ b/drivers/ide/ide-atapi.c
@@ -284,7 +284,7 @@ static ide_startstop_t ide_pc_intr(ide_d
 
 		drive->waiting_for_dma = 0;
 		rc = hwif->dma_ops->dma_end(drive);
-		ide_destroy_dmatable(drive);
+		ide_dma_unmap_sg(drive, cmd);
 
 		if (rc || (drive->media == ide_tape && (stat & ATA_ERR))) {
 			if (drive->media == ide_floppy)
Index: b/drivers/ide/ide-cd.c
===================================================================
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -640,7 +640,7 @@ static ide_startstop_t cdrom_newpc_intr(
 		drive->dma = 0;
 		drive->waiting_for_dma = 0;
 		dma_error = hwif->dma_ops->dma_end(drive);
-		ide_destroy_dmatable(drive);
+		ide_dma_unmap_sg(drive, cmd);
 		if (dma_error) {
 			printk(KERN_ERR PFX "%s: DMA %s error\n", drive->name,
 					write ? "write" : "read");
Index: b/drivers/ide/ide-dma.c
===================================================================
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -89,17 +89,16 @@ static const struct drive_list_entry dri
 ide_startstop_t ide_dma_intr(ide_drive_t *drive)
 {
 	ide_hwif_t *hwif = drive->hwif;
+	struct ide_cmd *cmd = &hwif->cmd;
 	u8 stat = 0, dma_stat = 0;
 
 	drive->waiting_for_dma = 0;
 	dma_stat = hwif->dma_ops->dma_end(drive);
-	ide_destroy_dmatable(drive);
+	ide_dma_unmap_sg(drive, cmd);
 	stat = hwif->tp_ops->read_status(hwif);
 
 	if (OK_STAT(stat, DRIVE_READY, drive->bad_wstat | ATA_DRQ)) {
 		if (!dma_stat) {
-			struct ide_cmd *cmd = &hwif->cmd;
-
 			if ((cmd->tf_flags & IDE_TFLAG_FS) == 0)
 				ide_finish_cmd(drive, cmd, stat);
 			else
@@ -119,8 +118,8 @@ int ide_dma_good_drive(ide_drive_t *driv
 }
 
 /**
- *	ide_build_sglist	-	map IDE scatter gather for DMA I/O
- *	@drive: the drive to build the DMA table for
+ *	ide_dma_map_sg	-	map IDE scatter gather for DMA I/O
+ *	@drive: the drive to map the DMA table for
  *	@cmd: command
  *
  *	Perform the DMA mapping magic necessary to access the source or
@@ -129,23 +128,19 @@ int ide_dma_good_drive(ide_drive_t *driv
  *	operate in a portable fashion.
  */
 
-static int ide_build_sglist(ide_drive_t *drive, struct ide_cmd *cmd)
+static int ide_dma_map_sg(ide_drive_t *drive, struct ide_cmd *cmd)
 {
 	ide_hwif_t *hwif = drive->hwif;
 	struct scatterlist *sg = hwif->sg_table;
 	int i;
 
-	ide_map_sg(drive, cmd);
-
 	if (cmd->tf_flags & IDE_TFLAG_WRITE)
 		cmd->sg_dma_direction = DMA_TO_DEVICE;
 	else
 		cmd->sg_dma_direction = DMA_FROM_DEVICE;
 
 	i = dma_map_sg(hwif->dev, sg, cmd->sg_nents, cmd->sg_dma_direction);
-	if (i == 0)
-		ide_map_sg(drive, cmd);
-	else {
+	if (i) {
 		cmd->orig_sg_nents = cmd->sg_nents;
 		cmd->sg_nents = i;
 	}
@@ -154,7 +149,7 @@ static int ide_build_sglist(ide_drive_t 
 }
 
 /**
- *	ide_destroy_dmatable	-	clean up DMA mapping
+ *	ide_dma_unmap_sg	-	clean up DMA mapping
  *	@drive: The drive to unmap
  *
  *	Teardown mappings after DMA has completed. This must be called
@@ -164,15 +159,14 @@ static int ide_build_sglist(ide_drive_t 
  *	time.
  */
 
-void ide_destroy_dmatable(ide_drive_t *drive)
+void ide_dma_unmap_sg(ide_drive_t *drive, struct ide_cmd *cmd)
 {
 	ide_hwif_t *hwif = drive->hwif;
-	struct ide_cmd *cmd = &hwif->cmd;
 
 	dma_unmap_sg(hwif->dev, hwif->sg_table, cmd->orig_sg_nents,
 		     cmd->sg_dma_direction);
 }
-EXPORT_SYMBOL_GPL(ide_destroy_dmatable);
+EXPORT_SYMBOL_GPL(ide_dma_unmap_sg);
 
 /**
  *	ide_dma_off_quietly	-	Generic DMA kill
@@ -471,6 +465,7 @@ ide_startstop_t ide_dma_timeout_retry(id
 {
 	ide_hwif_t *hwif = drive->hwif;
 	const struct ide_dma_ops *dma_ops = hwif->dma_ops;
+	struct ide_cmd *cmd = &hwif->cmd;
 	struct request *rq;
 	ide_startstop_t ret = ide_stopped;
 
@@ -482,7 +477,7 @@ ide_startstop_t ide_dma_timeout_retry(id
 		printk(KERN_WARNING "%s: DMA timeout error\n", drive->name);
 		drive->waiting_for_dma = 0;
 		(void)dma_ops->dma_end(drive);
-		ide_destroy_dmatable(drive);
+		ide_dma_unmap_sg(drive, cmd);
 		ret = ide_error(drive, "dma timeout error",
 				hwif->tp_ops->read_status(hwif));
 	} else {
@@ -495,7 +490,7 @@ ide_startstop_t ide_dma_timeout_retry(id
 					hwif->tp_ops->read_status(hwif));
 			drive->waiting_for_dma = 0;
 			(void)dma_ops->dma_end(drive);
-			ide_destroy_dmatable(drive);
+			ide_dma_unmap_sg(drive, cmd);
 		}
 	}
 
@@ -572,14 +567,19 @@ int ide_dma_prepare(ide_drive_t *drive, 
 	const struct ide_dma_ops *dma_ops = drive->hwif->dma_ops;
 
 	if ((drive->dev_flags & IDE_DFLAG_USING_DMA) == 0 ||
-	    (dma_ops->dma_check && dma_ops->dma_check(drive, cmd)) ||
-	    ide_build_sglist(drive, cmd) == 0)
-		return 1;
-	if (dma_ops->dma_setup(drive, cmd)) {
-		ide_destroy_dmatable(drive);
-		ide_map_sg(drive, cmd);
-		return 1;
-	}
+	    (dma_ops->dma_check && dma_ops->dma_check(drive, cmd)))
+		goto out;
+	ide_map_sg(drive, cmd);
+	if (ide_dma_map_sg(drive, cmd) == 0)
+		goto out_map;
+	if (dma_ops->dma_setup(drive, cmd))
+		goto out_dma_unmap;
 	drive->waiting_for_dma = 1;
 	return 0;
+out_dma_unmap:
+	ide_dma_unmap_sg(drive, cmd);
+out_map:
+	ide_map_sg(drive, cmd);
+out:
+	return 1;
 }
Index: b/drivers/ide/sgiioc4.c
===================================================================
--- a/drivers/ide/sgiioc4.c
+++ b/drivers/ide/sgiioc4.c
@@ -277,11 +277,12 @@ static void sgiioc4_dma_host_set(ide_dri
 		sgiioc4_clearirq(drive);
 }
 
-static void
-sgiioc4_resetproc(ide_drive_t * drive)
+static void sgiioc4_resetproc(ide_drive_t *drive)
 {
+	struct ide_cmd *cmd = &drive->hwif->cmd;
+
 	sgiioc4_dma_end(drive);
-	ide_destroy_dmatable(drive);
+	ide_dma_unmap_sg(drive, cmd);
 	sgiioc4_clearirq(drive);
 }
 
Index: b/include/linux/ide.h
===================================================================
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1438,8 +1438,7 @@ int ide_allocate_dma_engine(ide_hwif_t *
 void ide_release_dma_engine(ide_hwif_t *);
 
 int ide_dma_prepare(ide_drive_t *, struct ide_cmd *);
-
-void ide_destroy_dmatable(ide_drive_t *);
+void ide_dma_unmap_sg(ide_drive_t *, struct ide_cmd *);
 
 #ifdef CONFIG_BLK_DEV_IDEDMA_SFF
 int config_drive_for_dma(ide_drive_t *);

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 01/10] ide: add ->dma_clear method and remove ->dma_timeout one
  2009-02-20 17:11 ` [PATCH 01/10] ide: add ->dma_clear method and remove ->dma_timeout one Bartlomiej Zolnierkiewicz
@ 2009-03-08 22:17   ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-08 22:17 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Bartlomiej Zolnierkiewicz wrote:

> All custom ->dma_timeout implementations call the generic one thus it is
> possible to have only an optional method for resetting DMA engine instead:
>
> * Add ->dma_clear method and convert hpt366, pdc202xx_old and sl82c105
>   host drivers to use it.
>
> * Always use ide_dma_timeout() in ide_dma_timeout_retry() and remove
>  ->dma_timeout method.
>
> * Make ide_dma_timeout() static.
>
> There should be no functional changes caused by this patch.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>   

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

> Index: b/include/linux/ide.h
> ===================================================================
> --- a/include/linux/ide.h
> +++ b/include/linux/ide.h
> @@ -715,8 +715,9 @@ struct ide_dma_ops {
>  	int	(*dma_end)(struct ide_drive_s *);
>  	int	(*dma_test_irq)(struct ide_drive_s *);
>  	void	(*dma_lost_irq)(struct ide_drive_s *);
> +	/* below ones are optional */
>  	int	(*dma_timer_expiry)(struct ide_drive_s *);
> -	void	(*dma_timeout)(struct ide_drive_s *);
> +	void	(*dma_clear)(struct ide_drive_s *);
>  	/*
>  	 * The following method is optional and only required to be
>   

   Perhaps worth removing the words about method being optional now...

>  	 * implemented for the SFF-8038i compatible controllers.
>   

MBR, Sergei


^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 02/10] ide: inline ide_dma_timeout() into ide_dma_timeout_retry()
  2009-02-20 17:11 ` [PATCH 02/10] ide: inline ide_dma_timeout() into ide_dma_timeout_retry() Bartlomiej Zolnierkiewicz
@ 2009-03-08 22:18   ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-08 22:18 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Bartlomiej Zolnierkiewicz wrote:

> Since ide_dma_timeout() is only used by ide_dma_timeout_retry()
> inline it there.
>
> There should be no functional changes caused by this patch.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

MBR, Sergei



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 05/10] ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive()
  2009-02-20 17:12 ` [PATCH 05/10] ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive() Bartlomiej Zolnierkiewicz
@ 2009-03-08 22:22   ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-08 22:22 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Bartlomiej Zolnierkiewicz wrote:

> Use custom ->dma_{start,end} methods to handle ns87415_prepare_drive()
> there instead of in ->dma_setup method.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

MBR, Sergei



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 06/10] trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive()
  2009-02-20 17:12 ` [PATCH 06/10] trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive() Bartlomiej Zolnierkiewicz
@ 2009-03-08 22:26   ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-08 22:26 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Hello.

Bartlomiej Zolnierkiewicz wrote:

> Use custom ->dma_{start,end} methods to handle trm290_prepare_drive()
> there instead of in ->dma_setup method.
>
> There should be no functional changes caused by this patch
> (DMA support is disabled currently in trm290.c).
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>   

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

MBR, Sergei



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 07/10] ide: add ->dma_check method
  2009-02-20 17:12 ` [PATCH 07/10] ide: add ->dma_check method Bartlomiej Zolnierkiewicz
@ 2009-03-08 22:32   ` Sergei Shtylyov
  2009-03-11 16:36     ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-08 22:32 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Bartlomiej Zolnierkiewicz wrote:

> * Add (an optional) ->dma_check method for checking if DMA can be
>   used for a given command and fail DMA setup in ide_dma_prepare()
>   if necessary.
>
> * Convert alim15x3 and trm290 host drivers to use ->dma_check.
>
> * Rename ali15x3_dma_setup() to ali_dma_setup() while at it.
>   

   ali_dma_check() you mean?

> There should be no functional changes caused by this patch.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>   

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

MBR, Sergei



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/10] ide: destroy DMA mappings after ending DMA
  2009-02-20 17:12 ` [PATCH 03/10] ide: destroy DMA mappings after ending DMA Bartlomiej Zolnierkiewicz
@ 2009-03-09 14:00   ` Sergei Shtylyov
  2009-03-14  7:12   ` Grant Grundler
  1 sibling, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-09 14:00 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Hello.

Bartlomiej Zolnierkiewicz wrote:

> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] ide: destroy DMA mappings after ending DMA
>
> Move ide_destroy_dmatable() call out from ->dma_end method to
> {ide_pc,cdrom_newpc,ide_dma}_intr(), ide_dma_timeout_retry()
> and sgiioc4_resetproc().
>
> This causes minor/safe behavior changes w.r.t.:
> * cmd64x.c::cmd64{8,x}_dma_end()
> * cs5536.c::cs5536_dma_end()
> * icside.c::icside_dma_end()
> * it821x.c::it821x_dma_end()
> * scc_pata.c::__scc_dma_end()
> * sl82c105.c::sl82c105_dma_end()
> * tx4939ide.c::tx4939ide_dma_end()
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>   

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
> Index: b/drivers/ide/sgiioc4.c
> ===================================================================
> --- a/drivers/ide/sgiioc4.c
> +++ b/drivers/ide/sgiioc4.c
> @@ -259,7 +259,6 @@ static int sgiioc4_dma_end(ide_drive_t *
>  	}
>  
>  	drive->waiting_for_dma = 0;
> -	ide_destroy_dmatable(drive);
>  
>  	return dma_stat;
>  }
> @@ -284,6 +283,7 @@ static void
>  sgiioc4_resetproc(ide_drive_t * drive)
>  {
>  	sgiioc4_dma_end(drive);
> +	ide_destroy_dmatable(drive);
>  	sgiioc4_clearirq(drive);
>  }

   I somewhat doubt that resetproc() can be called with DMA still active...

MBR, Sergei



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 04/10] ide: add ide_dma_prepare() helper
  2009-02-20 17:12 ` [PATCH 04/10] ide: add ide_dma_prepare() helper Bartlomiej Zolnierkiewicz
@ 2009-03-09 14:36   ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-09 14:36 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Bartlomiej Zolnierkiewicz wrote:

> * Add ide_dma_prepare() helper.
>
> * Convert ide_issue_pc() and do_rw_taskfile() to use it.
>
> * Make ide_build_sglist() static.
>
> There should be no functional changes caused by this patch.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

MBR, Sergei



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method
  2009-02-20 17:12 ` [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method Bartlomiej Zolnierkiewicz
@ 2009-03-09 14:42   ` Sergei Shtylyov
  2009-03-11 16:36     ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-09 14:42 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Bartlomiej Zolnierkiewicz wrote:

> Move ide_map_sg() call from ->dma_setup implementations
> and ide_destroy_dmatable() one from *_build_dmatable() to
> ide_dma_prepare().
>
> There should be no functional changes caused by this patch.
>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>   
[...]
> Index: b/drivers/ide/au1xxx-ide.c
> ===================================================================
> --- a/drivers/ide/au1xxx-ide.c
> +++ b/drivers/ide/au1xxx-ide.c
> @@ -272,9 +272,7 @@ static int auide_build_dmatable(ide_driv
>  	if (count)
>  		return 1;
>  
> - use_pio_instead:
> -	ide_destroy_dmatable(drive);
> -
> +use_pio_instead:
>   

   Could you please get rid of goto and label too, while at it?

> Index: b/drivers/ide/pmac.c
> ===================================================================
> --- a/drivers/ide/pmac.c
> +++ b/drivers/ide/pmac.c
> @@ -1493,8 +1493,6 @@ static int pmac_ide_build_dmatable(ide_d
>  	printk(KERN_DEBUG "%s: empty DMA table?\n", drive->name);
>  
>  use_pio_instead:
> -	ide_destroy_dmatable(drive);
> -
>  	return 0; /* revert to PIO for this request */

   Ditto...

> Index: b/drivers/ide/sgiioc4.c
> ===================================================================
> --- a/drivers/ide/sgiioc4.c
> +++ b/drivers/ide/sgiioc4.c
> @@ -478,8 +478,6 @@ static int sgiioc4_build_dmatable(ide_dr
>  	}
>  
>  use_pio_instead:
> -	ide_destroy_dmatable(drive);
> -
>  	return 0;		/* revert to PIO for this request */
>   

   Ditto...

MBR, Sergei



^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 09/10] ide: set/clear drive->waiting_for_dma flag in the core code
  2009-02-20 17:12 ` [PATCH 09/10] ide: set/clear drive->waiting_for_dma flag in the core code Bartlomiej Zolnierkiewicz
@ 2009-03-10 15:05   ` Sergei Shtylyov
  0 siblings, 0 replies; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-10 15:05 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Hello.

Bartlomiej Zolnierkiewicz wrote:

> Set/clear drive->waiting_for_dma flag in the core code
> instead of in ->dma_setup and ->dma_end methods.

> There should be no functional changes caused by this patch.

> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

MBR, Sergei

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 07/10] ide: add ->dma_check method
  2009-03-08 22:32   ` Sergei Shtylyov
@ 2009-03-11 16:36     ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-03-11 16:36 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide, linux-kernel

On Sunday 08 March 2009, Sergei Shtylyov wrote:
> Bartlomiej Zolnierkiewicz wrote:
> 
> > * Add (an optional) ->dma_check method for checking if DMA can be
> >   used for a given command and fail DMA setup in ide_dma_prepare()
> >   if necessary.
> >
> > * Convert alim15x3 and trm290 host drivers to use ->dma_check.
> >
> > * Rename ali15x3_dma_setup() to ali_dma_setup() while at it.
> >   
> 
>    ali_dma_check() you mean?

Yep, thanks for noticing (it is fixed now).

> > There should be no functional changes caused by this patch.
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> >   
> 
> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method
  2009-03-09 14:42   ` Sergei Shtylyov
@ 2009-03-11 16:36     ` Bartlomiej Zolnierkiewicz
  2009-03-11 17:10       ` Sergei Shtylyov
  0 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-03-11 16:36 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide, linux-kernel

On Monday 09 March 2009, Sergei Shtylyov wrote:
> Bartlomiej Zolnierkiewicz wrote:
> 
> > Move ide_map_sg() call from ->dma_setup implementations
> > and ide_destroy_dmatable() one from *_build_dmatable() to
> > ide_dma_prepare().
> >
> > There should be no functional changes caused by this patch.
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> >   
> [...]
> > Index: b/drivers/ide/au1xxx-ide.c
> > ===================================================================
> > --- a/drivers/ide/au1xxx-ide.c
> > +++ b/drivers/ide/au1xxx-ide.c
> > @@ -272,9 +272,7 @@ static int auide_build_dmatable(ide_driv
> >  	if (count)
> >  		return 1;
> >  
> > - use_pio_instead:
> > -	ide_destroy_dmatable(drive);
> > -
> > +use_pio_instead:
> >   
> 
>    Could you please get rid of goto and label too, while at it?

Sorry but since this patch has been already merged it would be too much
work/noise for too little gain IMO.

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method
  2009-03-11 16:36     ` Bartlomiej Zolnierkiewicz
@ 2009-03-11 17:10       ` Sergei Shtylyov
  2009-03-11 17:36         ` Bartlomiej Zolnierkiewicz
  0 siblings, 1 reply; 28+ messages in thread
From: Sergei Shtylyov @ 2009-03-11 17:10 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

Hello.

Bartlomiej Zolnierkiewicz wrote:

>>>Move ide_map_sg() call from ->dma_setup implementations
>>>and ide_destroy_dmatable() one from *_build_dmatable() to
>>>ide_dma_prepare().

>>>There should be no functional changes caused by this patch.

>>>Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>

>>[...]
>>
>>>Index: b/drivers/ide/au1xxx-ide.c
>>>===================================================================
>>>--- a/drivers/ide/au1xxx-ide.c
>>>+++ b/drivers/ide/au1xxx-ide.c
>>>@@ -272,9 +272,7 @@ static int auide_build_dmatable(ide_driv
>>> 	if (count)
>>> 		return 1;
>>> 
>>>- use_pio_instead:
>>>-	ide_destroy_dmatable(drive);
>>>-
>>>+use_pio_instead:

>>   Could you please get rid of goto and label too, while at it?

> Sorry but since this patch has been already merged

    Merged where?!

> it would be too much work/noise for too little gain IMO.

    Will you take a reworked patch from me?

MBR, Sergei

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method
  2009-03-11 17:10       ` Sergei Shtylyov
@ 2009-03-11 17:36         ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-03-11 17:36 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide, linux-kernel

On Wednesday 11 March 2009, Sergei Shtylyov wrote:
> Hello.
> 
> Bartlomiej Zolnierkiewicz wrote:
> 
> >>>Move ide_map_sg() call from ->dma_setup implementations
> >>>and ide_destroy_dmatable() one from *_build_dmatable() to
> >>>ide_dma_prepare().
> 
> >>>There should be no functional changes caused by this patch.
> 
> >>>Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> 
> >>[...]
> >>
> >>>Index: b/drivers/ide/au1xxx-ide.c
> >>>===================================================================
> >>>--- a/drivers/ide/au1xxx-ide.c
> >>>+++ b/drivers/ide/au1xxx-ide.c
> >>>@@ -272,9 +272,7 @@ static int auide_build_dmatable(ide_driv
> >>> 	if (count)
> >>> 		return 1;
> >>> 
> >>>- use_pio_instead:
> >>>-	ide_destroy_dmatable(drive);
> >>>-
> >>>+use_pio_instead:
> 
> >>   Could you please get rid of goto and label too, while at it?
> 
> > Sorry but since this patch has been already merged
> 
>     Merged where?!

To pata tree, two weeks ago.

I try to limit touching merged stuff as much as possible so people working
with pata tree don't get surprised too much (sometimes it is impossible but
this doesn't discourage me from trying).  

[ Some people may argue that existing stuff shouldn't change at all but
  IMO it is all case specific and this trade-off is acceptable for fixing
  regressions / preserving bisectability... ]

> > it would be too much work/noise for too little gain IMO.
> 
>     Will you take a reworked patch from me?

Well, OK this time if it won't cause rejects in later patches... though stuff
like that is really much more efficient done in incremental patches.

Thanks,
Bart

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/10] ide: destroy DMA mappings after ending DMA
  2009-02-20 17:12 ` [PATCH 03/10] ide: destroy DMA mappings after ending DMA Bartlomiej Zolnierkiewicz
  2009-03-09 14:00   ` Sergei Shtylyov
@ 2009-03-14  7:12   ` Grant Grundler
  2009-03-14 19:51     ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 28+ messages in thread
From: Grant Grundler @ 2009-03-14  7:12 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

On Fri, Feb 20, 2009 at 6:12 PM, Bartlomiej Zolnierkiewicz
<bzolnier@gmail.com> wrote:
> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Subject: [PATCH] ide: destroy DMA mappings after ending DMA
>
> Move ide_destroy_dmatable() call out from ->dma_end method to
> {ide_pc,cdrom_newpc,ide_dma}_intr(), ide_dma_timeout_retry()
> and sgiioc4_resetproc().
...
> --- a/drivers/ide/ide-dma-sff.c
> +++ b/drivers/ide/ide-dma-sff.c
> @@ -310,8 +310,6 @@ int ide_dma_end(ide_drive_t *drive)
>        /* clear INTR & ERROR bits */
>        ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);
>
> -       /* purge DMA mappings */
> -       ide_destroy_dmatable(drive);
>        wmb();

Bartlomiej,
I think the wmb() could removed as well. The outb/writeb functions are
required to be strongly ordered and I don't see anything else touching
DMA-able memory here.

BTW, care to remove "mask" usage from this function?
It's really not needed (can be replaced with #define).

I can create separate patches for both. Which git tree should I base
them against?

...
> --- a/drivers/ide/scc_pata.c
> +++ b/drivers/ide/scc_pata.c
> @@ -365,8 +365,6 @@ static int __scc_dma_end(ide_drive_t *dr
>        dma_stat = scc_dma_sff_read_status(hwif);
>        /* clear the INTR & ERROR bits */
>        scc_ide_outb(dma_stat | 6, hwif->dma_base + 4);
> -       /* purge DMA mappings */
> -       ide_destroy_dmatable(drive);
>        /* verify good DMA status */
>        wmb();

I think this wmb() can be removed too.

....
> --- a/drivers/ide/tx4939ide.c
> +++ b/drivers/ide/tx4939ide.c
> @@ -335,11 +335,9 @@ static int tx4939ide_dma_end(ide_drive_t
>        /* read and clear the INTR & ERROR bits */
>        dma_stat = tx4939ide_clear_dma_status(base);
>
> -       /* purge DMA mappings */
> -       ide_destroy_dmatable(drive);
> -       /* verify good DMA status */
>        wmb();

and this one as well.

hth,
grant

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/10] ide: destroy DMA mappings after ending DMA
  2009-03-14  7:12   ` Grant Grundler
@ 2009-03-14 19:51     ` Bartlomiej Zolnierkiewicz
  2009-03-14 20:45       ` Grant Grundler
  0 siblings, 1 reply; 28+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2009-03-14 19:51 UTC (permalink / raw)
  To: Grant Grundler; +Cc: linux-ide, linux-kernel


Hi,

On Saturday 14 March 2009, Grant Grundler wrote:
> On Fri, Feb 20, 2009 at 6:12 PM, Bartlomiej Zolnierkiewicz
> <bzolnier@gmail.com> wrote:
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] ide: destroy DMA mappings after ending DMA
> >
> > Move ide_destroy_dmatable() call out from ->dma_end method to
> > {ide_pc,cdrom_newpc,ide_dma}_intr(), ide_dma_timeout_retry()
> > and sgiioc4_resetproc().
> ...
> > --- a/drivers/ide/ide-dma-sff.c
> > +++ b/drivers/ide/ide-dma-sff.c
> > @@ -310,8 +310,6 @@ int ide_dma_end(ide_drive_t *drive)
> >        /* clear INTR & ERROR bits */
> >        ide_dma_sff_write_status(hwif, dma_stat | ATA_DMA_ERR | ATA_DMA_INTR);
> >
> > -       /* purge DMA mappings */
> > -       ide_destroy_dmatable(drive);
> >        wmb();
> 
> Bartlomiej,
> I think the wmb() could removed as well. The outb/writeb functions are
> required to be strongly ordered and I don't see anything else touching
> DMA-able memory here.

Indeed.  IIRC this code precedes the requeirement for outb/writeb to be
strongly ordered.

Seems like wmb() in ide_dma_start() is also superfluous nowadays...

> BTW, care to remove "mask" usage from this function?
> It's really not needed (can be replaced with #define).

Feel free to remove it. :)

> I can create separate patches for both. Which git tree should I base
> them against?

linux-next git tree
(or pata-2.6 quilt tree)

> ...
> > --- a/drivers/ide/scc_pata.c
> > +++ b/drivers/ide/scc_pata.c
> > @@ -365,8 +365,6 @@ static int __scc_dma_end(ide_drive_t *dr
> >        dma_stat = scc_dma_sff_read_status(hwif);
> >        /* clear the INTR & ERROR bits */
> >        scc_ide_outb(dma_stat | 6, hwif->dma_base + 4);
> > -       /* purge DMA mappings */
> > -       ide_destroy_dmatable(drive);
> >        /* verify good DMA status */
> >        wmb();
> 
> I think this wmb() can be removed too.
> 
> ....
> > --- a/drivers/ide/tx4939ide.c
> > +++ b/drivers/ide/tx4939ide.c
> > @@ -335,11 +335,9 @@ static int tx4939ide_dma_end(ide_drive_t
> >        /* read and clear the INTR & ERROR bits */
> >        dma_stat = tx4939ide_clear_dma_status(base);
> >
> > -       /* purge DMA mappings */
> > -       ide_destroy_dmatable(drive);
> > -       /* verify good DMA status */
> >        wmb();
> 
> and this one as well.

Seems so but please cc: scc_pata & tx4939 maintainers on your patch.

Thanks,
Bart

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/10] ide: destroy DMA mappings after ending DMA
  2009-03-14 19:51     ` Bartlomiej Zolnierkiewicz
@ 2009-03-14 20:45       ` Grant Grundler
  2009-03-14 20:50         ` James Bottomley
  0 siblings, 1 reply; 28+ messages in thread
From: Grant Grundler @ 2009-03-14 20:45 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel

On Sat, Mar 14, 2009 at 8:51 PM, Bartlomiej Zolnierkiewicz
<bzolnier@gmail.com> wrote:
...
>> I can create separate patches for both. Which git tree should I base
>> them against?
>
> linux-next git tree
> (or pata-2.6 quilt tree)

I've not used quilt yet and can only deal with git in a very crude way.
Thanks for the references!

....
> Seems so but please cc: scc_pata & tx4939 maintainers on your patch.

Yes, will do!

thanks,
grant

^ permalink raw reply	[flat|nested] 28+ messages in thread

* Re: [PATCH 03/10] ide: destroy DMA mappings after ending DMA
  2009-03-14 20:45       ` Grant Grundler
@ 2009-03-14 20:50         ` James Bottomley
  0 siblings, 0 replies; 28+ messages in thread
From: James Bottomley @ 2009-03-14 20:50 UTC (permalink / raw)
  To: Grant Grundler; +Cc: Bartlomiej Zolnierkiewicz, linux-ide, linux-kernel

On Sat, 2009-03-14 at 21:45 +0100, Grant Grundler wrote:
> On Sat, Mar 14, 2009 at 8:51 PM, Bartlomiej Zolnierkiewicz
> <bzolnier@gmail.com> wrote:
> ...
> >> I can create separate patches for both. Which git tree should I base
> >> them against?
> >
> > linux-next git tree
> > (or pata-2.6 quilt tree)
> 
> I've not used quilt yet and can only deal with git in a very crude way.
> Thanks for the references!

Have no fear ... you just rsync the quilt to a directory (~/pata_quilt
or something) on any server (use rsync so you only pick up the diffs
next time around) and then do

git quiltimport --patches ~/pata_quilt

and voila: a git tree ... of course it's a new one, and it's much harder
to handle incremental quilts (quilts that just have an extra few patches
added) since git rebuilds the entire tree with a different commitid for
each patch every time.

James



^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2009-03-14 20:50 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-20 17:11 [PATCH 00/10] ide: DMA methods cleanups/sanitizations Bartlomiej Zolnierkiewicz
2009-02-20 17:11 ` [PATCH 01/10] ide: add ->dma_clear method and remove ->dma_timeout one Bartlomiej Zolnierkiewicz
2009-03-08 22:17   ` Sergei Shtylyov
2009-02-20 17:11 ` [PATCH 02/10] ide: inline ide_dma_timeout() into ide_dma_timeout_retry() Bartlomiej Zolnierkiewicz
2009-03-08 22:18   ` Sergei Shtylyov
2009-02-20 17:12 ` [PATCH 03/10] ide: destroy DMA mappings after ending DMA Bartlomiej Zolnierkiewicz
2009-03-09 14:00   ` Sergei Shtylyov
2009-03-14  7:12   ` Grant Grundler
2009-03-14 19:51     ` Bartlomiej Zolnierkiewicz
2009-03-14 20:45       ` Grant Grundler
2009-03-14 20:50         ` James Bottomley
2009-02-20 17:12 ` [PATCH 04/10] ide: add ide_dma_prepare() helper Bartlomiej Zolnierkiewicz
2009-03-09 14:36   ` Sergei Shtylyov
2009-02-20 17:12 ` [PATCH 05/10] ns87415: use custom ->dma_{start,end} to handle ns87415_prepare_drive() Bartlomiej Zolnierkiewicz
2009-03-08 22:22   ` Sergei Shtylyov
2009-02-20 17:12 ` [PATCH 06/10] trm290: use custom ->dma_{start,end} to handle trm290_prepare_drive() Bartlomiej Zolnierkiewicz
2009-03-08 22:26   ` Sergei Shtylyov
2009-02-20 17:12 ` [PATCH 07/10] ide: add ->dma_check method Bartlomiej Zolnierkiewicz
2009-03-08 22:32   ` Sergei Shtylyov
2009-03-11 16:36     ` Bartlomiej Zolnierkiewicz
2009-02-20 17:12 ` [PATCH 08/10] ide: move ide_map_sg() call out from ->dma_setup method Bartlomiej Zolnierkiewicz
2009-03-09 14:42   ` Sergei Shtylyov
2009-03-11 16:36     ` Bartlomiej Zolnierkiewicz
2009-03-11 17:10       ` Sergei Shtylyov
2009-03-11 17:36         ` Bartlomiej Zolnierkiewicz
2009-02-20 17:12 ` [PATCH 09/10] ide: set/clear drive->waiting_for_dma flag in the core code Bartlomiej Zolnierkiewicz
2009-03-10 15:05   ` Sergei Shtylyov
2009-02-20 17:12 ` [PATCH 10/10] ide: sanitize ide_build_sglist() and ide_destroy_dmatable() Bartlomiej Zolnierkiewicz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.