serial/core.c: Unneeded memory barriers and cleanup
PATCH 1/1 serial/core.c: Unneeded memory barriers and cleanup
Hi Russell,
Patch against 2.6-test5.
Kills a unneeded set_current_state (TASK_RUNNING) afterschedule_timeout and replaces a TASK_RUNNING settings with non-memory-barrier versions.
On uart_suspend_port, that set state thing isn't needed ifschedule_timeout was executed..but I couldn't come up with a (clean) fix for that, since we need to execute ops->shutdown. So I just replace it with __set_current_state so It's just an attribution and it's not that expensive.
Feel free to tell me I screwed up :)
Thanks,
Felipe
serial/core.c renamed from serial/core.c.orig +6 -7
@@ -1022,7 +1022,7 @@ cprev = cnow; } - current->state =TASK_RUNNING ; +__set_current_state (TASK_RUNNING );remove_wait_queue (&state->info->delta_msr_wait, &wait);return ret;
@@ -1277,7 +1277,6 @@if (state->close_delay) {set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (state->close_delay); -set_current_state (TASK_RUNNING ); } }else if (!uart_console (port)) {uart_change_pm (state,3 );
@@ -1345,11 +1344,11 @@set_current_state (TASK_INTERRUPTIBLE );schedule_timeout (char_time);if (signal_pending (current)) -break ; +return ;if (time_after (jiffies, expire)) -break ; +return ; } -set_current_state (TASK_RUNNING );/* might not be needed */ +__set_current_state (TASK_RUNNING );/* might not be needed */ }/*
@@ -1480,7 +1479,7 @@if (signal_pending (current))break ; } -set_current_state (TASK_RUNNING ); +__set_current_state (TASK_RUNNING );remove_wait_queue (&info->open_wait, &wait); state->count++;
@@ -1899,7 +1898,7 @@set_current_state (TASK_UNINTERRUPTIBLE );schedule_timeout (10 *HZ /1000 ); } -set_current_state (TASK_RUNNING ); +__set_current_state (TASK_RUNNING ); ops->shutdown (port); }