08 Oct, 2020

1 commit

  • * tag 'v5.4.70': (3051 commits)
    Linux 5.4.70
    netfilter: ctnetlink: add a range check for l3/l4 protonum
    ep_create_wakeup_source(): dentry name can change under you...
    ...

    Conflicts:
    arch/arm/mach-imx/pm-imx6.c
    arch/arm64/boot/dts/freescale/imx8mm-evk.dts
    arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
    drivers/crypto/caam/caamalg.c
    drivers/gpu/drm/imx/dw_hdmi-imx.c
    drivers/gpu/drm/imx/imx-ldb.c
    drivers/gpu/drm/imx/ipuv3/ipuv3-crtc.c
    drivers/mmc/host/sdhci-esdhc-imx.c
    drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
    drivers/net/ethernet/freescale/enetc/enetc.c
    drivers/net/ethernet/freescale/enetc/enetc_pf.c
    drivers/thermal/imx_thermal.c
    drivers/usb/cdns3/ep0.c
    drivers/xen/swiotlb-xen.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c

    Signed-off-by: Jason Liu

    Jason Liu
     

01 Oct, 2020

1 commit

  • [ Upstream commit a6dd255bdd7d00bbdbf78ba00bde9fc64f86c3a7 ]

    Some released ACPI FW for Huawei boards describes incorrect the port IO
    address range for child devices, in that it tells us the IO port max range
    is 0x3fff for each child device, which is not correct. The address range
    should be [e4:e8) or similar. With this incorrect upper range, the child
    device IO port resources overlap.

    As such, the kernel thinks that the LPC host serial device is a child of
    the IPMI device:

    root@(none)$ more /proc/ioports
    [...]
    00ffc0e3-00ffffff : hisi-lpc-ipmi.0.auto
    00ffc0e3-00ffc0e3 : ipmi_si
    00ffc0e4-00ffc0e4 : ipmi_si
    00ffc0e5-00ffc0e5 : ipmi_si
    00ffc2f7-00ffffff : serial8250.1.auto
    00ffc2f7-00ffc2fe : serial
    root@(none)$

    They should both be siblings. Note that these are logical PIO addresses,
    which have a direct mapping from the FW IO port ranges.

    This shows up as a real issue when we enable CONFIG_KASAN and
    CONFIG_DEBUG_TEST_DRIVER_REMOVE - we see use-after-free warnings in the
    host removal path:

    ==================================================================
    BUG: KASAN: use-after-free in release_resource+0x38/0xc8
    Read of size 8 at addr ffff0026accdbc38 by task swapper/0/1

    CPU: 2 PID: 1 Comm: swapper/0 Not tainted 5.5.0-rc6-00001-g68e186e77b5c-dirty #1593
    Hardware name: Huawei Taishan 2180 /D03, BIOS Hisilicon D03 IT20 Nemo 2.0 RC0 03/30/2018
    Call trace:
    dump_backtrace+0x0/0x290
    show_stack+0x14/0x20
    dump_stack+0xf0/0x14c
    print_address_description.isra.9+0x6c/0x3b8
    __kasan_report+0x12c/0x23c
    kasan_report+0xc/0x18
    __asan_load8+0x94/0xb8
    release_resource+0x38/0xc8
    platform_device_del.part.10+0x80/0xe0
    platform_device_unregister+0x20/0x38
    hisi_lpc_acpi_remove_subdev+0x10/0x20
    device_for_each_child+0xc8/0x128
    hisi_lpc_acpi_remove+0x4c/0xa8
    hisi_lpc_remove+0xbc/0xc0
    platform_drv_remove+0x3c/0x68
    really_probe+0x174/0x548
    driver_probe_device+0x7c/0x148
    device_driver_attach+0x94/0xa0
    __driver_attach+0xa4/0x110
    bus_for_each_dev+0xe8/0x158
    driver_attach+0x30/0x40
    bus_add_driver+0x234/0x2f0
    driver_register+0xbc/0x1d0
    __platform_driver_register+0x7c/0x88
    hisi_lpc_driver_init+0x18/0x20
    do_one_initcall+0xb4/0x258
    kernel_init_freeable+0x248/0x2c0
    kernel_init+0x10/0x118
    ret_from_fork+0x10/0x1c

    ...

    The issue here is that the kernel created an incorrect parent-child
    resource dependency between two devices, and references the false parent
    node when deleting the second child device, when it had been deleted
    already.

    Fix up the child device resources from FW to create proper IO port
    resource relationships for broken FW.

    With this, the IO port layout looks more healthy:

    root@(none)$ more /proc/ioports
    [...]
    00ffc0e3-00ffc0e7 : hisi-lpc-ipmi.0.auto
    00ffc0e3-00ffc0e3 : ipmi_si
    00ffc0e4-00ffc0e4 : ipmi_si
    00ffc0e5-00ffc0e5 : ipmi_si
    00ffc2f7-00ffc2ff : serial8250.1.auto
    00ffc2f7-00ffc2fe : serial

    Signed-off-by: John Garry
    Signed-off-by: Wei Xu
    Signed-off-by: Sasha Levin

    John Garry
     

