Date: 16 Sep 2003 05:49:06 -0000 From: alo@louko.com (Antti Louko) To: freebsd-hackers@freebsd.org Subject: Problems when writing to a Compact Flash card, FreeBSD 5.1, solution found. Message-ID: <20030916054906.95092.qmail@alo.louko.com>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030916054906.95092.qmail>