linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [-mm PATCH 12/32] ppc: fix-up schedule_timeout() usage
       [not found] <20050815180514.GC2854@us.ibm.com>
@ 2005-08-15 18:15 ` Nishanth Aravamudan
  2005-08-15 18:23 ` [-mm PATCH 23/32] drivers/macintosh: " Nishanth Aravamudan
  1 sibling, 0 replies; 2+ messages in thread
From: Nishanth Aravamudan @ 2005-08-15 18:15 UTC (permalink / raw)
  To: paulus; +Cc: akpm, linuxppc-dev

Description: Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size. Also use
human-time conversion functions instead of hard-coded HZ division to
avoid rounding errors.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

---

 arch/ppc/4xx_io/serial_sicc.c |   17 +++++++----------
 arch/ppc/8260_io/fcc_enet.c   |    3 +--
 2 files changed, 8 insertions(+), 12 deletions(-)

diff -urpN 2.6.13-rc5-mm1/arch/ppc/4xx_io/serial_sicc.c 2.6.13-rc5-mm1-dev/arch/ppc/4xx_io/serial_sicc.c
--- 2.6.13-rc5-mm1/arch/ppc/4xx_io/serial_sicc.c	2005-03-01 23:37:30.000000000 -0800
+++ 2.6.13-rc5-mm1-dev/arch/ppc/4xx_io/serial_sicc.c	2005-08-11 15:55:47.000000000 -0700
@@ -1145,8 +1145,8 @@ static int set_serial_info(struct SICC_i
     info->flags = ((state->flags & ~ASYNC_INTERNAL_FLAGS) |
                (info->flags & ASYNC_INTERNAL_FLAGS));
     state->custom_divisor = new_serial.custom_divisor;
-    state->close_delay = new_serial.close_delay * HZ / 100;
-    state->closing_wait = new_serial.closing_wait * HZ / 100;
+    state->close_delay = msecs_to_jiffies(10 * new_serial.close_delay);
+    state->closing_wait = msecs_to_jiffies(10 * new_serial.closing_wait);
     info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0;
     port->fifosize = new_serial.xmit_fifo_size;
 
@@ -1465,10 +1465,8 @@ static void siccuart_close(struct tty_st
     info->event = 0;
     info->tty = NULL;
     if (info->blocked_open) {
-        if (info->state->close_delay) {
-            set_current_state(TASK_INTERRUPTIBLE);
-            schedule_timeout(info->state->close_delay);
-        }
+        if (info->state->close_delay)
+            schedule_timeout_interruptible(info->state->close_delay);
         wake_up_interruptible(&info->open_wait);
     }
     info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CLOSING);
@@ -1496,7 +1494,7 @@ static void siccuart_wait_until_sent(str
      * Note: we have to use pretty tight timings here to satisfy
      * the NIST-PCTS.
      */
-    char_time = (info->timeout - HZ/50) / info->port->fifosize;
+    char_time = (info->timeout - msecs_to_jiffies(20)) / info->port->fifosize;
     char_time = char_time / 5;
     if (char_time == 0)
         char_time = 1;
@@ -1521,8 +1519,7 @@ static void siccuart_wait_until_sent(str
            tty->index, jiffies,
            expire, char_time);
     while ((readb(info->port->uart_base + BL_SICC_LSR) & _LSR_TX_ALL) != _LSR_TX_ALL) {
-        set_current_state(TASK_INTERRUPTIBLE);
-        schedule_timeout(char_time);
+        schedule_timeout_interruptible(char_time);
         if (signal_pending(current))
             break;
         if (timeout && time_after(jiffies, expire))
@@ -1773,7 +1770,7 @@ int __init siccuart_init(void)
     for (i = 0; i < SERIAL_SICC_NR; i++) {
         struct SICC_state *state = sicc_state + i;
         state->line     = i;
-        state->close_delay  = 5 * HZ / 10;
+        state->close_delay  = msecs_to_jiffies(500);
         state->closing_wait = 30 * HZ;
 	spin_lock_init(&state->sicc_lock);
     }
diff -urpN 2.6.13-rc5-mm1/arch/ppc/8260_io/fcc_enet.c 2.6.13-rc5-mm1-dev/arch/ppc/8260_io/fcc_enet.c
--- 2.6.13-rc5-mm1/arch/ppc/8260_io/fcc_enet.c	2005-08-07 09:57:22.000000000 -0700
+++ 2.6.13-rc5-mm1-dev/arch/ppc/8260_io/fcc_enet.c	2005-08-08 13:54:41.000000000 -0700
@@ -1309,8 +1309,7 @@ static void mii_dm9161_wait(uint mii_reg
 
 	/* Davicom takes a bit to come up after a reset,
 	 * so wait here for a bit */
-	set_current_state(TASK_UNINTERRUPTIBLE);
-	schedule_timeout(timeout);
+	schedule_timeout_uninterruptible(timeout);
 }
 
 static phy_info_t phy_info_dm9161 = {

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [-mm PATCH 23/32] drivers/macintosh: fix-up schedule_timeout() usage
       [not found] <20050815180514.GC2854@us.ibm.com>
  2005-08-15 18:15 ` [-mm PATCH 12/32] ppc: fix-up schedule_timeout() usage Nishanth Aravamudan
@ 2005-08-15 18:23 ` Nishanth Aravamudan
  1 sibling, 0 replies; 2+ messages in thread
From: Nishanth Aravamudan @ 2005-08-15 18:23 UTC (permalink / raw)
  To: benh; +Cc: akpm, linuxppc-dev

Description: Use schedule_timeout_interruptible() instead of
set_current_state()/schedule_timeout() to reduce kernel size.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>

---

 arch/m68k/atari/time.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff -urpN 2.6.13-rc5-mm1/drivers/macintosh/therm_pm72.c 2.6.13-rc5-mm1-dev/drivers/macintosh/therm_pm72.c
--- 2.6.13-rc5-mm1/drivers/macintosh/therm_pm72.c	2005-08-07 09:57:58.000000000 -0700
+++ 2.6.13-rc5-mm1-dev/drivers/macintosh/therm_pm72.c	2005-08-08 15:06:08.000000000 -0700
@@ -1678,10 +1678,9 @@ static int main_control_loop(void *x)
 		}
 
 		// FIXME: Deal with signals
-		set_current_state(TASK_INTERRUPTIBLE);
 		elapsed = jiffies - start;
 		if (elapsed < HZ)
-			schedule_timeout(HZ - elapsed);
+			schedule_timeout_interruptible(HZ - elapsed);
 	}
 
  out:

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-15 19:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20050815180514.GC2854@us.ibm.com>
2005-08-15 18:15 ` [-mm PATCH 12/32] ppc: fix-up schedule_timeout() usage Nishanth Aravamudan
2005-08-15 18:23 ` [-mm PATCH 23/32] drivers/macintosh: " Nishanth Aravamudan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).