05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this software is licensed under the terms of the gnu general public
    license version 2 as published by the free software foundation and
    may be copied distributed and modified under those terms this
    program is distributed in the hope that it will be useful but
    without any warranty without even the implied warranty of
    merchantability or fitness for a particular purpose see the gnu
    general public license for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 285 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141900.642774971@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

21 May, 2019

1 commit


17 May, 2019

1 commit

  • Pull ARM SoC-related driver updates from Olof Johansson:
    "Various driver updates for platforms and a couple of the small driver
    subsystems we merge through our tree:

    Among the larger pieces:

    - Power management improvements for TI am335x and am437x (RTC
    suspend/wake)

    - Misc new additions for Amlogic (socinfo updates)

    - ZynqMP FPGA manager

    - Nvidia improvements for reset/powergate handling

    - PMIC wrapper for Mediatek MT8516

    - Misc fixes/improvements for ARM SCMI, TEE, NXP i.MX SCU drivers"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (57 commits)
    soc: aspeed: fix Kconfig
    soc: add aspeed folder and misc drivers
    spi: zynqmp: Fix build break
    soc: imx: Add generic i.MX8 SoC driver
    MAINTAINERS: Update email for Qualcomm SoC maintainer
    memory: tegra: Fix a typos for "fdcdwr2" mc client
    Revert "ARM: tegra: Restore memory arbitration on resume from LP1 on Tegra30+"
    memory: tegra: Replace readl-writel with mc_readl-mc_writel
    memory: tegra: Fix integer overflow on tick value calculation
    memory: tegra: Fix missed registers values latching
    ARM: tegra: cpuidle: Handle tick broadcasting within cpuidle core on Tegra20/30
    optee: allow to work without static shared memory
    soc/tegra: pmc: Move powergate initialisation to probe
    soc/tegra: pmc: Remove reset sysfs entries on error
    soc/tegra: pmc: Fix reset sources and levels
    soc: amlogic: meson-gx-pwrc-vpu: Add support for G12A
    soc: amlogic: meson-gx-pwrc-vpu: Fix power on/off register bitmask
    fpga manager: Adding FPGA Manager support for Xilinx zynqmp
    dt-bindings: fpga: Add bindings for ZynqMP fpga driver
    firmware: xilinx: Add fpga API's
    ...

    Linus Torvalds
     

15 May, 2019

1 commit

  • To facilitate additional options to get_user_pages_fast() change the
    singular write parameter to be gup_flags.

    This patch does not change any functionality. New functionality will
    follow in subsequent patches.

    Some of the get_user_pages_fast() call sites were unchanged because they
    already passed FOLL_WRITE or 0 for the write parameter.

    NOTE: It was suggested to change the ordering of the get_user_pages_fast()
    arguments to ensure that callers were converted. This breaks the current
    GUP call site convention of having the returned pages be the final
    parameter. So the suggestion was rejected.

    Link: http://lkml.kernel.org/r/20190328084422.29911-4-ira.weiny@intel.com
    Link: http://lkml.kernel.org/r/20190317183438.2057-4-ira.weiny@intel.com
    Signed-off-by: Ira Weiny
    Reviewed-by: Mike Marshall
    Cc: Aneesh Kumar K.V
    Cc: Benjamin Herrenschmidt
    Cc: Borislav Petkov
    Cc: Dan Williams
    Cc: "David S. Miller"
    Cc: Heiko Carstens
    Cc: Ingo Molnar
    Cc: James Hogan
    Cc: Jason Gunthorpe
    Cc: John Hubbard
    Cc: "Kirill A. Shutemov"
    Cc: Martin Schwidefsky
    Cc: Michal Hocko
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Ralf Baechle
    Cc: Rich Felker
    Cc: Thomas Gleixner
    Cc: Yoshinori Sato
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ira Weiny
     

29 Apr, 2019

1 commit


17 Apr, 2019

1 commit


07 Mar, 2019

