1. 25 Apr, 2019 1 commit
  2. 19 Apr, 2019 1 commit
  3. 18 Apr, 2019 1 commit
    • Stephen Boyd's avatar
      clkdev: Hold clocks_mutex while iterating clocks list · 5a7efdac
      Stephen Boyd authored
      We recently introduced a change to support devm clk lookups. That change
      introduced a code-path that used clk_find() without holding the
      'clocks_mutex'. Unfortunately, clk_find() iterates over the 'clocks'
      list and so we need to prevent the list from being modified at the same
      time. Do this by holding the mutex and checking to make sure it's held
      while iterating the list.
      
      Note, we don't really care if the lookup is freed after we find it with
      clk_find() because we're just doing a pointer comparison, but if we did
      care we would need to keep holding the mutex while we dereference the
      clk_lookup pointer.
      
      Fixes: 3eee6c7d ("clkdev: add managed clkdev lookup registration")
      Cc: Miquel Raynal <miquel.raynal@bootlin.com>
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Michael Turquette <mturquette@baylibre.com>
      Cc: Jeffrey Hugo <jhugo@codeaurora.org>
      Cc: Chen-Yu Tsai <wens@csie.org>
      Cc: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
      Acked-by: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
      Tested-by: default avatarJeffrey Hugo <jhugo@codeaurora.org>
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      5a7efdac
  4. 12 Apr, 2019 2 commits
  5. 11 Apr, 2019 1 commit
  6. 10 Apr, 2019 1 commit
  7. 04 Apr, 2019 1 commit
  8. 03 Apr, 2019 1 commit
    • Jernej Skrabec's avatar
      clk: sunxi-ng: nkmp: Avoid GENMASK(-1, 0) · 2abc330c
      Jernej Skrabec authored
      Sometimes one of the nkmp factors is unused. This means that one of the
      factors shift and width values are set to 0. Current nkmp clock code
      generates a mask for each factor with GENMASK(width + shift - 1, shift).
      For unused factor this translates to GENMASK(-1, 0). This code is
      further expanded by C preprocessor to final version:
      (((~0UL) - (1UL << (0)) + 1) & (~0UL >> (BITS_PER_LONG - 1 - (-1))))
      or a bit simplified:
      (~0UL & (~0UL >> BITS_PER_LONG))
      
      It turns out that result of the second part (~0UL >> BITS_PER_LONG) is
      actually undefined by C standard, which clearly specifies:
      
      "If the value of the right operand is negative or is greater than or
      equal to the width of the promoted left operand, the behavior is
      undefined."
      
      Additionally, compiling kernel with aarch64-linux-gnu-gcc 8.3.0 gave
      different results whether literals or variables with same values as
      literals were used. GENMASK with literals -1 and 0 gives zero and with
      variables gives 0xFFFFFFFFFFFFFFF (~0UL). Because nkmp driver uses
      GENMASK with variables as parameter, expression calculates mask as ~0UL
      instead of 0. This has further consequences that LSB in register is
      always set to 1 (1 is neutral value for a factor and shift is 0).
      
      For example, H6 pll-de clock is set to 600 MHz by sun4i-drm driver, but
      due to this bug ends up being 300 MHz. Additionally, 300 MHz seems to be
      too low because following warning can be found in dmesg:
      
      [    1.752763] WARNING: CPU: 2 PID: 41 at drivers/clk/sunxi-ng/ccu_common.c:41 ccu_helper_wait_for_lock.part.0+0x6c/0x90
      [    1.763378] Modules linked in:
      [    1.766441] CPU: 2 PID: 41 Comm: kworker/2:1 Not tainted 5.1.0-rc2-next-20190401 #138
      [    1.774269] Hardware name: Pine H64 (DT)
      [    1.778200] Workqueue: events deferred_probe_work_func
      [    1.783341] pstate: 40000005 (nZcv daif -PAN -UAO)
      [    1.788135] pc : ccu_helper_wait_for_lock.part.0+0x6c/0x90
      [    1.793623] lr : ccu_helper_wait_for_lock.part.0+0x48/0x90
      [    1.799107] sp : ffff000010f93840
      [    1.802422] x29: ffff000010f93840 x28: 0000000000000000
      [    1.807735] x27: ffff800073ce9d80 x26: ffff000010afd1b8
      [    1.813049] x25: ffffffffffffffff x24: 00000000ffffffff
      [    1.818362] x23: 0000000000000001 x22: ffff000010abd5c8
      [    1.823675] x21: 0000000010000000 x20: 00000000685f367e
      [    1.828987] x19: 0000000000001801 x18: 0000000000000001
      [    1.834300] x17: 0000000000000001 x16: 0000000000000000
      [    1.839613] x15: 0000000000000000 x14: ffff000010789858
      [    1.844926] x13: 0000000000000000 x12: 0000000000000001
      [    1.850239] x11: 0000000000000000 x10: 0000000000000970
      [    1.855551] x9 : ffff000010f936c0 x8 : ffff800074cec0d0
      [    1.860864] x7 : 0000800067117000 x6 : 0000000115c30b41
      [    1.866177] x5 : 00ffffffffffffff x4 : 002c959300bfe500
      [    1.871490] x3 : 0000000000000018 x2 : 0000000029aaaaab
      [    1.876802] x1 : 00000000000002e6 x0 : 00000000686072bc
      [    1.882114] Call trace:
      [    1.884565]  ccu_helper_wait_for_lock.part.0+0x6c/0x90
      [    1.889705]  ccu_helper_wait_for_lock+0x10/0x20
      [    1.894236]  ccu_nkmp_set_rate+0x244/0x2a8
      [    1.898334]  clk_change_rate+0x144/0x290
      [    1.902258]  clk_core_set_rate_nolock+0x180/0x1b8
      [    1.906963]  clk_set_rate+0x34/0xa0
      [    1.910455]  sun8i_mixer_bind+0x484/0x558
      [    1.914466]  component_bind_all+0x10c/0x230
      [    1.918651]  sun4i_drv_bind+0xc4/0x1a0
      [    1.922401]  try_to_bring_up_master+0x164/0x1c0
      [    1.926932]  __component_add+0xa0/0x168
      [    1.930769]  component_add+0x10/0x18
      [    1.934346]  sun8i_dw_hdmi_probe+0x18/0x20
      [    1.938443]  platform_drv_probe+0x50/0xa0
      [    1.942455]  really_probe+0xcc/0x280
      [    1.946032]  driver_probe_device+0x54/0xe8
      [    1.950130]  __device_attach_driver+0x80/0xb8
      [    1.954488]  bus_for_each_drv+0x78/0xc8
      [    1.958326]  __device_attach+0xd4/0x130
      [    1.962163]  device_initial_probe+0x10/0x18
      [    1.966348]  bus_probe_device+0x90/0x98
      [    1.970185]  deferred_probe_work_func+0x6c/0xa0
      [    1.974720]  process_one_work+0x1e0/0x320
      [    1.978732]  worker_thread+0x228/0x428
      [    1.982484]  kthread+0x120/0x128
      [    1.985714]  ret_from_fork+0x10/0x18
      [    1.989290] ---[ end trace 9babd42e1ca4b84f ]---
      
      This commit solves the issue by first checking value of the factor
      width. If it is equal to 0 (unused factor), mask is set to 0, otherwise
      GENMASK() macro is used as before.
      
      Fixes: d897ef56 ("clk: sunxi-ng: Mask nkmp factors when setting register")
      Signed-off-by: default avatarJernej Skrabec <jernej.skrabec@siol.net>
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
      2abc330c
  9. 29 Mar, 2019 2 commits
  10. 25 Mar, 2019 1 commit
  11. 19 Mar, 2019 4 commits
  12. 18 Mar, 2019 1 commit
  13. 17 Mar, 2019 14 commits
  14. 16 Mar, 2019 9 commits
    • Linus Torvalds's avatar
      Merge tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux · a9dce667
      Linus Torvalds authored
      Pull pidfd system call from Christian Brauner:
       "This introduces the ability to use file descriptors from /proc/<pid>/
        as stable handles on struct pid. Even if a pid is recycled the handle
        will not change. For a start these fds can be used to send signals to
        the processes they refer to.
      
        With the ability to use /proc/<pid> fds as stable handles on struct
        pid we can fix a long-standing issue where after a process has exited
        its pid can be reused by another process. If a caller sends a signal
        to a reused pid it will end up signaling the wrong process.
      
        With this patchset we enable a variety of use cases. One obvious
        example is that we can now safely delegate an important part of
        process management - sending signals - to processes other than the
        parent of a given process by sending file descriptors around via scm
        rights and not fearing that the given process will have been recycled
        in the meantime. It also allows for easy testing whether a given
        process is still alive or not by sending signal 0 to a pidfd which is
        quite handy.
      
        There has been some interest in this feature e.g. from systems
        management (systemd, glibc) and container managers. I have requested
        and gotten comments from glibc to make sure that this syscall is
        suitable for their needs as well. In the future I expect it to take on
        most other pid-based signal syscalls. But such features are left for
        the future once they are needed.
      
        This has been sitting in linux-next for quite a while and has not
        caused any issues. It comes with selftests which verify basic
        functionality and also test that a recycled pid cannot be signaled via
        a pidfd.
      
        Jon has written about a prior version of this patchset. It should
        cover the basic functionality since not a lot has changed since then:
      
            https://lwn.net/Articles/773459/
      
        The commit message for the syscall itself is extensively documenting
        the syscall, including it's functionality and extensibility"
      
      * tag 'pidfd-v5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brauner/linux:
        selftests: add tests for pidfd_send_signal()
        signal: add pidfd_send_signal() syscall
      a9dce667
    • Linus Torvalds's avatar
      Merge tag 'devdax-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm · f67e3fb4
      Linus Torvalds authored
      Pull device-dax updates from Dan Williams:
       "New device-dax infrastructure to allow persistent memory and other
        "reserved" / performance differentiated memories, to be assigned to
        the core-mm as "System RAM".
      
        Some users want to use persistent memory as additional volatile
        memory. They are willing to cope with potential performance
        differences, for example between DRAM and 3D Xpoint, and want to use
        typical Linux memory management apis rather than a userspace memory
        allocator layered over an mmap() of a dax file. The administration
        model is to decide how much Persistent Memory (pmem) to use as System
        RAM, create a device-dax-mode namespace of that size, and then assign
        it to the core-mm. The rationale for device-dax is that it is a
        generic memory-mapping driver that can be layered over any "special
        purpose" memory, not just pmem. On subsequent boots udev rules can be
        used to restore the memory assignment.
      
        One implication of using pmem as RAM is that mlock() no longer keeps
        data off persistent media. For this reason it is recommended to enable
        NVDIMM Security (previously merged for 5.0) to encrypt pmem contents
        at rest. We considered making this recommendation an actively enforced
        requirement, but in the end decided to leave it as a distribution /
        administrator policy to allow for emulation and test environments that
        lack security capable NVDIMMs.
      
        Summary:
      
         - Replace the /sys/class/dax device model with /sys/bus/dax, and
           include a compat driver so distributions can opt-in to the new ABI.
      
         - Allow for an alternative driver for the device-dax address-range
      
         - Introduce the 'kmem' driver to hotplug / assign a device-dax
           address-range to the core-mm.
      
         - Arrange for the device-dax target-node to be onlined so that the
           newly added memory range can be uniquely referenced by numa apis"
      
      NOTE! I'm not entirely happy with the whole "PMEM as RAM" model because
      we currently have special - and very annoying rules in the kernel about
      accessing PMEM only with the "MC safe" accessors, because machine checks
      inside the regular repeat string copy functions can be fatal in some
      (not described) circumstances.
      
      And apparently the PMEM modules can cause that a lot more than regular
      RAM.  The argument is that this happens because PMEM doesn't necessarily
      get scrubbed at boot like RAM does, but that is planned to be added for
      the user space tooling.
      
      Quoting Dan from another email:
       "The exposure can be reduced in the volatile-RAM case by scanning for
        and clearing errors before it is onlined as RAM. The userspace tooling
        for that can be in place before v5.1-final. There's also runtime
        notifications of errors via acpi_nfit_uc_error_notify() from
        background scrubbers on the DIMM devices. With that mechanism the
        kernel could proactively clear newly discovered poison in the volatile
        case, but that would be additional development more suitable for v5.2.
      
        I understand the concern, and the need to highlight this issue by
        tapping the brakes on feature development, but I don't see PMEM as RAM
        making the situation worse when the exposure is also there via DAX in
        the PMEM case. Volatile-RAM is arguably a safer use case since it's
        possible to repair pages where the persistent case needs active
        application coordination"
      
      * tag 'devdax-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
        device-dax: "Hotplug" persistent memory for use like normal RAM
        mm/resource: Let walk_system_ram_range() search child resources
        mm/memory-hotplug: Allow memory resources to be children
        mm/resource: Move HMM pr_debug() deeper into resource code
        mm/resource: Return real error codes from walk failures
        device-dax: Add a 'modalias' attribute to DAX 'bus' devices
        device-dax: Add a 'target_node' attribute
        device-dax: Auto-bind device after successful new_id
        acpi/nfit, device-dax: Identify differentiated memory with a unique numa-node
        device-dax: Add /sys/class/dax backwards compatibility
        device-dax: Add support for a dax override driver
        device-dax: Move resource pinning+mapping into the common driver
        device-dax: Introduce bus + driver model
        device-dax: Start defining a dax bus model
        device-dax: Remove multi-resource infrastructure
        device-dax: Kill dax_region base
        device-dax: Kill dax_region ida
      f67e3fb4
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 477558d7
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "This is the final round of mostly small fixes and performance
        improvements to our initial submit.
      
        The main regression fix is the ia64 simscsi build failure which was
        missed in the serial number elimination conversion"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits)
        scsi: ia64: simscsi: use request tag instead of serial_number
        scsi: aacraid: Fix performance issue on logical drives
        scsi: lpfc: Fix error codes in lpfc_sli4_pci_mem_setup()
        scsi: libiscsi: Hold back_lock when calling iscsi_complete_task
        scsi: hisi_sas: Change SERDES_CFG init value to increase reliability of HiLink
        scsi: hisi_sas: Send HARD RESET to clear the previous affiliation of STP target port
        scsi: hisi_sas: Set PHY linkrate when disconnected
        scsi: hisi_sas: print PHY RX errors count for later revision of v3 hw
        scsi: hisi_sas: Fix a timeout race of driver internal and SMP IO
        scsi: hisi_sas: Change return variable type in phy_up_v3_hw()
        scsi: qla2xxx: check for kstrtol() failure
        scsi: lpfc: fix 32-bit format string warning
        scsi: lpfc: fix unused variable warning
        scsi: target: tcmu: Switch to bitmap_zalloc()
        scsi: libiscsi: fall back to sendmsg for slab pages
        scsi: qla2xxx: avoid printf format warning
        scsi: lpfc: resolve static checker warning in lpfc_sli4_hba_unset
        scsi: lpfc: Correct __lpfc_sli_issue_iocb_s4 lockdep check
        scsi: ufs: hisi: fix ufs_hba_variant_ops passing
        scsi: qla2xxx: Fix panic in qla_dfs_tgt_counters_show
        ...
      477558d7
    • Linus Torvalds's avatar
      Merge tag 'for-5.1/block-post-20190315' of git://git.kernel.dk/linux-block · 11efae35
      Linus Torvalds authored
      Pull more block layer changes from Jens Axboe:
       "This is a collection of both stragglers, and fixes that came in after
        I finalized the initial pull. This contains:
      
         - An MD pull request from Song, with a few minor fixes
      
         - Set of NVMe patches via Christoph
      
         - Pull request from Konrad, with a few fixes for xen/blkback
      
         - pblk fix IO calculation fix (Javier)
      
         - Segment calculation fix for pass-through (Ming)
      
         - Fallthrough annotation for blkcg (Mathieu)"
      
      * tag 'for-5.1/block-post-20190315' of git://git.kernel.dk/linux-block: (25 commits)
        blkcg: annotate implicit fall through
        nvme-tcp: support C2HData with SUCCESS flag
        nvmet: ignore EOPNOTSUPP for discard
        nvme: add proper write zeroes setup for the multipath device
        nvme: add proper discard setup for the multipath device
        nvme: remove nvme_ns_config_oncs
        nvme: disable Write Zeroes for qemu controllers
        nvmet-fc: bring Disconnect into compliance with FC-NVME spec
        nvmet-fc: fix issues with targetport assoc_list list walking
        nvme-fc: reject reconnect if io queue count is reduced to zero
        nvme-fc: fix numa_node when dev is null
        nvme-fc: use nr_phys_segments to determine existence of sgl
        nvme-loop: init nvmet_ctrl fatal_err_work when allocate
        nvme: update comment to make the code easier to read
        nvme: put ns_head ref if namespace fails allocation
        nvme-trace: fix cdw10 buffer overrun
        nvme: don't warn on block content change effects
        nvme: add get-feature to admin cmds tracer
        md: Fix failed allocation of md_register_thread
        It's wrong to add len to sector_nr in raid10 reshape twice
        ...
      11efae35
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-5.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs · 465c209d
      Linus Torvalds authored
      Pull NFS client bugfixes from Trond Myklebust:
       "Highlights include:
      
        Bugfixes:
         - Fix an Oops in SUNRPC back channel tracepoints
         - Fix a SUNRPC client regression when handling oversized replies
         - Fix the minimal size for SUNRPC reply buffer allocation
         - rpc_decode_header() must always return a non-zero value on error
         - Fix a typo in pnfs_update_layout()
      
        Cleanup:
         - Remove redundant check for the reply length in call_decode()"
      
      * tag 'nfs-for-5.1-2' of git://git.linux-nfs.org/projects/trondmy/linux-nfs:
        SUNRPC: Remove redundant check for the reply length in call_decode()
        SUNRPC: Handle the SYSTEM_ERR rpc error
        SUNRPC: rpc_decode_header() must always return a non-zero value on error
        SUNRPC: Use the ENOTCONN error on socket disconnect
        SUNRPC: Fix the minimal size for reply buffer allocation
        SUNRPC: Fix a client regression when handling oversized replies
        pNFS: Fix a typo in pnfs_update_layout
        fix null pointer deref in tracepoints in back channel
      465c209d
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · a9c55d58
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
       "One fix to prevent runtime allocation of 16GB pages when running in a
        VM (as opposed to bare metal), because it doesn't work.
      
        A small fix to our recently added KCOV support to exempt some more
        code from being instrumented.
      
        Plus a few minor build fixes, a small dead code removal and a
        defconfig update.
      
        Thanks to: Alexey Kardashevskiy, Aneesh Kumar K.V, Christophe Leroy,
        Jason Yan, Joel Stanley, Mahesh Salgaonkar, Mathieu Malaterre"
      
      * tag 'powerpc-5.1-2' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc/64s: Include <asm/nmi.h> header file to fix a warning
        powerpc/powernv: Fix compile without CONFIG_TRACEPOINTS
        powerpc/mm: Disable kcov for SLB routines
        powerpc: remove dead code in head_fsl_booke.S
        powerpc/configs: Sync skiroot defconfig
        powerpc/hugetlb: Don't do runtime allocation of 16G pages in LPAR configuration
      a9c55d58
    • Linus Torvalds's avatar
      Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 92497350
      Linus Torvalds authored
      Pull vfs mount infrastructure fix from Al Viro:
       "Fixup for sysfs braino.
      
        Capabilities checks for sysfs mount do include those on netns, but
        only if CONFIG_NET_NS is enabled. Sorry, should've caught that
        earlier..."
      
      * 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        fix sysfs_init_fs_context() in !CONFIG_NET_NS case
      92497350
    • Al Viro's avatar
      fix sysfs_init_fs_context() in !CONFIG_NET_NS case · ab81dabd
      Al Viro authored
      Permission checks on current's netns should be done only when
      netns are enabled.
      Reported-by: default avatarDominik Brodowski <linux@dominikbrodowski.net>
      Fixes: 23bf1b6bSigned-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      ab81dabd
    • Linus Torvalds's avatar
      Merge tag '5.1-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6 · 9c7dc824
      Linus Torvalds authored
      Pull more smb3 updates from Steve French:
       "Various tracing and debugging improvements, crediting fixes, some
        cleanup, and important fallocate fix (fixes three xfstests) and lock
        fix.
      
        Summary:
      
         - Various additional dynamic tracing tracepoints
      
         - Debugging improvements (including ability to query the server via
           SMB3 fsctl from userspace tools which can help with stats and
           debugging)
      
         - One minor performance improvement (root directory inode caching)
      
         - Crediting (SMB3 flow control) fixes
      
         - Some cleanup (docs and to mknod)
      
         - Important fixes: one to smb3 implementation of fallocate zero range
           (which fixes three xfstests) and a POSIX lock fix"
      
      * tag '5.1-rc-smb3' of git://git.samba.org/sfrench/cifs-2.6: (22 commits)
        CIFS: fix POSIX lock leak and invalid ptr deref
        SMB3: Allow SMB3 FSCTL queries to be sent to server from tools
        cifs: fix incorrect handling of smb2_set_sparse() return in smb3_simple_falloc
        smb2: fix typo in definition of a few error flags
        CIFS: make mknod() an smb_version_op
        cifs: minor documentation updates
        cifs: remove unused value pointed out by Coverity
        SMB3: passthru query info doesn't check for SMB3 FSCTL passthru
        smb3: add dynamic tracepoints for simple fallocate and zero range
        cifs: fix smb3_zero_range so it can expand the file-size when required
        cifs: add SMB2_ioctl_init/free helpers to be used with compounding
        smb3: Add dynamic trace points for various compounded smb3 ops
        cifs: cache FILE_ALL_INFO for the shared root handle
        smb3: display volume serial number for shares in /proc/fs/cifs/DebugData
        cifs: simplify how we handle credits in compound_send_recv()
        smb3: add dynamic tracepoint for timeout waiting for credits
        smb3: display security information in /proc/fs/cifs/DebugData more accurately
        cifs: add a timeout argument to wait_for_free_credits
        cifs: prevent starvation in wait_for_free_credits for multi-credit requests
        cifs: wait_for_free_credits() make it possible to wait for >=1 credits
        ...
      9c7dc824