All of lore.kernel.org
 help / color / mirror / Atom feed
* CFA 4.0 patch
@ 2012-05-15  5:17 Andre Hedrick (anhedric)
  2012-05-15 14:38 ` Alan Cox
  0 siblings, 1 reply; 10+ messages in thread
From: Andre Hedrick (anhedric) @ 2012-05-15  5:17 UTC (permalink / raw)
  To: linux-kernel

This is a missing part of the CFA 4.0 and above support.

6.2.1.6.1 Word 0: General Configuration
	This field indicates the general characteristics of the device.
When Word 0 of the Identify drive information is 848Ah then the device
is a CompactFlash Storage Card and complies with the CFA specification
and CFA command set. It is recommended that PC Card modes of operation
report only the 848Ah value as they are always intended as removable
devices.

Bits 15-0: CF Standard Configuration Value
Word 0 is 848Ah. This is the recommended value of Word 0.
	Some operating systems require Bit 6 of Word 0 to be set to 1
(Non-removable device) to use the card as the root storage device. The
Card must be the root storage device when a host completely replaces
conventional disk storage with a CompactFlash Card in True IDE mode. To
support this requirement and provide capability for any future removable
media Cards, alternate handling of Word 0 is permitted.

Bits 15-0: CF Preferred Alternate Configuration Values

044Ah: This is the alternate value of Word 0 turns on ATA device and
turns off Removable Media and Removable Device while 	preserving all
Retired bits in the word.

0040h: This is the alternate value of Word 0 turns on ATA device and
turns off Removable Media and Removable Device while 	zeroing all
Retired bits in the word

Cheers,
Andre
--------------------
The Linux X-ATA/SATA guy


--- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
+++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
@@ -819,6 +819,10 @@
 {
 	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
 		return 1;
+	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
removable turned off, preserving retired bits */
+		return 1;
+	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
removable turned off, zeroing retired bits*/
+		return 1;
 	/*
 	 * CF specs don't require specific value in the word 0 anymore
and yet
 	 * they forbid to report the ATA version in the word 80 and
require the

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

* Re: CFA 4.0 patch
  2012-05-15  5:17 CFA 4.0 patch Andre Hedrick (anhedric)
@ 2012-05-15 14:38 ` Alan Cox
  2012-05-15 18:35   ` Andre Hedrick (anhedric)
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Cox @ 2012-05-15 14:38 UTC (permalink / raw)
  To: Andre Hedrick (anhedric); +Cc: linux-kernel

> 044Ah: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	preserving all
> Retired bits in the word.
> 
> 0040h: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	zeroing all
> Retired bits in the word
> 
> Cheers,
> Andre
> --------------------
> The Linux X-ATA/SATA guy
      ^former ;)


> --- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
> +++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
> @@ -819,6 +819,10 @@
>  {
>  	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
>  		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
> removable turned off, preserving retired bits */
> +		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
> removable turned off, zeroing retired bits*/
> +		return 1;

Do you have test case hardware for this that fails the other checks. I've
never ever come across any. I don't believe it exists at this point.

Also 2.6.32 is some years ago 8)

Alan

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

* RE: CFA 4.0 patch
  2012-05-15 14:38 ` Alan Cox
@ 2012-05-15 18:35   ` Andre Hedrick (anhedric)
  2012-05-16 11:32     ` Alan Cox
  0 siblings, 1 reply; 10+ messages in thread
From: Andre Hedrick (anhedric) @ 2012-05-15 18:35 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Hi Alan,

You betcha, otherwise I would not have a case.

STEC configed to MWDMA4 (Max reported as UDMA/66)

-> ShowCFDriveInfo()
CompactFlash Identify Drive (0xEC)
Word 0: 0x044A
Word 1: 0x07C2
Word 2: 0x0000
Word 3: 0x0010
Word 4: 0x0000
Word 5: 0x0200
Word 6: 0x003F
Word 7: 0x001E
Word 8: 0x8BE0
Word 9: 0x0000
Word 10: 0x2053

Viking configed to MWDMA2 (Max reported as MWDMA2)

-> ShowCFDriveInfo()
CompactFlash Identify Drive (0xEC)
Word 0: 0x044A
Word 1: 0x07AA
Word 2: 0x0000
Word 3: 0x0010
Word 4: 0x0000
Word 5: 0x0240
Word 6: 0x003F
Word 7: 0x001E
Word 8: 0x2D60
Word 9: 0x0000
Word 10: 0x564D