1 commit

  • Pull ARM SoC driver updates from Arnd Bergmann:
    "As usual, the drivers/tee and drivers/reset subsystems get merged
    here, with the expected set of smaller updates and some new hardware
    support. The tee subsystem now supports device drivers to be attached
    to a tee, the first example here is a random number driver with its
    implementation in the secure world.

    Three new power domain drivers get added for specific chip families:
    - Broadcom BCM283x chips (used in Raspberry Pi)
    - Qualcomm Snapdragon phone chips
    - Xilinx ZynqMP FPGA SoCs

    One new driver is added to talk to the BPMP firmware on NVIDIA
    Tegra210

    Existing drivers are extended for new SoC variants from NXP, NVIDIA,
    Amlogic and Qualcomm"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (113 commits)
    tee: optee: update optee_msg.h and optee_smc.h to dual license
    tee: add cancellation support to client interface
    dpaa2-eth: configure the cache stashing amount on a queue
    soc: fsl: dpio: configure cache stashing destination
    soc: fsl: dpio: enable frame data cache stashing per software portal
    soc: fsl: guts: make fsl_guts_get_svr() static
    hwrng: make symbol 'optee_rng_id_table' static
    tee: optee: Fix unsigned comparison with less than zero
    hwrng: Fix unsigned comparison with less than zero
    tee: fix possible error pointer ctx dereferencing
    hwrng: optee: Initialize some structs using memset instead of braces
    tee: optee: Initialize some structs using memset instead of braces
    soc: fsl: dpio: fix memory leak of a struct qbman on error exit path
    clk: tegra: dfll: Make symbol 'tegra210_cpu_cvb_tables' static
    soc: qcom: llcc-slice: Fix typos
    qcom: soc: llcc-slice: Consolidate some code
    qcom: soc: llcc-slice: Clear the global drv_data pointer on error
    drivers: soc: xilinx: Add ZynqMP power domain driver
    firmware: xilinx: Add APIs to control node status/power
    dt-bindings: power: Add ZynqMP power domain bindings
    ...

    Linus Torvalds
     

01 Mar, 2019

1 commit


28 Feb, 2019

