[lkml]   [2005]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/3] osst upgrade to 0.99.3
On Sun, 02 Jan 2005 00:59:33 +0000, Willem Riede <> wrote:
> Here is patch 2 (see previous mail for context), providing osst error
> handling improvements.


> + while (retval && time_before (jiffies, startwait + 5*60*HZ)) {
> +
> + if (STp->buffer->syscall_result && (SRpnt->sr_sense_buffer[2] & 0x0f) != 2) {
> +
> + /* some failure - not just not-ready */
> + retval = osst_write_error_recovery(STp, aSRpnt, 0);
> + break;
> + }
> + set_current_state(TASK_INTERRUPTIBLE);
> + schedule_timeout (HZ / OSST_POLL_PER_SEC);

Are you sure you want to use TASK_INTERRUPTIBLE here? If you are sure,
then you probably should add code which checks if schedule_timeout()
returns early because of signals (signals_pending(current) will be
true). Additionally, you may as well use msleep_interruptible(1000 /
OSST_POLL_PER_SEC), since you are requesting a 10th of a second sleep
(with OSST_POLL_PER_SEC #define'd to 10) (which is long & measurable
in milliseconds), you are not checking the return value (so you don't
seem to care how much time was left in the sleep) and
msleep_interruptible() will return on the same conditions as the
current code does. Seems like it should do what you want (still need
some means of checking for signals, though, I think).

If, in fact, you did not intend to use TASK_INTERRUPTIBLE, but
TASK_UNINTERRUPTIBLE, then you may want to consider using msleep(1000
/ OSST_POLL_PER_SEC) [ignoring signals in addition to waitqueue

If, though, you want to keep the code as is, then please ignore the
noise and I apologize :)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 14:09    [W:0.070 / U:0.248 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site