From: Hannes Reinecke <hare@suse.de>
To: Tejun Heo <tj@kernel.org>
Cc: Damien Le Moal <damien.lemoal@hgst.com>,
linux-ide@vger.kernel.org, Hannes Reinecke <hare@suse.com>
Subject: Re: [PATCH 3/6] ata: add ata_is_fpdma() accessor
Date: Tue, 21 Jun 2016 07:49:26 +0200 [thread overview]
Message-ID: <5768D566.9070207@suse.de> (raw)
In-Reply-To: <20160620154249.GK3262@mtj.duckdns.org>
On 06/20/2016 05:42 PM, Tejun Heo wrote:
> On Mon, Jun 20, 2016 at 01:39:13PM +0200, Hannes Reinecke wrote:
>> diff --git a/include/linux/libata.h b/include/linux/libata.h
>> index d15c19e..264414c 100644
>> --- a/include/linux/libata.h
>> +++ b/include/linux/libata.h
>> @@ -152,6 +152,7 @@ enum {
>> ATA_PROT_FLAG_DATA = ATA_PROT_FLAG_PIO | ATA_PROT_FLAG_DMA,
>> ATA_PROT_FLAG_NCQ = (1 << 2), /* is NCQ */
>> ATA_PROT_FLAG_ATAPI = (1 << 3), /* is ATAPI */
>> + ATA_PROT_FLAG_FPDMA = ATA_PROT_FLAG_NCQ | ATA_PROT_FLAG_DMA,
>>
>> /* struct ata_device stuff */
>> ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
>> @@ -1093,6 +1094,11 @@ static inline int ata_is_data(u8 prot)
>> return ata_prot_flags(prot) & ATA_PROT_FLAG_DATA;
>> }
>>
>> +static inline int ata_is_fpdma(u8 prot)
>> +{
>> + return ata_prot_flags(prot) & ATA_PROT_FLAG_FPDMA;
>> +}
>> +
>
> This is NCQ or DMA which isn't the same thing as some of the tests
> it's replacing. Is this intentional?
>
Yes. Most of the SATA drivers (with the exception of ahci) don't know
about NCQ NON DATA commands, so they use the test for 'NCQ' as a
shorthand for 'NCQ command with DMA data'.
With the introduction of the ATA_PROT_NODATA protocol variable these two
are no longer equivalent, as you can have NCQ commands without DMA.
As I haven't vetted any of those adapters for NCQ NON DATA commands, and
these driver internally also assume that any NCQ command will have
DMA-able data, I thought it prudent to introduce an ata_is_fpdma() flag,
which retains the original meaning of ata_is_ncq().
Cheers,
Hannes
--
Dr. Hannes Reinecke Teamlead Storage & Networking
hare@suse.de +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
next prev parent reply other threads:[~2016-06-21 5:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-20 11:39 [PATCH 0/6] libata: Fixup ATA NCQ NON-DATA commands Hannes Reinecke
2016-06-20 11:39 ` [PATCH 1/6] libata: use ata_is_ncq() accessors Hannes Reinecke
2016-06-20 11:39 ` [PATCH 2/6] libsas: use ata_is_ncq() and ata_has_dma() accessors Hannes Reinecke
2016-06-20 15:40 ` Tejun Heo
2016-06-21 5:44 ` Hannes Reinecke
2016-06-20 11:39 ` [PATCH 3/6] ata: add ata_is_fpdma() accessor Hannes Reinecke
2016-06-20 15:42 ` Tejun Heo
2016-06-21 5:49 ` Hannes Reinecke [this message]
2016-06-21 15:45 ` Tejun Heo
2016-06-20 11:39 ` [PATCH 4/6] ata: fixup ATA_PROT_NODATA Hannes Reinecke
2016-06-20 15:44 ` Tejun Heo
2016-06-21 5:52 ` Hannes Reinecke
2016-06-20 11:39 ` [PATCH 5/6] libata-eh: decode all taskfile protocols Hannes Reinecke
2016-06-20 11:39 ` [PATCH 6/6] ata: Handle ATA NCQ NO-DATA commands correctly Hannes Reinecke
2016-06-21 1:14 ` Damien Le Moal
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=5768D566.9070207@suse.de \
--to=hare@suse.de \
--cc=damien.lemoal@hgst.com \
--cc=hare@suse.com \
--cc=linux-ide@vger.kernel.org \
--cc=tj@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).