Skip to contentSkip to conversation

parport/parport_pc: replace

PATCH In review Nishanth Aravamudan 3 participants 3 messages Jul 27, 2004 – Jul 28, 2004

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parport/parport_pc: replace

I would appreciate any comments from the janitors list. This is one (of many) cases where I made a decision about replacing

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);

with

msleep(jiffies_to_msecs(some_time));

msleep() is not exactly the same as the previous code, but I only did this replacement where I thought long delays were *desired*. If this is not the case here, then just disregard this patch.

Thanks,
Nish

Applys-to: 2.6.7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays the desired time.

drivers/parport/parport_pc.c +1 -2
@@ -168,8 +168,7 @@ static int change_mode(struct parport *p
 				if (time_after_eq (jiffies, expire))
 					/* The FIFO is stuck. */
 					return -EBUSY;
-				__set_current_state (TASK_INTERRUPTIBLE);
-				schedule_timeout ((HZ + 99) / 100);
+				msleep(10);
 				if (signal_pending (current))
 					break;
 			}

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#1 lore raw

Re: [Kernel-janitors] [PATCH] parport/parport_pc:

Quoted 29 lines · Nishanth Aravamudan

I would appreciate any comments from the janitors list. This is one (of many) cases where I made a decision about replacing

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);

with

msleep(jiffies_to_msecs(some_time));

msleep() is not exactly the same as the previous code, but I only did this replacement where I thought long delays were *desired*. If this is not the case here, then just disregard this patch.

Thanks,
Nish

Applys-to: 2.6.7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays the desired time.

drivers/parport/parport_pc.c static int change_mode(struct parport *p · line 174

Quoted 9 lines
drivers/parport/parport_pc.c +1 -2
@@ -168,8 +168,7 @@ static int change_mode(struct parport *p
 				if (time_after_eq (jiffies, expire))
 					/* The FIFO is stuck. */
 					return -EBUSY;
-				__set_current_state (TASK_INTERRUPTIBLE);
-				schedule_timeout ((HZ + 99) / 100);
+				msleep(10);
 				if (signal_pending (current))
 					break;
 			}

Wouldn't the check of signal_pending indicate that the interruptability was intentional?

Signature · 2 lines
--------------------------
Mark Hollomon

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw
In reply to Nishanth Aravamudan

You are very right, Mark. I had tried to catch these misses on my part as I was submitting but must have looked right past this one. This patch should not be applied.

-Nish

Quoted 45 lines · Mark Hollomon
Quoted 29 lines · Nishanth Aravamudan

I would appreciate any comments from the janitors list. This is one (of many) cases where I made a decision about replacing

set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(some_time);

with

msleep(jiffies_to_msecs(some_time));

msleep() is not exactly the same as the previous code, but I only did this replacement where I thought long delays were *desired*. If this is not the case here, then just disregard this patch.

Thanks,
Nish

Applys-to: 2.6.7

Description: Uses msleep() instead of schedule_timeout() to guarantee the task delays the desired time.

drivers/parport/parport_pc.c 2004-07-12 22:09:32.000000000 +0000 static int change_mode(struct parport *p · line 174

Quoted 9 lines
drivers/parport/parport_pc.c 2004-07-12 22:09:32.000000000 +0000 renamed from drivers/parport/parport_pc.c 2004-06-16 05:20:04.000000000 +0000 +1 -2
@@ -168,8 +168,7 @@ static int change_mode(struct parport *p
                              if (time_after_eq (jiffies, expire))
                                      /* The FIFO is stuck. */
                                      return -EBUSY;
-                             __set_current_state (TASK_INTERRUPTIBLE);
-                             schedule_timeout ((HZ + 99) / 100);
+                             msleep(10);
                              if (signal_pending (current))
                                      break;
                      }

Wouldn't the check of signal_pending indicate that the interruptability was intentional?

Quoted 6 lines

--
--------------------------
Mark Hollomon

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors