linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Compact Flash Serial ATA patch
@ 2006-05-23 10:16 Russell McConnachie
  2006-05-23 17:23 ` Matthew Dharm
  2006-05-23 18:56 ` Alan Cox
  0 siblings, 2 replies; 7+ messages in thread
From: Russell McConnachie @ 2006-05-23 10:16 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

I was having some trouble with a serial ATA compact flash adapter with
libata. I wrote a small patch for the kernel to work around the sanity
check, dma blacklisting and device ID detections in ata_dev_classify(). 

I am not exactly a programmer, I'm sure this can be written much better
but for anyone who may run into a similar problem with compact flash.

Russell McConnachie.


[-- Attachment #2: linux-2.6.16.16-compactflash-sata.patch --]
[-- Type: text/x-patch, Size: 1256 bytes --]

822,825c822,845
< 	    ((tf->lbam == 0x3c) && (tf->lbah == 0xc3))) {
< 		DPRINTK("found ATA device by sig\n");
< 		return ATA_DEV_ATA;
< 	}
---
> 		// Allows the compact flash to work, For some reason our 
> 		// Addonics SATA flash reader/writer. 
> 		// The following types of flash have been used: 
> 		// 	- Infineon 2.0GB
> 		// 	- Sandisk Ultra II 2.0GB 
> 		// 	- Lexar Platinum
> 		//
> 	
> 		// Sandisk Compact Flash
> 		((tf->lbam == 0x30) && (tf->lbah == 0)) ||
> 		 
> 		// Infineon Compact Flash 
> 		((tf->lbam == 0x50) && (tf->lbah == 0)) ||
> 		 
> 		// Infineon Compact Flash 
> 		((tf->lbam == 0x55) && (tf->lbah == 0)) ||
> 		           
> 		// Infineon Compact Flash 
> 		(((tf->lbam > 0x2f) && (tf->lbam < 0x7f))  && (tf->lbah == 0)) ||
> 		 
> 		((tf->lbam == 0x3c) && (tf->lbah == 0xc3))) {
> 		        DPRINTK("found ATA device by sig\n");
> 		        return ATA_DEV_ATA;
> 		}
875a896,897
> 	else if (device == 0)
> 		/* do nothing */ ; 
1335,1336c1357,1358
< 		if (!ata_id_is_ata(dev->id))	/* sanity check */
< 			goto err_out_nosup;
---
> //		if (!ata_id_is_ata(dev->id))	/* sanity check */
> //			goto err_out_nosup;
2235a2258,2260
> 	"MODEL",
> 	"SMI MODEL",
> 	"SanDisk SDCFH-2048",

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

* Re: Compact Flash Serial ATA patch
  2006-05-23 17:23 ` Matthew Dharm
@ 2006-05-23 10:41   ` Russell McConnachie
  2006-05-23 18:54   ` Alan Cox
  1 sibling, 0 replies; 7+ messages in thread
From: Russell McConnachie @ 2006-05-23 10:41 UTC (permalink / raw)
  To: Matthew Dharm; +Cc: linux-kernel

Hi Matt,

The patch which stopped the DMA problems was adding the model ID to the
dma blacklist in the libata-core.c file. I will create another patch in
unified diff format, it seems that compact flash uses different device
IDs than regular ATA/ATAPI devices.

On Tue, 2006-05-23 at 10:23 -0700, Matthew Dharm wrote:
> On Tue, May 23, 2006 at 04:16:37AM -0600, Russell McConnachie wrote:
> > I was having some trouble with a serial ATA compact flash adapter with
> > libata. I wrote a small patch for the kernel to work around the sanity
> > check, dma blacklisting and device ID detections in ata_dev_classify(). 
> 
> I've had this problem, too.  Apparently, my CF/SATA bridge doesn't support
> DMA, but libata requires it.
> 
> I don't know if this is the right fix (if nothing else the patch needs to
> be sent in unified diff format), but it's certainly something that needs
> fixing.
> 
> Matt
> 

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

* Re: Compact Flash Serial ATA patch
  2006-05-23 10:16 Compact Flash Serial ATA patch Russell McConnachie
@ 2006-05-23 17:23 ` Matthew Dharm
  2006-05-23 10:41   ` Russell McConnachie
  2006-05-23 18:54   ` Alan Cox
  2006-05-23 18:56 ` Alan Cox
  1 sibling, 2 replies; 7+ messages in thread
From: Matthew Dharm @ 2006-05-23 17:23 UTC (permalink / raw)
  To: Russell McConnachie; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

On Tue, May 23, 2006 at 04:16:37AM -0600, Russell McConnachie wrote:
> I was having some trouble with a serial ATA compact flash adapter with
> libata. I wrote a small patch for the kernel to work around the sanity
> check, dma blacklisting and device ID detections in ata_dev_classify(). 

I've had this problem, too.  Apparently, my CF/SATA bridge doesn't support
DMA, but libata requires it.

I don't know if this is the right fix (if nothing else the patch needs to
be sent in unified diff format), but it's certainly something that needs
fixing.

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@one-eyed-alien.net 
Maintainer, Linux USB Mass Storage Driver

Somebody call an exorcist!
					-- Dust Puppy
User Friendly, 5/16/1998

[-- Attachment #2: Type: application/pgp-signature, Size: 191 bytes --]

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

* Re: Compact Flash Serial ATA patch
  2006-05-23 17:23 ` Matthew Dharm
  2006-05-23 10:41   ` Russell McConnachie
@ 2006-05-23 18:54   ` Alan Cox
  1 sibling, 0 replies; 7+ messages in thread
