public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@suse.cz>
To: "Grover, Andrew" <andrew.grover@intel.com>
Cc: "'Woller, Thomas'" <twoller@crystal.cirrus.com>,
	"'linux-kernel@vger.kernel.org'" <linux-kernel@vger.kernel.org>
Subject: Re: Incorrect mdelay() results on Power Managed Machines x86
Date: Mon, 26 Mar 2001 00:00:49 +0000	[thread overview]
Message-ID: <20010326000048.A50@(none)> (raw)
In-Reply-To: <4148FEAAD879D311AC5700A0C969E8905DE7A2@orsmsx35.jf.intel.com>; from andrew.grover@intel.com on Thu, Mar 22, 2001 at 02:53:35PM -0800

Hi!

> > During resume the IBM thinkpad with the cs46xx driver needs 
> > to delay 700
> > milleseconds, so if the machine is booted up on battery power, then to
> > ensure that the delay is long enough, then a value of 3000 
> > milleseconds is
> > must be programmed into the driver (3 seconds!).  all the 
> > mdelay and udelay
> > wait times are incorrect by the same factor, resulting in some serious
> > problems when attempting to wait specific delay times in 
> > other parts of the
> > driver.  
> 
> Well yes this is a problem, but only when starting out with a low effective
> CPU freq and going high - the reverse is usually OK because longer than
> anticipated waits are OK.
> 
> However, you can alleviate this problem by not using udelay (or mdelay) but
> using a kernel timer. I would think you should be doing this anyway (700ms
> is a LONG TIME) but this should also work regardless of effective CPU freq.

Going from 59usec to 19usec is probably as fatal as going from 10sec to 3sec.

> A grep of the kernel source shows cs46xx isn't even doing the biggest
> mdelay. I can understand the use of spinning on a calibrated loop for less
> than a clock tick, but I gotta think there are better ways for longer
> periods.
> 
> I wonder if there is a way to modify mdelay to use a kernel timer if
> interval > 10msec? I am not familiar with this section of the kernel, but I
> do know that Microsoft's similar function KeStallExecutionProcessor is not
> recommended for more than 50 *micro*seconds.

You can't use kernel timer from within interrupts.

-- 
Philips Velo 1: 1"x4"x8", 300gram, 60, 12MB, 40bogomips, linux, mutt,
details at http://atrey.karlin.mff.cuni.cz/~pavel/velo/index.html.


  parent reply	other threads:[~2001-03-28 20:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-22 22:53 Incorrect mdelay() results on Power Managed Machines x86 Grover, Andrew
2001-03-22 23:07 ` Alan Cox
2001-03-26  0:00 ` Pavel Machek [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-03-30 17:17 Grover, Andrew
2001-03-29 18:30 Woller, Thomas
2001-03-28 23:12 Grover, Andrew
2001-03-29  4:10 ` Alan Cox
2001-03-24  3:55 sfr
2001-03-23 16:43 Woller, Thomas
2001-03-23  4:00 sfr
2001-03-23  9:54 ` Alan Cox
2001-03-26  0:06   ` Pavel Machek
2001-03-22 23:26 Woller, Thomas
2001-03-22 23:37 ` Alan Cox
2001-03-23  1:42   ` Tim Wright
2001-03-23  9:45     ` Alan Cox
2001-03-22 20:29 Woller, Thomas
2001-03-22 21:26 ` Alan Cox
2001-03-23  6:43   ` Dave Zarzycki
2001-03-22 23:29 ` Pavel Machek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20010326000048.A50@(none)' \
    --to=pavel@suse.cz \
    --cc=andrew.grover@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=twoller@crystal.cirrus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox