30 May, 2020

1 commit

  • For AES CMAC, the max supported message length is (2^16)-1. In order to
    support this type of message the MAX_DATA_SIZE_PER_USER must be
    increased to bigger value, in order to contains the message header and
    the entire message data

    Signed-off-by: Hugo Dupras
    Reviewed-by: Stéphane Dion
    (cherry picked from commit 80438c2b525f0273c93c820c3f3ac6dc68709624)

    Hugo Dupras
     

24 Apr, 2020

1 commit


23 Apr, 2020

1 commit

  • At boot, the driver can print error messages because it has been
    deferred so they should not be printed.
    The driver also prints the version of the SECO which is not useful.

    This patch fixes the print of messages due to defer and remove the
    print of the SECO version.

    Signed-off-by: Franck LENORMAND
    Reviewed-by: Horia Geantă

    Franck LENORMAND
     

22 Apr, 2020

2 commits


09 Apr, 2020

1 commit


30 Mar, 2020

1 commit


14 Mar, 2020

2 commits

  • The Security Violation module requires SC API for the SECO, RM, MISC
    and IRQ.

    This patch does:
    - imx-scu-irq: Allow reuse of imx_scu_irq_get_status
    - seco:
    - Add imx_sc_seco_secvio_enable
    - Add imx_sc_seco_secvio_config
    - Add imx_sc_seco_secvio_dgo_config

    Signed-off-by: Franck LENORMAND

    Franck LENORMAND
     
  • The implementation was limiting the size of a message which can be
    received to 4 but soem response can be bigger. For example the
    response of the 'sc_seco_secvio_config' API is 6 words.

    This patch removes this limitation relying on the count of word
    received instead of the index of the chan.
    It does so by duplicating imx_scu_call_rpc as imx_scu_call_big_rpc
    in order to cahnge the RX method using imx_scu_big_rx_callback
    instead of imx_scu_rx_callback.

    Signed-off-by: Franck LENORMAND

    Franck LENORMAND
     

12 Mar, 2020

1 commit


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


04 Mar, 2020

1 commit


26 Feb, 2020

3 commits

  • SCU requires that all messages words are written sequentially but linux MU
    driver implements multiple independent channels for each register so ordering
    between different channels must be ensured by SCU API interface.

    Wait for tx_done before every send to ensure that no queueing happens at the
    mailbox channel level.

    Reported-by: Franck LENORMAND
    Acked-by: Ye Li
    [ Based on initial work from Franck LENORMAND ]
    Signed-off-by: Leonard Crestez
    Signed-off-by: Dong Aisheng

    (cherry picked from commit f7021eaa04ecb71b85ae8b653d673e44a7cbcfc4)

    Leonard Crestez
     
  • The header of the message to send can be changed if the
    response is longer than the request:
    - 1st word, the header is sent
    - the remaining words of the message are sent
    - the response is received asynchronously during the
    execution of the loop, changing the size field in
    the header
    - the for loop test the termination condition using
    the corrupted header

    It is the case for the API build_info which has just a
    header as request but 3 words in response.

    This issue is fixed storing the header locally instead of
    using a pointer on it.

    Fixes: edbee095fafb (firmware: imx: add SCU firmware driver support)

    Signed-off-by: Franck LENORMAND
    Reviewed-by: Leonard Crestez
    Signed-off-by: Dong Aisheng
    (cherry picked from commit fb0ad9322eb4477f30f41852bb8673b80a89a8d0)

    Franck LENORMAND
     
  • The imx SC api strongly assumes that messages are composed out of
    4-bytes words but some of our message structs have sizeof "6" and "7".

    This produces many oopses with CONFIG_KASAN=y:

    BUG: KASAN: stack-out-of-bounds in imx_mu_send_data+0x108/0x1f0

    It shouldn't cause an issues in normal use because these structs are
    always allocated on the stack.

    Also upstream: https://patchwork.kernel.org/patch/11376909/

    Reported-by: Iuliana Prodan
    Signed-off-by: Leonard Crestez
    Reviewed-by: Jason Liu
    Reviewed-by: Aisheng Dong
    Signed-off-by: Dong Aisheng
    (cherry picked from commit 8ca6d9eb2725152404a5764fc8916f77ee82aa29)

    Leonard Crestez
     

