From ff99ccfc407e501268d3e20485114d7230342f8c Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Sat, 3 Sep 2005 15:55:37 -0700 Subject: [PATCH] --- yaml --- r: 6911 b: refs/heads/master c: 638861d54eec6b04a88d5d8df8b790d87de80b8d h: refs/heads/master i: 6909: 5304f78caf7b4ba920a96ed1c785681446a8d141 6907: 276cc4b2106b9d78afd588f0ef10960d40b429e7 6903: 4932060e2a9bad05eaca2c1cac10f9f3b2d02506 6895: 64126616697e18463669c09cbc277ad6b46391e9 6879: 398a05bc4f183178b0bd77c8bd32f6ffdf3dfade 6847: 079764d772f292031122960242c6073589020e59 6783: 9ffc87e7b61804cd8fd13c521c9ba55ee75035ea 6655: 62d18c74c260dd72aeacb5142b555ac8f93a4faa v: v3 --- [refs] | 2 +- trunk/drivers/serial/cpm_uart/cpm_uart_core.c | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/[refs] b/[refs] index de23464afd9d..acbbc6d614d6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0d8ba1a9793302fdcee3d6d4133c455023ca8ce9 +refs/heads/master: 638861d54eec6b04a88d5d8df8b790d87de80b8d diff --git a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c index 282b32351d8e..25825f2aba22 100644 --- a/trunk/drivers/serial/cpm_uart/cpm_uart_core.c +++ b/trunk/drivers/serial/cpm_uart/cpm_uart_core.c @@ -403,10 +403,8 @@ static int cpm_uart_startup(struct uart_port *port) inline void cpm_uart_wait_until_send(struct uart_cpm_port *pinfo) { - unsigned long target_jiffies = jiffies + pinfo->wait_closing; - - while (!time_after(jiffies, target_jiffies)) - schedule(); + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(pinfo->wait_closing); } /* @@ -425,9 +423,12 @@ static void cpm_uart_shutdown(struct uart_port *port) /* If the port is not the console, disable Rx and Tx. */ if (!(pinfo->flags & FLAG_CONSOLE)) { /* Wait for all the BDs marked sent */ - while(!cpm_uart_tx_empty(port)) + while(!cpm_uart_tx_empty(port)) { + set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(2); - if(pinfo->wait_closing) + } + + if (pinfo->wait_closing) cpm_uart_wait_until_send(pinfo); /* Stop uarts */