30 Sep, 2020

1 commit

  • Add a new api that returns Management Complex firmware version
    and make the required structure public. The api's first user will be
    the caam driver for setting prediction resistance bits.

    Signed-off-by: Andrei Botila
    Acked-by: Laurentiu Tudor
    Reviewed-by: Horia Geantă
    Cc: Chris Healy
    Cc: Lucas Stach
    Cc: Horia Geantă
    Cc: Herbert Xu
    Cc: Iuliana Prodan
    Cc: linux-crypto@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-imx@nxp.com
    Signed-off-by: Herbert Xu
    (cherry picked from commit 0544cb75bd7df357c1758b760ecc7709125c139a)
    Signed-off-by: Horia Geantă
    Reviewed-by: Franck LENORMAND

    Andrei Botila
     

19 Aug, 2020

1 commit

  • [ Upstream commit 4254632dba27271f6de66efd87e444ee405dee29 ]

    Similar to what we have for the legacy platform data, we need to
    configure SWSUP_SIDLE and SWSUP_MSTANDBY quirks for usb_host_hs.

    These are needed to drop the legacy platform data for usb_host_hs.

    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     

22 Jul, 2020

9 commits

  • [ Upstream commit a55de412228cc5a2b4bf8d2a09849898102633e2 ]

    If we have "ti,no-idle" specified for a module we must not disable
    the the module on suspend to keep things backwards compatible.

    Fixes: 386cb76681ca ("bus: ti-sysc: Handle missed no-idle property in addition to no-idle-on-init")
    Reported-by: Grygorii Strashko
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit afe6f1eeb08f85e57f0a02b71efb5a0839606aac ]

    With CONFIG_DEBUG_ATOMIC_SLEEP enabled we can see the following with RTC probe:

    BUG: sleeping function called from invalid context at drivers/bus/ti-sysc.c:1736
    ...
    (sysc_quirk_rtc) from [] (sysc_write_sysconfig+0x1c/0x60)
    (sysc_write_sysconfig) from [] (sysc_enable_module+0x11c/0x274)
    (sysc_enable_module) from [] (sysc_probe+0xe9c/0x1380)
    (sysc_probe) from [] (platform_drv_probe+0x48/0x98)

    Fixes: e8639e1c986a ("bus: ti-sysc: Handle module unlock quirk needed for some RTC")
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 9f9113925018d500a95df539014d9ff11ac2c02d ]

    With CONFIG_DEBUG_ATOMIC_SLEEP enabled we can see the following with
    wakeirqs and serial console idled:

    BUG: sleeping function called from invalid context at drivers/bus/ti-sysc.c:242
    ...
    (sysc_wait_softreset) from [] (sysc_enable_module+0x48/0x274)
    (sysc_enable_module) from [] (sysc_runtime_resume+0x19c/0x1d8)
    (sysc_runtime_resume) from [] (sysc_child_runtime_resume+0x58/0x84)
    (sysc_child_runtime_resume) from [] (__rpm_callback+0x30/0x12c)
    (__rpm_callback) from [] (rpm_callback+0x20/0x80)
    (rpm_callback) from [] (rpm_resume+0x638/0x7fc)
    (rpm_resume) from [] (__pm_runtime_resume+0x60/0x9c)
    (__pm_runtime_resume) from [] (handle_threaded_wake_irq+0x24/0x60)
    (handle_threaded_wake_irq) from [] (irq_thread_fn+0x1c/0x78)
    (irq_thread_fn) from [] (irq_thread+0x140/0x26c)

    We have __pm_runtime_resume() call the sysc_runtime_resume() with spinlock
    held and interrupts disabled.

    Fixes: d46f9fbec719 ("bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit")
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit d46f9fbec71997420e4fb83c04d9affdf423f879 ]

    Some modules reset automatically when idled, and when re-enabled, we must
    wait for the automatic OCP softreset to complete. And if optional clocks
    are configured, we need to keep the clocks on while waiting for the reset
    to complete.

    Let's fix the issue by moving the OCP softreset code to a separate
    function sysc_wait_softreset(), and call it also from sysc_enable_module()
    with the optional clocks enabled.

    This is based on what we're already doing for legacy platform data booting
    in _enable_sysc().

    Fixes: 7324a7a0d5e2 ("bus: ti-sysc: Implement display subsystem reset quirk")
    Reported-by: Faiz Abbas
    Cc: Laurent Pinchart
    Cc: Tomi Valkeinen
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 25bfaaa73c7d26a6e897559c510d7daff5e9d22d ]

    In order to probe EDMA with ti-sysc interconnect target module and with
    device tree data, we need to properly detect EDMA and set the flags for
    SYSC_QUIRK_SWSUP_SIDLE | SYSC_QUIRK_SWSUP_MSTANDBY for tptc.

    We have these flags currently set for am4 and dra7, but not for am335x.
    Let's set them for all the SoCs as the tptc module should behave the
    same for all of them. It's likely that am335x was never tested to idle
    EDMA tptc.

    Cc: Peter Ujfalusi
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 77dfece2e6d8bedb6ecd4d61379ae3dc52f389bd ]

    In order to prepare probing display subsystem (DSS) with ti-sysc
    interconnect target module driver and device tree data, let's
    detect DSS related modules.

    We need to also add reset quirk handling for DSS, but until that's
    done, let's just enable the optional clock quirks for DSS and
    omap4 HDMI. The rest is just naming of modules if CONFIG_DEBUG
    is set.

    Cc: Jyri Sarha
    Cc: Laurent Pinchart
    Cc: Tomi Valkeinen
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit e8639e1c986a8a9d0f94549170f6db579376c3ae ]

    The RTC modules on am3 and am4 need quirk handling to unlock and lock
    them for reset so let's add the quirk handling based on what we already
    have for legacy platform data. In later patches we will simply drop the
    RTC related platform data and the old quirk handling.

    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 590e15c76f1231329d1543570a54058dba2e4ff6 ]

    We are currently setting -1 for non-existing sysconfig related registers
    for quirks, but setting -ENODEV elsewhere. And for matching the quirks,
    we're now just ignoring the non-existing registers. This will cause issues
    with misdetecting DSS registers as the hardware revision numbers can have
    duplicates.

    To avoid this, let's standardize on using -ENODEV also for the quirks
    instead of -1. That way we can always just test for a match without adding
    any more complicated logic.

    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit e64c021fd92467e34b9d970a651bcaa8f326f3f2 ]

    The clk_disable_quirk and clk_enable_quirk should really be called
    pre_reset_quirk and post_reset_quirk to avoid confusion like we had
    with hdq1w reset.

    Let's also rename the related functions so the code is easier to follow.
    Note that we also have reset_done_quirk that is needed in some cases
    after checking the separate register for reset done bit.

    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     

