From owner-freebsd-current@FreeBSD.ORG Wed Oct 3 10:17:39 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFECD16A46B for ; Wed, 3 Oct 2007 10:17:39 +0000 (UTC) (envelope-from lwindschuh@googlemail.com) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.230]) by mx1.freebsd.org (Postfix) with ESMTP id BBF5E13C4BD for ; Wed, 3 Oct 2007 10:17:39 +0000 (UTC) (envelope-from lwindschuh@googlemail.com) Received: by nz-out-0506.google.com with SMTP id l8so2852555nzf for ; Wed, 03 Oct 2007 03:17:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=+0bV75LtdtOhaymesASejCWIt/WMmxdOmQ9dC8GIewk=; b=ZfJYuUyF/YQheXDpruHGCeJWgpzWc+Wik7wZUqkR3QkwePEgLQBOwsv5lw1RM2r6Ypq4oV598f02vR+cge4eJQCkE6JxBTqOIIqlwKUTy+TKbmbTSMwCboPjWdFkEPDXUDggms0STDCfaEy4160JII5qXguOgusgIzfwce93rb0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=D+Ry+s9ObDTNg4FJcOtJ0958UrefHbgQkKZcdF//YZ9ErUHZm2p46Qne2g2AdlKiYWkyG3EBEzuMXLrGyRqLZuXG4baztOwCJ0g6k3Mq94YO24Kdp6SejHFjSaOUOWNd4ilPWUHhREL6jxVW2qjwK/J7cJMT3+lmDQnySX/fsBk= Received: by 10.65.116.10 with SMTP id t10mr12077484qbm.1191405125946; Wed, 03 Oct 2007 02:52:05 -0700 (PDT) Received: by 10.65.204.3 with HTTP; Wed, 3 Oct 2007 02:52:05 -0700 (PDT) Message-ID: <90a5caac0710030252v20bbefbcg6455d2ae9fb73775@mail.gmail.com> Date: Wed, 3 Oct 2007 11:52:05 +0200 From: "Lucius Windschuh" To: freebsd-current@freebsd.org In-Reply-To: <90a5caac0710021727l3b1e93c0la8fdb5dc5fbf4465@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <90a5caac0710021727l3b1e93c0la8fdb5dc5fbf4465@mail.gmail.com> Subject: DELAY() woes X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Oct 2007 10:17:40 -0000 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