public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: R.E.Wolff@BitWizard.nl (Rogier Wolff)
To: Andre Hedrick <andre@linux-ide.org>
Cc: schwidefsky@de.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: Linux-Kernel Archive: No 100 HZ timer !
Date: Sat, 14 Apr 2001 15:57:38 +0200 (MEST)	[thread overview]
Message-ID: <200104141357.PAA15976@cave.bitwizard.nl> (raw)
In-Reply-To: <Pine.LNX.4.10.10104121448520.4564-100000@master.linux-ide.org> from Andre Hedrick at "Apr 12, 2001 02:52:22 pm"

Andre Hedrick wrote:
> 
> Okay but what will be used for a base for hardware that has critical
> timing issues due to the rules of the hardware?
> 
> I do not care but your drives/floppy/tapes/cdroms/cdrws do:
> 
> /*
>  * Timeouts for various operations:
>  */
> #define WAIT_DRQ        (5*HZ/100)      /* 50msec - spec allows up to 20ms */
> #ifdef CONFIG_APM
> #define WAIT_READY      (5*HZ)          /* 5sec - some laptops are very slow */
> #else
> #define WAIT_READY      (3*HZ/100)      /* 30msec - should be instantaneous */
> #endif /* CONFIG_APM */
> #define WAIT_PIDENTIFY  (10*HZ) /* 10sec  - should be less than 3ms (?), if all ATAPI CD is closed at boot */
> #define WAIT_WORSTCASE  (30*HZ) /* 30sec  - worst case when spinning up */
> #define WAIT_CMD        (10*HZ) /* 10sec  - maximum wait for an IRQ to happen */
> #define WAIT_MIN_SLEEP  (2*HZ/100)      /* 20msec - minimum sleep time */

May I make a coding-style suggestion (which is ugly on one hand, neat
on the other):

#define mSec   *Hz/1000     /* Convert millisecs to jiffies */
#define Sec    *Hz          /* Convert secs to jiffies */


#define WAIT_DRQ        (50 mSec)   /* spec allows up to 20ms */
#ifdef CONFIG_APM
#define WAIT_READY      ( 5 Sec)    /* some laptops are very slow */
#else
#define WAIT_READY      (30 mSec)   /* should be instantaneous */
#endif /* CONFIG_APM */
#define WAIT_PIDENTIFY  (10 Sec)    /* should be less than 3ms (?), if all ATAPI CD is closed at boot */
#define WAIT_WORSTCASE  (30 Sec)    /* worst case when spinning up */
#define WAIT_CMD        (10 Sec)    /* maximum wait for an IRQ to happen */
#define WAIT_MIN_SLEEP  (20 mSec)   /* minimum sleep time */


I think that this is more readable than the above original. 

Also note that the numbers are not really repeated in the comments. If
someone changes the numbers, but not the comments, it may confuse
someone quite some time before he/she notices that the number that
is used is not the same as the one in the comment. 


				Roger. 

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 

  parent reply	other threads:[~2001-04-14 13:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3AD622AB.5F0A061B@linux-ide.org>
2001-04-12 21:52 ` Linux-Kernel Archive: No 100 HZ timer ! Andre Hedrick
2001-04-12 23:12   ` Alan Cox
2001-04-12 23:21     ` Andre Hedrick
2001-04-13  2:58       ` george anzinger
2001-04-13  4:04         ` Andre Hedrick
2001-04-13  7:21           ` Eric W. Biederman
2001-04-13  8:28             ` george anzinger
2001-04-13 12:20               ` Mark Salisbury
2001-04-13 12:55                 ` Michael Raymond
2001-04-13 15:50                 ` george anzinger
2001-04-13  9:05           ` David Schleef
2001-04-13 12:47           ` Alan Cox
2001-04-14 13:57   ` Rogier Wolff [this message]
2001-04-15  2:10   ` Roger Larsson
2001-04-15  7:22     ` george anzinger
2001-04-16 15:32   ` 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=200104141357.PAA15976@cave.bitwizard.nl \
    --to=r.e.wolff@bitwizard.nl \
    --cc=andre@linux-ide.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=schwidefsky@de.ibm.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