From: Mark Lord <liml@rtr.ca>
To: Jeff Garzik <jgarzik@pobox.com>
Cc: Albert Lee <albertcc@tw.ibm.com>,
IDE/ATA development list <linux-ide@vger.kernel.org>,
Alan Cox <alan@redhat.com>, Tejun Heo <htejun@gmail.com>
Subject: Re: [PATCH] libata-scsi: automatically use DMADIR if drive/bridge requires it
Date: Wed, 20 Feb 2008 13:53:27 -0500 [thread overview]
Message-ID: <47BC7727.1090508@rtr.ca> (raw)
In-Reply-To: <47BC6100.9020906@pobox.com>
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 <mlord@pobox.com>
>>
>> --- old/drivers/ata/libata-scsi.c 2008-02-18 14:45:08.000000000 -0500
>> +++ linux/drivers/ata/libata-scsi.c 2008-02-18 14:53:02.000000000
>> -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
next prev parent reply other threads:[~2008-02-20 18:53 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-18 19:02 atapi_dmadir: why do we not (also) auto-detect it from IDENTIFY PACKET ?? Mark Lord
2008-02-18 20:53 ` [PATCH] libata-scsi: automatically use DMADIR if drive/bridge requires it Mark Lord
2008-02-18 22:20 ` Alan Cox
2008-02-19 0:41 ` Mark Lord
2008-02-20 17:18 ` Jeff Garzik
2008-02-20 18:53 ` Mark Lord [this message]
2008-02-21 4:25 ` [PATCH] libata: " Tejun Heo
2008-02-22 10:09 ` Albert Lee
2008-02-22 13:33 ` Mark Lord
2008-02-22 14:11 ` Mark Lord
2008-02-22 16:32 ` Jeff Garzik
2008-02-24 5:29 ` Jeff Garzik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47BC7727.1090508@rtr.ca \
--to=liml@rtr.ca \
--cc=alan@redhat.com \
--cc=albertcc@tw.ibm.com \
--cc=htejun@gmail.com \
--cc=jgarzik@pobox.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).