Skip to content
Permalink
Qu-Wenruo/Intr…

Commits on Jan 3, 2020

  1. btrfs: statfs: Use virtual chunk allocation to calculation available …

    …data space
    
    Although btrfs_calc_avail_data_space() is trying to do an estimation
    on how many data chunks it can allocate, the estimation is far from
    perfect:
    
    - Metadata over-commit is not considered at all
    - Chunk allocation doesn't take RAID5/6 into consideration
    
    Although current per-profile available space itself is not able to
    handle metadata over-commit itself, the virtual chunk infrastructure can
    be re-used to address above problems.
    
    This patch will change btrfs_calc_avail_data_space() to do the following
    things:
    - Do metadata virtual chunk allocation first
      This is to address the over-commit behavior.
      If current metadata chunks have enough free space, we can completely
      skip this step.
    
    - Allocate data virtual chunks as many as possible
      Just like what we did in per-profile available space estimation.
      Here we only need to calculate one profile, since statfs() call is
      a relative cold path.
    
    Now statfs() should be able to report near perfect estimation on
    available data space, and can handle RAID5/6 better.
    
    Signed-off-by: Qu Wenruo <wqu@suse.com>
    adam900710 authored and 0day robot committed Jan 3, 2020
  2. btrfs: space-info: Use per-profile available space in can_overcommit()

    For the following disk layout, can_overcommit() can cause false
    confidence in available space:
    
      devid 1 unallocated:	1T
      devid 2 unallocated:	10T
      metadata type:	RAID1
    
    As can_overcommit() simply uses unallocated space with factor to
    calculate the allocatable metadata chunk size.
    
    can_overcommit() believes we still have 5.5T for metadata chunks, while
    the truth is, we only have 1T available for metadata chunks.
    This can lead to ENOSPC at run_delalloc_range() and cause transaction
    abort.
    
    Since factor based calculation can't distinguish RAID1/RAID10 and DUP at
    all, we need proper chunk-allocator level awareness to do such estimation.
    
    Thankfully, we have per-profile available space already calculated, just
    use that facility to avoid such false confidence.
    
    Reported-by: Marc Lehmann <schmorp@schmorp.de>
    Signed-off-by: Qu Wenruo <wqu@suse.com>
    adam900710 authored and 0day robot committed Jan 3, 2020
  3. btrfs: Update per-profile available space when device size/used space…

    … get updated
    
    There are 4 locations where device size or used space get updated:
    - Chunk allocation
    - Chunk removal
    - Device grow
    - Device shrink
    
    Now also update per-profile available space at those timings.
    
    For __btrfs_alloc_chunk() we can't acquire device_list_mutex as in
    btrfs_finish_chunk_alloc() we could hold device_list_mutex and cause
    dead lock.
    
    Signed-off-by: Qu Wenruo <wqu@suse.com>
    adam900710 authored and 0day robot committed Jan 3, 2020
  4. btrfs: Introduce per-profile available space facility

    [PROBLEM]
    There are some locations in btrfs requiring accurate estimation on how
    many new bytes can be allocated on unallocated space.
    
    We have two types of estimation:
    - Factor based calculation
      Just use all unallocated space, divide by the profile factor
      One obvious user is can_overcommit().
    
    - Chunk allocator like calculation
      This will emulate the chunk allocator behavior, to get a proper
      estimation.
      The only user is btrfs_calc_avail_data_space(), utilized by
      btrfs_statfs().
      The problem is, that function is not generic purposed enough, can't
      handle things like RAID5/6.
    
    Current factor based calculation can't handle the following case:
      devid 1 unallocated:	1T
      devid 2 unallocated:	10T
      metadata type:	RAID1
    
    If using factor, we can use (1T + 10T) / 2 = 5.5T free space for
    metadata.
    But in fact we can only get 1T free space, as we're limited by the
    smallest device for RAID1.
    
    [SOLUTION]
    This patch will introduce the skeleton of per-profile available space
    calculation, which can more-or-less get to the point of chunk allocator.
    
    The difference between it and chunk allocator is mostly on rounding and
    [0, 1M) reserved space handling, which shouldn't cause practical impact.
    
    The newly introduced per-profile available space calculation will
    calculate available space for each type, using chunk-allocator like
    calculation.
    
    With that facility, for above device layout we get the full available
    space array:
      RAID10:	0  (not enough devices)
      RAID1:	1T
      RAID1C3:	0  (not enough devices)
      RAID1C4:	0  (not enough devices)
      DUP:		5.5T
      RAID0:	2T
      SINGLE:	11T
      RAID5:	1T
      RAID6:	0  (not enough devices)
    
    Or for a more complex example:
      devid 1 unallocated:	1T
      devid 2 unallocated:  1T
      devid 3 unallocated:	10T
    
    We will get an array of:
      RAID10:	0  (not enough devices)
      RAID1:	2T
      RAID1C3:	1T
      RAID1C4:	0  (not enough devices)
      DUP:		6T
      RAID0:	3T
      SINGLE:	12T
      RAID5:	2T
      RAID6:	0  (not enough devices)
    
    And for the each profile , we go chunk allocator level calculation:
    The code code looks like:
    
      clear_virtual_used_space_of_all_rw_devices();
      do {
      	/*
      	 * The same as chunk allocator, despite used space,
      	 * we also take virtual used space into consideration.
      	 */
      	sort_device_with_virtual_free_space();
    
      	/*
      	 * Unlike chunk allocator, we don't need to bother hole/stripe
      	 * size, so we use the smallest device to make sure we can
      	 * allocated as many stripes as regular chunk allocator
      	 */
      	stripe_size = device_with_smallest_free->avail_space;
    	stripe_size = min(stripe_size, to_alloc / ndevs);
    
      	/*
      	 * Allocate a virtual chunk, allocated virtual chunk will
      	 * increase virtual used space, allow next iteration to
      	 * properly emulate chunk allocator behavior.
      	 */
      	ret = alloc_virtual_chunk(stripe_size, &allocated_size);
      	if (ret == 0)
      		avail += allocated_size;
      } while (ret == 0)
    
    As we always select the device with least free space (just like chunk
    allocator), for above 1T + 10T device, we will allocate a 1T virtual chunk
    in the first iteration, then run out of device in next iteration.
    
    Thus only get 1T free space for RAID1 type, just like what chunk
    allocator would do.
    
    This patch is just the skeleton, we only do the per-profile chunk
    calculation at mount time.
    
    Later commits will update per-profile available space at other proper
    timings.
    
    Suggested-by: Josef Bacik <josef@toxicpanda.com>
    Signed-off-by: Qu Wenruo <wqu@suse.com>
    adam900710 authored and 0day robot committed Jan 3, 2020

