serial: sh-sci: Fix panic when serial console and DMA are enabled
authorTakatoshi Akiyama <takatoshi.akiyama.kj@ps.hitachi-solutions.com>
Mon, 27 Feb 2017 06:56:31 +0000 (15:56 +0900)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 26 Aug 2017 01:13:57 +0000 (02:13 +0100)
commit135e5d48d5340a13dde43d38193fb58f661e8d47
tree6e108cd3e7fa9f8c511e6051cb893ba8ba6183d4
parent4b8798065015ed68f2eafc68d32f12dc3cac55f0
serial: sh-sci: Fix panic when serial console and DMA are enabled

commit 3c9101766b502a0163d1d437fada5801cf616be2 upstream.

This patch fixes an issue that kernel panic happens when DMA is enabled
and we press enter key while the kernel booting on the serial console.

* An interrupt may occur after sci_request_irq().
* DMA transfer area is initialized by setup_timer() in sci_request_dma()
  and used in interrupt.

If an interrupt occurred between sci_request_irq() and setup_timer() in
sci_request_dma(), DMA transfer area has not been initialized yet.
So, this patch changes the order of sci_request_irq() and
sci_request_dma().

Fixes: 73a19e4c0301 ("serial: sh-sci: Add DMA support.")
Signed-off-by: Takatoshi Akiyama <takatoshi.akiyama.kj@ps.hitachi-solutions.com>
[Shimoda changes the commit log]
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/tty/serial/sh-sci.c