01 Jul, 2020

2 commits

  • [ Upstream commit 08b91dd6e547467fad61a7c201ff71080d7ad65a ]

    We must ignore the clockactivity bit for most modules and not set it
    unless specified for the module with SYSC_QUIRK_USE_CLOCKACT. Otherwise
    the interface clock can be automatically gated constantly causing
    unexpected performance issues.

    Fixes: ae9ae12e9daa ("bus: ti-sysc: Handle clockactivity for enable and disable")
    Cc: Laurent Pinchart
    Cc: Tomi Valkeinen
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 5ce8aee81be6c8bc19051d7c7b0d3cbb7ac5fc3f ]

    Looks like we're missing flush of posted write after module enable and
    disable. I've seen occasional errors accessing various modules, and it
    is suspected that the lack of posted writes can also cause random reboots.

    The errors we can see are similar to the one below from spi for example:

    44000000.ocp:L3 Custom Error: MASTER MPU TARGET L4CFG (Read): Data Access
    in User mode during Functional access
    ...
    mcspi_wait_for_reg_bit
    omap2_mcspi_transfer_one
    spi_transfer_one_message
    ...

    We also want to also flush posted write for disable. The clkctrl clock
    disable happens after module disable, and we don't want to have the
    module potentially stay active while we're trying to disable the clock.

    Fixes: d59b60564cbf ("bus: ti-sysc: Add generic enable/disable functions")
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     