3 commits

  • The files optee_msg.h and optee_smc.h (under drivers/tee/optee) contain
    information originating from the OP-TEE OS project [1] [2], where the
    licensing terms are BSD 2-Clause. Therefore, apply a dual license to
    those files.

    Link: [1] https://github.com/OP-TEE/optee_os/blob/master/core/include/optee_msg.h
    Link: [2] https://github.com/OP-TEE/optee_os/blob/master/core/arch/arm/include/sm/optee_smc.h
    Signed-off-by: Jerome Forissier
    Signed-off-by: Jens Wiklander

    Jerome Forissier
     
  • Add support of cancellation request to the TEE kernel internal
    client interface. Can be used by software TPM drivers, that leverage
    TEE under the hood (for instance TPM2.0 mobile profile), for requesting
    cancellation of time-consuming operations (RSA key-pair generation etc.).

    Signed-off-by: Igor Opaniuk
    Signed-off-by: Jens Wiklander

    Igor Opaniuk
     
  • Add an of_node_put when a tested device node is not available.

    The semantic patch that fixes this problem is as follows
    (http://coccinelle.lip6.fr):

    //
    @@
    identifier f;
    local idexpression e;
    expression x;
    @@

    e = f(...);
    ... when != of_node_put(e)
    when != x = e
    when != e = x
    when any
    if () {
    ... when != of_node_put(e)
    (
    return e;
    |
    + of_node_put(e);
    return ...;
    )
    }
    //

    Fixes: db878f76b9ff ("tee: optee: take DT status property into account")
    Signed-off-by: Julia Lawall
    Signed-off-by: Jens Wiklander

    Julia Lawall
     

21 Feb, 2019

2 commits

  • The return from the call to tee_client_invoke_func can be a
    negative error code however this is being assigned to an
    unsigned variable 'ret' hence the check is always false.
    Fix this by making 'ret' an int.

    Detected by Coccinelle ("Unsigned expression compared with zero:
    ret < 0")

    Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support")
    Signed-off-by: YueHaibing
    Reviewed-by: Sumit Garg
    Signed-off-by: Arnd Bergmann

    YueHaibing
     
  • Add check for valid ctx pointer and then only dereference ctx to
    configure supp_nowait flag.

    Fixes: 42bf4152d8a7 ("tee: add supp_nowait flag in tee_context struct")
    Reported-by: Dan Carpenter
    Signed-off-by: Sumit Garg
    Signed-off-by: Arnd Bergmann

    Sumit Garg
     

20 Feb, 2019

1 commit

  • Clang warns:

    drivers/tee/optee/device.c:39:31: warning: suggest braces around
    initialization of subobject [-Wmissing-braces]
    struct tee_param param[4] = {0};
    ^
    {}
    drivers/tee/optee/device.c:92:48: warning: suggest braces around
    initialization of subobject [-Wmissing-braces]
    struct tee_ioctl_open_session_arg sess_arg = {0};
    ^
    {}
    2 warnings generated.

    One way to fix these warnings is to add additional braces like Clang
    suggests; however, there has been a bit of push back from some
    maintainers, who just prefer memset as it is unambiguous, doesn't
    depend on a particular compiler version, and properly initializes all
    subobjects [1][2]. Do that here so there are no more warnings.

    [1]: https://lore.kernel.org/lkml/022e41c0-8465-dc7a-a45c-64187ecd9684@amd.com/
    [2]: https://lore.kernel.org/lkml/20181128.215241.702406654469517539.davem@davemloft.net/

    Fixes: c3fa24af9244 ("tee: optee: add TEE bus device enumeration support")
    Link: https://github.com/ClangBuiltLinux/linux/issues/370
    Signed-off-by: Nathan Chancellor
    Reviewed-by: Sumit Garg
    Signed-off-by: Arnd Bergmann

    Nathan Chancellor
     

01 Feb, 2019

3 commits

  • OP-TEE provides a pseudo TA to enumerate TAs which can act as devices/
    services for TEE bus. So implement device enumeration using invoke
    function: PTA_CMD_GET_DEVICES provided by pseudo TA to fetch array of
    device UUIDs. Also register these enumerated devices with TEE bus as
    "optee-clntX" device.

    Signed-off-by: Sumit Garg
    Reviewed-by: Daniel Thompson
    [jw: fix optee_enumerate_devices() with no devices found]
    Signed-off-by: Jens Wiklander

    Sumit Garg
     
  • Introduce a generic TEE bus driver concept for TEE based kernel drivers
    which would like to communicate with TEE based devices/services. Also
    add support in module device table for these new TEE based devices.

    In this TEE bus concept, devices/services are identified via Universally
    Unique Identifier (UUID) and drivers register a table of device UUIDs
    which they can support.

    So this TEE bus framework registers following apis:
    - match(): Iterates over the driver UUID table to find a corresponding
    match for device UUID. If a match is found, then this particular device
    is probed via corresponding probe api registered by the driver. This
    process happens whenever a device or a driver is registered with TEE
    bus.
    - uevent(): Notifies user-space (udev) whenever a new device is registered
    on this bus for auto-loading of modularized drivers.

    Also this framework allows for device enumeration to be specific to
    corresponding TEE implementation like OP-TEE etc.

    Signed-off-by: Sumit Garg
    Reviewed-by: Daniel Thompson
    Reviewed-by: Bhupesh Sharma
    Signed-off-by: Jens Wiklander

    Sumit Garg
     
  • This flag indicates that requests in this context should not wait for
    tee-supplicant daemon to be started if not present and just return
    with an error code. It is needed for requests which should be
    non-blocking in nature like ones arising from TEE based kernel drivers
    or any in kernel api that uses TEE internal client interface.

    Signed-off-by: Sumit Garg
    Reviewed-by: Daniel Thompson
    Signed-off-by: Jens Wiklander

    Sumit Garg
     

01 Jan, 2019

1 commit


11 Dec, 2018

2 commits

  • When dynamic shared memory support is enabled in the OP-TEE Trusted
    OS, it doesn't mean that the driver supports it, which can confuse
    users during debugging. Log a message when dynamic shared memory is
    enabled in the driver, to let users know for sure.

    Suggested-by: Jerome Forissier
    Signed-off-by: Victor Chong
    Reviewed-by: Jerome Forissier
    Signed-off-by: Jens Wiklander

    Victor Chong
     
  • This bug occurs when:

    - a new request arrives, one thread(let's call it A) is pending in
    optee_supp_req() with req->busy is initial value false.

    - tee-supplicant is killed, then optee_supp_release() is called, this
    function calls list_del(&req->link), and set supp->ctx to NULL. And
    it also wake up process A.

    - process A continues, it firstly checks supp->ctx which is NULL,
    then checks req->busy which is false, at last run list_del(&req->link).
    This triggers double list_del() and results kernel panic.

    For solve this problem, we rename req->busy to req->in_queue, and
    associate it with state of whether req is linked to supp->reqs. So we
    can just only check req->in_queue to make decision calling list_del()
    or not.

    Signed-off-by: Zhizhou Zhang
    Signed-off-by: Jens Wiklander

    Zhizhou Zhang
     

27 Aug, 2018

1 commit

  • …-tee into next/drivers

    Misc enhancement for tee driver subsystem

    * Adds a kernel internal tee client interface allowing other drivers
    etc to access a TEE
    * OP-TEE driver takes DT status property into account

    * tag 'tee-drv-for-4.20' of git://git.linaro.org/people/jens.wiklander/linux-tee:
    tee: add kernel internal client interface
    tee: optee: take DT status property into account

    Signed-off-by: Olof Johansson <olof@lixom.net>

    Olof Johansson
     

24 Aug, 2018

3 commits

  • Adds a kernel internal TEE client interface to be used by other drivers.

    Reviewed-by: Sumit Garg
    Tested-by: Sumit Garg
    Tested-by: Zeng Tao
    Signed-off-by: Jens Wiklander

    Jens Wiklander
     
  • DT nodes may have a 'status' property which, if set to anything other
    than 'ok' or 'okay', indicates to the OS that the DT node should be
    treated as if it was not present. So add that missing logic to the
    OP-TEE driver.

    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Jens Wiklander

    Ard Biesheuvel
     
  • Pull ARM SoC driver updates from Olof Johansson:
    "Some of the larger changes this merge window:

    - Removal of drivers for Exynos5440, a Samsung SoC that never saw
    widespread use.

    - Uniphier support for USB3 and SPI reset handling

    - Syste control and SRAM drivers and bindings for Allwinner platforms

    - Qualcomm AOSS (Always-on subsystem) reset controller drivers

    - Raspberry Pi hwmon driver for voltage

    - Mediatek pwrap (pmic) support for MT6797 SoC"

    * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (52 commits)
    drivers/firmware: psci_checker: stash and use topology_core_cpumask for hotplug tests
    soc: fsl: cleanup Kconfig menu
    soc: fsl: dpio: Convert DPIO documentation to .rst
    staging: fsl-mc: Remove remaining files
    staging: fsl-mc: Move DPIO from staging to drivers/soc/fsl
    staging: fsl-dpaa2: eth: move generic FD defines to DPIO
    soc: fsl: qe: gpio: Add qe_gpio_set_multiple
    usb: host: exynos: Remove support for Exynos5440
    clk: samsung: Remove support for Exynos5440
    soc: sunxi: Add the A13, A23 and H3 system control compatibles
    reset: uniphier: add reset control support for SPI
    cpufreq: exynos: Remove support for Exynos5440
    ata: ahci-platform: Remove support for Exynos5440
    soc: imx6qp: Use GENPD_FLAG_ALWAYS_ON for PU errata
    soc: mediatek: pwrap: add mt6351 driver for mt6797 SoCs
    soc: mediatek: pwrap: add pwrap driver for mt6797 SoCs
    soc: mediatek: pwrap: fix cipher init setting error
    dt-bindings: pwrap: mediatek: add pwrap support for MT6797
    reset: uniphier: add USB3 core reset control
    dt-bindings: reset: uniphier: add USB3 core reset support
    ...

    Linus Torvalds
     

22 Jun, 2018

1 commit

  • drm-misc-next for 4.19:

    UAPI Changes:
    - Add writeback connector (Brian Starkey/Liviu Dudau)
    - Add "content type" property to HDMI connectors (Stanislav Lisovskiy)

    Cross-subsystem Changes:
    - some devicetree Docs update
    - fix compile breakage on ION due to the dma-buf cleanups (Christian König)

    Core Changes:
    - Reject over-sized allocation requests early (Chris Wilson)
    - gem-fb-helper: Always do implicit sync (Daniel Vetter)
    - dma-buf cleanups (Christian König)

    Driver Changes:
    - Fixes for the otm8009a panel driver (Philippe Cornu)
    - Add Innolux TV123WAM panel driver support (Sandeep Panda)
    - Move GEM BO to drm_framebuffer in few drivers (Daniel Stone)
    - i915 pinning improvements (Chris Wilson)
    - Stop consulting plane->fb/crtc in a few drivers (Ville Syrjälä)

    Signed-off-by: Dave Airlie

    Link: https://patchwork.freedesktop.org/patch/msgid/20180621105428.GA20795@juma

    Dave Airlie
     

20 Jun, 2018

2 commits


19 Jun, 2018

1 commit


07 May, 2018

2 commits

  • This change prevents userland from referencing TEE shared memory
    outside the area initially allocated by its owner. Prior this change an
    application could not reference or access memory it did not own but
    it could reference memory not explicitly allocated by owner but still
    allocated to the owner due to the memory allocation granule.

    Reported-by: Alexandre Jutras
    Signed-off-by: Etienne Carriere
    Signed-off-by: Jens Wiklander

    Etienne Carriere
     
  • Bump the file's refcount before moving the reference into the fd table,
    not afterwards. The old code could drop the file's refcount to zero for a
    short moment before calling get_file() via get_dma_buf().

    This code can only be triggered on ARM systems that use Linaro's OP-TEE.

    Fixes: 967c9cca2cc5 ("tee: generic TEE subsystem")
    Signed-off-by: Jann Horn
    Signed-off-by: Jens Wiklander

    Jann Horn
     

06 Mar, 2018

3 commits

  • When the driver initializes, report the following information
    about the OP-TEE OS:
    - major and minor version,
    - build identifier (if available).

    Signed-off-by: Jerome Forissier
    Reviewed-by: Matthias Brugger
    Signed-off-by: Jens Wiklander

    Jérôme Forissier
     
  • In the OPTEE_SMC_CALL_GET_OS_REVISION request, the previously reserved
    parameter a2 is now documented as being an optional build identifier
    (such as an SCM revision or commit ID, for instance).

    A new structure optee_smc_call_get_os_revision_result is introduced to
    be used when querying the secure OS version, instead of re-using the
    struct defined for OPTEE_SMC_CALLS_REVISION.

    Signed-off-by: Jerome Forissier
    Reviewed-by: Matthias Brugger
    Signed-off-by: Jens Wiklander

    Jérôme Forissier
     
  • The privileged dev id range is [TEE_NUM_DEVICES / 2, TEE_NUM_DEVICES).
    The non-privileged dev id range is [0, TEE_NUM_DEVICES / 2).

    So when finding a slot for them, need to use different max value.

    Signed-off-by: Peng Fan
    Signed-off-by: Jens Wiklander

    Peng Fan
     

12 Jan, 2018

1 commit

  • …/jens.wiklander/linux-tee into next/drivers

    This pull request updates the previous tee-drv-dynamic-shm-for-v4.16 pull
    request with five new patches fixing review comments and errors.

    Apart from three small fixes there's two larger patches that in the end
    checks that memory to be registered really is normal cached memory.

    * tag 'tee-drv-dynamic-shm+fixes-for-v4.16' of https://git.linaro.org/people/jens.wiklander/linux-tee:
    tee: shm: Potential NULL dereference calling tee_shm_register()
    tee: shm: don't put_page on null shm->pages
    tee: shm: make function __tee_shm_alloc static
    tee: optee: check type of registered shared memory
    tee: add start argument to shm_register callback

    Signed-off-by: Olof Johansson <olof@lixom.net>

    Olof Johansson
     

09 Jan, 2018

1 commit

  • get_user_pages_fast() can return zero in certain error paths. We should
    handle that or else it means we accidentally return ERR_PTR(0) which is
    NULL instead of an error pointer. The callers are not expecting that
    and will crash with a NULL dereference.

    Fixes: 033ddf12bcf5 ("tee: add register user memory")
    Signed-off-by: Dan Carpenter
    Signed-off-by: Jens Wiklander

    Dan Carpenter
     

29 Dec, 2017

2 commits

  • In the case that shm->pages fails to allocate, the current exit
    error path will try to put_page on a null shm->pages and cause
    a null pointer dereference when accessing shm->pages[n]. Fix this
    by only performing the put_page and kfree on shm->pages if it
    is not null.

    Detected by CoverityScan, CID#1463283 ("Dereference after null check")

    Fixes: 033ddf12bcf5 ("tee: add register user memory")
    Signed-off-by: Colin Ian King
    Signed-off-by: Jens Wiklander

    Colin Ian King
     
  • The function __tee_shm_alloc is local to the source and does
    not need to be in global scope, so make it static.

    Cleans up sparse warning:
    symbol '__tee_shm_alloc' was not declared. Should it be static?

    Signed-off-by: Colin Ian King
    Signed-off-by: Jens Wiklander

    Colin Ian King
     

28 Dec, 2017

2 commits


22 Dec, 2017

1 commit

  • The optee driver includes the header files in an unusual order,
    with asm/pgtable.h before the linux/*.h headers. For some reason
    this seems to trigger a build failure:

    drivers/tee/optee/call.c: In function 'optee_fill_pages_list':
    include/asm-generic/memory_model.h:64:14: error: implicit declaration of function 'page_to_section'; did you mean '__nr_to_section'? [-Werror=implicit-function-declaration]
    int __sec = page_to_section(__pg); \
    drivers/tee/optee/call.c:494:15: note: in expansion of macro 'page_to_phys'
    optee_page = page_to_phys(*pages) +

    Let's just include linux/mm.h, which will then get the other
    header implicitly.

    Fixes: 3bb48ba5cd60 ("tee: optee: add page list manipulation functions")
    Signed-off-by: Arnd Bergmann

    Arnd Bergmann