From: Alexander Stein <hidden> Date: 2016-12-05 15:59:51
schedule_timeout takes a timeout in jiffies resolution. So pass 2ms
as a converted jiffies value. This makes the timeout independent of
CONFIG_HZ.
Signed-off-by: Alexander Stein <redacted>
---
drivers/tty/serial/ucc_uart.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
NACK.
So I don't remember why I wrote this code, but I don't think I was
expecting it to be 2ms. Instead, I think I just wanted it to be some
delay, but I believed that schedule_timeout(1) was too short or would be
"optimized" out somehow.
Note that right below this, I do:
if (qe_port->wait_closing) {
/* Wait a bit longer */
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(qe_port->wait_closing);
}
And wait_closing is a number of jiffies, so I knew that
schedule_timeout() took jiffies as a parameter.
So I think I'm going to NACK this patch, since I believe I knew what I
was doing when I wrote it five years ago.
NACK.
So I don't remember why I wrote this code, but I don't think I was
expecting it to be 2ms. Instead, I think I just wanted it to be some
delay, but I believed that schedule_timeout(1) was too short or would be
"optimized" out somehow.
Note that right below this, I do:
if (qe_port->wait_closing) {
/* Wait a bit longer */
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(qe_port->wait_closing);
}
And wait_closing is a number of jiffies, so I knew that
schedule_timeout() took jiffies as a parameter.
So I think I'm going to NACK this patch, since I believe I knew what I
was doing when I wrote it five years ago.
Okay, I was just wondering why the timeout is dependant on the timer tick.
That didn't seem obvious to me.
Rethinking about this, I would rather replace those lines with msleep instead.
Best regards,
Alexander
From: Timur Tabi <hidden> Date: 2016-12-06 13:35:47
Alexander Stein wrote:
Okay, I was just wondering why the timeout is dependant on the timer tick.
That didn't seem obvious to me.
Rethinking about this, I would rather replace those lines with msleep instead.
What's wrong with leaving it as-is? The code is five years old, and
Freescale/NXP barely uses the QE any more. I don't have access to any
hardware to test any changes you would propose.