Now I only have data for the 0x044A case, but it is on par with the CFA
4.0 spec that I can send you if you want a copy.

Oh yeah, just so you know I am coming out of retirement and tinkering
with the other insanity, security.

Cheers,
Andre

Linux Former-ATA/SATA guy
      ^^^^^^
      Changed just for you friend.

-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk] 
Sent: Tuesday, May 15, 2012 7:38 AM
To: Andre Hedrick (anhedric)
Cc: linux-kernel@vger.kernel.org
Subject: Re: CFA 4.0 patch

> 044Ah: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	preserving all
> Retired bits in the word.
> 
> 0040h: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	zeroing all
> Retired bits in the word
> 
> Cheers,
> Andre
> --------------------
> The Linux X-ATA/SATA guy
      ^former ;)


> --- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
> +++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
> @@ -819,6 +819,10 @@
>  {
>  	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
>  		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
> removable turned off, preserving retired bits */
> +		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
> removable turned off, zeroing retired bits*/
> +		return 1;

Do you have test case hardware for this that fails the other checks.
I've
never ever come across any. I don't believe it exists at this point.

Also 2.6.32 is some years ago 8)

Alan

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

* Re: CFA 4.0 patch
  2012-05-15 18:35   ` Andre Hedrick (anhedric)
@ 2012-05-16 11:32     ` Alan Cox
  0 siblings, 0 replies; 10+ messages in thread
From: Alan Cox @ 2012-05-16 11:32 UTC (permalink / raw)
  To: Andre Hedrick (anhedric); +Cc: linux-kernel

On Tue, 15 May 2012 11:35:57 -0700
"Andre Hedrick (anhedric)" <anhedric@cisco.com> wrote:

> Hi Alan,
> 
> You betcha, otherwise I would not have a case.
> 
> STEC configed to MWDMA4 (Max reported as UDMA/66)

Both of these however should have the identify data indicating CF ? Do
they also have word 83 not reporting them as CFA ?



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

* Re: CFA 4.0 patch
  2012-05-15 19:20   ` Andre Hedrick (anhedric)
@ 2012-05-16 12:26     ` Sergei Shtylyov
  0 siblings, 0 replies; 10+ messages in thread
From: Sergei Shtylyov @ 2012-05-16 12:26 UTC (permalink / raw)
  To: Andre Hedrick (anhedric); +Cc: jgarzik, linux-ide

Hello.

On 15-05-2012 23:20, Andre Hedrick (anhedric) wrote:

> Sergei,

> Sorry wrong answer about broken devices, and if I had taken such short
> cuts in the past, the strength of the cheap storage would not have been
> there or present today in Linux.

> Just because someone calls it broken, because they don't read "ALL" the
> associated specification,

    Name the part I didn't read please.

> it means they don't understand what they don't know.

    From your words so far it follows to me that you who don't understand.

> So try again with all the information before the classic call if
> "it is broken" because I can't or don't know how to fix.

    Your fix is incorrect because it blindly assumes that device is CFA basing 
on word 0 while these alternate values (044Ah and 0040h) also correspond to 
hard disks. We can't make such decisions without consulting word 83 first 
which clearly follows from CFA 4.0. And in second of the identify data dumps 
you sent to me privately the device erroneously don't indicate CFA command set 
support in word 83, that's why it's not detected as CF. I agree however, that 
we shoiuld try and overcome this incompatibility by adding more heuristics but 
not in this proposed simplistic form.

> Cheers,
> Andre

> -----Original Message-----
> From: Sergei Shtylyov [mailto:sshtylyov@mvista.com]
> Sent: Tuesday, May 15, 2012 4:37 AM
> To: Andre Hedrick (anhedric)
> Cc: jgarzik@pobox.com; linux-ide@vger.kernel.org; lkml@vger.kernel.org
> Subject: Re: CFA 4.0 patch

> Hello.

> On 15-05-2012 8:57, Andre Hedrick (anhedric) wrote:

>> This is a missing part of the CFA 4.0 and above support.

