linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pata_it821x: (partially) fix DMA in RAID mode
@ 2007-06-10 16:43 Bartlomiej Zolnierkiewicz
  2007-06-10 17:42 ` Alan Cox
  2007-06-11  4:52 ` Jeff Garzik
  0 siblings, 2 replies; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-06-10 16:43 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-kernel, Alan Cox, Tejun Heo


Code intended to check DMA status was checking DMA command register.

Moreover firmware seems to "forget" to set DMA capable bit for the
slave device (at least in RAID mode but without ITE RAID volumes) so
check device ID for DMA capable bit when deciding whether to use DMA
and remove DMA status check completely.

Thanks to Pavol Šimo for the bugreport and testing the initial fix.

This change unfortunately still doesn't fix DMA in RAID mode (which
works fine with IDE it821x) but Alan is working on the missing pieces
(pata_it821x vs libata EH issues).

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Tejun Heo <htejun@gmail.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
---

 drivers/ata/pata_it821x.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Index: b/drivers/ata/pata_it821x.c
===================================================================
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -2,6 +2,7 @@
  * pata_it821x.c 	- IT821x PATA for new ATA layer
  *			  (C) 2005 Red Hat Inc
  *			  Alan Cox <alan@redhat.com>
+ *			  (C) 2007 Bartlomiej Zolnierkiewicz
  *
  * based upon
  *
@@ -79,7 +80,7 @@
 
 
 #define DRV_NAME "pata_it821x"