19 Jun, 2020

1 commit

  • * tag 'v5.4.47': (2193 commits)
    Linux 5.4.47
    KVM: arm64: Save the host's PtrAuth keys in non-preemptible context
    KVM: arm64: Synchronize sysreg state on injecting an AArch32 exception
    ...

    Conflicts:
    arch/arm/boot/dts/imx6qdl.dtsi
    arch/arm/mach-imx/Kconfig
    arch/arm/mach-imx/common.h
    arch/arm/mach-imx/suspend-imx6.S
    arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
    arch/powerpc/include/asm/cacheflush.h
    drivers/cpufreq/imx6q-cpufreq.c
    drivers/dma/imx-sdma.c
    drivers/edac/synopsys_edac.c
    drivers/firmware/imx/imx-scu.c
    drivers/net/ethernet/freescale/fec.h
    drivers/net/ethernet/freescale/fec_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/phy_device.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/usb/cdns3/gadget.c
    drivers/usb/dwc3/gadget.c
    include/uapi/linux/dma-buf.h

    Signed-off-by: Jason Liu

    Jason Liu
     

17 Apr, 2020

1 commit

  • [ Upstream commit a43ab30dcd4a1abcdd0d2461bf1cf7c0817f6cd3 ]

    When doing a 16-bit read that returns data in the MSB byte, the
    RSB_DATA register will keep the MSB byte unchanged when doing
    the following 8-bit read. sunxi_rsb_read() will then return
    a result that contains high byte from 16-bit read mixed with
    the 8-bit result.

    The consequence is that after this happens the PMIC's regmap will
    look like this: (0x33 is the high byte from the 16-bit read)

    % cat /sys/kernel/debug/regmap/sunxi-rsb-3a3/registers
    00: 33
    01: 33
    02: 33
    03: 33
    04: 33
    05: 33
    06: 33
    07: 33
    08: 33
    09: 33
    0a: 33
    0b: 33
    0c: 33
    0d: 33
    0e: 33
    [snip]

    Fix this by masking the result of the read with the correct mask
    based on the size of the read. There are no 16-bit users in the
    mainline kernel, so this doesn't need to get into the stable tree.

    Signed-off-by: Ondrej Jirman
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Maxime Ripard
    Signed-off-by: Sasha Levin

    Ondrej Jirman
     

12 Mar, 2020

1 commit

  • commit aec551c7a00fb7eae049c0c4cc3208ca53e26355 upstream.

    Because of the i2c quirk we have the reset quirks named in a confusing
    way. Let's fix the 1-wire quirk accordinlyg. Then let's switch to using
    better naming later on.

    Fixes: 4e23be473e30 ("bus: ti-sysc: Add support for module specific reset quirks")
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren
     

08 Mar, 2020

1 commit

  • Merge Linux stable release v5.4.24 into imx_5.4.y

    * tag 'v5.4.24': (3306 commits)
    Linux 5.4.24
    blktrace: Protect q->blk_trace with RCU
    kvm: nVMX: VMWRITE checks unsupported field before read-only field
    ...

    Signed-off-by: Jason Liu

    Conflicts:
    arch/arm/boot/dts/imx6sll-evk.dts
    arch/arm/boot/dts/imx7ulp.dtsi
    arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
    drivers/clk/imx/clk-composite-8m.c
    drivers/gpio/gpio-mxc.c
    drivers/irqchip/Kconfig
    drivers/mmc/host/sdhci-of-esdhc.c
    drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
    drivers/net/can/flexcan.c
    drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
    drivers/net/ethernet/mscc/ocelot.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
    drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
    drivers/net/phy/realtek.c
    drivers/pci/controller/mobiveil/pcie-mobiveil-host.c
    drivers/perf/fsl_imx8_ddr_perf.c
    drivers/tee/optee/shm_pool.c
    drivers/usb/cdns3/gadget.c
    kernel/sched/cpufreq.c
    net/core/xdp.c
    sound/soc/fsl/fsl_esai.c
    sound/soc/fsl/fsl_sai.c
    sound/soc/sof/core.c
    sound/soc/sof/imx/Kconfig
    sound/soc/sof/loader.c

    Jason Liu
     

05 Mar, 2020

