From: Felipe W Damasio <felipewd@terra.com.br>
To: rmk@arm.linux.org.uk
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] serial/core.c: Unneeded memory barriers and cleanup
Date: Mon, 15 Sep 2003 12:00:47 -0300 [thread overview]
Message-ID: <3F65D41F.4020606@terra.com.br> (raw)
[-- 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);
}
reply other threads:[~2003-09-15 14:58 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=3F65D41F.4020606@terra.com.br \
--to=felipewd@terra.com.br \
--cc=linux-kernel@vger.kernel.org \
--cc=rmk@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 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.