1. 03 6月, 2019 3 次提交
    • N
      dma-contiguous: use fallback alloc_pages for single pages · bd2e7563
      Nicolin Chen 提交于
      The addresses within a single page are always contiguous, so it's
      not so necessary to always allocate one single page from CMA area.
      Since the CMA area has a limited predefined size of space, it may
      run out of space in heavy use cases, where there might be quite a
      lot CMA pages being allocated for single pages.
      
      However, there is also a concern that a device might care where a
      page comes from -- it might expect the page from CMA area and act
      differently if the page doesn't.
      
      This patch tries to use the fallback alloc_pages path, instead of
      one-page size allocations from the global CMA area in case that a
      device does not have its own CMA area. This'd save resources from
      the CMA global area for more CMA allocations, and also reduce CMA
      fragmentations resulted from trivial allocations.
      Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Tested-by: Ndann frazier <dann.frazier@canonical.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      bd2e7563
    • N
      dma-contiguous: add dma_{alloc,free}_contiguous() helpers · b1d2dc00
      Nicolin Chen 提交于
      Both dma_alloc_from_contiguous() and dma_release_from_contiguous() are
      very simply implemented, but requiring callers to pass certain
      parameters like count and align, and taking a boolean parameter to check
      __GFP_NOWARN in the allocation flags. So every function call duplicates
      similar work:
      
      	unsigned long order = get_order(size);
      	size_t count = size >> PAGE_SHIFT;
      
      	page = dma_alloc_from_contiguous(dev, count, order,
      			gfp & __GFP_NOWARN);
      
      	[...]
      
      	dma_release_from_contiguous(dev, page, size >> PAGE_SHIFT);
      
      Additionally, as CMA can be used only in the context which permits
      sleeping, most of callers do a gfpflags_allow_blocking() check and a
      corresponding fallback allocation of normal pages upon any false result:
      
      	if (gfpflags_allow_blocking(flag))
      		page = dma_alloc_from_contiguous();
      	if (!page)
      		page = alloc_pages();
      
      	[...]
      
      	if (!dma_release_from_contiguous(dev, page, count))
      		__free_pages(page, get_order(size));
      
      So this patch simplifies those function calls by abstracting these
      operations into the two new functions: dma_{alloc,free}_contiguous.
      
      As some callers of dma_{alloc,release}_from_contiguous() might be
      complicated, this patch just implements these two new functions to
      kernel/dma/direct.c only as an initial step.
      Suggested-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NNicolin Chen <nicoleotsuka@gmail.com>
      Tested-by: Ndann frazier <dann.frazier@canonical.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      b1d2dc00
    • N
      iommu/dma: Fix condition check in iommu_dma_unmap_sg · 1b961423
      Nathan Chancellor 提交于
      Clang warns:
      
      drivers/iommu/dma-iommu.c:897:6: warning: logical not is only applied to
      the left hand side of this comparison [-Wlogical-not-parentheses]
              if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
                  ^                                 ~~
      drivers/iommu/dma-iommu.c:897:6: note: add parentheses after the '!' to
      evaluate the comparison first
              if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
                  ^
                   (                                    )
      drivers/iommu/dma-iommu.c:897:6: note: add parentheses around left hand
      side expression to silence this warning
              if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
                  ^
                  (                                )
      1 warning generated.
      
      Judging from the rest of the commit and the conditional in
      iommu_dma_map_sg, either
      
          if (!(attrs & DMA_ATTR_SKIP_CPU_SYNC))
      
      or
          if ((attrs & DMA_ATTR_SKIP_CPU_SYNC) == 0)
      
      was intended, not a combination of the two.
      
      I personally think that the former is easier to understand so use that.
      
      Fixes: 06d60728 ("iommu/dma: move the arm64 wrappers to common code")
      Link: https://github.com/ClangBuiltLinux/linux/issues/497Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJoerg Roedel <jroedel@suse.de>
      1b961423
  2. 27 5月, 2019 26 次提交
  3. 26 5月, 2019 6 次提交
  4. 25 5月, 2019 5 次提交
    • G
      ext4: fix dcache lookup of !casefolded directories · 66883da1
      Gabriel Krisman Bertazi 提交于
      Found by visual inspection, this wasn't caught by my xfstest, since it's
      effect is ignoring positive dentries in the cache the fallback just goes
      to the disk.  it was introduced in the last iteration of the
      case-insensitive patch.
      
      d_compare should return 0 when the entries match, so make sure we are
      correctly comparing the entire string if the encoding feature is set and
      we are on a case-INsensitive directory.
      
      Fixes: b886ee3e ("ext4: Support case-insensitive file name lookups")
      Signed-off-by: NGabriel Krisman Bertazi <krisman@collabora.com>
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      66883da1
    • L
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 2409207a
      Linus Torvalds 提交于
      Pull SCSI fixes from James Bottomley:
       "This is the same set of patches sent in the merge window as the final
        pull except that Martin's read only rework is replaced with a simple
        revert of the original change that caused the regression.
      
        Everything else is an obvious fix or small cleanup"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        Revert "scsi: sd: Keep disk read-only when re-reading partition"
        scsi: bnx2fc: fix incorrect cast to u64 on shift operation
        scsi: smartpqi: Reporting unhandled SCSI errors
        scsi: myrs: Fix uninitialized variable
        scsi: lpfc: Update lpfc version to 12.2.0.2
        scsi: lpfc: add check for loss of ndlp when sending RRQ
        scsi: lpfc: correct rcu unlock issue in lpfc_nvme_info_show
        scsi: lpfc: resolve lockdep warnings
        scsi: qedi: remove set but not used variables 'cdev' and 'udev'
        scsi: qedi: remove memset/memcpy to nfunc and use func instead
        scsi: qla2xxx: Add cleanup for PCI EEH recovery
      2409207a
    • L
      Merge tag 'for-linus-20190524' of git://git.kernel.dk/linux-block · 7fbc78e3
      Linus Torvalds 提交于
      Pull block fixes from Jens Axboe:
      
       - NVMe pull request from Keith, with fixes from a few folks.
      
       - bio and sbitmap before atomic barrier fixes (Andrea)
      
       - Hang fix for blk-mq freeze and unfreeze (Bob)
      
       - Single segment count regression fix (Christoph)
      
       - AoE now has a new maintainer
      
       - tools/io_uring/ Makefile fix, and sync with liburing (me)
      
      * tag 'for-linus-20190524' of git://git.kernel.dk/linux-block: (23 commits)
        tools/io_uring: sync with liburing
        tools/io_uring: fix Makefile for pthread library link
        blk-mq: fix hang caused by freeze/unfreeze sequence
        block: remove the bi_seg_{front,back}_size fields in struct bio
        block: remove the segment size check in bio_will_gap
        block: force an unlimited segment size on queues with a virt boundary
        block: don't decrement nr_phys_segments for physically contigous segments
        sbitmap: fix improper use of smp_mb__before_atomic()
        bio: fix improper use of smp_mb__before_atomic()
        aoe: list new maintainer for aoe driver
        nvme-pci: use blk-mq mapping for unmanaged irqs
        nvme: update MAINTAINERS
        nvme: copy MTFA field from identify controller
        nvme: fix memory leak for power latency tolerance
        nvme: release namespace SRCU protection before performing controller ioctls
        nvme: merge nvme_ns_ioctl into nvme_ioctl
        nvme: remove the ifdef around nvme_nvm_ioctl
        nvme: fix srcu locking on error return in nvme_get_ns_from_disk
        nvme: Fix known effects
        nvme-pci: Sync queues on reset
        ...
      7fbc78e3
    • L
      Merge tag 'linux-kselftest-5.2-rc2' of... · 7f8b40e3
      Linus Torvalds 提交于
      Merge tag 'linux-kselftest-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull Kselftest fixes from Shuah Khan:
      
       - Two fixes to regressions introduced in kselftest Makefile test run
         output refactoring work (Kees Cook)
      
       - Adding Atom support to syscall_arg_fault test (Tong Bo)
      
      * tag 'linux-kselftest-5.2-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests/timers: Add missing fflush(stdout) calls
        selftests: Remove forced unbuffering for test running
        selftests/x86: Support Atom for syscall_arg_fault test
      7f8b40e3
    • L
      Merge tag 'devicetree-fixes-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · e7bd3e24
      Linus Torvalds 提交于
      Pull Devicetree fixes from Rob Herring:
      
       - Update checkpatch.pl to use DT vendor-prefixes.yaml
      
       - Fix DT binding references to files converted to DT schema
      
       - Clean-up Arm CPU binding examples to match schema
      
       - Add Sifive block versioning scheme documentation
      
       - Pass binding directory base to validation tools for reference lookups
      
      * tag 'devicetree-fixes-for-5.2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        checkpatch.pl: Update DT vendor prefix check
        dt: bindings: mtd: replace references to nand.txt with nand-controller.yaml
        dt-bindings: interrupt-controller: arm,gic: Fix schema errors in example
        dt-bindings: arm: Clean up CPU binding examples
        dt: fix refs that were renamed to json with the same file name
        dt-bindings: Pass binding directory to validation tools
        dt-bindings: sifive: describe sifive-blocks versioning
      e7bd3e24