Compact Flash Serial ATA patch

From: Russell McConnachie
Date: Tue May 23 2006 - 13:13:57 EST


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.

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",