22 Feb, 2020

1 commit


21 Feb, 2020

5 commits


13 Feb, 2020

1 commit


26 Jan, 2020

2 commits

  • [ Upstream commit 7bd39bc6bfdf96f5df0f92199bbc1a3ee2f2adb8 ]

    The logic to ring the scmi performance fastchannel ignores the
    value read from the doorbell register in case of !CONFIG_64BIT.
    This bug also shows up as warning with '-Wunused-but-set-variable' gcc
    flag:

    drivers/firmware/arm_scmi/perf.c: In function scmi_perf_fc_ring_db:
    drivers/firmware/arm_scmi/perf.c:323:7: warning: variable val set but
    not used [-Wunused-but-set-variable]

    Fix the same by aligning the logic with CONFIG_64BIT as used in the
    macro SCMI_PERF_FC_RING_DB().

    Fixes: 823839571d76 ("firmware: arm_scmi: Make use SCMI v2.0 fastchannel for performance protocol")
    Reported-by: Hulk Robot
    Reported-by: Zheng Yongjun
    Signed-off-by: Sudeep Holla
    Signed-off-by: Sasha Levin

    Sudeep Holla
     
  • [ Upstream commit 0e4e8cc30a2940c57448af1376e40d3c0996fb29 ]

    IMX DSP device is created by SOF layer. The current call to
    devm_of_platform_populate is not needed and it doesn't produce
    any effects.

    Fixes: ffbf23d50353915d ("firmware: imx: Add DSP IPC protocol interface)
    Signed-off-by: Daniel Baluta
    Signed-off-by: Shawn Guo
    Signed-off-by: Sasha Levin

    Daniel Baluta
     

23 Jan, 2020

1 commit

  • commit d92b54570d24d017d2630e314b525ed792f5aa6c upstream.

    On x86, until PAT is initialized, WC translates into UC-. Since we
    calculate and store pgprot_writecombine(PAGE_KERNEL) when earlycon is
    initialized, this means we actually use UC- mappings instead of WC
    mappings, which makes scrolling very slow.

    Instead store a boolean flag to indicate whether we want to use
    writeback or write-combine mappings, and recalculate the actual pgprot_t
    we need on every mapping. Once PAT is initialized, we will start using
    write-combine mappings, which speeds up the scrolling considerably.

    Signed-off-by: Arvind Sankar
    Signed-off-by: Ard Biesheuvel
    Cc: Hans de Goede
    Cc: Linus Torvalds
    Cc: Peter Zijlstra
    Cc: Thomas Gleixner
    Cc: linux-efi@vger.kernel.org
    Fixes: 69c1f396f25b ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")
    Link: https://lkml.kernel.org/r/20191224132909.102540-2-ardb@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Arvind Sankar
     

12 Jan, 2020

4 commits

  • [ Upstream commit b418d660bb9798d2249ac6a46c844389ef50b6a5 ]

    When commit:

    69c1f396f25b ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")

    moved the x86 specific EFI earlyprintk implementation to a shared location,
    it also tweaked the behaviour. In particular, it dropped a trick with full
    framebuffer remapping after page initialization, leading to two regressions:

    1) very slow scrolling after page initialization,
    2) kernel hang when the 'keep_bootcon' command line argument is passed.

    Putting the tweak back fixes #2 and mitigates #1, i.e., it limits the slow
    behavior to the early boot stages, presumably due to eliminating heavy
    map()/unmap() operations per each pixel line on the screen.

    [ ardb: ensure efifb is unmapped again unless keep_bootcon is in effect. ]
    [ mingo: speling fixes. ]

    Signed-off-by: Andy Shevchenko
    Signed-off-by: Ard Biesheuvel
    Cc: Arvind Sankar
    Cc: Bhupesh Sharma
    Cc: Masayoshi Mizuma
    Cc: linux-efi@vger.kernel.org
    Fixes: 69c1f396f25b ("efi/x86: Convert x86 EFI earlyprintk into generic earlycon implementation")
    Link: https://lkml.kernel.org/r/20191206165542.31469-7-ardb@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin

    Andy Shevchenko
     
  • [ Upstream commit ff397be685e410a59c34b21ce0c55d4daa466bb7 ]

    efi_graphics_output_protocol::query_mode() returns info in
    callee-allocated memory which must be freed by the caller, which
    we aren't doing.

    We don't actually need to call query_mode() in order to obtain the
    info for the current graphics mode, which is already there in
    gop->mode->info, so just access it directly in the setup_gop32/64()
    functions.

    Also nothing uses the size of the info structure, so don't update the
    passed-in size (which is the size of the gop_handle table in bytes)
    unnecessarily.

    Signed-off-by: Arvind Sankar
    Signed-off-by: Ard Biesheuvel
    Cc: Andy Shevchenko
    Cc: Bhupesh Sharma
    Cc: Masayoshi Mizuma
    Cc: linux-efi@vger.kernel.org
    Link: https://lkml.kernel.org/r/20191206165542.31469-5-ardb@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin

    Arvind Sankar
     
  • [ Upstream commit dbd89c303b4420f6cdb689fd398349fc83b059dd ]

    If we've found a usable instance of the Graphics Output Protocol
    (GOP) with a framebuffer, it is possible that one of the later EFI
    calls fails while checking if any support console output. In this
    case status may be an EFI error code even though we found a usable
    GOP.

    Fix this by explicitly return EFI_SUCCESS if a usable GOP has been
    located.

    Signed-off-by: Arvind Sankar
    Signed-off-by: Ard Biesheuvel
    Cc: Andy Shevchenko
    Cc: Bhupesh Sharma
    Cc: Masayoshi Mizuma
    Cc: linux-efi@vger.kernel.org
    Link: https://lkml.kernel.org/r/20191206165542.31469-4-ardb@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin

    Arvind Sankar
     
  • [ Upstream commit 6fc3cec30dfeee7d3c5db8154016aff9d65503c5 ]

    If we don't find a usable instance of the Graphics Output Protocol
    (GOP) because none of them have a framebuffer (i.e. they were all
    PIXEL_BLT_ONLY), but all the EFI calls succeeded, we will return
    EFI_SUCCESS even though we didn't find a usable GOP.

    Fix this by explicitly returning EFI_NOT_FOUND if no usable GOPs are
    found, allowing the caller to probe for UGA instead.

    Signed-off-by: Arvind Sankar
    Signed-off-by: Ard Biesheuvel
    Cc: Andy Shevchenko
    Cc: Bhupesh Sharma
    Cc: Masayoshi Mizuma
    Cc: linux-efi@vger.kernel.org
    Link: https://lkml.kernel.org/r/20191206165542.31469-3-ardb@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin

    Arvind Sankar
     

