]> git.baikalelectronics.ru Git - kernel.git/commit
serial: sh-sci: Don't enable/disable port from within break timer
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Thu, 28 Nov 2013 17:11:45 +0000 (18:11 +0100)
committerSimon Horman <horms+renesas@verge.net.au>
Sat, 14 Dec 2013 00:58:12 +0000 (09:58 +0900)
commite125fe6aafa740e13fc45ff58fce891b69a22d50
tree8a68b6cc78511ef077c56fecbc854dc991050dd2
parent9edce452bcc3c84b54b78b7935aab5da051de86b
serial: sh-sci: Don't enable/disable port from within break timer

The break timer accesses hardware registers and thus requires the port
to be enabled. It currently ensures this by enabling the port at the
beginning of the timer handler, and disabling it at the end. However,
the enable/disable operations call the runtime PM sync functions, which
are not allowed in atomic context. The current situation is thus broken.

This change relies on non-atomic code to enable/disable the port. The
break timer will only be started from the IRQ handler, which already
runs with the port enabled. We just need to ensure that the port won't
be disabled with the timer running, and that's easily done by just
cancelling the timer in the port disable function.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Magnus Damm <damm@opensource.se>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
drivers/tty/serial/sh-sci.c