From 70e1df66ed233184ac2c61131361e81a4b9136dc Mon Sep 17 00:00:00 2001 From: Louie Lu Date: Tue, 22 Aug 2017 12:25:04 +0800 Subject: [PATCH] Remove sched_elect() in serialchar_callback() Early triggering scheduler results in failure of unstacking in exception return. Unexpected exception return increases the probability of occurrence of faults, such as INVPC, INVSTATE. In this situation, we can't make sure that it wouldn't cause faults or invalid interrupt raising due to unfinished interrupt handling. For example, if a context switch is done inside the irq, it will make v7m-head.S `pop {pc}` to a undefined place. Closed: #12 --- drivers/serial/serialchar.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/serial/serialchar.c b/drivers/serial/serialchar.c index 2b23733..a10a921 100644 --- a/drivers/serial/serialchar.c +++ b/drivers/serial/serialchar.c @@ -7,7 +7,6 @@ static void serialchar_callback(struct serial_info *serial) { sched_enqueue(serial->owner); - sched_elect(0); } static int serialchar_open(struct inode *inode, struct file *file)