09 Jan, 2020

2 commits

  • [ Upstream commit a470552ee8965da0fe6fd4df0aa39c4cda652c7c ]

    Commit:

    1c5fecb61255aa12 ("efi: Export Runtime Configuration Interface table to sysfs")

    ... added support for a Dell specific UEFI configuration table, but
    failed to take into account that mapping the table should not be
    attempted unless the table actually exists. If it doesn't exist,
    the code usually fails silently unless pr_debug() prints are
    enabled. However, on 32-bit PAE x86, the splat below is produced due
    to the attempt to map the placeholder value EFI_INVALID_TABLE_ADDR
    which we use for non-existing UEFI configuration tables, and which
    equals ULONG_MAX.

    memremap attempted on mixed range 0x00000000ffffffff size: 0x1e
    WARNING: CPU: 1 PID: 1 at kernel/iomem.c:81 memremap+0x1a3/0x1c0
    Modules linked in:
    CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.4.2-smp-mine #1
    Hardware name: Hewlett-Packard HP Z400 Workstation/0B4Ch, BIOS 786G3 v03.61 03/05/2018
    EIP: memremap+0x1a3/0x1c0
    ...
    Call Trace:
    ? map_properties+0x473/0x473
    ? efi_rci2_sysfs_init+0x2c/0x154
    ? map_properties+0x473/0x473
    ? do_one_initcall+0x49/0x1d4
    ? parse_args+0x1e8/0x2a0
    ? do_early_param+0x7a/0x7a
    ? kernel_init_freeable+0x139/0x1c2
    ? rest_init+0x8e/0x8e
    ? kernel_init+0xd/0xf2
    ? ret_from_fork+0x2e/0x38

    Fix this by checking whether the table exists before attempting to map it.

    Reported-by: Richard Narron
    Tested-by: Richard Narron
    Signed-off-by: Ard Biesheuvel
    Cc: linux-efi@vger.kernel.org
    Fixes: 1c5fecb61255aa12 ("efi: Export Runtime Configuration Interface table to sysfs")
    Link: https://lkml.kernel.org/r/20191210090945.11501-2-ardb@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Sasha Levin

    Ard Biesheuvel
     
  • commit 8305e90a894f82c278c17e51a28459deee78b263 upstream.

    If device_register() fails, both put_device() and kfree() are called,
    ending with a double free of the scmi_dev.

    Calling kfree() is needed only when a failure happens between the
    allocation of the scmi_dev and its registration, so move it to there
    and remove it from the error flow.

    Fixes: 46edb8d1322c ("firmware: arm_scmi: provide the mandatory device release callback")
    Signed-off-by: Wen Yang
    Signed-off-by: Sudeep Holla
    Signed-off-by: Greg Kroah-Hartman

    Wen Yang
     

