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
     

07 Oct, 2020

1 commit

  • commit f85086f95fa36194eb0db5cd5c12e56801b98523 upstream.

    In register_mem_sect_under_node() the system_state's value is checked to
    detect whether the call is made during boot time or during an hot-plug
    operation. Unfortunately, that check against SYSTEM_BOOTING is wrong
    because regular memory is registered at SYSTEM_SCHEDULING state. In
    addition, memory hot-plug operation can be triggered at this system
    state by the ACPI [1]. So checking against the system state is not
    enough.

    The consequence is that on system with interleaved node's ranges like this:

    Early memory node ranges
    node 1: [mem 0x0000000000000000-0x000000011fffffff]
    node 2: [mem 0x0000000120000000-0x000000014fffffff]
    node 1: [mem 0x0000000150000000-0x00000001ffffffff]
    node 0: [mem 0x0000000200000000-0x000000048fffffff]
    node 2: [mem 0x0000000490000000-0x00000007ffffffff]

    This can be seen on PowerPC LPAR after multiple memory hot-plug and
    hot-unplug operations are done. At the next reboot the node's memory
    ranges can be interleaved and since the call to link_mem_sections() is
    made in topology_init() while the system is in the SYSTEM_SCHEDULING
    state, the node's id is not checked, and the sections registered to
    multiple nodes:

    $ ls -l /sys/devices/system/memory/memory21/node*
    total 0
    lrwxrwxrwx 1 root root 0 Aug 24 05:27 node1 -> ../../node/node1
    lrwxrwxrwx 1 root root 0 Aug 24 05:27 node2 -> ../../node/node2

    In that case, the system is able to boot but if later one of theses
    memory blocks is hot-unplugged and then hot-plugged, the sysfs
    inconsistency is detected and this is triggering a BUG_ON():

    kernel BUG at /Users/laurent/src/linux-ppc/mm/memory_hotplug.c:1084!
    Oops: Exception in kernel mode, sig: 5 [#1]
    LE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=2048 NUMA pSeries
    Modules linked in: rpadlpar_io rpaphp pseries_rng rng_core vmx_crypto gf128mul binfmt_misc ip_tables x_tables xfs libcrc32c crc32c_vpmsum autofs4
    CPU: 8 PID: 10256 Comm: drmgr Not tainted 5.9.0-rc1+ #25
    Call Trace:
    add_memory_resource+0x23c/0x340 (unreliable)
    __add_memory+0x5c/0xf0
    dlpar_add_lmb+0x1b4/0x500
    dlpar_memory+0x1f8/0xb80
    handle_dlpar_errorlog+0xc0/0x190
    dlpar_store+0x198/0x4a0
    kobj_attr_store+0x30/0x50
    sysfs_kf_write+0x64/0x90
    kernfs_fop_write+0x1b0/0x290
    vfs_write+0xe8/0x290
    ksys_write+0xdc/0x130
    system_call_exception+0x160/0x270
    system_call_common+0xf0/0x27c

    This patch addresses the root cause by not relying on the system_state
    value to detect whether the call is due to a hot-plug operation. An
    extra parameter is added to link_mem_sections() detailing whether the
    operation is due to a hot-plug operation.

    [1] According to Oscar Salvador, using this qemu command line, ACPI
    memory hotplug operations are raised at SYSTEM_SCHEDULING state:

    $QEMU -enable-kvm -machine pc -smp 4,sockets=4,cores=1,threads=1 -cpu host -monitor pty \
    -m size=$MEM,slots=255,maxmem=4294967296k \
    -numa node,nodeid=0,cpus=0-3,mem=512 -numa node,nodeid=1,mem=512 \
    -object memory-backend-ram,id=memdimm0,size=134217728 -device pc-dimm,node=0,memdev=memdimm0,id=dimm0,slot=0 \
    -object memory-backend-ram,id=memdimm1,size=134217728 -device pc-dimm,node=0,memdev=memdimm1,id=dimm1,slot=1 \
    -object memory-backend-ram,id=memdimm2,size=134217728 -device pc-dimm,node=0,memdev=memdimm2,id=dimm2,slot=2 \
    -object memory-backend-ram,id=memdimm3,size=134217728 -device pc-dimm,node=0,memdev=memdimm3,id=dimm3,slot=3 \
    -object memory-backend-ram,id=memdimm4,size=134217728 -device pc-dimm,node=1,memdev=memdimm4,id=dimm4,slot=4 \
    -object memory-backend-ram,id=memdimm5,size=134217728 -device pc-dimm,node=1,memdev=memdimm5,id=dimm5,slot=5 \
    -object memory-backend-ram,id=memdimm6,size=134217728 -device pc-dimm,node=1,memdev=memdimm6,id=dimm6,slot=6 \

    Fixes: 4fbce633910e ("mm/memory_hotplug.c: make register_mem_sect_under_node() a callback of walk_memory_range()")
    Signed-off-by: Laurent Dufour
    Signed-off-by: Andrew Morton
    Reviewed-by: David Hildenbrand
    Reviewed-by: Oscar Salvador
    Acked-by: Michal Hocko
    Cc: Greg Kroah-Hartman
    Cc: "Rafael J. Wysocki"
    Cc: Fenghua Yu
    Cc: Nathan Lynch
    Cc: Scott Cheloha
    Cc: Tony Luck
    Cc:
    Link: https://lkml.kernel.org/r/20200915094143.79181-3-ldufour@linux.ibm.com
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Laurent Dufour
     

01 Oct, 2020

3 commits

  • [ Upstream commit 05669b63170771d554854c0e465b76dc98fc7c84 ]

    Non-incrementing writes can fail if register + length crosses page
    border. However for non-incrementing writes we should not check for page
    border crossing. Fix this by passing additional flag to _regmap_raw_write
    and passing length to _regmap_select_page basing on the flag.

    Signed-off-by: Dmitry Baryshkov
    Fixes: cdf6b11daa77 ("regmap: Add regmap_noinc_write API")
    Link: https://lore.kernel.org/r/20200917153405.3139200-2-dmitry.baryshkov@linaro.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Dmitry Baryshkov
     
  • [ Upstream commit 4003324856311faebb46cbd56a1616bd3f3b67c2 ]

    Non-incrementing reads can fail if register + length crosses page
    border. However for non-incrementing reads we should not check for page
    border crossing. Fix this by passing additional flag to _regmap_raw_read
    and passing length to _regmap_select_page basing on the flag.

    Signed-off-by: Dmitry Baryshkov
    Fixes: 74fe7b551f33 ("regmap: Add regmap_noinc_read API")
    Link: https://lore.kernel.org/r/20200917153405.3139200-1-dmitry.baryshkov@linaro.org
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Dmitry Baryshkov
     
  • [ Upstream commit 4a33691c4cea9eb0a7c66e87248be4637e14b180 ]

    Currently there are only 10 bytes to store the cpu-topology 'name'
    information. Only 10 bytes copied into cluster/thread/core names.

    If the cluster ID exceeds 2-digit number, it will result in the data
    corruption, and ending up in a dead loop in the parsing routines. The
    same applies to the thread names with more that 3-digit number.

    This issue was found using the boundary tests under virtualised
    environment like QEMU.

    Let us increase the buffer to fix such potential issues.

    Reviewed-by: Sudeep Holla
    Signed-off-by: Zeng Tao

    Link: https://lore.kernel.org/r/1583294092-5929-1-git-send-email-prime.zeng@hisilicon.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Zeng Tao
     

23 Sep, 2020

1 commit

  • commit 4965b8cd1bc1ffb017e5c58e622da82b55e49414 upstream.

    vfree() is being called on paged buffer allocated
    using alloc_page() and mapped using vmap().

    Freeing of pages in vfree() relies on nr_pages of
    struct vm_struct. vmap() does not update nr_pages.
    It can lead to memory leaks.

    Fixes: ddaf29fd9bb6 ("firmware: Free temporary page table after vmapping")
    Signed-off-by: Prateek Sood
    Reviewed-by: Takashi Iwai
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/r/1597957070-27185-1-git-send-email-prsood@codeaurora.org
    Cc: Shuah Khan
    Signed-off-by: Greg Kroah-Hartman

    Prateek Sood
     

03 Sep, 2020

2 commits

  • commit c15e1bdda4365a5f17cdadf22bf1c1df13884a9e upstream.

    When the primary firmware node pointer is removed from a
    device (set to NULL) the secondary firmware node pointer,
    when it exists, is made the primary node for the device.
    However, the secondary firmware node pointer of the original
    primary firmware node is never cleared (set to NULL).

    To avoid situation where the secondary firmware node pointer
    is pointing to a non-existing object, clearing it properly
    when the primary node is removed from a device in
    set_primary_fwnode().

    Fixes: 97badf873ab6 ("device property: Make it possible to use secondary firmware nodes")
    Cc: All applicable
    Signed-off-by: Heikki Krogerus
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Heikki Krogerus
     
  • commit e3eb6e8fba65094328b8dca635d00de74ba75b45 upstream.

    It has been reported that system-wide suspend may be aborted in the
    absence of any wakeup events due to unforseen interactions of it with
    the runtume PM framework.

    One failing scenario is when there are multiple devices sharing an
    ACPI power resource and runtime-resume needs to be carried out for
    one of them during system-wide suspend (for example, because it needs
    to be reconfigured before the whole system goes to sleep). In that
    case, the runtime-resume of that device involves turning the ACPI
    power resource "on" which in turn causes runtime-resume requests
    to be queued up for all of the other devices sharing it. Those
    requests go to the runtime PM workqueue which is frozen during
    system-wide suspend, so they are not actually taken care of until
    the resume of the whole system, but the pm_runtime_barrier()
    call in __device_suspend() sees them and triggers system wakeup
    events for them which then cause the system-wide suspend to be
    aborted if wakeup source objects are in active use.

    Of course, the logic that leads to triggering those wakeup events is
    questionable in the first place, because clearly there are cases in
    which a pending runtime resume request for a device is not connected
    to any real wakeup events in any way (like the one above). Moreover,
    it is racy, because the device may be resuming already by the time
    the pm_runtime_barrier() runs and so if the driver doesn't take care
    of signaling the wakeup event as appropriate, it will be lost.
    However, if the driver does take care of that, the extra
    pm_wakeup_event() call in the core is redundant.

    Accordingly, drop the conditional pm_wakeup_event() call fron
    __device_suspend() and make the latter call pm_runtime_barrier()
    alone. Also modify the comment next to that call to reflect the new
    code and extend it to mention the need to avoid unwanted interactions
    between runtime PM and system-wide device suspend callbacks.

    Fixes: 1e2ef05bb8cf8 ("PM: Limit race conditions between runtime PM and system sleep (v2)")
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Alan Stern
    Reported-by: Utkarsh H Patel
    Tested-by: Utkarsh H Patel
    Tested-by: Pengfei Xu
    Cc: All applicable
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

21 Aug, 2020

1 commit

  • commit 654888327e9f655a9d55ad477a9583e90e8c9b5c upstream.

    Commit 3451a495ef24 ("driver core: Establish order of operations for
    device_add and device_del via bitflag") sought to prevent asynchronous
    driver binding to a device which is being removed. It added a
    per-device "dead" flag which is checked in the following code paths:

    * asynchronous binding in __driver_attach_async_helper()
    * synchronous binding in device_driver_attach()
    * asynchronous binding in __device_attach_async_helper()

    It did *not* check the flag upon:

    * synchronous binding in __device_attach()

    However __device_attach() may also be called asynchronously from:

    deferred_probe_work_func()
    bus_probe_device()
    device_initial_probe()
    __device_attach()

    So if the commit's intention was to check the "dead" flag in all
    asynchronous code paths, then a check is also necessary in
    __device_attach(). Add the missing check.

    Fixes: 3451a495ef24 ("driver core: Establish order of operations for device_add and device_del via bitflag")
    Signed-off-by: Lukas Wunner
    Cc: stable@vger.kernel.org # v5.1+
    Cc: Alexander Duyck
    Link: https://lore.kernel.org/r/de88a23a6fe0ef70f7cfd13c8aea9ab51b4edab6.1594214103.git.lukas@wunner.de
    Signed-off-by: Greg Kroah-Hartman

    Lukas Wunner
     

01 Aug, 2020

2 commits

  • commit e976eb4b91e906f20ec25b20c152d53c472fc3fd upstream.

    After commit 00ee22c28915 (PM / wakeup: Use seq_open() to show wakeup
    stats), print_wakeup_source_stats(m, &deleted_ws) is not called from
    wakeup_sources_stats_seq_show() any more.

    Because deleted_ws is one of the wakeup sources, it should be shown
    too, so add it to the end of all other wakeup sources.

    Signed-off-by: zhuguangqing
    [ rjw: Subject & changelog ]
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Florian Fainelli
    Signed-off-by: Greg Kroah-Hartman

    zhuguangqing
     
  • commit 74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91 upstream.

    When executing the following command, we met kernel dump.
    dmesg -c > /dev/null; cd /sys;
    for i in `ls /sys/kernel/debug/regmap/* -d`; do
    echo "Checking regmap in $i";
    cat $i/registers;
    done && grep -ri "0x02d0" *;

    It is because the count value is too big, and kmalloc fails. So add an
    upper bound check to allow max size `PAGE_SIZE << (MAX_ORDER - 1)`.

    Signed-off-by: Peng Fan
    Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Peng Fan
     

29 Jul, 2020

1 commit

  • [ Upstream commit e84861fec32dee8a2e62bbaa52cded6b05a2a456 ]

    This function is used by dev_get_regmap() to retrieve a regmap for the
    specified device. If the device has more than one regmap, the name parameter
    can be used to specify one.

    The code here uses a pointer comparison to check for equal strings. This
    however will probably always fail, as the regmap->name is allocated via
    kstrdup_const() from the regmap's config->name.

    Fix this by using strcmp() instead.

    Signed-off-by: Marc Kleine-Budde
    Link: https://lore.kernel.org/r/20200703103315.267996-1-mkl@pengutronix.de
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Marc Kleine-Budde
     

22 Jul, 2020

1 commit

  • [ Upstream commit 299632e54b2e692d2830af84be51172480dc1e26 ]

    If a regmap has "fast_io" set then its lock function uses a spinlock.
    That doesn't work so well with the functions:
    * regmap_cache_only_write_file()
    * regmap_cache_bypass_write_file()

    Both of the above functions have the pattern:
    1. Lock the regmap.
    2. Call:
    debugfs_write_file_bool()
    copy_from_user()
    __might_fault()
    __might_sleep()

    Let's reorder things a bit so that we do all of our sleepable
    functions before we grab the lock.

    Fixes: d3dc5430d68f ("regmap: debugfs: Allow writes to cache state settings")
    Signed-off-by: Douglas Anderson
    Link: https://lore.kernel.org/r/20200715164611.1.I35b3533e8a80efde0cec1cc70f71e1e74b2fa0da@changeid
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Douglas Anderson
     

16 Jul, 2020

1 commit

  • [ Upstream commit 53d860952c8215cf9ae1ea33409c8cb71ad6ad3d ]

    The assembly and disassembly of data to be sent to or received from
    a device invoke functions regmap_format_XX() and regmap_parse_XX()
    that extract or insert data items from or into a buffer, using
    assignments. In some cases the functions are called with a buffer
    pointer with an odd address. On architectures with strict alignment
    requirements this can result in a kernel crash. The assignments
    have been replaced by functions that take alignment into account.

    Signed-off-by: Jens Thoms Toerring
    Link: https://lore.kernel.org/r/20200531095300.GA27570@toerring.de
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Jens Thoms Toerring
     

01 Jul, 2020

1 commit

  • [ Upstream commit 95b2c3ec4cb1689db2389c251d39f64490ba641c ]

    When a register patch is registered the reg_sequence is copied but the
    memory allocated is never freed. Add a kfree in regmap_exit to clean it
    up.

    Fixes: 22f0d90a3482 ("regmap: Support register patch sets")
    Signed-off-by: Charles Keepax
    Link: https://lore.kernel.org/r/20200617152129.19655-1-ckeepax@opensource.cirrus.com
    Signed-off-by: Mark Brown
    Signed-off-by: Sasha Levin

    Charles Keepax
     

24 Jun, 2020

1 commit

  • …er developer is foolish

    [ Upstream commit 388bcc6ecc609fca1b4920de7dc3806c98ec535e ]

    If platform bus driver registration is failed then, accessing
    platform bus spin lock (&drv->driver.bus->p->klist_drivers.k_lock)
    in __platform_driver_probe() without verifying the return value
    __platform_driver_register() can lead to NULL pointer exception.

    So check the return value before attempting the spin lock.

    One such example is below:

    For a custom usecase, I have intentionally failed the platform bus
    registration and I expected all the platform device/driver
    registrations to fail gracefully. But I came across this panic
    issue.

    [ 1.331067] BUG: kernel NULL pointer dereference, address: 00000000000000c8
    [ 1.331118] #PF: supervisor write access in kernel mode
    [ 1.331163] #PF: error_code(0x0002) - not-present page
    [ 1.331208] PGD 0 P4D 0
    [ 1.331233] Oops: 0002 [#1] PREEMPT SMP
    [ 1.331268] CPU: 3 PID: 1 Comm: swapper/0 Tainted: G W 5.6.0-00049-g670d35fb0144 #165
    [ 1.331341] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
    [ 1.331406] RIP: 0010:_raw_spin_lock+0x15/0x30
    [ 1.331588] RSP: 0000:ffffc9000001be70 EFLAGS: 00010246
    [ 1.331632] RAX: 0000000000000000 RBX: 00000000000000c8 RCX: 0000000000000001
    [ 1.331696] RDX: 0000000000000001 RSI: 0000000000000092 RDI: 0000000000000000
    [ 1.331754] RBP: 00000000ffffffed R08: 0000000000000501 R09: 0000000000000001
    [ 1.331817] R10: ffff88817abcc520 R11: 0000000000000670 R12: 00000000ffffffed
    [ 1.331881] R13: ffffffff82dbc268 R14: ffffffff832f070a R15: 0000000000000000
    [ 1.331945] FS: 0000000000000000(0000) GS:ffff88817bd80000(0000) knlGS:0000000000000000
    [ 1.332008] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    [ 1.332062] CR2: 00000000000000c8 CR3: 000000000681e001 CR4: 00000000003606e0
    [ 1.332126] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 1.332189] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    [ 1.332252] Call Trace:
    [ 1.332281] __platform_driver_probe+0x92/0xee
    [ 1.332323] ? rtc_dev_init+0x2b/0x2b
    [ 1.332358] cmos_init+0x37/0x67
    [ 1.332396] do_one_initcall+0x7d/0x168
    [ 1.332428] kernel_init_freeable+0x16c/0x1c9
    [ 1.332473] ? rest_init+0xc0/0xc0
    [ 1.332508] kernel_init+0x5/0x100
    [ 1.332543] ret_from_fork+0x1f/0x30
    [ 1.332579] CR2: 00000000000000c8
    [ 1.332616] ---[ end trace 3bd87f12e9010b87 ]---
    [ 1.333549] note: swapper/0[1] exited with preempt_count 1
    [ 1.333592] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
    [ 1.333736] Kernel Offset: disabled

    Note, this can only be triggered if a driver errors out from this call,
    which should never happen. If it does, the driver needs to be fixed.

    Signed-off-by: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@linux.intel.com>
    Link: https://lore.kernel.org/r/20200408214003.3356-1-sathyanarayanan.kuppuswamy@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: Sasha Levin <sashal@kernel.org>

    Kuppuswamy Sathyanarayanan
     

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
     

11 Jun, 2020

1 commit

  • commit 7e5b3c267d256822407a22fdce6afdf9cd13f9fb upstream

    SRBDS is an MDS-like speculative side channel that can leak bits from the
    random number generator (RNG) across cores and threads. New microcode
    serializes the processor access during the execution of RDRAND and
    RDSEED. This ensures that the shared buffer is overwritten before it is
    released for reuse.

    While it is present on all affected CPU models, the microcode mitigation
    is not needed on models that enumerate ARCH_CAPABILITIES[MDS_NO] in the
    cases where TSX is not supported or has been disabled with TSX_CTRL.

    The mitigation is activated by default on affected processors and it
    increases latency for RDRAND and RDSEED instructions. Among other
    effects this will reduce throughput from /dev/urandom.

    * Enable administrator to configure the mitigation off when desired using
    either mitigations=off or srbds=off.

    * Export vulnerability status via sysfs

    * Rename file-scoped macros to apply for non-whitelist table initializations.

    [ bp: Massage,
    - s/VULNBL_INTEL_STEPPING/VULNBL_INTEL_STEPPINGS/g,
    - do not read arch cap MSR a second time in tsx_fused_off() - just pass it in,
    - flip check in cpu_set_bug_bits() to save an indentation level,
    - reflow comments.
    jpoimboe: s/Mitigated/Mitigation/ in user-visible strings
    tglx: Dropped the fused off magic for now
    ]

    Signed-off-by: Mark Gross
    Signed-off-by: Borislav Petkov
    Signed-off-by: Thomas Gleixner
    Reviewed-by: Tony Luck
    Reviewed-by: Pawan Gupta
    Reviewed-by: Josh Poimboeuf
    Tested-by: Neelima Krishnan
    Signed-off-by: Greg Kroah-Hartman

    Mark Gross
     

27 May, 2020

1 commit

  • [ Upstream commit 7706b0a76a9697021e2bf395f3f065c18f51043d ]

    If a component fails to bind due to -EPROBE_DEFER we should not log an
    error as this is not a real failure.

    Fixes messages like:
    vc4-drm soc:gpu: failed to bind 3f902000.hdmi (ops vc4_hdmi_ops): -517
    vc4-drm soc:gpu: master bind failed: -517

    Signed-off-by: James Hilliard
    Link: https://lore.kernel.org/r/20200411190241.89404-1-james.hilliard1@gmail.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    James Hilliard
     

10 May, 2020

1 commit

  • commit 7589238a8cf37331607c3222a64ac3140b29532d upstream.

    This reverts commit 3df85a1ae51f6b256982fe9d17c2dc5bfb4cc402.

    The reverted commit says "It's possible to release the node ID
    immediately when fwnode_remove_software_node() is called, no need to
    wait for software_node_release() with that." However, releasing the node
    ID before waiting for software_node_release() to be called causes the
    node ID to be released before the kobject and the underlying sysfs
    entry; this means there is a period of time where a sysfs entry exists
    that is associated with an unallocated node ID.

    Once consequence of this is that there is a race condition where it is
    possible to call fwnode_create_software_node() with no parent node
    specified (NULL) and have it fail with -EEXIST because the node ID that
    was assigned is still associated with a stale sysfs entry that hasn't
    been cleaned up yet.

    Although it is difficult to reproduce this race condition under normal
    conditions, it can be deterministically reproduced with the following
    minconfig on UML:

    CONFIG_KUNIT_DRIVER_PE_TEST=y
    CONFIG_DEBUG_KERNEL=y
    CONFIG_DEBUG_OBJECTS=y
    CONFIG_DEBUG_OBJECTS_TIMERS=y
    CONFIG_DEBUG_KOBJECT_RELEASE=y
    CONFIG_KUNIT=y

    Running the tests with this configuration causes the following failure:

    kobject: 'node0' ((____ptrval____)): kobject_release, parent (____ptrval____) (delayed 400)
    ok 1 - pe_test_uints
    sysfs: cannot create duplicate filename '/kernel/software_nodes/node0'
    CPU: 0 PID: 28 Comm: kunit_try_catch Not tainted 5.6.0-rc3-next-20200227 #14

    kobject_add_internal failed for node0 with -EEXIST, don't try to register things with the same name in the same directory.
    kobject: 'node0' ((____ptrval____)): kobject_release, parent (____ptrval____) (delayed 100)
    # pe_test_uint_arrays: ASSERTION FAILED at drivers/base/test/property-entry-test.c:123
    Expected node is not error, but is: -17
    not ok 2 - pe_test_uint_arrays

    Reported-by: Heidi Fahim
    Signed-off-by: Brendan Higgins
    Reviewed-by: Heikki Krogerus
    Cc: 5.3+ # 5.3+
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Brendan Higgins
     

02 May, 2020

1 commit

  • commit 09beebd8f93b3c8bf894e342f0a203a5c612478c upstream.

    Commit 8b9ec6b73277 ("PM core: Use new async_schedule_dev command")
    introduced a new function for better performance.

    However commit f2a424f6c613 ("PM / core: Introduce dpm_async_fn()
    helper") went back to the non-optimized version, async_schedule().

    So switch back to the sync_schedule_dev() to improve performance

    Fixes: f2a424f6c613 ("PM / core: Introduce dpm_async_fn() helper")
    Signed-off-by: Kai-Heng Feng
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Kai-Heng Feng
     

17 Apr, 2020

3 commits

  • commit 87de6594dc45dbf6819f3e0ef92f9331c5a9444c upstream.

    Skip wakeup_source_sysfs_remove() to fix a NULL pinter dereference via
    ws->dev, if the wakeup source is unregistered before registering the
    wakeup class from device_add().

    Fixes: 2ca3d1ecb8c4 ("PM / wakeup: Register wakeup class kobj after device is added")
    Signed-off-by: Neeraj Upadhyay
    Cc: 5.4+ # 5.4+
    [ rjw: Subject & changelog, white space ]
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Neeraj Upadhyay
     
  • commit 56cb26891ea4180121265dc6b596015772c4a4b8 upstream.

    Commit 2c361684803e ("PM / Domains: Don't treat zero found compatible idle
    states as an error"), moved of_genpd_parse_idle_states() towards allowing
    none compatible idle state to be found for the device node, rather than
    returning an error code.

    However, it didn't consider that the "domain-idle-states" DT property may
    be missing as it's optional, which makes of_count_phandle_with_args() to
    return -ENOENT. Let's fix this to make the behaviour consistent.

    Fixes: 2c361684803e ("PM / Domains: Don't treat zero found compatible idle states as an error")
    Reported-by: Benjamin Gaignard
    Cc: 4.20+ # 4.20+
    Reviewed-by: Sudeep Holla
    Signed-off-by: Ulf Hansson
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Greg Kroah-Hartman

    Ulf Hansson
     
  • [ Upstream commit bcfbd3523f3c6eea51a74d217a8ebc5463bcb7f4 ]

    fw_sysfs_wait_timeout may return err with -ENOENT
    at fw_load_sysfs_fallback and firmware is already
    in abort status, no need to abort again, so skip it.

    This issue is caused by concurrent situation like below:
    when thread 1# wait firmware loading, thread 2# may write
    -1 to abort loading and wakeup thread 1# before it timeout.
    so wait_for_completion_killable_timeout of thread 1# would
    return remaining time which is != 0 with fw_st->status
    FW_STATUS_ABORTED.And the results would be converted into
    err -ENOENT in __fw_state_wait_common and transfered to
    fw_load_sysfs_fallback in thread 1#.
    The -ENOENT means firmware status is already at ABORTED,
    so fw_load_sysfs_fallback no need to get mutex to abort again.
    -----------------------------
    thread 1#,wait for loading
    fw_load_sysfs_fallback
    ->fw_sysfs_wait_timeout
    ->__fw_state_wait_common
    ->wait_for_completion_killable_timeout

    in __fw_state_wait_common,
    ...
    93 ret = wait_for_completion_killable_timeout(&fw_st->completion, timeout);
    94 if (ret != 0 && fw_st->status == FW_STATUS_ABORTED)
    95 return -ENOENT;
    96 if (!ret)
    97 return -ETIMEDOUT;
    98
    99 return ret < 0 ? ret : 0;
    -----------------------------
    thread 2#, write -1 to abort loading
    firmware_loading_store
    ->fw_load_abort
    ->__fw_load_abort
    ->fw_state_aborted
    ->__fw_state_set
    ->complete_all

    in __fw_state_set,
    ...
    111 if (status == FW_STATUS_DONE || status == FW_STATUS_ABORTED)
    112 complete_all(&fw_st->completion);
    -------------------------------------------
    BTW,the double abort issue would not cause kernel panic or create an issue,
    but slow down it sometimes.The change is just a minor optimization.

    Signed-off-by: Junyong Sun
    Acked-by: Luis Chamberlain
    Link: https://lore.kernel.org/r/1583202968-28792-1-git-send-email-sunjunyong@xiaomi.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Junyong Sun
     

14 Apr, 2020

1 commit

  • When executing the following command, we met kernel dump.
    dmesg -c > /dev/null; cd /sys;
    for i in `ls /sys/kernel/debug/regmap/* -d`; do
    echo "Checking regmap in $i";
    cat $i/registers;
    done && grep -ri "0x02d0" *;

    It is because the count value is too big, and kmalloc fails. So add an
    upper bound check to allow max size `PAGE_SIZE << (MAX_ORDER - 1)`.

    Signed-off-by: Peng Fan
    Link: https://lore.kernel.org/r/1584064687-12964-1-git-send-email-peng.fan@nxp.com
    Signed-off-by: Mark Brown

    Joakim cherry pick from upstream commit: 74edd08a4fbf51d65fd8f4c7d8289cd0f392bd91
    Signed-off-by: Joakim Zhang

    Peng Fan
     

01 Apr, 2020

1 commit

  • commit 53cdc1cb29e87ce5a61de5bb393eb08925d14ede upstream.

    We see multiple issues with the implementation/interface to compute
    whether a memory block can be offlined (exposed via
    /sys/devices/system/memory/memoryX/removable) and would like to simplify
    it (remove the implementation).

    1. It runs basically lockless. While this might be good for performance,
    we see possible races with memory offlining that will require at
    least some sort of locking to fix.

    2. Nowadays, more false positives are possible. No arch-specific checks
    are performed that validate if memory offlining will not be denied
    right away (and such check will require locking). For example, arm64
    won't allow to offline any memory block that was added during boot -
    which will imply a very high error rate. Other archs have other
    constraints.

    3. The interface is inherently racy. E.g., if a memory block is detected
    to be removable (and was not a false positive at that time), there is
    still no guarantee that offlining will actually succeed. So any
    caller already has to deal with false positives.

    4. It is unclear which performance benefit this interface actually
    provides. The introducing commit 5c755e9fd813 ("memory-hotplug: add
    sysfs removable attribute for hotplug memory remove") mentioned

    "A user-level agent must be able to identify which sections
    of memory are likely to be removable before attempting the
    potentially expensive operation."

    However, no actual performance comparison was included.

    Known users:

    - lsmem: Will group memory blocks based on the "removable" property. [1]

    - chmem: Indirect user. It has a RANGE mode where one can specify
    removable ranges identified via lsmem to be offlined. However,
    it also has a "SIZE" mode, which allows a sysadmin to skip the
    manual "identify removable blocks" step. [2]

    - powerpc-utils: Uses the "removable" attribute to skip some memory
    blocks right away when trying to find some to offline+remove.
    However, with ballooning enabled, it already skips this
    information completely (because it once resulted in many false
    negatives). Therefore, the implementation can deal with false
    positives properly already. [3]

    According to Nathan Fontenot, DLPAR on powerpc is nowadays no longer
    driven from userspace via the drmgr command (powerpc-utils). Nowadays
    it's managed in the kernel - including onlining/offlining of memory
    blocks - triggered by drmgr writing to /sys/kernel/dlpar. So the
    affected legacy userspace handling is only active on old kernels. Only
    very old versions of drmgr on a new kernel (unlikely) might execute
    slower - totally acceptable.

    With CONFIG_MEMORY_HOTREMOVE, always indicating "removable" should not
    break any user space tool. We implement a very bad heuristic now.
    Without CONFIG_MEMORY_HOTREMOVE we cannot offline anything, so report
    "not removable" as before.

    Original discussion can be found in [4] ("[PATCH RFC v1] mm:
    is_mem_section_removable() overhaul").

    Other users of is_mem_section_removable() will be removed next, so that
    we can remove is_mem_section_removable() completely.

    [1] http://man7.org/linux/man-pages/man1/lsmem.1.html
    [2] http://man7.org/linux/man-pages/man8/chmem.8.html
    [3] https://github.com/ibm-power-utilities/powerpc-utils
    [4] https://lkml.kernel.org/r/20200117105759.27905-1-david@redhat.com

    Also, this patch probably fixes a crash reported by Steve.
    http://lkml.kernel.org/r/CAPcyv4jpdaNvJ67SkjyUJLBnBnXXQv686BiVW042g03FUmWLXw@mail.gmail.com

    Reported-by: "Scargall, Steve"
    Suggested-by: Michal Hocko
    Signed-off-by: David Hildenbrand
    Signed-off-by: Andrew Morton
    Reviewed-by: Nathan Fontenot
    Acked-by: Michal Hocko
    Cc: Dan Williams
    Cc: Greg Kroah-Hartman
    Cc: "Rafael J. Wysocki"
    Cc: Badari Pulavarty
    Cc: Robert Jennings
    Cc: Heiko Carstens
    Cc: Karel Zak
    Cc:
    Link: http://lkml.kernel.org/r/20200128093542.6908-1-david@redhat.com
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    David Hildenbrand
     

18 Mar, 2020

1 commit

  • commit e3a36eb6dfaeea8175c05d5915dcf0b939be6dab upstream.

    This does three inter-related things to clarify the usage of the
    platform device dma_mask field. In the process, fix the bug introduced
    by cdfee5623290 ("driver core: initialize a default DMA mask for
    platform device") that caused Artem Tashkinov's laptop to not boot with
    newer Fedora kernels.

    This does:

    - First off, rename the field to "platform_dma_mask" to make it
    greppable.

    We have way too many different random fields called "dma_mask" in
    various data structures, where some of them are actual masks, and
    some of them are just pointers to the mask. And the structures all
    have pointers to each other, or embed each other inside themselves,
    and "pdev" sometimes means "platform device" and sometimes it means
    "PCI device".

    So to make it clear in the code when you actually use this new field,
    give it a unique name (it really should be something even more unique
    like "platform_device_dma_mask", since it's per platform device, not
    per platform, but that gets old really fast, and this is unique
    enough in context).

    To further clarify when the field gets used, initialize it when we
    actually start using it with the default value.

    - Then, use this field instead of the random one-off allocation in
    platform_device_register_full() that is now unnecessary since we now
    already have a perfectly fine allocation for it in the platform
    device structure.

    - The above then allows us to fix the actual bug, where the error path
    of platform_device_register_full() would unconditionally free the
    platform device DMA allocation with 'kfree()'.

    That kfree() was dont regardless of whether the allocation had been
    done earlier with the (now removed) kmalloc, or whether
    setup_pdev_dma_masks() had already been used and the dma_mask pointer
    pointed to the mask that was part of the platform device.

    It seems most people never triggered the error path, or only triggered
    it from a call chain that set an explicit pdevinfo->dma_mask value (and
    thus caused the unnecessary allocation that was "cleaned up" in the
    error path) before calling platform_device_register_full().

    Robin Murphy points out that in Artem's case the wdat_wdt driver failed
    in platform_device_add(), and that was the one that had called
    platform_device_register_full() with pdevinfo.dma_mask = 0, and would
    have caused that kfree() of pdev.dma_mask corrupting the heap.

    A later unrelated kmalloc() then oopsed due to the heap corruption.

    Fixes: cdfee5623290 ("driver core: initialize a default DMA mask for platform device")
    Reported-bisected-and-tested-by: Artem S. Tashkinov
    Reviewed-by: Robin Murphy
    Cc: Greg Kroah-Hartman
    Signed-off-by: Christoph Hellwig
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Christoph Hellwig
     

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
     

24 Feb, 2020

3 commits

  • [ Upstream commit 0707cfa5c3ef58effb143db9db6d6e20503f9dec ]

    Currently the check that a u32 variable i is >= 0 is always true because
    the unsigned variable will never be negative, causing the loop to run
    forever. Fix this by changing the pre-decrement check to a zero check on
    i followed by a decrement of i.

    Addresses-Coverity: ("Unsigned compared against 0")
    Fixes: 39cc539f90d0 ("driver core: platform: Prevent resouce overflow from causing infinite loops")
    Signed-off-by: Colin Ian King
    Reviewed-by: Rafael J. Wysocki
    Link: https://lore.kernel.org/r/20200116175758.88396-1-colin.king@canonical.com
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Colin Ian King
     
  • [ Upstream commit 7c35e699c88bd60734277b26962783c60e04b494 ]

    If a device already has devres items attached before probing, a warning
    backtrace is printed. However, this backtrace does not reveal the
    offending device, leaving the user uninformed. Furthermore, using
    WARN_ON() causes systems with panic-on-warn to reboot.

    Fix this by replacing the WARN_ON() by a dev_crit() message.
    Abort probing the device, to prevent doing more damage to the device's
    resources.

    Signed-off-by: Geert Uytterhoeven
    Link: https://lore.kernel.org/r/20191206132219.28908-1-geert+renesas@glider.be
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Geert Uytterhoeven
     
  • [ Upstream commit 39cc539f90d035a293240c9443af50be55ee81b8 ]

    num_resources in the platform_device struct is declared as a u32. The
    for loops that iterate over num_resources use an int as the counter,
    which can cause infinite loops on architectures with smaller ints.
    Change the loop counters to u32.

    Signed-off-by: Simon Schwartz
    Link: https://lore.kernel.org/r/2201ce63a2a171ffd2ed14e867875316efcf71db.camel@theschwartz.xyz
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Simon Schwartz
     

15 Feb, 2020

1 commit

  • commit 2e31aab08bad0d4ee3d3d890a7b74cb6293e0a41 upstream.

    When checking if a register block is writable we must ensure that the
    block does not start with or contain a non incrementing register.

    Fixes: 8b9f9d4dc511 ("regmap: verify if register is writeable before writing operations")
    Signed-off-by: Ben Whitten
    Link: https://lore.kernel.org/r/20200118205625.14532-1-ben.whitten@gmail.com
    Signed-off-by: Mark Brown
    Signed-off-by: Greg Kroah-Hartman

    Ben Whitten
     

11 Feb, 2020

1 commit

  • commit 0552e05fdfea191a2cf3a0abd33574b5ef9ca818 upstream.

    If a device is deleted by one of its system-wide resume callbacks
    (for example, because it does not appear to be present or accessible
    any more) along with its children, the resume of the children may
    continue leading to use-after-free errors and other issues
    (potentially).

    Namely, if the device's children are resumed asynchronously, their
    resume may have been scheduled already before the device's callback
    runs and so the device may be deleted while dpm_wait_for_superior()
    is being executed for them. The memory taken up by the parent device
    object may be freed then while dpm_wait() is waiting for the parent's
    resume callback to complete, which leads to a use-after-free.
    Moreover, the resume of the children is really not expected to
    continue after they have been unregistered, so it must be terminated
    right away in that case.

    To address this problem, modify dpm_wait_for_superior() to check
    if the target device is still there in the system-wide PM list of
    devices and if so, to increment its parent's reference counter, both
    under dpm_list_mtx which prevents device_del() running for the child
    from dropping the parent's reference counter prematurely.

    If the device is not present in the system-wide PM list of devices
    any more, the resume of it cannot continue, so check that again after
    dpm_wait() returns, which means that the parent's callback has been
    completed, and pass the result of that check to the caller of
    dpm_wait_for_superior() to allow it to abort the device's resume
    if it is not there any more.

    Link: https://lore.kernel.org/linux-pm/1579568452-27253-1-git-send-email-chanho.min@lge.com
    Reported-by: Chanho Min
    Cc: All applicable
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Greg Kroah-Hartman

    Rafael J. Wysocki
     

01 Feb, 2020

2 commits

  • commit 264d25275a46fce5da501874fa48a2ae5ec571c8 upstream.

    Since commit 57ea974fb871 ("driver core: Rewrite test_async_driver_probe
    to cover serialization and NUMA affinity"), running the test with NUMA
    disabled results in warning messages similar to the following.

    test_async_driver test_async_driver.12: NUMA node mismatch -1 != 0

    If CONFIG_NUMA=n, dev_to_node(dev) returns -1, and numa_node_id()
    returns 0. Both are widely used, so it appears risky to change return
    values. Augment the check with IS_ENABLED(CONFIG_NUMA) instead
    to fix the problem.

    Cc: Alexander Duyck
    Fixes: 57ea974fb871 ("driver core: Rewrite test_async_driver_probe to cover serialization and NUMA affinity")
    Signed-off-by: Guenter Roeck
    Cc: stable
    Acked-by: Alexander Duyck
    Link: https://lore.kernel.org/r/20191127202453.28087-1-linux@roeck-us.net
    Signed-off-by: Greg Kroah-Hartman

    Guenter Roeck
     
  • commit ef9ffc1e5f1ac73ecd2fb3b70db2a3b2472ff2f7 upstream.

    The match data does not have to be a struct device pointer, and indeed
    very often is not. Attempt to treat it as such easily results in a
    crash.

    For the components that are not registered, we don't know which device
    is missing. Once it it is there, we can use the struct component to get
    the device and whether it's bound or not.

    Fixes: 59e73854b5fd ('component: add debugfs support')
    Signed-off-by: Lubomir Rintel
    Cc: stable
    Cc: Arnaud Pouliquen
    Link: https://lore.kernel.org/r/20191118115431.63626-1-lkundrak@v3.sk
    Signed-off-by: Greg Kroah-Hartman

    Lubomir Rintel
     

26 Jan, 2020

1 commit

  • [ Upstream commit 51c100a651a471fcb8ead1ecc1224471eb0d61b9 ]

    The software_node_get_parent() returned a pointer to the parent swnode,
    but did not take a reference to it, leading the caller to put a reference
    that was not taken. Take that reference now.

    Fixes: 59abd83672f7 ("drivers: base: Introducing software nodes to the firmware node framework")
    Signed-off-by: Sakari Ailus
    Reviewed-by: Heikki Krogerus
    Reviewed-by: Andy Shevchenko
    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Sasha Levin

    Sakari Ailus
     

23 Jan, 2020

1 commit

  • commit f5ae2ea6347a308cfe91f53b53682ce635497d0d upstream.

    Intel Software Developer's Manual, volume 3, chapter 9.11.6 says:

    "Note that the microcode update must be aligned on a 16-byte boundary
    and the size of the microcode update must be 1-KByte granular"

    When early-load Intel microcode is loaded from initramfs, userspace tool
    'iucode_tool' has already 16-byte aligned those microcode bits in that
    initramfs image. Image that was created something like this:

    iucode_tool --write-earlyfw=FOO.cpio microcode-files...

    However, when early-load Intel microcode is loaded from built-in
    firmware BLOB using CONFIG_EXTRA_FIRMWARE= kernel config option, that
    16-byte alignment is not guaranteed.

    Fix this by forcing all built-in firmware BLOBs to 16-byte alignment.

    [ If we end up having other firmware with much bigger alignment
    requirements, we might need to introduce some method for the firmware
    to specify it, this is the minimal "just increase the alignment a bit
    to account for this one special case" patch - Linus ]

    Signed-off-by: Jari Ruusu
    Cc: Borislav Petkov
    Cc: Fenghua Yu
    Cc: Luis Chamberlain
    Cc: stable@kernel.org
    Signed-off-by: Linus Torvalds
    Signed-off-by: Greg Kroah-Hartman

    Jari Ruusu
     

31 Dec, 2019

1 commit

  • [ Upstream commit 553671b7685972ca671da5f71cf6414b54376e13 ]

    Some firmware images contain a comma, such as:
    EXTRA_FIRMWARE "brcm/brcmfmac4334-sdio.samsung,gt-s7710.txt"
    as Broadcom firmware simply tags the device tree compatible
    string at the end of the firmware parameter file. And the
    compatible string contains a comma.

    This doesn't play well with gas:

    drivers/base/firmware_loader/builtin/brcm/brcmfmac4334-sdio.samsung,gt-s7710.txt.gen.S: Assembler messages:
    drivers/base/firmware_loader/builtin/brcm/brcmfmac4334-sdio.samsung,gt-s7710.txt.gen.S:4: Error: bad instruction `_fw_brcm_brcmfmac4334_sdio_samsung,gt_s7710_txt_bin:'
    drivers/base/firmware_loader/builtin/brcm/brcmfmac4334-sdio.samsung,gt-s7710.txt.gen.S:9: Error: bad instruction `_fw_brcm_brcmfmac4334_sdio_samsung,gt_s7710_txt_name:'
    drivers/base/firmware_loader/builtin/brcm/brcmfmac4334-sdio.samsung,gt-s7710.txt.gen.S:15: Error: can't resolve `.rodata' {.rodata section} - `_fw_brcm_brcmfmac4334_sdio_samsung' {*UND* section}
    make[6]: *** [../scripts/Makefile.build:357: drivers/base/firmware_loader/builtin/brcm/brcmfmac4334-sdio.samsung,gt-s7710.txt.gen.o] Error 1

    We need to get rid of the comma from the labels used by the
    assembly stub generator.

    Replacing a comma using GNU Make subst requires a helper
    variable.

    Cc: Stephan Gerhold
    Signed-off-by: Linus Walleij
    Link: https://lore.kernel.org/r/20191115225911.3260-1-linus.walleij@linaro.org
    Acked-by: Luis Chamberlain
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin

    Linus Walleij
     

17 Dec, 2019

1 commit

  • This reverts commit 9b947a13e7f6017f18470f665992dbae267852b3.

    The commit 9b947a13e7f6017f18470f665992dbae267852b3 does not consider power and
    clock when expose the regmap into debugsfs. This may bring some problem for some
    case. E.g., For reset registers (not real GPR, but csi bridge register) for
    MIPI DSI, MIPI CSI and LCDIF on i.mx8mm, they only can be accessed after the
    disp_root clock and dispmix power has been turned on, otherwise the system may
    be stuck.

    on i.mx8mm evk, the command to reproduce (with default dtb, no display/capture
    running):
    cat /sys/kernel/debug/regmap/dummy-display-gpr@32e28000/registers

    This patch reverted previous commit to avoid the exposure.

    Signed-off-by: Robby Cai
    Reviewed-by: Fancy Fang

    Robby Cai
     

16 Dec, 2019

1 commit

  • This is the 5.4.3 stable release

    Conflicts:
    drivers/cpufreq/imx-cpufreq-dt.c
    drivers/spi/spi-fsl-qspi.c

    The conflict is very minor, fixed it when do the merge. The imx-cpufreq-dt.c
    is just one line code-style change, using upstream one, no any function change.

    The spi-fsl-qspi.c has minor conflicts when merge upstream fixes: c69b17da53b2
    spi: spi-fsl-qspi: Clear TDH bits in FLSHCR register

    After merge, basic boot sanity test and basic qspi test been done on i.mx

    Signed-off-by: Jason Liu

    Jason Liu