-#define DRV_VERSION "0.3.6"
+#define DRV_VERSION "0.3.7"
 
 struct it821x_dev
 {
@@ -460,14 +461,8 @@ static unsigned int it821x_passthru_qc_i
 
 static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused)
 {
-	int dma_enabled = 0;
 	int i;
 
-	/* Bits 5 and 6 indicate if DMA is active on master/slave */
-	/* It is possible that BMDMA isn't allocated */
-	if (ap->ioaddr.bmdma_addr)
-		dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
-
 	for (i = 0; i < ATA_MAX_DEVICES; i++) {
 		struct ata_device *dev = &ap->device[i];
 		if (ata_dev_enabled(dev)) {
@@ -476,7 +471,7 @@ static int it821x_smart_set_mode(struct 
 			dev->dma_mode = XFER_MW_DMA_0;
 			/* We do need the right mode information for DMA or PIO
 			   and this comes from the current configuration flags */
-			if (dma_enabled & (1 << (5 + i))) {
+			if (ata_id_has_dma(dev->id)) {
 				ata_dev_printk(dev, KERN_INFO, "configured for DMA\n");
 				dev->xfer_mode = XFER_MW_DMA_0;
 				dev->xfer_shift = ATA_SHIFT_MWDMA;

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

* Re: [PATCH] pata_it821x: (partially) fix DMA in RAID mode
  2007-06-10 16:43 Bartlomiej Zolnierkiewicz
@ 2007-06-10 17:42 ` Alan Cox
  2007-06-11  4:52 ` Jeff Garzik
  1 sibling, 0 replies; 6+ messages in thread
From: Alan Cox @ 2007-06-10 17:42 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Jeff Garzik, linux-ide, linux-kernel, Tejun Heo

> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: Tejun Heo <htejun@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>


Acked-by: Alan Cox <alan@redhat.com>


> -	/* Bits 5 and 6 indicate if DMA is active on master/slave */
> -	/* It is possible that BMDMA isn't allocated */
> -	if (ap->ioaddr.bmdma_addr)
> -		dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
> -
>  	for (i = 0; i < ATA_MAX_DEVICES; i++) {

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

* Re: [PATCH] pata_it821x: (partially) fix DMA in RAID mode
  2007-06-10 16:43 Bartlomiej Zolnierkiewicz
  2007-06-10 17:42 ` Alan Cox
@ 2007-06-11  4:52 ` Jeff Garzik
  2007-06-11  9:37   ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 6+ messages in thread
From: Jeff Garzik @ 2007-06-11  4:52 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: linux-ide, linux-kernel, Alan Cox, Tejun Heo

Bartlomiej Zolnierkiewicz wrote:
> Code intended to check DMA status was checking DMA command register.
> 
> Moreover firmware seems to "forget" to set DMA capable bit for the
> slave device (at least in RAID mode but without ITE RAID volumes) so
> check device ID for DMA capable bit when deciding whether to use DMA
> and remove DMA status check completely.
> 
> Thanks to Pavol Šimo for the bugreport and testing the initial fix.
> 
> This change unfortunately still doesn't fix DMA in RAID mode (which
> works fine with IDE it821x) but Alan is working on the missing pieces
> (pata_it821x vs libata EH issues).
> 
> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> Cc: Tejun Heo <htejun@gmail.com>
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> ---
> 
>  drivers/ata/pata_it821x.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)

Patch is OK but it's mangled by your mailer:

@@ -79,7 +80,7 @@
=20
=20
  #define DRV_NAME "pata_it821x"
=2D#define DRV_VERSION "0.3.6"
+#define DRV_VERSION "0.3.7"
=20
  struct it821x_dev
  {
@@ -460,14 +461,8 @@ static unsigned int it821x_passthru_qc_i
=20

=2D     int dma_enabled =3D 0;
         int i;
=20

etc.


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

* Re: [PATCH] pata_it821x: (partially) fix DMA in RAID mode
  2007-06-11  4:52 ` Jeff Garzik
@ 2007-06-11  9:37   ` Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-06-11  9:37 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide, linux-kernel, Alan Cox, Tejun Heo

On Monday 11 June 2007, Jeff Garzik wrote:
> Bartlomiej Zolnierkiewicz wrote:
> > Code intended to check DMA status was checking DMA command register.
> > 
> > Moreover firmware seems to "forget" to set DMA capable bit for the
> > slave device (at least in RAID mode but without ITE RAID volumes) so
> > check device ID for DMA capable bit when deciding whether to use DMA
> > and remove DMA status check completely.
> > 
> > Thanks to Pavol Šimo for the bugreport and testing the initial fix.
> > 
> > This change unfortunately still doesn't fix DMA in RAID mode (which
> > works fine with IDE it821x) but Alan is working on the missing pieces
> > (pata_it821x vs libata EH issues).
> > 
> > Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
> > Cc: Tejun Heo <htejun@gmail.com>
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > ---
> > 
> >  drivers/ata/pata_it821x.c |   11 +++--------
> >  1 file changed, 3 insertions(+), 8 deletions(-)
> 
> Patch is OK but it's mangled by your mailer:
> 
> @@ -79,7 +80,7 @@
> =20
> =20
>   #define DRV_NAME "pata_it821x"
> =2D#define DRV_VERSION "0.3.6"
> +#define DRV_VERSION "0.3.7"
> =20
>   struct it821x_dev
>   {
> @@ -460,14 +461,8 @@ static unsigned int it821x_passthru_qc_i
> =20
> 
> =2D     int dma_enabled =3D 0;
>          int i;
> =20
> 
> etc.

Ah, non-ASCII char confused the mailer... resend.  Sorry for that.

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

* [PATCH] pata_it821x: (partially) fix DMA in RAID mode
@ 2007-06-11  9:40 Bartlomiej Zolnierkiewicz
  2007-06-20 23:56 ` Jeff Garzik
  0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2007-06-11  9:40 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: Alan Cox, Tejun Heo, linux-ide, linux-kernel


Code intended to check DMA status was checking DMA command register.

Moreover firmware seems to "forget" to set DMA capable bit for the
slave device (at least in RAID mode but without ITE RAID volumes) so
check device ID for DMA capable bit when deciding whether to use DMA
and remove DMA status check completely.

Thanks to Pavol Simo for the bugreport and testing the initial fix.

This change unfortunately still doesn't fix DMA in RAID mode (which
works fine with IDE it821x) but Alan is working on the missing pieces
(pata_it821x vs libata EH issues).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Cc: Tejun Heo <htejun@gmail.com>
---
removed non-ASCII char from the patch description + added Alan's ACK

 drivers/ata/pata_it821x.c |   11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

Index: b/drivers/ata/pata_it821x.c
===================================================================
--- a/drivers/ata/pata_it821x.c
+++ b/drivers/ata/pata_it821x.c
@@ -2,6 +2,7 @@
  * pata_it821x.c 	- IT821x PATA for new ATA layer
  *			  (C) 2005 Red Hat Inc
  *			  Alan Cox <alan@redhat.com>
+ *			  (C) 2007 Bartlomiej Zolnierkiewicz
  *
  * based upon
  *
@@ -79,7 +80,7 @@
 
 
 #define DRV_NAME "pata_it821x"
-#define DRV_VERSION "0.3.6"
+#define DRV_VERSION "0.3.7"
 
 struct it821x_dev
 {
@@ -460,14 +461,8 @@ static unsigned int it821x_passthru_qc_i
 
 static int it821x_smart_set_mode(struct ata_port *ap, struct ata_device **unused)
 {
-	int dma_enabled = 0;
 	int i;
 
-	/* Bits 5 and 6 indicate if DMA is active on master/slave */
-	/* It is possible that BMDMA isn't allocated */
-	if (ap->ioaddr.bmdma_addr)
-		dma_enabled = ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD);
-
 	for (i = 0; i < ATA_MAX_DEVICES; i++) {
 		struct ata_device *dev = &ap->device[i];
 		if (ata_dev_enabled(dev)) {
@@ -476,7 +471,7 @@ static int it821x_smart_set_mode(struct 
 			dev->dma_mode = XFER_MW_DMA_0;
 			/* We do need the right mode information for DMA or PIO
 			   and this comes from the current configuration flags */
-			if (dma_enabled & (1 << (5 + i))) {
+			if (ata_id_has_dma(dev->id)) {
 				ata_dev_printk(dev, KERN_INFO, "configured for DMA\n");
 				dev->xfer_mode = XFER_MW_DMA_0;
 				dev->xfer_shift = ATA_SHIFT_MWDMA;

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

* Re: [PATCH] pata_it821x: (partially) fix DMA in RAID mode
  2007-06-11  9:40 [PATCH] pata_it821x: (partially) fix DMA in RAID mode Bartlomiej Zolnierkiewicz
@ 2007-06-20 23:56 ` Jeff Garzik
  0 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2007-06-20 23:56 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz; +Cc: Alan Cox, Tejun Heo, linux-ide, linux-kernel

Bartlomiej Zolnierkiewicz wrote:
> Code intended to check DMA status was checking DMA command register.
> 
> Moreover firmware seems to "forget" to set DMA capable bit for the
> slave device (at least in RAID mode but without ITE RAID volumes) so
> check device ID for DMA capable bit when deciding whether to use DMA
> and remove DMA status check completely.
> 
> Thanks to Pavol Simo for the bugreport and testing the initial fix.
> 
> This change unfortunately still doesn't fix DMA in RAID mode (which
> works fine with IDE it821x) but Alan is working on the missing pieces
> (pata_it821x vs libata EH issues).
> 
> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Acked-by: Alan Cox <alan@redhat.com>
> Cc: Tejun Heo <htejun@gmail.com>
> ---
> removed non-ASCII char from the patch description + added Alan's ACK
> 
>  drivers/ata/pata_it821x.c |   11 +++--------
>  1 file changed, 3 insertions(+), 8 deletions(-)

applied



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

end of thread, other threads:[~2007-06-20 23:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11  9:40 [PATCH] pata_it821x: (partially) fix DMA in RAID mode Bartlomiej Zolnierkiewicz
2007-06-20 23:56 ` Jeff Garzik
  -- strict thread matches above, loose matches on Subject: below --
2007-06-10 16:43 Bartlomiej Zolnierkiewicz
2007-06-10 17:42 ` Alan Cox
2007-06-11  4:52 ` Jeff Garzik
2007-06-11  9:37   ` Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).