1. 21 Oct, 2021 3 commits
    • Xianting Tian's avatar
      tty: hvc: use correct dma alignment size · 30480f65
      Xianting Tian authored
      Use L1_CACHE_BYTES as the dma alignment size, use 'sizeof(long)' as
      dma alignment is wrong.
      Signed-off-by: default avatarXianting Tian <xianting.tian@linux.alibaba.com>
      Signed-off-by: default avatarShile Zhang <shile.zhang@linux.alibaba.com>
      Link: https://lore.kernel.org/r/20211015024658.1353987-2-xianting.tian@linux.alibaba.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      30480f65
    • Francesco Dolcini's avatar
      serial: imx: disable console clocks on unregister · 9768a37c
      Francesco Dolcini authored
      During console setup imx_uart_console_setup() enables clocks, but they
      are never disabled when the console is unregistered, this leads to
      clk_prepare_enable() being called multiple times without a matching
      clk_disable_unprepare() in case of console unregister.
      
      Ensure that clock enable/disable are balanced adding
      clk_disable_unprepare() in the console exit callback.
      Signed-off-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
      Link: https://lore.kernel.org/r/20211020192643.476895-3-francesco.dolcini@toradex.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9768a37c
    • Stefan Agner's avatar
      serial: imx: fix detach/attach of serial console · 6d0d1b5a
      Stefan Agner authored
      If the device used as a serial console gets detached/attached at runtime,
      register_console() will try to call imx_uart_setup_console(), but this
      is not possible since it is marked as __init.
      
      For instance
      
        # cat /sys/devices/virtual/tty/console/active
        tty1 ttymxc0
        # echo -n N > /sys/devices/virtual/tty/console/subsystem/ttymxc0/console
        # echo -n Y > /sys/devices/virtual/tty/console/subsystem/ttymxc0/console
      
      [   73.166649] 8<--- cut here ---
      [   73.167005] Unable to handle kernel paging request at virtual address c154d928
      [   73.167601] pgd = 55433e84
      [   73.167875] [c154d928] *pgd=8141941e(bad)
      [   73.168304] Internal error: Oops: 8000000d [#1] SMP ARM
      [   73.168429] Modules linked in:
      [   73.168522] CPU: 0 PID: 536 Comm: sh Not tainted 5.15.0-rc6-00056-g3968ddcf #3
      [   73.168675] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
      [   73.168791] PC is at imx_uart_console_setup+0x0/0x238
      [   73.168927] LR is at try_enable_new_console+0x98/0x124
      [   73.169056] pc : [<c154d928>]    lr : [<c0196f44>]    psr: a0000013
      [   73.169178] sp : c2ef5e70  ip : 00000000  fp : 00000000
      [   73.169281] r10: 00000000  r9 : c02cf970  r8 : 00000000
      [   73.169389] r7 : 00000001  r6 : 00000001  r5 : c1760164  r4 : c1e0fb08
      [   73.169512] r3 : c154d928  r2 : 00000000  r1 : efffcbd1  r0 : c1760164
      [   73.169641] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment none
      [   73.169782] Control: 10c5387d  Table: 8345406a  DAC: 00000051
      [   73.169895] Register r0 information: non-slab/vmalloc memory
      [   73.170032] Register r1 information: non-slab/vmalloc memory
      [   73.170158] Register r2 information: NULL pointer
      [   73.170273] Register r3 information: non-slab/vmalloc memory
      [   73.170397] Register r4 information: non-slab/vmalloc memory
      [   73.170521] Register r5 information: non-slab/vmalloc memory
      [   73.170647] Register r6 information: non-paged memory
      [   73.170771] Register r7 information: non-paged memory
      [   73.170892] Register r8 information: NULL pointer
      [   73.171009] Register r9 information: non-slab/vmalloc memory
      [   73.171142] Register r10 information: NULL pointer
      [   73.171259] Register r11 information: NULL pointer
      [   73.171375] Register r12 information: NULL pointer
      [   73.171494] Process sh (pid: 536, stack limit = 0xcd1ba82f)
      [   73.171621] Stack: (0xc2ef5e70 to 0xc2ef6000)
      [   73.171731] 5e60:                                     ???????? ???????? ???????? ????????
      [   73.171899] 5e80: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.172059] 5ea0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.172217] 5ec0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.172377] 5ee0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.172537] 5f00: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.172698] 5f20: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.172856] 5f40: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.173016] 5f60: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.173177] 5f80: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.173336] 5fa0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.173496] 5fc0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.173654] 5fe0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.173826] [<c0196f44>] (try_enable_new_console) from [<c01984a8>] (register_console+0x10c/0x2ec)
      [   73.174053] [<c01984a8>] (register_console) from [<c06e2c90>] (console_store+0x14c/0x168)
      [   73.174262] [<c06e2c90>] (console_store) from [<c0383718>] (kernfs_fop_write_iter+0x110/0x1cc)
      [   73.174470] [<c0383718>] (kernfs_fop_write_iter) from [<c02cf5f4>] (vfs_write+0x31c/0x548)
      [   73.174679] [<c02cf5f4>] (vfs_write) from [<c02cf970>] (ksys_write+0x60/0xec)
      [   73.174863] [<c02cf970>] (ksys_write) from [<c0100080>] (ret_fast_syscall+0x0/0x1c)
      [   73.175052] Exception stack(0xc2ef5fa8 to 0xc2ef5ff0)
      [   73.175167] 5fa0:                   ???????? ???????? ???????? ???????? ???????? ????????
      [   73.175327] 5fc0: ???????? ???????? ???????? ???????? ???????? ???????? ???????? ????????
      [   73.175486] 5fe0: ???????? ???????? ???????? ????????
      [   73.175608] Code: 00000000 00000000 00000000 00000000 (00000000)
      [   73.175744] ---[ end trace 9b75121265109bf1 ]---
      
      A similar issue could be triggered by unbinding/binding the serial
      console device [*].
      
      Drop __init so that imx_uart_setup_console() can be safely called at
      runtime.
      
      [*] https://lore.kernel.org/all/20181114174940.7865-3-stefan@agner.ch/
      
      Fixes: a3cb39d2 ("serial: core: Allow detach and attach serial device for console")
      Reviewed-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
      Acked-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: default avatarStefan Agner <stefan@agner.ch>
      Signed-off-by: default avatarFrancesco Dolcini <francesco.dolcini@toradex.com>
      Link: https://lore.kernel.org/r/20211020192643.476895-2-francesco.dolcini@toradex.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      6d0d1b5a
  2. 18 Oct, 2021 19 commits
  3. 17 Oct, 2021 3 commits
  4. 16 Oct, 2021 15 commits