Commits on Dec 29, 2019

  1. Linux 5.5-rc4

    torvalds committed Dec 29, 2019
  2. Merge tag 'riscv/for-v5.5-rc4' of git://git.kernel.org/pub/scm/linux/…

    …kernel/git/riscv/linux
    
    Pull RISC-V fixes from Paul Walmsley:
     "One important fix for RISC-V:
    
       - Redirect any incoming syscall with an ID less than -1 to
         sys_ni_syscall, rather than allowing them to fall through into the
         syscall handler.
    
      and two minor build fixes:
    
       - Export __asm_copy_{from,to}_user() from where they are defined.
         This fixes a build error triggered by some randconfigs.
    
       - Export flush_icache_all(). I'd resisted this before, since
         historically we didn't want modules to be able to flush the I$
         directly; but apparently everyone else is doing it now"
    
    * tag 'riscv/for-v5.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
      riscv: export flush_icache_all to modules
      riscv: reject invalid syscalls below -1
      riscv: fix compile failure with EXPORT_SYMBOL() & !MMU
    torvalds committed Dec 29, 2019
  3. Merge tag 'locks-v5.5-1' of git://git.kernel.org/pub/scm/linux/kernel…

    …/git/jlayton/linux
    
    Pull /proc/locks formatting fix from Jeff Layton:
     "This is a trivial fix for a _very_ long standing bug in /proc/locks
      formatting. Ordinarily, I'd wait for the merge window for something
      like this, but it is making it difficult to validate some overlayfs
      fixes.
    
      I've also gone ahead and marked this for stable"
    
    * tag 'locks-v5.5-1' of git://git.kernel.org/pub/scm/linux/kernel/git/jlayton/linux:
      locks: print unsigned ino in /proc/locks
    torvalds committed Dec 29, 2019
  4. Merge tag '5.5-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6

    Pull cifs fixes from Steve French:
     "One performance fix for large directory searches, and one minor style
      cleanup noticed by Clang"
    
    * tag '5.5-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
      cifs: Optimize readdir on reparse points
      cifs: Adjust indentation in smb2_open_file
    torvalds committed Dec 29, 2019
  5. locks: print unsigned ino in /proc/locks

    An ino is unsigned, so display it as such in /proc/locks.
    
    Cc: stable@vger.kernel.org
    Signed-off-by: Amir Goldstein <amir73il@gmail.com>
    Signed-off-by: Jeff Layton <jlayton@kernel.org>
    amir73il authored and jtlayton committed Dec 29, 2019

