Patch "tty: serial: imx: disable Ageing Timer interrupt request irq" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    tty: serial: imx: disable Ageing Timer interrupt request irq

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     tty-serial-imx-disable-ageing-timer-interrupt-reques.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 23d9685038ca2309cb4fafa444f7b8cccb8cfb7c
Author: Peng Fan <peng.fan@xxxxxxx>
Date:   Mon Feb 6 09:30:16 2023 +0800

    tty: serial: imx: disable Ageing Timer interrupt request irq
    
    [ Upstream commit ef25e16ea9674b713a68c3bda821556ce9901254 ]
    
    There maybe pending USR interrupt before requesting irq, however
    uart_add_one_port has not executed, so there will be kernel panic:
    [    0.795668] Unable to handle kernel NULL pointer dereference at virtual addre
    ss 0000000000000080
    [    0.802701] Mem abort info:
    [    0.805367]   ESR = 0x0000000096000004
    [    0.808950]   EC = 0x25: DABT (current EL), IL = 32 bits
    [    0.814033]   SET = 0, FnV = 0
    [    0.816950]   EA = 0, S1PTW = 0
    [    0.819950]   FSC = 0x04: level 0 translation fault
    [    0.824617] Data abort info:
    [    0.827367]   ISV = 0, ISS = 0x00000004
    [    0.831033]   CM = 0, WnR = 0
    [    0.833866] [0000000000000080] user address but active_mm is swapper
    [    0.839951] Internal error: Oops: 0000000096000004 [#1] PREEMPT SMP
    [    0.845953] Modules linked in:
    [    0.848869] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.1+g56321e101aca #1
    [    0.855617] Hardware name: Freescale i.MX8MP EVK (DT)
    [    0.860452] pstate: 000000c5 (nzcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
    [    0.867117] pc : __imx_uart_rxint.constprop.0+0x11c/0x2c0
    [    0.872283] lr : imx_uart_int+0xf8/0x1ec
    
    The issue only happends in the inmate linux when Jailhouse hypervisor
    enabled. The test procedure is:
    while true; do
            jailhouse enable imx8mp.cell
            jailhouse cell linux xxxx
            sleep 10
            jailhouse cell destroy 1
            jailhouse disable
            sleep 5
    done
    
    And during the upper test, press keys to the 2nd linux console.
    When `jailhouse cell destroy 1`, the 2nd linux has no chance to put
    the uart to a quiese state, so USR1/2 may has pending interrupts. Then
    when `jailhosue cell linux xx` to start 2nd linux again, the issue
    trigger.
    
    In order to disable irqs before requesting them, both UCR1 and UCR2 irqs
    should be disabled, so here fix that, disable the Ageing Timer interrupt
    in UCR2 as UCR1 does.
    
    Fixes: 8a61f0c70ae6 ("serial: imx: Disable irqs before requesting them")
    Suggested-by: Sherry Sun <sherry.sun@xxxxxxx>
    Reviewed-by: Sherry Sun <sherry.sun@xxxxxxx>
    Signed-off-by: Peng Fan <peng.fan@xxxxxxx>
    Acked-by: Jason Liu <jason.hui.liu@xxxxxxx>
    Link: https://lore.kernel.org/r/20230206013016.29352-1-sherry.sun@xxxxxxx
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index f3f03cef3c7a9..f07c4f9ff13c0 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2377,6 +2377,11 @@ static int imx_uart_probe(struct platform_device *pdev)
 	ucr1 &= ~(UCR1_ADEN | UCR1_TRDYEN | UCR1_IDEN | UCR1_RRDYEN | UCR1_RTSDEN);
 	imx_uart_writel(sport, ucr1, UCR1);
 
+	/* Disable Ageing Timer interrupt */
+	ucr2 = imx_uart_readl(sport, UCR2);
+	ucr2 &= ~UCR2_ATEN;
+	imx_uart_writel(sport, ucr2, UCR2);
+
 	/*
 	 * In case RS485 is enabled without GPIO RTS control, the UART IP
 	 * is used to control CTS signal. Keep both the UART and Receiver



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux