From: Nishanth Aravamudan <nacc@us.ibm.com>
To: rmk+serial@arm.linux.org.uk
Cc: Kernel-Janitors <kernel-janitors@lists.osdl.org>,
linux-serial@vger.kernel.org
Subject: [PATCH] serial/68360serial: replace schedule_timeout() with msleep_interruptible()
Date: Thu, 3 Mar 2005 10:54:11 -0800 [thread overview]
Message-ID: <20050303185411.GM11600@us.ibm.com> (raw)
Hi,
Russell, sorry if you are not responsible for this driver, but I figure
the more eyes the better.
Thanks,
Nish
Please consider applying.
Description: Use msleep_interruptible() instead of schedule_timeout() in
send_break() to guarantee the task delays as expected. Change
@duration's units to milliseconds, and modify arguments in callers
appropriately.
Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
--- 2.6.11-kj-v/drivers/serial/68360serial.c 2005-03-01 23:38:26.000000000 -0800
+++ 2.6.11-kj/drivers/serial/68360serial.c 2005-03-02 14:40:38.000000000 -0800
@@ -1394,14 +1394,13 @@ static void end_break(ser_info_t *info)
/*
* This routine sends a break character out the serial port.
*/
-static void send_break(ser_info_t *info, int duration)
+static void send_break(ser_info_t *info, unsigned int duration)
{
- set_current_state(TASK_INTERRUPTIBLE);
#ifdef SERIAL_DEBUG_SEND_BREAK
printk("rs_send_break(%d) jiff=%lu...", duration, jiffies);
#endif
begin_break(info);
- schedule_timeout(duration);
+ msleep_interruptible(duration);
end_break(info);
#ifdef SERIAL_DEBUG_SEND_BREAK
printk("done jiffies=%lu\n", jiffies);
@@ -1436,7 +1435,7 @@ static int rs_360_ioctl(struct tty_struc
if (signal_pending(current))
return -EINTR;
if (!arg) {
- send_break(info, HZ/4); /* 1/4 second */
+ send_break(info, 250); /* 1/4 second */
if (signal_pending(current))
return -EINTR;
}
@@ -1448,7 +1447,7 @@ static int rs_360_ioctl(struct tty_struc
tty_wait_until_sent(tty, 0);
if (signal_pending(current))
return -EINTR;
- send_break(info, arg ? arg*(HZ/10) : HZ/4);
+ send_break(info, arg ? arg*100 : 250);
if (signal_pending(current))
return -EINTR;
return 0;
reply other threads:[~2005-03-03 18:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050303185411.GM11600@us.ibm.com \
--to=nacc@us.ibm.com \
--cc=kernel-janitors@lists.osdl.org \
--cc=linux-serial@vger.kernel.org \
--cc=rmk+serial@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).