>> 6.2.1.6.1 Word 0: General Configuration
>> 	This field indicates the general characteristics of the device.
>> When Word 0 of the Identify drive information is 848Ah then the device
>> is a CompactFlash Storage Card and complies with the CFA specification
>> and CFA command set. It is recommended that PC Card modes of operation
>> report only the 848Ah value as they are always intended as removable
>> devices.

>> Bits 15-0: CF Standard Configuration Value
>> Word 0 is 848Ah. This is the recommended value of Word 0.
>> 	Some operating systems require Bit 6 of Word 0 to be set to 1
>> (Non-removable device) to use the card as the root storage device. The
>> Card must be the root storage device when a host completely replaces
>> conventional disk storage with a CompactFlash Card in True IDE mode.
> To
>> support this requirement and provide capability for any future
> removable
>> media Cards, alternate handling of Word 0 is permitted.

>> Bits 15-0: CF Preferred Alternate Configuration Values

>> 044Ah: This is the alternate value of Word 0 turns on ATA device and
>> turns off Removable Media and Removable Device while 	preserving all
>> Retired bits in the word.

>> 0040h: This is the alternate value of Word 0 turns on ATA device and
>> turns off Removable Media and Removable Device while 	zeroing all
>> Retired bits in the word

>      If you did read a bit further, you'd have seen:

> Bit 15-12: Configuration Flag
> If bits 15:12 are set to 8h then Word 0 shall be 848Ah.
> If bits 15:12 are set to 0h then Bits 11:0 are set using the definitions
> below
> and the Card is
> required to support for the CFA command set and report that in bit 2 of
> Word 83.
> Bit 15:12 values other than 8h and 0h are prohibited.

>      That's why our code does what it does, and not checks for the
> alternate
> values. If our check in word 83 fails, we therefore have a broken
> device.

>> Cheers,
>> Andre
>> --------------------
>> The Linux X-ATA/SATA guy

