In 2.4 that's already there:
> static inline void wait_for_cmd_done(long cmd_ioaddr)
> {
> int wait = 1000;
> do udelay(1) ;
> while(inb(cmd_ioaddr) && --wait >= 0);
> #ifndef final_version
> if (wait < 0)
> printk(KERN_ALERT "eepro100: wait_for_cmd_done timeout!\n");
> #endif
> }
In contrast, here is what Becker's current version looks like. It looks
like Becker just added a hack to continue waiting.
Things to try:
(a) add a rmb() after the udelay
(b) the Becker version
> /* How to wait for the command unit to accept a command.
> Typically this takes 0 ticks. */
>
> static inline void wait_for_cmd_done(long cmd_ioaddr)
> {
> int wait = 0;
> do
> if (inb(cmd_ioaddr) == 0) return;
> while(++wait <= 100);
> do
> if (inb(cmd_ioaddr) == 0) break;
> while(++wait <= 10000);
> printk(KERN_ERR "Command %4.4x was not immediately accepted, %d ticks!\n
> ",
> inb(cmd_ioaddr), wait);
> }
-- Jeff Garzik | Only so many songs can be sung Building 1024 | with two lips, two lungs, and one tongue. MandrakeSoft | - nomeansno - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/