From: Alan Cox @ 2006-05-23 18:54 UTC (permalink / raw)
  To: Matthew Dharm; +Cc: Russell McConnachie, linux-kernel

On Maw, 2006-05-23 at 10:23 -0700, Matthew Dharm wrote:
> I don't know if this is the right fix (if nothing else the patch needs to
> be sent in unified diff format), but it's certainly something that needs
> fixing.

I sent Jeff the patch to fix that a few days ago. Jeff can probably tell
you if its been applied yet. If not grab the libata PATA patches as they
include the needed fixes for 2.6.17-rc. The 2.6.17-mm tree is a bit
different so may be ok anyway.


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

* Re: Compact Flash Serial ATA patch
  2006-05-23 10:16 Compact Flash Serial ATA patch Russell McConnachie
  2006-05-23 17:23 ` Matthew Dharm
@ 2006-05-23 18:56 ` Alan Cox
  2006-05-23 20:47   ` markus reichelt
  1 sibling, 1 reply; 7+ messages in thread
From: Alan Cox @ 2006-05-23 18:56 UTC (permalink / raw)
  To: Russell McConnachie; +Cc: linux-kernel

On Maw, 2006-05-23 at 04:16 -0600, Russell McConnachie wrote:
> I am not exactly a programmer, I'm sure this can be written much better
> but for anyone who may run into a similar problem with compact flash.

Some CF adapters do not include all the neccessary pins for DMA because
they were designed to be cheap before the idea of CF using DMA seemed
realistic.

Alan


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

* Re: Compact Flash Serial ATA patch
  2006-05-23 18:56 ` Alan Cox
@ 2006-05-23 20:47   ` markus reichelt
  2006-05-24  7:14     ` Helge Hafting
  0 siblings, 1 reply; 7+ messages in thread
From: markus reichelt @ 2006-05-23 20:47 UTC (permalink / raw)
  To: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 871 bytes --]

* Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> On Maw, 2006-05-23 at 04:16 -0600, Russell McConnachie wrote:
> > I am not exactly a programmer, I'm sure this can be written much
> > better but for anyone who may run into a similar problem with
> > compact flash.
> 
> Some CF adapters do not include all the neccessary pins for DMA
> because they were designed to be cheap before the idea of CF using
> DMA seemed realistic.

Some CF adapters I've seen included all necessary pins but the pin
connections for DMA were missing. Someone at a slackware mailing list
was having the same problem, and if I recall correctly (better check
specs though) it can be fixed quite easily:

CF pin 44: disconnect from +V, connect to IDE pin 29.
CF pin 43: connect to IDE pin 21.

Typical transfer rates increased to about 10-12 MB/s

-- 
left blank, right bald

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: Compact Flash Serial ATA patch
  2006-05-23 20:47   ` markus reichelt
@ 2006-05-24  7:14     ` Helge Hafting
  0 siblings, 0 replies; 7+ messages in thread
From: Helge Hafting @ 2006-05-24  7:14 UTC (permalink / raw)
  To: linux-kernel

markus reichelt wrote:
> * Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
>
>   
>> On Maw, 2006-05-23 at 04:16 -0600, Russell McConnachie wrote:
>>     
>>> I am not exactly a programmer, I'm sure this can be written much
>>> better but for anyone who may run into a similar problem with
>>> compact flash.
>>>       
>> Some CF adapters do not include all the neccessary pins for DMA
>> because they were designed to be cheap before the idea of CF using
>> DMA seemed realistic.
>>     
>
> Some CF adapters I've seen included all necessary pins but the pin
> connections for DMA were missing. Someone at a slackware mailing list
> was having the same problem, and if I recall correctly (better check
> specs though) it can be fixed quite easily:
>
> CF pin 44: disconnect from +V, connect to IDE pin 29.
> CF pin 43: connect to IDE pin 21.
>
> Typical transfer rates increased to about 10-12 MB/s
>   
No more than that?  I have a CF card on parallel IDE,
hdparm can read 20MB/s from it with the 4GB 100xKingston
card I use to boot from.  Of course this card was bought
precisely for its speed (and size).

Helge Hafting


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

end of thread, other threads:[~2006-05-24  7:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-23 10:16 Compact Flash Serial ATA patch Russell McConnachie
2006-05-23 17:23 ` Matthew Dharm
2006-05-23 10:41   ` Russell McConnachie
2006-05-23 18:54   ` Alan Cox
2006-05-23 18:56 ` Alan Cox
2006-05-23 20:47   ` markus reichelt
2006-05-24  7:14     ` Helge Hafting

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).