31 Dec, 2019

1 commit

  • commit ab0eb16205b43ece4c78e2259e681ff3d645ea66 upstream.

    Memory regions that are reserved using efi_mem_reserve_persistent()
    are recorded in a special EFI config table which survives kexec,
    allowing the incoming kernel to honour them as well. However,
    such reservations are not visible in /proc/iomem, and so the kexec
    tools that load the incoming kernel and its initrd into memory may
    overwrite these reserved regions before the incoming kernel has a
    chance to reserve them from further use.

    Address this problem by adding these reservations to /proc/iomem as
    they are created. Note that reservations that are inherited from a
    previous kernel are memblock_reserve()'d early on, so they are already
    visible in /proc/iomem.

    Tested-by: Masayoshi Mizuma
    Tested-by: Bhupesh Sharma
    Signed-off-by: Ard Biesheuvel
    Reviewed-by: Bhupesh Sharma
    Cc: # v5.4+
    Cc: Andy Shevchenko
    Cc: Arvind Sankar
    Cc: linux-efi@vger.kernel.org
    Link: https://lkml.kernel.org/r/20191206165542.31469-2-ardb@kernel.org
    Signed-off-by: Ingo Molnar
    Signed-off-by: Greg Kroah-Hartman

    Ard Biesheuvel
     

18 Dec, 2019

1 commit

  • commit ff34f3cce278a0982a7b66b1afaed6295141b1fc upstream.

    The 'a0' member of 'struct arm_smccc_res' is declared as 'unsigned long',
    however the Qualcomm SCM firmware interface driver expects to receive
    negative error codes via this field, so ensure that it's cast to 'long'
    before comparing to see if it is less than 0.

    Cc:
    Reviewed-by: Bjorn Andersson
    Signed-off-by: Will Deacon
    Signed-off-by: Greg Kroah-Hartman

    Will Deacon
     

02 Dec, 2019

1 commit

  • * pm/next: (54 commits)
    drivers/soc/fsl: add EPU FSM configuration for deep sleep
    fsl_pmc: update device bindings
    soc: fsl: add RCPM driver
    Documentation: dt: binding: fsl: Add 'little-endian' and update Chassis define
    MLK-22992 firmware: imx: scu-pd: fix wu_num
    ...

    Dong Aisheng
     

29 Nov, 2019

1 commit


28 Nov, 2019

3 commits


25 Nov, 2019

1 commit