25 Jan, 2021

1 commit


20 Jan, 2021

1 commit


18 Jan, 2021

1 commit


06 Jan, 2021

1 commit

  • [ Upstream commit 72d3e093afae79611fa38f8f2cfab9a888fe66f2 ]

    The UML random driver creates a dummy device under the guest,
    /dev/hw_random. When this file is read from the guest, the driver
    reads from the host machine's /dev/random, in-turn reading from
    the host kernel's entropy pool. This entropy pool could have been
    filled by a hardware random number generator or just the host
    kernel's internal software entropy generator.

    Currently the driver does not fill the guests kernel entropy pool,
    this requires a userspace tool running inside the guest (like
    rng-tools) to read from the dummy device provided by this driver,
    which then would fill the guest's internal entropy pool.

    This all seems quite pointless when we are already reading from an
    entropy pool, so this patch aims to register the device as a hwrng
    device using the hwrng-core framework. This not only improves and
    cleans up the driver, but also fills the guest's entropy pool
    without having to resort to using extra userspace tools in the guest.

    This is typically a nuisance when booting a guest: the random pool
    takes a long time (~200s) to build up enough entropy since the dummy
    hwrng is not used to fill the guest's pool.

    This port was originally attempted by Alexander Neville "dark" (in CC,
    discussion in Link), but the conversation there stalled since the
    handling of -EAGAIN errors were no removed and longer handled by the
    driver. This patch attempts to use the existing method of error
    handling but utilises the new hwrng core.

    The issue can be noticed when booting a UML guest:

    [ 2.560000] random: fast init done
    [ 214.000000] random: crng init done

    With the patch applied, filling the pool becomes a lot quicker:

    [ 2.560000] random: fast init done
    [ 12.000000] random: crng init done

    Cc: Alexander Neville
    Link: https://lore.kernel.org/lkml/20190828204609.02a7ff70@TheDarkness/
    Link: https://lore.kernel.org/lkml/20190829135001.6a5ff940@TheDarkness.local/
    Cc: Sjoerd Simons
    Signed-off-by: Christopher Obbard
    Acked-by: Anton Ivanov
    Signed-off-by: Richard Weinberger
    Signed-off-by: Sasha Levin

    Christopher Obbard
     

14 Dec, 2020

2 commits

  • Currently, there is only spin lock added in imx_sema4_mutex_lock(),but
    sema4 driver assume any mutex should be handled one by one and complain
    when mutex locked once again before unlocked. Hence, if another lock happens
    indeed after the last imx_sema4_mutex_lock(),the complains "imx_sema4_
    mutex_lock 135 already locked" would come out over again and again as below.
    So delay lock released into imx_sema4_mutex_unlock() to elimate such race
    contition.

    Thread1: Thread2:
    .... ....
    ------------------------------------------
    imx_sema4_mutex_lock ---->grabbed->|imx_sema4_mutex_lock |
    |"imx_sema4_mutex_lock 135 already locked"|
    ------------------------------------------
    imx_sema4_mutex_unlock imx_sema4_mutex_unlock
    .... .....

    Signed-off-by: Robin Gong
    Reviewed-by: Anson Huang
    Signed-off-by: Dong Aisheng
    (cherry picked from commit 362fdbb91f1c2e386adc6147c07f714be6134907)

    Robin Gong
     
  • Add i.MX SEMA4 driver support for AMP SoC such as i.MX6SX.

    Signed-off-by: Anson Huang

    Anson Huang
     

16 Nov, 2020

2 commits

  • …scm/linux/kernel/git/gregkh/char-misc") into android-mainline

    Steps on the way to 5.10-rc4

    Resolves conflict in:
    arch/arm64/kvm/sys_regs.c

    Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
    Change-Id: Id188ccbec038cf7e30c204e9f5b7866f72b6640d

    Greg Kroah-Hartman
     
  • Pull char/misc driver fixes from Greg KH:
    "Here are some small char/misc/whatever driver fixes for 5.10-rc4.

    Nothing huge, lots of small fixes for reported issues:

    - habanalabs driver fixes

    - speakup driver fixes

    - uio driver fixes

    - virtio driver fix

    - other tiny driver fixes

    Full details are in the shortlog.

    All of these have been in linux-next for a full week with no reported
    issues"

    * tag 'char-misc-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
    uio: Fix use-after-free in uio_unregister_device()
    firmware: xilinx: fix out-of-bounds access
    nitro_enclaves: Fixup type and simplify logic of the poll mask setup
    speakup ttyio: Do not schedule() in ttyio_in_nowait
    speakup: Fix clearing selection in safe context
    speakup: Fix var_id_t values and thus keymap
    virtio: virtio_console: fix DMA memory allocation for rproc serial
    habanalabs/gaudi: mask WDT error in QMAN
    habanalabs/gaudi: move coresight mmu config
    habanalabs: fix kernel pointer type
    mei: protect mei_cl_mtu from null dereference

    Linus Torvalds
     