>> --- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
>> +++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
>> @@ -819,6 +819,10 @@
>>    {
>>    	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
>>    		return 1;
>> +	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
>> removable turned off, preserving retired bits */
>> +		return 1;
>> +	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
>> removable turned off, zeroing retired bits*/
>> +		return 1;
>>    	/*
>>    	 * CF specs don't require specific value in the word 0 anymore
>> and yet
>>    	 * they forbid to report the ATA version in the word 80 and
>> require the

MBR, Sergei

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

* RE: CFA 4.0 patch
  2012-05-15 11:37 ` Sergei Shtylyov
@ 2012-05-15 19:20   ` Andre Hedrick (anhedric)
  2012-05-16 12:26     ` Sergei Shtylyov
  0 siblings, 1 reply; 10+ messages in thread
From: Andre Hedrick (anhedric) @ 2012-05-15 19:20 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: jgarzik, linux-ide

Sergei,

Sorry wrong answer about broken devices, and if I had taken such short
cuts in the past, the strength of the cheap storage would not have been
there or present today in Linux.

Just because someone calls it broken, because they don't read "ALL" the
associated specification, it means they don't understand what they don't
know.  So try again with all the information before the classic call if
"it is broken" because I can't or don't know how to fix.

Cheers,
Andre

-----Original Message-----
From: Sergei Shtylyov [mailto:sshtylyov@mvista.com] 
Sent: Tuesday, May 15, 2012 4:37 AM
To: Andre Hedrick (anhedric)
Cc: jgarzik@pobox.com; linux-ide@vger.kernel.org; lkml@vger.kernel.org
Subject: Re: CFA 4.0 patch

Hello.

On 15-05-2012 8:57, Andre Hedrick (anhedric) wrote:

> This is a missing part of the CFA 4.0 and above support.

> 6.2.1.6.1 Word 0: General Configuration
> 	This field indicates the general characteristics of the device.
> When Word 0 of the Identify drive information is 848Ah then the device
> is a CompactFlash Storage Card and complies with the CFA specification
> and CFA command set. It is recommended that PC Card modes of operation
> report only the 848Ah value as they are always intended as removable
> devices.

> Bits 15-0: CF Standard Configuration Value
> Word 0 is 848Ah. This is the recommended value of Word 0.
> 	Some operating systems require Bit 6 of Word 0 to be set to 1
> (Non-removable device) to use the card as the root storage device. The
> Card must be the root storage device when a host completely replaces
> conventional disk storage with a CompactFlash Card in True IDE mode.
To
> support this requirement and provide capability for any future
removable
> media Cards, alternate handling of Word 0 is permitted.

> Bits 15-0: CF Preferred Alternate Configuration Values

> 044Ah: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	preserving all
> Retired bits in the word.

> 0040h: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	zeroing all
> Retired bits in the word

    If you did read a bit further, you'd have seen:

Bit 15-12: Configuration Flag
If bits 15:12 are set to 8h then Word 0 shall be 848Ah.
If bits 15:12 are set to 0h then Bits 11:0 are set using the definitions
below 
and the Card is
required to support for the CFA command set and report that in bit 2 of
Word 83.
Bit 15:12 values other than 8h and 0h are prohibited.

    That's why our code does what it does, and not checks for the
alternate 
values. If our check in word 83 fails, we therefore have a broken
device.

> Cheers,
> Andre
> --------------------
> The Linux X-ATA/SATA guy

> --- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
> +++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
> @@ -819,6 +819,10 @@
>   {
>   	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
>   		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
> removable turned off, preserving retired bits */
> +		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
> removable turned off, zeroing retired bits*/
> +		return 1;
>   	/*
>   	 * CF specs don't require specific value in the word 0 anymore
> and yet
>   	 * they forbid to report the ATA version in the word 80 and
> require the
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide"
in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WBR, Sergei

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

* Re: CFA 4.0 patch
  2012-05-15  4:57 Andre Hedrick (anhedric)
  2012-05-15 10:15 ` Sergei Shtylyov
@ 2012-05-15 11:37 ` Sergei Shtylyov
  2012-05-15 19:20   ` Andre Hedrick (anhedric)
  1 sibling, 1 reply; 10+ messages in thread
From: Sergei Shtylyov @ 2012-05-15 11:37 UTC (permalink / raw)
  To: Andre Hedrick (anhedric); +Cc: jgarzik, linux-ide, lkml

Hello.

On 15-05-2012 8:57, Andre Hedrick (anhedric) wrote:

> This is a missing part of the CFA 4.0 and above support.

> 6.2.1.6.1 Word 0: General Configuration
> 	This field indicates the general characteristics of the device.
> When Word 0 of the Identify drive information is 848Ah then the device
> is a CompactFlash Storage Card and complies with the CFA specification
> and CFA command set. It is recommended that PC Card modes of operation
> report only the 848Ah value as they are always intended as removable
> devices.

> Bits 15-0: CF Standard Configuration Value
> Word 0 is 848Ah. This is the recommended value of Word 0.
> 	Some operating systems require Bit 6 of Word 0 to be set to 1
> (Non-removable device) to use the card as the root storage device. The
> Card must be the root storage device when a host completely replaces
> conventional disk storage with a CompactFlash Card in True IDE mode. To
> support this requirement and provide capability for any future removable
> media Cards, alternate handling of Word 0 is permitted.

> Bits 15-0: CF Preferred Alternate Configuration Values

> 044Ah: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	preserving all
> Retired bits in the word.

> 0040h: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	zeroing all
> Retired bits in the word

    If you did read a bit further, you'd have seen:

Bit 15-12: Configuration Flag
If bits 15:12 are set to 8h then Word 0 shall be 848Ah.
If bits 15:12 are set to 0h then Bits 11:0 are set using the definitions below 
and the Card is
required to support for the CFA command set and report that in bit 2 of Word 83.
Bit 15:12 values other than 8h and 0h are prohibited.

    That's why our code does what it does, and not checks for the alternate 
values. If our check in word 83 fails, we therefore have a broken device.

> Cheers,
> Andre
> --------------------
> The Linux X-ATA/SATA guy

> --- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
> +++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
> @@ -819,6 +819,10 @@
>   {
>   	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
>   		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
> removable turned off, preserving retired bits */
> +		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
> removable turned off, zeroing retired bits*/
> +		return 1;
>   	/*
>   	 * CF specs don't require specific value in the word 0 anymore
> and yet
>   	 * they forbid to report the ATA version in the word 80 and
> require the
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ide" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

WBR, Sergei

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

* RE: CFA 4.0 patch
  2012-05-15 10:15 ` Sergei Shtylyov
@ 2012-05-15 11:07   ` Andre Hedrick (anhedric)
  0 siblings, 0 replies; 10+ messages in thread
From: Andre Hedrick (anhedric) @ 2012-05-15 11:07 UTC (permalink / raw)
  To: Sergei Shtylyov; +Cc: linux-ide

Hi Sergei,

I am glad to see the mailing lists are still rough and tumble as they
were in the past.

I am so sorry, it has been 10 plus years since I was the global
maintainer or drivers/ide and co-author of ATA/ATAPI-6 and 7.  Your
first comment is a whatever, patch line wrap who cares.  Now the second
comment, I happen to know what it does and I am letting everyone know
what it fails to do also.

The enclosed text came directly from the CFA 4.0 standard document, read
it again please.

Take care now, mate.

Cheers,
Andre

-----Original Message-----
From: Sergei Shtylyov [mailto:sshtylyov@mvista.com] 
Sent: Tuesday, May 15, 2012 3:15 AM
To: Andre Hedrick (anhedric)
Cc: jgarzik@pobox.com; linux-ide@vger.kernel.org; lkml@vger.kernel.org
Subject: Re: CFA 4.0 patch

Hello.

On 15-05-2012 8:57, Andre Hedrick (anhedric) wrote:

> This is a missing part of the CFA 4.0 and above support.

> 6.2.1.6.1 Word 0: General Configuration
> 	This field indicates the general characteristics of the device.
> When Word 0 of the Identify drive information is 848Ah then the device
> is a CompactFlash Storage Card and complies with the CFA specification
> and CFA command set. It is recommended that PC Card modes of operation
> report only the 848Ah value as they are always intended as removable
> devices.

> Bits 15-0: CF Standard Configuration Value
> Word 0 is 848Ah. This is the recommended value of Word 0.
> 	Some operating systems require Bit 6 of Word 0 to be set to 1
> (Non-removable device) to use the card as the root storage device. The
> Card must be the root storage device when a host completely replaces
> conventional disk storage with a CompactFlash Card in True IDE mode.
To
> support this requirement and provide capability for any future
removable
> media Cards, alternate handling of Word 0 is permitted.

> Bits 15-0: CF Preferred Alternate Configuration Values

> 044Ah: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	preserving all
> Retired bits in the word.

> 0040h: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	zeroing all
> Retired bits in the word

> Cheers,
> Andre
> --------------------
> The Linux X-ATA/SATA guy
>
>
> --- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
> +++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
> @@ -819,6 +819,10 @@
>   {
>   	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
>   		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
> removable turned off, preserving retired bits */
> +		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
> removable turned off, zeroing retired bits*/
> +		return 1;

    Have you read the code below this point? We rely on the CFA feature
set 
bit in the word 83 if the word 0 is non-traditional. Or does this below
check 
not detect your CF?
    Your patch won't apply to the recent kernels anyway.

>   	/*
>   	 * CF specs don't require specific value in the word 0 anymore
> and yet
>   	 * they forbid to report the ATA version in the word 80 and
> require the

    Patch is also line wrapped.

WBR, Sergei

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

* Re: CFA 4.0 patch
  2012-05-15  4:57 Andre Hedrick (anhedric)
@ 2012-05-15 10:15 ` Sergei Shtylyov
  2012-05-15 11:07   ` Andre Hedrick (anhedric)
  2012-05-15 11:37 ` Sergei Shtylyov
  1 sibling, 1 reply; 10+ messages in thread
From: Sergei Shtylyov @ 2012-05-15 10:15 UTC (permalink / raw)
  To: Andre Hedrick (anhedric); +Cc: jgarzik, linux-ide, lkml

Hello.

On 15-05-2012 8:57, Andre Hedrick (anhedric) wrote:

> This is a missing part of the CFA 4.0 and above support.

> 6.2.1.6.1 Word 0: General Configuration
> 	This field indicates the general characteristics of the device.
> When Word 0 of the Identify drive information is 848Ah then the device
> is a CompactFlash Storage Card and complies with the CFA specification
> and CFA command set. It is recommended that PC Card modes of operation
> report only the 848Ah value as they are always intended as removable
> devices.

> Bits 15-0: CF Standard Configuration Value
> Word 0 is 848Ah. This is the recommended value of Word 0.
> 	Some operating systems require Bit 6 of Word 0 to be set to 1
> (Non-removable device) to use the card as the root storage device. The
> Card must be the root storage device when a host completely replaces
> conventional disk storage with a CompactFlash Card in True IDE mode. To
> support this requirement and provide capability for any future removable
> media Cards, alternate handling of Word 0 is permitted.

> Bits 15-0: CF Preferred Alternate Configuration Values

> 044Ah: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	preserving all
> Retired bits in the word.

> 0040h: This is the alternate value of Word 0 turns on ATA device and
> turns off Removable Media and Removable Device while 	zeroing all
> Retired bits in the word

> Cheers,
> Andre
> --------------------
> The Linux X-ATA/SATA guy
>
>
> --- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
> +++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
> @@ -819,6 +819,10 @@
>   {
>   	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
>   		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
> removable turned off, preserving retired bits */
> +		return 1;
> +	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
> removable turned off, zeroing retired bits*/
> +		return 1;

    Have you read the code below this point? We rely on the CFA feature set 
bit in the word 83 if the word 0 is non-traditional. Or does this below check 
not detect your CF?
    Your patch won't apply to the recent kernels anyway.

>   	/*
>   	 * CF specs don't require specific value in the word 0 anymore
> and yet
>   	 * they forbid to report the ATA version in the word 80 and
> require the

    Patch is also line wrapped.

WBR, Sergei

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

* CFA 4.0 patch
@ 2012-05-15  4:57 Andre Hedrick (anhedric)
  2012-05-15 10:15 ` Sergei Shtylyov
  2012-05-15 11:37 ` Sergei Shtylyov
  0 siblings, 2 replies; 10+ messages in thread
From: Andre Hedrick (anhedric) @ 2012-05-15  4:57 UTC (permalink / raw)
  To: jgarzik, linux-ide, lkml

This is a missing part of the CFA 4.0 and above support.

6.2.1.6.1 Word 0: General Configuration
	This field indicates the general characteristics of the device.
When Word 0 of the Identify drive information is 848Ah then the device
is a CompactFlash Storage Card and complies with the CFA specification
and CFA command set. It is recommended that PC Card modes of operation
report only the 848Ah value as they are always intended as removable
devices.

Bits 15-0: CF Standard Configuration Value
Word 0 is 848Ah. This is the recommended value of Word 0.
	Some operating systems require Bit 6 of Word 0 to be set to 1
(Non-removable device) to use the card as the root storage device. The
Card must be the root storage device when a host completely replaces
conventional disk storage with a CompactFlash Card in True IDE mode. To
support this requirement and provide capability for any future removable
media Cards, alternate handling of Word 0 is permitted.

Bits 15-0: CF Preferred Alternate Configuration Values

044Ah: This is the alternate value of Word 0 turns on ATA device and
turns off Removable Media and Removable Device while 	preserving all
Retired bits in the word.

0040h: This is the alternate value of Word 0 turns on ATA device and
turns off Removable Media and Removable Device while 	zeroing all
Retired bits in the word

Cheers,
Andre
--------------------
The Linux X-ATA/SATA guy


--- linux-2.6.32.orig/include/linux/ata.h	Mon May 14 15:48:24 2012
+++ linux-2.6.32/include/linux/ata.h	Mon May 14 15:51:42 2012
@@ -819,6 +819,10 @@
 {
 	if (id[ATA_ID_CONFIG] == 0x848A)	/* Traditional CF */
 		return 1;
+	if (id[ATA_ID_CONFIG] == 0x044A)	/* Alternative CF w/
removable turned off, preserving retired bits */
+		return 1;
+	if (id[ATA_ID_CONFIG] == 0x0040)	/* Alternative CF w/
removable turned off, zeroing retired bits*/
+		return 1;
 	/*
 	 * CF specs don't require specific value in the word 0 anymore
and yet
 	 * they forbid to report the ATA version in the word 80 and
require the

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

end of thread, other threads:[~2012-05-16 12:27 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-15  5:17 CFA 4.0 patch Andre Hedrick (anhedric)
2012-05-15 14:38 ` Alan Cox
2012-05-15 18:35   ` Andre Hedrick (anhedric)
2012-05-16 11:32     ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2012-05-15  4:57 Andre Hedrick (anhedric)
2012-05-15 10:15 ` Sergei Shtylyov
2012-05-15 11:07   ` Andre Hedrick (anhedric)
2012-05-15 11:37 ` Sergei Shtylyov
2012-05-15 19:20   ` Andre Hedrick (anhedric)
2012-05-16 12:26     ` Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.