Date: Wed, 3 Oct 2007 11:52:05 +0200 From: "Lucius Windschuh" <lwindschuh@googlemail.com> To: freebsd-current@freebsd.org Subject: DELAY() woes Message-ID: <90a5caac0710030252v20bbefbcg6455d2ae9fb73775@mail.gmail.com> In-Reply-To: <90a5caac0710021727l3b1e93c0la8fdb5dc5fbf4465@mail.gmail.com> References: <90a5caac0710021727l3b1e93c0la8fdb5dc5fbf4465@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi, I'm using FreeBSD -CURRENT as of October the 2nd and ran into some troubles with ACPI suspend on my Thinkpad T41. It is patched with Ariff's vpc patch and the one from PR kern/114649. My kernel config is GENERIC with SCHED_ULE instead of SCHED_4BSD and without WITNESS. On resuming from ACPI S3, I got: "ad0: detached" Some googling led me to http://lists.freebsd.org/pipermail/freebsd-current/2007-February/069214.html Alex sent me his solution: --- sys/dev/ata/ata-all.c-orig 2007-10-03 00:03:11.000000000 +0200 +++ sys/dev/ata/ata-all.c 2007-10-03 00:10:10.000000000 +0200 @@ -295,6 +295,9 @@ struct ata_channel *ch; int error; + device_printf(dev, " a small delay to wait until the disk is ready\n"); + ata_udelay(2000000); + /* check for valid device */ if (!dev || !(ch = device_get_softc(dev))) return ENXIO; I tried it and nothing changed (except the new log message about the "small delay" of 2 seconds;) ). Enlarging the delay to 10 seconds showed: DELAY(10000000) took only an unnoticable amount of time instead of 10 sec. Exchanging DELAY(10000000) with pause("atares", hz*10) gave the desired effect. Knowing this, I removed the extra lines above and changed ata_udelay so that it uses pause() for delays <= 100 ms instead of DELAY(). This solved the "ad0: detached" problems on ACPI S3 resume (now, I can see the 100 ms delays when probing the ATA devices in ata_generic_reset()). So now I'm confused about DELAY(). It seems to behave strange shortly after resuming, and "normalizes" its behaviour later on. Is this a known problem? Greetings, Lucius
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?90a5caac0710030252v20bbefbcg6455d2ae9fb73775>
