* [PATCH] serial/core.c: Unneeded memory barriers and cleanup
@ 2003-09-15 15:00 Felipe W Damasio
0 siblings, 0 replies; only message in thread
From: Felipe W Damasio @ 2003-09-15 15:00 UTC (permalink / raw)
To: rmk; +Cc: Linux Kernel Mailing List
[-- Attachment #1: Type: text/plain, Size: 536 bytes --]
Hi Russell,
Patch against 2.6-test5.
Kills a unneeded set_current_state (TASK_RUNNING) after
schedule_timeout and replaces a TASK_RUNNING settings with
non-memory-barrier versions.
On uart_suspend_port, that set state thing isn't needed if
schedule_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
[-- Attachment #2: core-state.patch --]
[-- Type: text/plain, Size: 1334 bytes --]
--- drivers/serial/core.c.orig 2003-09-15 11:49:50.000000000 -0300
+++ drivers/serial/core.c 2003-09-15 11:53:13.000000000 -0300
@@ -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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-09-15 14:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-15 15:00 [PATCH] serial/core.c: Unneeded memory barriers and cleanup Felipe W Damasio
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.