Skip to contentSkip to conversation

IDE: strange WAIT_READY dependency on APM

PATCH New Adrian Bunk 3 participants 4 messages Dec 9, 2004 – Dec 11, 2004

lore
Share & tools
lore
#0 lore raw

IDE contains the following strange code:

<-- snip -->

#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
#define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */
#else
#define WAIT_READY (HZ/10) /* 100msec - should be instantaneous */
#endif /* CONFIG_APM || CONFIG_APM_MODULE */

<-- snip -->

On the one hand APM isn't enabled on all laptops.
On the other hand, this also affects regular PCs with APM support (or using a distribution kernel with APM support).

The time for the !APM case was already increased from 30msec in 2.4 . Isn't there a timeout that is suitable for all cases?

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#1 lore raw

Hi!

Quoted 10 lines

IDE contains the following strange code:

<-- snip -->

#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
#define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */
#else
#define WAIT_READY (HZ/10) /* 100msec - should be instantaneous */
#endif /* CONFIG_APM || CONFIG_APM_MODULE */

Quoted 8 lines

<-- snip -->

On the one hand APM isn't enabled on all laptops.
On the other hand, this also affects regular PCs with APM support (or using a distribution kernel with APM support).

The time for the !APM case was already increased from 30msec in 2.4 . Isn't there a timeout that is suitable for all cases?

We should probably always make it the "big" timeout. Or put there HZ/10, and see who screams :-).

Pavel

Signature · 2 lines
People were complaining that M$ turns users into beta-testers...
...jr ghea gurz vagb qrirybcref, naq gurl frrz gb yvxr vg gung jnl!
#2 lore raw
In reply to Adrian Bunk
Quoted 2 lines · Adrian Bunk

The time for the !APM case was already increased from 30msec in 2.4 . Isn't there a timeout that is suitable for all cases?

The five seconds should be just fine for all cases. The smaller value with no
power manglement should help speed up recovery however. It probably doesn't belong CONFIG_APM now ACPI and friends are involved either.

#3 lore raw

PATCH 1/1 IDE: remove WAIT_READY dependency on APM

Quoted 8 lines · Alan Cox
Quoted 2 lines · Adrian Bunk

The time for the !APM case was already increased from 30msec in 2.4 . Isn't there a timeout that is suitable for all cases?

The five seconds should be just fine for all cases. The smaller value with no
power manglement should help speed up recovery however. It probably doesn't belong CONFIG_APM now ACPI and friends are involved either.

Thanks for this information. A patch is below.

include/linux/ide.h renamed from include/linux/ide.h.old +0 -4
@@ -187,11 +187,7 @@
  * Timeouts for various operations:
  */
 #define WAIT_DRQ	(HZ/10)		/* 100msec - spec allows up to 20ms */
-#if defined(CONFIG_APM) || defined(CONFIG_APM_MODULE)
 #define WAIT_READY	(5*HZ)		/* 5sec - some laptops are very slow */
-#else
-#define WAIT_READY	(HZ/10)		/* 100msec - should be instantaneous */
-#endif /* CONFIG_APM || CONFIG_APM_MODULE */
 #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 */