Re: [PATCH] libata-scsi: automatically use DMADIR if drive/bridge requires it

2008-02-20 Thread Mark Lord

Jeff Garzik wrote:

Mark Lord wrote:

Back in 2.6.17-rc2, a libata module parameter was added for atapi_dmadir.

That's nice, but most SATA devices which need it will tell us about it
in their IDENTIFY PACKET response, as bit-15 of word-62 of the
returned data (as per ATA7, ATA8 specifications).

So for those which specify it, we should automatically use the DMADIR 
bit.

Otherwise, disc writing will fail by default on many SATA-ATAPI drives.

Signed-off-by: Mark Lord <[EMAIL PROTECTED]>

--- old/drivers/ata/libata-scsi.c2008-02-18 14:45:08.0 -0500
+++ linux/drivers/ata/libata-scsi.c2008-02-18 14:53:02.0 
-0500

@@ -2543,9 +2543,10 @@
qc->tf.protocol = ATAPI_PROT_DMA;
qc->tf.feature |= ATAPI_PKT_DMA;

-if (atapi_dmadir && (scmd->sc_data_direction != DMA_TO_DEVICE))
-/* some SATA bridges need us to indicate data xfer 
direction */

-qc->tf.feature |= ATAPI_DMADIR;
+/* some SATA bridges need us to indicate data xfer direction */
+if (atapi_dmadir || (dev->id[62] & 0x8000))
+if (scmd->sc_data_direction != DMA_TO_DEVICE)
+qc->tf.feature |= ATAPI_DMADIR;


Regardless of the historical usage (or lack thereof) of that I.D. word, 
I would prefer


1) an ata version check

2) a simple wrapper in linux/ata.h, similar to the many that already exist

So, conditional ACK...

..

Good.  As I said, I don't expect to be doing this,
so if anyone else wants to fix this issue in libata
they are more than welcome to take the above and build on it.

Cheers 
-

To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] libata-scsi: automatically use DMADIR if drive/bridge requires it

2008-02-20 Thread Jeff Garzik

Mark Lord wrote:

Back in 2.6.17-rc2, a libata module parameter was added for atapi_dmadir.

That's nice, but most SATA devices which need it will tell us about it
in their IDENTIFY PACKET response, as bit-15 of word-62 of the
returned data (as per ATA7, ATA8 specifications).

So for those which specify it, we should automatically use the DMADIR bit.
Otherwise, disc writing will fail by default on many SATA-ATAPI drives.

Signed-off-by: Mark Lord <[EMAIL PROTECTED]>

--- old/drivers/ata/libata-scsi.c2008-02-18 14:45:08.0 -0500
+++ linux/drivers/ata/libata-scsi.c2008-02-18 14:53:02.0 -0500
@@ -2543,9 +2543,10 @@
qc->tf.protocol = ATAPI_PROT_DMA;
qc->tf.feature |= ATAPI_PKT_DMA;

-if (atapi_dmadir && (scmd->sc_data_direction != DMA_TO_DEVICE))
-/* some SATA bridges need us to indicate data xfer 
direction */

-qc->tf.feature |= ATAPI_DMADIR;
+/* some SATA bridges need us to indicate data xfer direction */
+if (atapi_dmadir || (dev->id[62] & 0x8000))
+if (scmd->sc_data_direction != DMA_TO_DEVICE)
+qc->tf.feature |= ATAPI_DMADIR;


Regardless of the historical usage (or lack thereof) of that I.D. word, 
I would prefer


1) an ata version check

2) a simple wrapper in linux/ata.h, similar to the many that already exist

So, conditional ACK...

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] libata-scsi: automatically use DMADIR if drive/bridge requires it

2008-02-18 Thread Mark Lord

Alan Cox wrote:

On Mon, Feb 18, 2008 at 03:53:46PM -0500, Mark Lord wrote:
+		/* some SATA bridges need us to indicate data xfer direction 
*/

+   if (atapi_dmadir || (dev->id[62] & 0x8000))


The rest of the code uses ata_ inlines/defines in ata.h for things like this
and religiously checks validity bits and ATA versions.

..

Feel free.  I don't actually have a device like that here to test on,
so I'm not particularly motivated about doing more than the above right now.

Perhaps you or Albert may be, though.  :)

That particular bit has always been zero (reserved), from ATA1 through present,
except when used as a DMADIR bit, beginning somewhere around ATA7.

Cheers
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] libata-scsi: automatically use DMADIR if drive/bridge requires it

2008-02-18 Thread Alan Cox
On Mon, Feb 18, 2008 at 03:53:46PM -0500, Mark Lord wrote:
> + /* some SATA bridges need us to indicate data xfer direction 
> */
> + if (atapi_dmadir || (dev->id[62] & 0x8000))

The rest of the code uses ata_ inlines/defines in ata.h for things like this
and religiously checks validity bits and ATA versions.

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html