1 commit

  • commit 2f56acf818a08a9187ac8ec6e3d994fc13dc368d upstream.

    The ACONNECT bus driver does not use pm-clk interface anymore and hence
    the dependency can be removed from its Kconfig option.

    Fixes: 0d7dab926130 ("bus: tegra-aconnect: use devm_clk_*() helpers")
    Signed-off-by: Sameer Pujar
    Acked-by: Jon Hunter
    Signed-off-by: Thierry Reding
    Signed-off-by: Greg Kroah-Hartman

    Sameer Pujar
     

24 Feb, 2020

1 commit

  • [ Upstream commit 94f6345712b37e4bb23cb265ce4c65b9d177e75a ]

    For dra7 dcan and dwc3 instances we need to block clockdomain autoidle.
    Let's do this with CLKDM_NOAUTO quirk flag and enable it for dcan and
    dwc3.

    Cc: Keerthy
    Cc: Roger Quadros
    Cc: Tero Kristo
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     

20 Feb, 2020

1 commit

  • commit 3bf3c9744694803bd2d6f0ee70a6369b980530fd upstream.

    The input_read function declares the size of the hex array relative to
    sizeof(buf), but buf is a pointer argument of the function. The hex
    array is meant to contain hexadecimal representation of the bin array.

    Link: https://lore.kernel.org/r/20200215142130.22743-1-marek.behun@nic.cz
    Fixes: 5bc7f990cd98 ("bus: Add support for Moxtet bus")
    Signed-off-by: Marek Behún
    Reported-by: sohu0106
    Signed-off-by: Olof Johansson
    Signed-off-by: Greg Kroah-Hartman

    Marek Behún
     

01 Feb, 2020

4 commits

  • [ Upstream commit 93c60483b5feefced92b869d5f97769495bc6313 ]

    Commit 03856e928b0e ("bus: ti-sysc: Handle mstandby quirk and use it for
    musb") added quirk handling for mstandby quirk but did not consider that
    we also need a quirk variant for SYSC_QUIRK_FORCE_MSTANDBY.

    We need to use forced idle mode for both SYSC_QUIRK_SWSUP_MSTANDBY and
    SYSC_QUIRK_FORCE_MSTANDBY, but SYSC_QUIRK_SWSUP_MSTANDBY also need to
    additionally also configure no-idle mode when enabled.

    Fixes: 03856e928b0e ("bus: ti-sysc: Handle mstandby quirk and use it for musb")
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 020003f763e24e4ed0bb3d8909f3940891536d5d ]

    We must set the autogating bit on enable for AESS (Audio Engine SubSystem)
    when probed with ti-sysc interconnect target module driver. Otherwise it
    won't idle properly.

    Cc: Peter Ujfalusi
    Tested-by: Peter Ujfalusi
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 1819ef2e2d12d5b1a6ee54ac1c2afe35cffc677c ]

    Also on am335x we need the swsup quirks for musb.

    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     
  • [ Upstream commit 03856e928b0e1a1c274eece1dfe4330a362c37f3 ]

    We need swsup quirks for sidle and mstandby for musb to work
    properly.

    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     

23 Jan, 2020

1 commit

  • commit 2c81f0f6d3f52ac222a5dc07a6e5c06e1543e88b upstream.

    Commit d878970f6ce1 ("bus: ti-sysc: Add separate functions for handling
    clocks") separated handling of optional clocks from the main clocks, but
    introduced an issue where we do not necessarily allocate a slot for both
    fck and ick clocks, but still assume fixed slots for enumerating over the
    clocks.

    Let's fix the issue by ensuring we always have slots for both fck and ick
    even if we don't use ick, and don't attempt to enumerate optional clocks
    if not allocated.

    In the long run we might want to simplify things a bit by only allocating
    space only for the optional clocks as we have only few devices with
    optional clocks.

    Fixes: d878970f6ce1 ("bus: ti-sysc: Add separate functions for handling clocks")
    Signed-off-by: Tony Lindgren
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren
     

12 Jan, 2020

1 commit

  • [ Upstream commit e709ed70d122e94cb426b1e1f905829eae19a009 ]

    We have dts property for "ti,sysc-delay-us", and we're using it, but the
    wait after OCP softreset only happens if devices are probed in legacy mode.

    Let's add a delay after writing the OCP softreset when specified.

    Fixes: e0db94fe87da ("bus: ti-sysc: Make OCP reset work for sysstatus and sysconfig reset bits")
    Cc: Keerthy
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin

    Tony Lindgren
     

20 Dec, 2019

1 commit


02 Dec, 2019

11 commits