Re: [PATCH 3/6] ata: add ata_is_fpdma() accessor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx			               +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)
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux