Problems when writing to a Compact Flash card, FreeBSD 5.1, solution found.

Antti Louko alo at louko.com
Mon Sep 15 22:49:10 PDT 2003


Finally, after adding and removing printfs and DELAYs in different
places, I found that probably after status inquiry, one must wait just
a little moment before doing anything with IDE device.  The following
patch seems to fix the problem.

Thank you for all of you who participated in the effort with
suggestions or sympathy!

Regards,

	Antti Louko

P.S.

If I won't find further problems, I will send this as a bug report so
this will get  into the releases, too.  I haven't tried CURRENT yet
but it seems that it might have the problem, too.

*** dev/ata/ata-all.c.orig      Sun May 18 19:43:08 2003
--- dev/ata/ata-all.c   Tue Sep 16 08:14:56 2003
***************
*** 978,983 ****
--- 978,984 ----
      DELAY(1);
      while (timeout < 5000000) { /* timeout 5 secs */
        atadev->channel->status = ATA_IDX_INB(atadev->channel, ATA_STATUS);
+         DELAY(1);
  
        /* if drive fails status, reselect the drive just to be sure */
        if (atadev->channel->status == 0xff) {



More information about the freebsd-hackers mailing list