linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Fwd: IDE DMA compact flash patch linux 2.4.20]
@ 2003-04-21 20:20 Stephen Baker
  0 siblings, 0 replies; only message in thread
From: Stephen Baker @ 2003-04-21 20:20 UTC (permalink / raw)
  To: linux-kernel

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



[-- Attachment #2: Forwarded message - IDE DMA compact flash patch linux 2.4.20 --]
[-- Type: message/rfc822, Size: 3934 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 1533 bytes --]

All,

I have been testing several vendors Compact Flash Cards with Linux
2.4.20.  I have noticed many DMA problems when the Compact Flash is used
with a hard drive (salve or master) on the same control ide0.  The
second problem was the detection of the hard drive.

I read most of the posting and most people doing this kind of
configuration work was seeing some kind of DMA error with this
configuration but know one had any fixes.

The first change I made was to modify my grub to use "hda=flash".  I did
this because I would have to add each vendors ID string to the list of
compact flash device in the kernel which would mean frequent patches.

Now with the flash flag set correctly; I change the ide-dma.c to black
list Compact Flash cards.  This keeps us from having to list all compact
flash cards in the black list as well.  Now I'm able to use the Compact
Flash with out random DMA errors.

To fix the hard drive detection in this case I just commented out the
code that disables the other device if one of the devices is Compact
Flash in ide-probe.c.  I researched this change and it was put in to fix
having two compact flash and if one was missing so the boot would not
hang for a long time.  This breaks any configuration that uses a Compact
Flash with a hard drive.  I had seen some posts that had this same
change but I guess they never submitted as a patch.  I think the correct
solution for the original two Compact Flash cards would be using the
"noprobe" option in the grub.conf not as a kernel mod.

Thanks,
SB



[-- Attachment #2.1.2: idedma.patch --]
[-- Type: text/plain, Size: 1770 bytes --]

--- ref/linux-2.4.20/drivers/ide/ide-probe.c	2002-11-28 17:53:13.000000000 -0600
+++ linux-2.4.20/drivers/ide/ide-probe.c	2003-03-30 00:22:43.000000000 -0600
@@ -166,6 +166,7 @@
 	 * Prevent long system lockup probing later for non-existant
 	 * slave drive if the hwif is actually a flash memory card of some variety:
 	 */
+#if 0
 	if (drive_is_flashcard(drive)) {
 		ide_drive_t *mate = &HWIF(drive)->drives[1^drive->select.b.unit];
 		if (!mate->ata_flash) {
@@ -173,6 +174,7 @@
 			mate->noprobe = 1;
 		}
 	}
+#endif
 	drive->media = ide_disk;
 	printk("ATA DISK drive\n");
 	QUIRK_LIST(HWIF(drive),drive);
--- ref/linux-2.4.20/drivers/ide/ide-dma.c	2002-11-28 17:53:13.000000000 -0600
+++ linux-2.4.20/drivers/ide/ide-dma.c	2003-03-30 00:20:19.000000000 -0600
@@ -439,6 +439,8 @@
  *  For both Blacklisted and Whitelisted drives.
  *  This is setup to be called as an extern for future support
  *  to other special driver code.
+ *
+ *  All flash cards in ATA mode should also be black listed
  */
 int check_drive_lists (ide_drive_t *drive, int good_bad)
 {
@@ -448,7 +450,7 @@
 	if (good_bad) {
 		return in_drive_list(id, drive_whitelist);
 	} else {
-		int blacklist = in_drive_list(id, drive_blacklist);
+		int blacklist = drive_is_flashcard(drive) || in_drive_list(id, drive_blacklist);
 		if (blacklist)
 			printk("%s: Disabling (U)DMA for %s\n", drive->name, id->model);
 		return(blacklist);
@@ -465,6 +467,12 @@
 		}
 	} else {
 		/* Consult the list of known "bad" drives */
+           if( drive_is_flashcard(drive) ) {
+              printk("%s: Disabling (U)DMA for Flash %s\n",
+	      drive->name, id->model);           
+              return 1;
+           }
+
 		list = bad_dma_drives;
 		while (*list) {
 			if (!strcmp(*list++,id->model)) {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-21 20:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-04-21 20:20 [Fwd: IDE DMA compact flash patch linux 2.4.20] Stephen Baker

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