Commits on Dec 28, 2019

  1. riscv: export flush_icache_all to modules

    This is needed by LKDTM (crash dump test module), it calls
    flush_icache_range(), which on RISC-V turns into flush_icache_all(). On
    other architectures, the actual implementation is exported, so follow
    that precedence and export it here too.
    
    Fixes build of CONFIG_LKDTM that fails with:
    ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!
    
    Signed-off-by: Olof Johansson <olof@lixom.net>
    Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
    olofj authored and paul-walmsley-sifive committed Dec 28, 2019
  2. riscv: reject invalid syscalls below -1

    Running "stress-ng --enosys 4 -t 20 -v" showed a large number of kernel oops
    with "Unable to handle kernel paging request at virtual address" message. This
    happens when enosys stressor starts testing random non-valid syscalls.
    
    I forgot to redirect any syscall below -1 to sys_ni_syscall.
    
    With the patch kernel oops messages are gone while running stress-ng enosys
    stressor.
    
    Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
    Fixes: 5340627 ("riscv: add support for SECCOMP and SECCOMP_FILTER")
    Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
    davidlt authored and paul-walmsley-sifive committed Dec 28, 2019
  3. riscv: fix compile failure with EXPORT_SYMBOL() & !MMU

    When support for !MMU was added, the declaration of
    __asm_copy_to_user() & __asm_copy_from_user() were #ifdefed
    out hence their EXPORT_SYMBOL() give an error message like:
      .../riscv_ksyms.c:13:15: error: '__asm_copy_to_user' undeclared here
      .../riscv_ksyms.c:14:15: error: '__asm_copy_from_user' undeclared here
    
    Since these symbols are not defined with !MMU it's wrong to export them.
    Same for __clear_user() (even though this one is also declared in
    include/asm-generic/uaccess.h and thus doesn't give an error message).
    
    Fix this by doing the EXPORT_SYMBOL() directly where these symbols
    are defined: inside lib/uaccess.S itself.
    
    Fixes: 6bd33e1 ("riscv: fix compile failure with EXPORT_SYMBOL() & !MMU")
    Reported-by: kbuild test robot <lkp@intel.com>
    Cc: Christoph Hellwig <hch@lst.de>
    Cc: Palmer Dabbelt <palmer@dabbelt.com>
    Cc: Paul Walmsley <paul.walmsley@sifive.com>
    Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
    Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
    lucvoo authored and paul-walmsley-sifive committed Dec 28, 2019
  4. Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…

    …it/jejb/scsi
    
    Pull SCSI fixes from James Bottomley:
     "Four fixes and one spelling update, all in drivers: two in lpfc and
      the rest in mp3sas, cxgbi and target"
    
    * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
      scsi: target/iblock: Fix protection error with blocks greater than 512B
      scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
      scsi: lpfc: fix spelling mistakes of asynchronous
      scsi: lpfc: fix build failure with DEBUGFS disabled
      scsi: mpt3sas: Fix double free in attach error handling
    torvalds committed Dec 28, 2019

Commits on Dec 27, 2019

  1. Merge tag 'drm-fixes-2019-12-28' of git://anongit.freedesktop.org/drm…

    …/drm
    
    Pull drm fixes from Dave Airlie:
     "Post-xmas food coma recovery fixes. Only three fixes for i915 since I
      expect most people are holidaying.
    
      i915:
       - power management rc6 fix
       - framebuffer tracking fix
       - display power management ratelimit fix"
    
    * tag 'drm-fixes-2019-12-28' of git://anongit.freedesktop.org/drm/drm:
      drm/i915: Hold reference to intel_frontbuffer as we track activity
      drm/i915/gt: Ratelimit display power w/a
      drm/i915/pmu: Ensure monotonic rc6
    torvalds committed Dec 27, 2019
  2. Merge tag 'linux-kselftest-5.5-rc4' of git://git.kernel.org/pub/scm/l…

    …inux/kernel/git/shuah/linux-kselftest
    
    Pull Kselftest fixes from Shuah Khan:
    
     - rseq build failures fixes related to glibc 2.30 compatibility from
       Mathieu Desnoyers
    
     - Kunit fixes and cleanups from SeongJae Park
    
     - Fixes to filesystems/epoll, firmware, and livepatch build failures
       and skip handling.
    
    * tag 'linux-kselftest-5.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
      rseq/selftests: Clarify rseq_prepare_unload() helper requirements
      rseq/selftests: Fix: Namespace gettid() for compatibility with glibc 2.30
      rseq/selftests: Turn off timeout setting
      kunit/kunit_tool_test: Test '--build_dir' option run
      kunit: Rename 'kunitconfig' to '.kunitconfig'
      kunit: Place 'test.log' under the 'build_dir'
      kunit: Create default config in '--build_dir'
      kunit: Remove duplicated defconfig creation
      docs/kunit/start: Use in-tree 'kunit_defconfig'
      selftests: livepatch: Fix it to do root uid check and skip
      selftests: firmware: Fix it to do root uid check and skip
      selftests: filesystems/epoll: fix build error
    torvalds committed Dec 27, 2019
  3. Merge tag 'pm-5.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/g…

    …it/rafael/linux-pm
    
    Pull power management fixes from Rafael Wysocki:
     "Fix compile test of the Tegra devfreq driver (Arnd Bergmann) and
      remove redundant Kconfig dependencies from multiple devfreq drivers
      (Leonard Crestez)"
    
    * tag 'pm-5.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
      PM / devfreq: tegra: Add COMMON_CLK dependency
      PM / devfreq: Drop explicit selection of PM_OPP
    torvalds committed Dec 27, 2019
  4. Merge tag 'io_uring-5.5-20191226' of git://git.kernel.dk/linux-block

    Pull io_uring fixes from Jens Axboe:
    
     - Removal of now unused busy wqe list (Hillf)
    
     - Add cond_resched() to io-wq work processing (Hillf)
    
     - And then the series that I hinted at from last week, which removes
       the sqe from the io_kiocb and keeps all sqe handling on the prep
       side. This guarantees that an opcode can't do the wrong thing and
       read the sqe more than once. This is unchanged from last week, no
       issues have been observed with this in testing. Hence I really think
       we should fold this into 5.5.
    
    * tag 'io_uring-5.5-20191226' of git://git.kernel.dk/linux-block:
      io-wq: add cond_resched() to worker thread
      io-wq: remove unused busy list from io_sqe
      io_uring: pass in 'sqe' to the prep handlers
      io_uring: standardize the prep methods
      io_uring: read 'count' for IORING_OP_TIMEOUT in prep handler
      io_uring: move all prep state for IORING_OP_{SEND,RECV}_MGS to prep handler
      io_uring: move all prep state for IORING_OP_CONNECT to prep handler
      io_uring: add and use struct io_rw for read/writes
      io_uring: use u64_to_user_ptr() consistently
    torvalds committed Dec 27, 2019
  5. Merge tag 'libata-5.5-20191226' of git://git.kernel.dk/linux-block

    Pull libata fixes from Jens Axboe:
     "Two things in here:
    
       - First half of a series that fixes ahci_brcm, also marked for
         stable. The other part of the series is going into 5.6 (Florian)
    
       - sata_nv regression fix that is also marked for stable (Sascha)"
    
    * tag 'libata-5.5-20191226' of git://git.kernel.dk/linux-block:
      ata: ahci_brcm: Add missing clock management during recovery
      ata: ahci_brcm: BCM7425 AHCI requires AHCI_HFLAG_DELAY_ENGINE
      ata: ahci_brcm: Fix AHCI resources management
      ata: libahci_platform: Export again ahci_platform_<en/dis>able_phys()
      libata: Fix retrieving of active qcs
    torvalds committed Dec 27, 2019
  6. Merge tag 'block-5.5-20191226' of git://git.kernel.dk/linux-block

    Pull block fixes from Jens Axboe:
     "Only thing here are the changes from Arnd from last week, which now
      have the appropriate header include to ensure they actually compile if
      COMPAT is enabled"
    
    * tag 'block-5.5-20191226' of git://git.kernel.dk/linux-block:
      compat_ioctl: block: handle Persistent Reservations
      compat_ioctl: block: handle add zone open, close and finish ioctl
      compat_ioctl: block: handle BLKGETZONESZ/BLKGETNRZONES
      compat_ioctl: block: handle BLKREPORTZONE/BLKRESETZONE
      pktcdvd: fix regression on 64-bit architectures
    torvalds committed Dec 27, 2019
  7. Merge tag 'gpio-v5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/…

    …git/linusw/linux-gpio
    
    Pull GPIO fixes from Linus Walleij:
     "A set of fixes for the v5.5 series:
    
       - Fix the build for the Xtensa driver.
    
       - Make sure to set up the parent device for mpc8xxx.
    
       - Clarify the look-up error message.
    
       - Fix the usage of the line direction in the mockup device.
    
       - Fix a type warning on the Aspeed driver.
    
       - Remove the pointless __exit annotation on the xgs-iproc which is
         causing a compilation problem.
    
       - Fix up emultation of open drain outputs .get_direction()
    
       - Fix the IRQ callbacks on the PCA953xx to use bitops and work
         properly.
    
       - Fix the Kconfig on the Tegra driver"
    
    * tag 'gpio-v5.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
      gpio: tegra186: Allow building on Tegra194-only configurations
      gpio: pca953x: Switch to bitops in IRQ callbacks
      gpiolib: fix up emulated open drain outputs
      MAINTAINERS: Append missed file to the database
      gpio: xgs-iproc: remove __exit annotation for iproc_gpio_remove
      gpio: aspeed: avoid return type warning
      gpio: mockup: Fix usage of new GPIO_LINE_DIRECTION
      gpio: Fix error message on out-of-range GPIO in lookup table
      gpio: mpc8xxx: Add platform device to gpiochip->parent
      gpio: xtensa: fix driver build
    torvalds committed Dec 27, 2019
  8. Merge tag 'drm-intel-fixes-2019-12-23' of git://anongit.freedesktop.o…

    …rg/drm/drm-intel into drm-fixes
    
    i915 power and frontbuffer tracking fixes
    
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    
    From: Jani Nikula <jani.nikula@intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/87r20vdlrs.fsf@intel.com
    airlied committed Dec 27, 2019

Commits on Dec 26, 2019

  1. ata: ahci_brcm: Add missing clock management during recovery

    The downstream implementation of ahci_brcm.c did contain clock
    management recovery, but until recently, did that outside of the
    libahci_platform helpers and this was unintentionally stripped out while
    forward porting the patch upstream.
    
    Add the missing clock management during recovery and sleep for 10
    milliseconds per the design team recommendations to ensure the SATA PHY
    controller and AFE have been fully quiesced.
    
    Fixes: eb73390 ("ata: ahci_brcm: Recover from failures to identify devices")
    Cc: stable@vger.kernel.org
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    ffainelli authored and axboe committed Dec 26, 2019
  2. ata: ahci_brcm: BCM7425 AHCI requires AHCI_HFLAG_DELAY_ENGINE

    Set AHCI_HFLAG_DELAY_ENGINE for the BCM7425 AHCI controller thus making
    it conforming to the 'strict' AHCI implementation which this controller
    is based on.
    
    This solves long link establishment with specific hard drives (e.g.:
    Seagate ST1000VM002-9ZL1 SC12) that would otherwise have to complete the
    error recovery handling before finally establishing a succesful SATA
    link at the desired speed.
    
    We re-order the hpriv->flags assignment to also remove the NONCQ quirk
    since we can set the flag directly.
    
    Fixes: 9586114cf1e9 ("ata: ahci_brcmstb: add support MIPS-based platforms")
    Fixes: 423be77daabe ("ata: ahci_brcmstb: add quirk for broken ncq")
    Cc: stable@vger.kernel.org
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    ffainelli authored and axboe committed Dec 26, 2019
  3. ata: ahci_brcm: Fix AHCI resources management

    The AHCI resources management within ahci_brcm.c is a little
    convoluted, largely because it historically had a dedicated clock that
    was managed within this file in the downstream tree. Once brough
    upstream though, the clock was left to be managed by libahci_platform.c
    which is entirely appropriate.
    
    This patch series ensures that the AHCI resources are fetched and
    enabled before any register access is done, thus avoiding bus errors on
    platforms which clock gate the controller by default.
    
    As a result we need to re-arrange the suspend() and resume() functions
    in order to avoid accessing registers after the clocks have been turned
    off respectively before the clocks have been turned on. Finally, we can
    refactor brcm_ahci_get_portmask() in order to fetch the number of ports
    from hpriv->mmio which is now accessible without jumping through hoops
    like we used to do.
    
    The commit pointed in the Fixes tag is both old and new enough not to
    require major headaches for backporting of this patch.
    
    Fixes: eba68f8 ("ata: ahci_brcmstb: rename to support across Broadcom SoC's")
    Cc: stable@vger.kernel.org
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    ffainelli authored and axboe committed Dec 26, 2019
  4. ata: libahci_platform: Export again ahci_platform_<en/dis>able_phys()

    This reverts commit 6bb86fe
    ("libahci_platform: Staticize ahci_platform_<en/dis>able_phys()") we are
    going to need ahci_platform_{enable,disable}_phys() in a subsequent
    commit for ahci_brcm.c in order to properly control the PHY
    initialization order.
    
    Also make sure the function prototypes are declared in
    include/linux/ahci_platform.h as a result.
    
    Cc: stable@vger.kernel.org
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    ffainelli authored and axboe committed Dec 26, 2019
  5. libata: Fix retrieving of active qcs

    ata_qc_complete_multiple() is called with a mask of the still active
    tags.
    
    mv_sata doesn't have this information directly and instead calculates
    the still active tags from the started tags (ap->qc_active) and the
    finished tags as (ap->qc_active ^ done_mask)
    
    Since 28361c4 the hw_tag and tag are no longer the same and the
    equation is no longer valid. In ata_exec_internal_sg() ap->qc_active is
    initialized as 1ULL << ATA_TAG_INTERNAL, but in hardware tag 0 is
    started and this will be in done_mask on completion. ap->qc_active ^
    done_mask becomes 0x100000000 ^ 0x1 = 0x100000001 and thus tag 0 used as
    the internal tag will never be reported as completed.
    
    This is fixed by introducing ata_qc_get_active() which returns the
    active hardware tags and calling it where appropriate.
    
    This is tested on mv_sata, but sata_fsl and sata_nv suffer from the same
    problem. There is another case in sata_nv that most likely needs fixing
    as well, but this looks a little different, so I wasn't confident enough
    to change that.
    
    Fixes: 28361c4 ("libata: add extra internal command")
    Cc: stable@vger.kernel.org
    Tested-by: Pali Rohár <pali.rohar@gmail.com>
    Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
    
    Add missing export of ata_qc_get_active(), as per Pali.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    saschahauer authored and axboe committed Dec 26, 2019

Commits on Dec 25, 2019

  1. Merge tag 'devfreq-fixes-for-5.5-rc4' of git://git.kernel.org/pub/scm…

    …/linux/kernel/git/chanwoo/linux
    
    Pull devfreq fixes for 5.5-rc4 from Chanwoo Choi:
    
    "1. Fix the build error of tegra*-devfreq.c when COMPILE_TEST is enabled.
     2. Drop unneeded PM_OPP dependency from each driver in Kconfig."
    
    * tag 'devfreq-fixes-for-5.5-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/linux:
      PM / devfreq: tegra: Add COMMON_CLK dependency
      PM / devfreq: Drop explicit selection of PM_OPP
    Rafael J. Wysocki
    Rafael J. Wysocki committed Dec 25, 2019

Commits on Dec 24, 2019

  1. io-wq: add cond_resched() to worker thread

    Reschedule the current IO worker to cut the risk that it is becoming
    a cpu hog.
    
    Signed-off-by: Hillf Danton <hdanton@sina.com>
    Signed-off-by: Jens Axboe <axboe@kernel.dk>
    Hillf Danton authored and axboe committed Dec 24, 2019

Commits on Dec 23, 2019

  1. rseq/selftests: Clarify rseq_prepare_unload() helper requirements

    The rseq.h UAPI now documents that the rseq_cs field must be cleared
    before reclaiming memory that contains the targeted struct rseq_cs, but
    also that the rseq_cs field must be cleared before reclaiming memory of
    the code pointed to by the rseq_cs start_ip and post_commit_offset
    fields.
    
    While we can expect that use of dlclose(3) will typically unmap
    both struct rseq_cs and its associated code at once, nothing would
    theoretically prevent a JIT from reclaiming the code without
    reclaiming the struct rseq_cs, which would erroneously allow the
    kernel to consider new code which is not a rseq critical section
    as a rseq critical section following a code reclaim.
    
    Suggested-by: Florian Weimer <fw@deneb.enyo.de>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Florian Weimer <fw@deneb.enyo.de>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>
    Cc: Boqun Feng <boqun.feng@gmail.com>
    Cc: "H . Peter Anvin" <hpa@zytor.com>
    Cc: Paul Turner <pjt@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    compudj authored and Shuah Khan committed Dec 23, 2019
  2. rseq/selftests: Fix: Namespace gettid() for compatibility with glibc …

    …2.30
    
    glibc 2.30 introduces gettid() in public headers, which clashes with
    the internal static definition within rseq selftests.
    
    Rename gettid() to rseq_gettid() to eliminate this symbol name clash.
    
    Reported-by: Tommi T. Rantala <tommi.t.rantala@nokia.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Tommi T. Rantala <tommi.t.rantala@nokia.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>
    Cc: Boqun Feng <boqun.feng@gmail.com>
    Cc: "H . Peter Anvin" <hpa@zytor.com>
    Cc: Paul Turner <pjt@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Cc: <stable@vger.kernel.org>	# v4.18+
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    compudj authored and Shuah Khan committed Dec 23, 2019
  3. rseq/selftests: Turn off timeout setting

    As the rseq selftests can run for a long period of time, disable the
    timeout that the general selftests have.
    
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
    Cc: Shuah Khan <skhan@linuxfoundation.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
    Cc: "Paul E. McKenney" <paulmck@linux.ibm.com>
    Cc: Boqun Feng <boqun.feng@gmail.com>
    Cc: "H . Peter Anvin" <hpa@zytor.com>
    Cc: Paul Turner <pjt@google.com>
    Cc: Dmitry Vyukov <dvyukov@google.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    compudj authored and Shuah Khan committed Dec 23, 2019
  4. kunit/kunit_tool_test: Test '--build_dir' option run

    This commit adds kunit tool test for the '--build_dir' option.
    
    Signed-off-by: SeongJae Park <sjpark@amazon.de>
    Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
    Tested-by: Brendan Higgins <brendanhiggins@google.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    SeongJae Park Shuah Khan
    SeongJae Park authored and Shuah Khan committed Dec 23, 2019
  5. kunit: Rename 'kunitconfig' to '.kunitconfig'

    This commit renames 'kunitconfig' to '.kunitconfig' so that it can be
    automatically ignored by git and do not disturb people who want to type
    'kernel/' by pressing only the 'k' and then 'tab' key.
    
    Signed-off-by: SeongJae Park <sjpark@amazon.de>
    Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
    Tested-by: Brendan Higgins <brendanhiggins@google.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    SeongJae Park Shuah Khan
    SeongJae Park authored and Shuah Khan committed Dec 23, 2019
  6. kunit: Place 'test.log' under the 'build_dir'

    'kunit' writes the 'test.log' under the kernel source directory even
    though a 'build_dir' option is given.  As users who use the option might
    expect the outputs to be placed under the specified directory, this
    commit modifies the logic to write the log file under the 'build_dir'.
    
    Signed-off-by: SeongJae Park <sjpark@amazon.de>
    Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
    Tested-by: Brendan Higgins <brendanhiggins@google.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    SeongJae Park Shuah Khan
    SeongJae Park authored and Shuah Khan committed Dec 23, 2019
  7. kunit: Create default config in '--build_dir'

    If both '--build_dir' and '--defconfig' are given, the handling of
    '--defconfig' ignores '--build_dir' option.  This commit modifies the
    behavior to respect '--build_dir' option.
    
    Reported-by: Brendan Higgins <brendanhiggins@google.com>
    Suggested-by: Brendan Higgins <brendanhiggins@google.com>
    Signed-off-by: SeongJae Park <sjpark@amazon.de>
    Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
    Tested-by: Brendan Higgins <brendanhiggins@google.com>
    Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
    SeongJae Park Shuah Khan
    SeongJae Park authored and Shuah Khan committed Dec 23, 2019
Older
You can’t perform that action at this time.