10 Nov, 2020

1 commit

  • Since commit 086d08725d34 ("remoteproc: create vdev subdevice with
    specific dma memory pool"), every remoteproc has a DMA subdevice
    ("remoteprocX#vdevYbuffer") for each virtio device, which inherits
    DMA capabilities from the corresponding platform device. This allowed
    to associate different DMA pools with each vdev, and required from
    virtio drivers to perform DMA operations with the parent device
    (vdev->dev.parent) instead of grandparent (vdev->dev.parent->parent).

    virtio_rpmsg_bus was already changed in the same merge cycle with
    commit d999b622fcfb ("rpmsg: virtio: allocate buffer from parent"),
    but virtio_console did not. In fact, operations using the grandparent
    worked fine while the grandparent was the platform device, but since
    commit c774ad010873 ("remoteproc: Fix and restore the parenting
    hierarchy for vdev") this was changed, and now the grandparent device
    is the remoteproc device without any DMA capabilities.
    So, starting v5.8-rc1 the following warning is observed:

    [ 2.483925] ------------[ cut here ]------------
    [ 2.489148] WARNING: CPU: 3 PID: 101 at kernel/dma/mapping.c:427 0x80e7eee8
    [ 2.489152] Modules linked in: virtio_console(+)
    [ 2.503737] virtio_rpmsg_bus rpmsg_core
    [ 2.508903]
    [ 2.528898]
    [ 2.913043]
    [ 2.914907] ---[ end trace 93ac8746beab612c ]---
    [ 2.920102] virtio-ports vport1p0: Error allocating inbufs

    kernel/dma/mapping.c:427 is:

    WARN_ON_ONCE(!dev->coherent_dma_mask);

    obviously because the grandparent now is remoteproc dev without any
    DMA caps:

    [ 3.104943] Parent: remoteproc0#vdev1buffer, grandparent: remoteproc0

    Fix this the same way as it was for virtio_rpmsg_bus, using just the
    parent device (vdev->dev.parent, "remoteprocX#vdevYbuffer") for DMA
    operations.
    This also allows now to reserve DMA pools/buffers for rproc serial
    via Device Tree.

    Fixes: c774ad010873 ("remoteproc: Fix and restore the parenting hierarchy for vdev")
    Cc: stable@vger.kernel.org # 5.1+
    Reviewed-by: Mathieu Poirier
    Acked-by: Jason Wang
    Signed-off-by: Alexander Lobakin
    Date: Thu, 5 Nov 2020 11:10:24 +0800
    Link: https://lore.kernel.org/r/AOKowLclCbOCKxyiJ71WeNyuAAj2q8EUtxrXbyky5E@cp7-web-042.plabs.ch
    Signed-off-by: Greg Kroah-Hartman

    Alexander Lobakin
     

09 Nov, 2020

1 commit


07 Nov, 2020

2 commits

  • Mimic the pre-existing ACPI and Device Tree event log behavior by not
    creating the binary_bios_measurements file when the EFI TPM event log is
    empty.

    This fixes the following NULL pointer dereference that can occur when
    reading /sys/kernel/security/tpm0/binary_bios_measurements after the
    kernel received an empty event log from the firmware:

    BUG: kernel NULL pointer dereference, address: 000000000000002c
    #PF: supervisor read access in kernel mode
    #PF: error_code(0x0000) - not-present page
    PGD 0 P4D 0
    Oops: 0000 [#1] SMP PTI
    CPU: 2 PID: 3932 Comm: fwupdtpmevlog Not tainted 5.9.0-00003-g629990edad62 #17
    Hardware name: LENOVO 20LCS03L00/20LCS03L00, BIOS N27ET38W (1.24 ) 11/28/2019
    RIP: 0010:tpm2_bios_measurements_start+0x3a/0x550
    Code: 54 53 48 83 ec 68 48 8b 57 70 48 8b 1e 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 48 8b 82 c0 06 00 00 48 8b 8a c8 06 00 00 8b 60 1c 48 89 4d a0 4c 89 e2 49 83 c4 20 48 83 fb 00 75 2a 49
    RSP: 0018:ffffa9c901203db0 EFLAGS: 00010246
    RAX: 0000000000000010 RBX: 0000000000000000 RCX: 0000000000000010
    RDX: ffff8ba1eb99c000 RSI: ffff8ba1e4ce8280 RDI: ffff8ba1e4ce8258
    RBP: ffffa9c901203e40 R08: ffffa9c901203dd8 R09: ffff8ba1ec443300
    R10: ffffa9c901203e50 R11: 0000000000000000 R12: ffff8ba1e4ce8280
    R13: ffffa9c901203ef0 R14: ffffa9c901203ef0 R15: ffff8ba1e4ce8258
    FS: 00007f6595460880(0000) GS:ffff8ba1ef880000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
    CR2: 000000000000002c CR3: 00000007d8d18003 CR4: 00000000003706e0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
    Call Trace:
    ? __kmalloc_node+0x113/0x320
    ? kvmalloc_node+0x31/0x80
    seq_read+0x94/0x420
    vfs_read+0xa7/0x190
    ksys_read+0xa7/0xe0
    __x64_sys_read+0x1a/0x20
    do_syscall_64+0x37/0x80
    entry_SYSCALL_64_after_hwframe+0x44/0xa9

    In this situation, the bios_event_log pointer in the tpm_bios_log struct
    was not NULL but was equal to the ZERO_SIZE_PTR (0x10) value. This was
    due to the following kmemdup() in tpm_read_log_efi():

    int tpm_read_log_efi(struct tpm_chip *chip)
    {
    ...
    /* malloc EventLog space */
    log->bios_event_log = kmemdup(log_tbl->log, log_size, GFP_KERNEL);
    if (!log->bios_event_log) {
    ret = -ENOMEM;
    goto out;
    }
    ...
    }

    When log_size is zero, due to an empty event log from firmware,
    ZERO_SIZE_PTR is returned from kmemdup(). Upon a read of the
    binary_bios_measurements file, the tpm2_bios_measurements_start()
    function does not perform a ZERO_OR_NULL_PTR() check on the
    bios_event_log pointer before dereferencing it.

    Rather than add a ZERO_OR_NULL_PTR() check in functions that make use of
    the bios_event_log pointer, simply avoid creating the
    binary_bios_measurements_file as is done in other event log retrieval
    backends.

    Explicitly ignore all of the events in the final event log when the main
    event log is empty. The list of events in the final event log cannot be
    accurately parsed without referring to the first event in the main event
    log (the event log header) so the final event log is useless in such a
    situation.

    Fixes: 58cc1e4faf10 ("tpm: parse TPM event logs based on EFI table")
    Link: https://lore.kernel.org/linux-integrity/E1FDCCCB-CA51-4AEE-AC83-9CDE995EAE52@canonical.com/
    Reported-by: Kai-Heng Feng
    Reported-by: Kenneth R. Crudup
    Reported-by: Mimi Zohar
    Cc: Thiébaud Weksteen
    Cc: Ard Biesheuvel
    Signed-off-by: Tyler Hicks
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen

    Tyler Hicks
     
  • There is a misconfiguration in the bios of the gpio pin used for the
    interrupt in the T490s. When interrupts are enabled in the tpm_tis
    driver code this results in an interrupt storm. This was initially
    reported when we attempted to enable the interrupt code in the tpm_tis
    driver, which previously wasn't setting a flag to enable it. Due to
    the reports of the interrupt storm that code was reverted and we went back
    to polling instead of using interrupts. Now that we know the T490s problem
    is a firmware issue, add code to check if the system is a T490s and
    disable interrupts if that is the case. This will allow us to enable
    interrupts for everyone else. If the user has a fixed bios they can
    force the enabling of interrupts with tpm_tis.interrupts=1 on the
    kernel command line.

    Cc: Peter Huewe
    Cc: Jason Gunthorpe
    Cc: Hans de Goede
    Signed-off-by: Jerry Snitselaar
    Reviewed-by: James Bottomley
    Reviewed-by: Hans de Goede
    Reviewed-by: Jarkko Sakkinen
    Signed-off-by: Jarkko Sakkinen

    Jerry Snitselaar
     

29 Oct, 2020

1 commit

  • DYNAMIC_MINORS value has been set to 64.
    Due to this reason, we are facing a module loading fail problem of
    device driver like below.

    [ 45.712771] pdic_misc_init - return error : -16

    We need to increase this value for registering more misc devices.

    Signed-off-by: Sangmoon Kim

    Bug: 171370390
    Link: https://lore.kernel.org/lkml/20201029070552.GA3062343@kroah.com/
    Change-Id: I04ab486ce7674dde3118506c3d783f0e4e211bac
    Signed-off-by: Sangmoon Kim

    Sangmoon Kim
     

25 Oct, 2020

1 commit

  • Non-cryptographic PRNGs may have great statistical properties, but
    are usually trivially predictable to someone who knows the algorithm,
    given a small sample of their output. An LFSR like prandom_u32() is
    particularly simple, even if the sample is widely scattered bits.

    It turns out the network stack uses prandom_u32() for some things like
    random port numbers which it would prefer are *not* trivially predictable.
    Predictability led to a practical DNS spoofing attack. Oops.

    This patch replaces the LFSR with a homebrew cryptographic PRNG based
    on the SipHash round function, which is in turn seeded with 128 bits
    of strong random key. (The authors of SipHash have *not* been consulted
    about this abuse of their algorithm.) Speed is prioritized over security;
    attacks are rare, while performance is always wanted.

    Replacing all callers of prandom_u32() is the quick fix.
    Whether to reinstate a weaker PRNG for uses which can tolerate it
    is an open question.

    Commit f227e3ec3b5c ("random32: update the net random state on interrupt
    and activity") was an earlier attempt at a solution. This patch replaces
    it.

    Reported-by: Amit Klein
    Cc: Willy Tarreau
    Cc: Eric Dumazet
    Cc: "Jason A. Donenfeld"
    Cc: Andy Lutomirski
    Cc: Kees Cook
    Cc: Thomas Gleixner
    Cc: Peter Zijlstra
    Cc: Linus Torvalds
    Cc: tytso@mit.edu
    Cc: Florian Westphal
    Cc: Marc Plumb
    Fixes: f227e3ec3b5c ("random32: update the net random state on interrupt and activity")
    Signed-off-by: George Spelvin
    Link: https://lore.kernel.org/netdev/20200808152628.GA27941@SDF.ORG/
    [ willy: partial reversal of f227e3ec3b5c; moved SIPROUND definitions
    to prandom.h for later use; merged George's prandom_seed() proposal;
    inlined siprand_u32(); replaced the net_rand_state[] array with 4
    members to fix a build issue; cosmetic cleanups to make checkpatch
    happy; fixed RANDOM32_SELFTEST build ]
    Signed-off-by: Willy Tarreau

    George Spelvin
     

16 Oct, 2020

2 commits

  • Pull drm updates from Dave Airlie:
    "Not a major amount of change, the i915 trees got split into display
    and gt trees to better facilitate higher level review, and there's a
    major refactoring of i915 GEM locking to use more core kernel concepts
    (like ww-mutexes). msm gets per-process pagetables, older AMD SI cards
    get DC support, nouveau got a bump in displayport support with common
    code extraction from i915.

    Outside of drm this contains a couple of patches for hexint
    moduleparams which you've acked, and a virtio common code tree that
    you should also get via it's regular path.

    New driver:
    - Cadence MHDP8546 DisplayPort bridge driver

    core:
    - cross-driver scatterlist cleanups
    - devm_drm conversions
    - remove drm_dev_init
    - devm_drm_dev_alloc conversion

    ttm:
    - lots of refactoring and cleanups

    bridges:
    - chained bridge support in more drivers

    panel:
    - misc new panels

    scheduler:
    - cleanup priority levels

    displayport:
    - refactor i915 code into helpers for nouveau

    i915:
    - split into display and GT trees
    - WW locking refactoring in GEM
    - execbuf2 extension mechanism
    - syncobj timeline support
    - GEN 12 HOBL display powersaving
    - Rocket Lake display additions
    - Disable FBC on Tigerlake
    - Tigerlake Type-C + DP improvements
    - Hotplug interrupt refactoring

    amdgpu:
    - Sienna Cichlid updates
    - Navy Flounder updates
    - DCE6 (SI) support for DC
    - Plane rotation enabled
    - TMZ state info ioctl
    - PCIe DPC recovery support
    - DC interrupt handling refactor
    - OLED panel fixes

    amdkfd:
    - add SMI events for thermal throttling
    - SMI interface events ioctl update
    - process eviction counters

    radeon:
    - move to dma_ for allocations
    - expose sclk via sysfs

    msm:
    - DSI support for sm8150/sm8250
    - per-process GPU pagetable support
    - Displayport support

    mediatek:
    - move HDMI phy driver to PHY
    - convert mtk-dpi to bridge API
    - disable mt2701 tmds

    tegra:
    - bridge support

    exynos:
    - misc cleanups

    vc4:
    - dual display cleanups

    ast:
    - cleanups

    gma500:
    - conversion to GPIOd API

    hisilicon:
    - misc reworks

    ingenic:
    - clock handling and format improvements

    mcde:
    - DSI support

    mgag200:
    - desktop g200 support

    mxsfb:
    - i.MX7 + i.MX8M
    - alpha plane support

    panfrost:
    - devfreq support
    - amlogic SoC support

    ps8640:
    - EDID from eDP retrieval

    tidss:
    - AM65xx YUV workaround

    virtio:
    - virtio-gpu exported resources

    rcar-du:
    - R8A7742, R8A774E1 and R8A77961 support
    - YUV planar format fixes
    - non-visible plane handling
    - VSP device reference count fix
    - Kconfig fix to avoid displaying disabled options in .config"

    * tag 'drm-next-2020-10-15' of git://anongit.freedesktop.org/drm/drm: (1494 commits)
    drm/ingenic: Fix bad revert
    drm/amdgpu: Fix invalid number of character '{' in amdgpu_acpi_init
    drm/amdgpu: Remove warning for virtual_display
    drm/amdgpu: kfd_initialized can be static
    drm/amd/pm: setup APU dpm clock table in SMU HW initialization
    drm/amdgpu: prevent spurious warning
    drm/amdgpu/swsmu: fix ARC build errors
    drm/amd/display: Fix OPTC_DATA_FORMAT programming
    drm/amd/display: Don't allow pstate if no support in blank
    drm/panfrost: increase readl_relaxed_poll_timeout values
    MAINTAINERS: Update entry for st7703 driver after the rename
    Revert "gpu/drm: ingenic: Add option to mmap GEM buffers cached"
    drm/amd/display: HDMI remote sink need mode validation for Linux
    drm/amd/display: Change to correct unit on audio rate
    drm/amd/display: Avoid set zero in the requested clk
    drm/amdgpu: align frag_end to covered address space
    drm/amdgpu: fix NULL pointer dereference for Renoir
    drm/vmwgfx: fix regression in thp code due to ttm init refactor.
    drm/amdgpu/swsmu: add interrupt work handler for smu11 parts
    drm/amdgpu/swsmu: add interrupt work function
    ...

    Linus Torvalds
     
  • Pull char/misc driver updates from Greg KH:
    "Here is the big set of char, misc, and other assorted driver subsystem
    patches for 5.10-rc1.

    There's a lot of different things in here, all over the drivers/
    directory. Some summaries:

    - soundwire driver updates

    - habanalabs driver updates

    - extcon driver updates

    - nitro_enclaves new driver

    - fsl-mc driver and core updates

    - mhi core and bus updates

    - nvmem driver updates

    - eeprom driver updates

    - binder driver updates and fixes

    - vbox minor bugfixes

    - fsi driver updates

    - w1 driver updates

    - coresight driver updates

    - interconnect driver updates

    - misc driver updates

    - other minor driver updates

    All of these have been in linux-next for a while with no reported
    issues"

    * tag 'char-misc-5.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (396 commits)
    binder: fix UAF when releasing todo list
    docs: w1: w1_therm: Fix broken xref, mistakes, clarify text
    misc: Kconfig: fix a HISI_HIKEY_USB dependency
    LSM: Fix type of id parameter in kernel_post_load_data prototype
    misc: Kconfig: add a new dependency for HISI_HIKEY_USB
    firmware_loader: fix a kernel-doc markup
    w1: w1_therm: make w1_poll_completion static
    binder: simplify the return expression of binder_mmap
    test_firmware: Test partial read support
    firmware: Add request_partial_firmware_into_buf()
    firmware: Store opt_flags in fw_priv
    fs/kernel_file_read: Add "offset" arg for partial reads
    IMA: Add support for file reads without contents
    LSM: Add "contents" flag to kernel_read_file hook
    module: Call security_kernel_post_load_data()
    firmware_loader: Use security_post_load_data()
    LSM: Introduce kernel_post_load_data() hook
    fs/kernel_read_file: Add file_size output argument
    fs/kernel_read_file: Switch buffer size arg to size_t
    fs/kernel_read_file: Remove redundant size argument
    ...

    Linus Torvalds
     

15 Oct, 2020

1 commit

  • Pull IPMI updates from Corey Minyard:
    "Some minor bug fixes, return values, cleanups of prints, conversion of
    tasklets to the new API.

    The biggest change is retrying the initial information fetch from the
    management controller. If that fails, the iterface is not operational,
    and one group was having trouble with the management controller not
    being ready when the OS started up. So a retry was added"

    * tag 'for-linus-5.10-1' of git://github.com/cminyard/linux-ipmi:
    ipmi_si: Fix wrong return value in try_smi_init()
    ipmi: msghandler: Fix a signedness bug
    ipmi: add retry in try_get_dev_id()
    ipmi: Clean up some printks
    ipmi:msghandler: retry to get device id on an error
    ipmi:sm: Print current state when the state is invalid
    ipmi: Reset response handler when failing to send the command
    ipmi: add a newline when printing parameter 'panic_op' by sysfs
    char: ipmi: convert tasklets to use new tasklet_setup() API

    Linus Torvalds
     

14 Oct, 2020

1 commit

  • Pull block updates from Jens Axboe:

    - Series of merge handling cleanups (Baolin, Christoph)

    - Series of blk-throttle fixes and cleanups (Baolin)

    - Series cleaning up BDI, seperating the block device from the
    backing_dev_info (Christoph)

    - Removal of bdget() as a generic API (Christoph)

    - Removal of blkdev_get() as a generic API (Christoph)

    - Cleanup of is-partition checks (Christoph)

    - Series reworking disk revalidation (Christoph)

    - Series cleaning up bio flags (Christoph)

    - bio crypt fixes (Eric)

    - IO stats inflight tweak (Gabriel)

    - blk-mq tags fixes (Hannes)

    - Buffer invalidation fixes (Jan)

    - Allow soft limits for zone append (Johannes)

    - Shared tag set improvements (John, Kashyap)

    - Allow IOPRIO_CLASS_RT for CAP_SYS_NICE (Khazhismel)

    - DM no-wait support (Mike, Konstantin)

    - Request allocation improvements (Ming)

    - Allow md/dm/bcache to use IO stat helpers (Song)

    - Series improving blk-iocost (Tejun)

    - Various cleanups (Geert, Damien, Danny, Julia, Tetsuo, Tian, Wang,
    Xianting, Yang, Yufen, yangerkun)

    * tag 'block-5.10-2020-10-12' of git://git.kernel.dk/linux-block: (191 commits)
    block: fix uapi blkzoned.h comments
    blk-mq: move cancel of hctx->run_work to the front of blk_exit_queue
    blk-mq: get rid of the dead flush handle code path
    block: get rid of unnecessary local variable
    block: fix comment and add lockdep assert
    blk-mq: use helper function to test hw stopped
    block: use helper function to test queue register
    block: remove redundant mq check
    block: invoke blk_mq_exit_sched no matter whether have .exit_sched
    percpu_ref: don't refer to ref->data if it isn't allocated
    block: ratelimit handle_bad_sector() message
    blk-throttle: Re-use the throtl_set_slice_end()
    blk-throttle: Open code __throtl_de/enqueue_tg()
    blk-throttle: Move service tree validation out of the throtl_rb_first()
    blk-throttle: Move the list operation after list validation
    blk-throttle: Fix IO hang for a corner case
    blk-throttle: Avoid tracking latency if low limit is invalid
    blk-throttle: Avoid getting the current time if tg->last_finish_time is 0
    blk-throttle: Remove a meaningless parameter for throtl_downgrade_state()
    block: Remove redundant 'return' statement
    ...

    Linus Torvalds
     

13 Oct, 2020

1 commit

  • Pull crypto updates from Herbert Xu:
    "API:
    - Allow DRBG testing through user-space af_alg
    - Add tcrypt speed testing support for keyed hashes
    - Add type-safe init/exit hooks for ahash

    Algorithms:
    - Mark arc4 as obsolete and pending for future removal
    - Mark anubis, khazad, sead and tea as obsolete
    - Improve boot-time xor benchmark
    - Add OSCCA SM2 asymmetric cipher algorithm and use it for integrity

    Drivers:
    - Fixes and enhancement for XTS in caam
    - Add support for XIP8001B hwrng in xiphera-trng
    - Add RNG and hash support in sun8i-ce/sun8i-ss
    - Allow imx-rngc to be used by kernel entropy pool
    - Use crypto engine in omap-sham
    - Add support for Ingenic X1830 with ingenic"

    * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: (205 commits)
    X.509: Fix modular build of public_key_sm2
    crypto: xor - Remove unused variable count in do_xor_speed
    X.509: fix error return value on the failed path
    crypto: bcm - Verify GCM/CCM key length in setkey
    crypto: qat - drop input parameter from adf_enable_aer()
    crypto: qat - fix function parameters descriptions
    crypto: atmel-tdes - use semicolons rather than commas to separate statements
    crypto: drivers - use semicolons rather than commas to separate statements
    hwrng: mxc-rnga - use semicolons rather than commas to separate statements
    hwrng: iproc-rng200 - use semicolons rather than commas to separate statements
    hwrng: stm32 - use semicolons rather than commas to separate statements
    crypto: xor - use ktime for template benchmarking
    crypto: xor - defer load time benchmark to a later time
    crypto: hisilicon/zip - fix the uninitalized 'curr_qm_qp_num'
    crypto: hisilicon/zip - fix the return value when device is busy
    crypto: hisilicon/zip - fix zero length input in GZIP decompress
    crypto: hisilicon/zip - fix the uncleared debug registers
    lib/mpi: Fix unused variable warnings
    crypto: x86/poly1305 - Remove assignments with no effect
    hwrng: npcm - modify readl to readb
    ...

    Linus Torvalds
     

06 Oct, 2020

1 commit


02 Oct, 2020

7 commits


28 Sep, 2020

1 commit


25 Sep, 2020

1 commit


24 Sep, 2020

1 commit


19 Sep, 2020

1 commit

  • The type for the completion codes should be unsigned char instead of
    char. If it is declared as a normal char then the conditions in
    __get_device_id() are impossible because the IPMI_DEVICE_IN_FW_UPDATE_ERR
    error codes are higher than 127.

    drivers/char/ipmi/ipmi_msghandler.c:2449 __get_device_id()
    warn: impossible condition '(bmc->cc == 209) => ((-128)-127 == 209)'

    Fixes: f8910ffa81b0 ("ipmi:msghandler: retry to get device id on an error")
    Signed-off-by: Dan Carpenter
    Message-Id:
    Signed-off-by: Corey Minyard

    Dan Carpenter
     

16 Sep, 2020

1 commit

  • Use a retry machanism to give the BMC more opportunities to correctly
    respond when we receive specific completion codes.

    This is similar to what is done in __get_device_id().

    Signed-off-by: Xianting Tian
    Message-Id:
    [Moved GET_DEVICE_ID_MAX_RETRY to include/linux/ipmi.h, reworded some
    text.]
    Signed-off-by: Corey Minyard

    Xianting Tian
     

15 Sep, 2020

4 commits

  • Convert to dev_xxx() and fix some verbage.

    Signed-off-by: Corey Minyard

    Corey Minyard
     
  • We fail to get the BMCS's device id with low probability when loading
    the ipmi driver and it causes BMC device registration failed. When this
    issue occurs we got below kernel prints:

    [Wed Sep 9 19:52:03 2020] ipmi_si IPI0001:00: IPMI message handler:
    device id demangle failed: -22
    [Wed Sep 9 19:52:03 2020] IPMI BT: using default values
    [Wed Sep 9 19:52:03 2020] IPMI BT: req2rsp=5 secs retries=2
    [Wed Sep 9 19:52:03 2020] ipmi_si IPI0001:00: Unable to get the
    device id: -5
    [Wed Sep 9 19:52:04 2020] ipmi_si IPI0001:00: Unable to register
    device: error -5

    When this issue happens, we want to manually unload the driver and try to
    load it again, but it can't be unloaded by 'rmmod' as it is already 'in
    use'.

    We add a print in handle_one_recv_msg(), when this issue happens,
    the msg we received is "Recv: 1c 01 d5", which means the data_len is 1,
    data[0] is 0xd5 (completion code), which means "bmc cannot execute
    command. Command, or request parameter(s), not supported in present
    state". Debug code:
    static int handle_one_recv_msg(struct ipmi_smi *intf,
    struct ipmi_smi_msg *msg) {
    printk("Recv: %*ph\n", msg->rsp_size, msg->rsp);
    ... ...
    }
    Then in ipmi_demangle_device_id(), it returned '-EINVAL' as 'data_len < 7'
    and 'data[0] != 0'.

    We created this patch to retry the get device id when this error
    happens. We reproduced this issue again and the retry succeed on the
    first retry, we finally got the correct msg and then all is ok:
    Recv: 1c 01 00 01 81 05 84 02 af db 07 00 01 00 b9 00 10 00

    So use a retry machanism in this patch to give bmc more opportunity to
    correctly response kernel when we received specific completion codes.

    Signed-off-by: Xianting Tian
    Message-Id:
    [Cleaned up the verbage a bit in the header and prints.]
    Signed-off-by: Corey Minyard

    Xianting Tian
     
  • Print current state before returning IPMI_NOT_IN_MY_STATE_ERR so we can
    know where this issue is coming from and possibly fix the state machine.

    Signed-off-by: Xianting Tian
    Message-Id:
    [Converted printk() to pr_xxx().]
    Signed-off-by: Corey Minyard

    Xianting Tian
     
  • When failing to send a command we don't expect a response. Clear the
    `null_user_handler` like is done in the success path.

    Signed-off-by: Markus Boehme
    Message-Id:
    Signed-off-by: Corey Minyard

    Markus Boehme
     

11 Sep, 2020

2 commits

  • Xiphera XIP8001B is an FPGA-based True Random Number Generator
    Intellectual Property (IP) Core which can be instantiated in
    multiple FPGA families. This driver adds Linux support for it through
    the hwrng interface.

    Signed-off-by: Atte Tommiska
    Signed-off-by: Herbert Xu

    Atte Tommiska
     
  • The RNGB can generate 2^20 words (1 word == 4 byte) of 'random' data
    after the seed pool was initialized. The pool needs to be reseeded if
    more words are required. The reseeding is done automatically since
    commit 3acd9ea9331c ("hwrng: imx-rngc - use automatic seeding").

    We can't retrieve the TRNG values directly so we need a other way to get
    the quality level. We know that the PRNG uses 20.000 entropy samples
    from the TRNG to generate 2^20 words (1MiB) and the quality level is
    defined as (in bits of entropy per 1024 bits of input). So the quality
    level can be calculated by:

    20.000 * 1024
    ------------- = ~ 19.5
    2^20

    Signed-off-by: Marco Felsch
    Signed-off-by: Herbert Xu

    Marco Felsch
     

07 Sep, 2020

2 commits

  • Make it possible to have virtio console built-in when
    other virtio drivers are modular.

    Signed-off-by: Michal Suchanek
    Reviewed-by: Amit Shah
    Link: https://lore.kernel.org/r/20200831165850.26163-1-msuchanek@suse.de
    Signed-off-by: Greg Kroah-Hartman

    Michal Suchanek
     
  • Reported the cleared bytes in case of a partial clear_user instead
    of -EFAULT, and remove a pointless conditional, as cleared must be
    non-zero by the time we hit the signal_pending check.

    Reported-by: Rasmus Villemoes
    Signed-off-by: Christoph Hellwig
    Link: https://lore.kernel.org/r/20200907082700.2057137-1-hch@lst.de
    Signed-off-by: Greg Kroah-Hartman

    Christoph Hellwig