lkml.org 
[lkml]   [2005]   [Aug]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 16/16] block/ps2esdi: replace sleep_on() with wait_event()
domen@coderock.org wrote:
>
> Use wait_event() instead of the deprecated sleep_on(). In all
> replacements, wait_event() expects the condition to *stop* on, so the existing
> conditional is negated and passed as the parameter. I am not sure if these
> changes are appropriate, as the condition to pass to wait_event() to guarantee
> the same behavior; I think this is the best choice, though.
>
> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
> Signed-off-by: Domen Puncer <domen@coderock.org>
> ---
> ps2esdi.c | 7 +++----
> 1 files changed, 3 insertions(+), 4 deletions(-)
>
> Index: quilt/drivers/block/ps2esdi.c
> ===================================================================
> --- quilt.orig/drivers/block/ps2esdi.c
> +++ quilt/drivers/block/ps2esdi.c
> @@ -43,6 +43,7 @@
> #include <linux/init.h>
> #include <linux/ioport.h>
> #include <linux/module.h>
> +#include <linux/delay.h>
>
> #include <asm/system.h>
> #include <asm/io.h>
> @@ -461,8 +462,7 @@ static void __init ps2esdi_get_device_cf
> cmd_blk[1] = 0;
> no_int_yet = TRUE;
> ps2esdi_out_cmd_blk(cmd_blk);
> - if (no_int_yet)
> - sleep_on(&ps2esdi_int);
> + wait_event(ps2esdi_int, !no_int_yet);
>
> if (ps2esdi_drives > 1) {
> printk("%s: Drive 1\n", DEVICE_NAME); /*BA */
> @@ -470,8 +470,7 @@ static void __init ps2esdi_get_device_cf
> cmd_blk[1] = 0;
> no_int_yet = TRUE;
> ps2esdi_out_cmd_blk(cmd_blk);
> - if (no_int_yet)
> - sleep_on(&ps2esdi_int);
> + wait_event(ps2esdi_int, !no_int_yet);
> } /* if second physical drive is present */
> return;
> }

hm, what a racy driver.

wake_up(&ps2esdi_int);
no_int_yet = FALSE;

these should be in the other order, no?

Anyway, I think I'll duck this patch until someone can say "it works".

-
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/

\
 
 \ /
  Last update: 2005-08-09 08:19    [W:0.095 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site