1. 14 9月, 2017 7 次提交
  2. 12 9月, 2017 13 次提交
    • D
      pinctrl/amd: save pin registers over suspend/resume · 79d2c8be
      Daniel Drake 提交于
      The touchpad in the Asus laptop models X505BA/BP and X542BA/BP is
      unresponsive after suspend/resume. The following error appears during
      resume:
      
        i2c_hid i2c-ELAN1300:00: failed to reset device.
      
      The problem here is that i2c_hid does not notice the interrupt being
      generated at this point, because the GPIO is no longer configured
      for interrupts.
      
      Fix this by saving pinctrl-amd pin registers during suspend and
      restoring them at resume time.
      
      Based on code from pinctrl-intel.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NDaniel Drake <drake@endlessm.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      79d2c8be
    • G
      pinctrl: armada-37xx: Fix gpio interrupt setup · a9a1a483
      Gregory CLEMENT 提交于
      Since commit dc749a09 ("gpiolib: allow gpio irqchip to map irqs
      dynamically"), the irqs for gpio are not statically allocated during in
      gpiochip_irqchip_add.
      
      This driver was based on this assumption for initializing the mask
      associated to each interrupt this led to a NULL pointer crash in the
      kernel:
      
      Unable to handle kernel NULL pointer dereference at virtual address 00000000
      Mem abort info:
        Exception class = DABT (current EL), IL = 32 bits
        SET = 0, FnV = 0
        EA = 0, S1PTW = 0
      Data abort info:
        ISV = 0, ISS = 0x00000068
        CM = 0, WnR = 1
      [0000000000000000] user address but active_mm is swapper
      Internal error: Oops: 96000044 [#1] PREEMPT SMP
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.13.0-06657-g3b9f8ed2 #576
      Hardware name: Marvell Armada 3720 Development Board DB-88F3720-DDR3 (DT)
      task: ffff80001d908000 task.stack: ffff000008068000
      PC is at armada_37xx_pinctrl_probe+0x5f8/0x670
      LR is at armada_37xx_pinctrl_probe+0x5e8/0x670
      pc : [<ffff000008e25cdc>] lr : [<ffff000008e25ccc>] pstate: 60000045
      sp : ffff00000806bb80
      x29: ffff00000806bb80 x28: 0000000000000024
      x27: 000000000000000c x26: 0000000000000001
      x25: ffff80001efee760 x24: 0000000000000000
      x23: ffff80001db6f570 x22: ffff80001db6f438
      x21: 0000000000000000 x20: ffff80001d9f4810
      x19: ffff80001db6f418 x18: 0000000000000000
      x17: 0000000000000001 x16: 0000000000000019
      x15: ffffffffffffffff x14: 0140000000000000
      x13: 0000000000000000 x12: 0000000000000030
      x11: 0101010101010101 x10: 0000000000000040
      x9 : ffff000009923580 x8 : ffff80001d400248
      x7 : ffff80001d400270 x6 : 0000000000000000
      x5 : ffff80001d400248 x4 : ffff80001d400270
      x3 : 0000000000000000 x2 : 0000000000000001
      x1 : 0000000000000001 x0 : 0000000000000000
      Process swapper/0 (pid: 1, stack limit = 0xffff000008068000)
      Call trace:
      Exception stack(0xffff00000806ba40 to 0xffff00000806bb80)
      ba40: 0000000000000000 0000000000000001 0000000000000001 0000000000000000
      ba60: ffff80001d400270 ffff80001d400248 0000000000000000 ffff80001d400270
      ba80: ffff80001d400248 ffff000009923580 0000000000000040 0101010101010101
      baa0: 0000000000000030 0000000000000000 0140000000000000 ffffffffffffffff
      bac0: 0000000000000019 0000000000000001 0000000000000000 ffff80001db6f418
      bae0: ffff80001d9f4810 0000000000000000 ffff80001db6f438 ffff80001db6f570
      bb00: 0000000000000000 ffff80001efee760 0000000000000001 000000000000000c
      bb20: 0000000000000024 ffff00000806bb80 ffff000008e25ccc ffff00000806bb80
      bb40: ffff000008e25cdc 0000000060000045 ffff00000806bb60 ffff0000081189b8
      bb60: ffffffffffffffff ffff00000811cf1c ffff00000806bb80 ffff000008e25cdc
      [<ffff000008e25cdc>] armada_37xx_pinctrl_probe+0x5f8/0x670
      [<ffff00000859d8c8>] platform_drv_probe+0x58/0xb8
      [<ffff00000859bb44>] driver_probe_device+0x22c/0x2d8
      [<ffff00000859bcac>] __driver_attach+0xbc/0xc0
      [<ffff000008599c84>] bus_for_each_dev+0x4c/0x98
      [<ffff00000859b440>] driver_attach+0x20/0x28
      [<ffff00000859af90>] bus_add_driver+0x1b8/0x228
      [<ffff00000859c648>] driver_register+0x60/0xf8
      [<ffff00000859df64>] __platform_driver_probe+0x74/0x130
      [<ffff000008e256dc>] armada_37xx_pinctrl_driver_init+0x20/0x28
      [<ffff000008083980>] do_one_initcall+0x38/0x128
      [<ffff000008e00cf4>] kernel_init_freeable+0x188/0x22c
      [<ffff0000089b56e8>] kernel_init+0x10/0x100
      [<ffff000008084bb0>] ret_from_fork+0x10/0x18
      Code: f9403fa2 12001341 1100075a 9ac12041 (b9000001)
      ---[ end trace 8b0f4e05e1603208 ]---
      
      This patch moves the initialization of the mask field in the irq_startup
      function. However some callbacks such as irq_set_type and irq_set_wake
      could be called before irq_startup. For those functions the mask is
      computed at each call which is not a issue as these functions are not
      located in a hot path but are used sporadically for configuration.
      
      Fixes: dc749a09 ("gpiolib: allow gpio irqchip to map irqs
      dynamically")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      a9a1a483
    • D
      pinctrl: sprd: fix off by one bugs · 4ce504c4
      Dan Carpenter 提交于
      info->groups[] has info->ngroups elements so these comparisons should be
      >= instead of >.
      
      Fixes: 41d32cfc ("pinctrl: sprd: Add Spreadtrum pin control driver")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NBaolin Wang <baolin.wang@spreadtrum.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      4ce504c4
    • D
      pinctrl: sprd: check for allocation failure · 41470c37
      Dan Carpenter 提交于
      devm_pinctrl_get() could fail with ERR_PTR(-ENOMEM) so I have added a
      check for that.  I also reversed the other IS_ERR() test because it was
      a little confusing to test one way and then the opposite a couple lines
      later.
      
      Fixes: 41d32cfc ("pinctrl: sprd: Add Spreadtrum pin control driver")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      41470c37
    • G
      pinctrl: sprd: Restrict PINCTRL_SPRD to ARCH_SPRD or COMPILE_TEST · baec7e68
      Geert Uytterhoeven 提交于
      The Spreadtrum pinctrl drivers are only useful when building for a
      Spreadtrum platform.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      baec7e68
    • R
      pinctrl: sprd: fix build errors and dependencies · aaab90bb
      Randy Dunlap 提交于
      Fix build errors when CONFIG_OF is not enabled.
      Also, the pinctrl-sprd-sc9860 driver uses functions from the pinctrl-sprd
      driver, so the former should depend on the latter driver.
      
      ../drivers/pinctrl/sprd/pinctrl-sprd.c: In function 'sprd_dt_node_to_map':
      ../drivers/pinctrl/sprd/pinctrl-sprd.c:290:2: error: implicit declaration of function 'pinconf_generic_parse_dt_config' [-Werror=implicit-function-declaration]
        ret = pinconf_generic_parse_dt_config(np, pctldev, &configs,
        ^
      ../drivers/pinctrl/sprd/pinctrl-sprd.c: At top level:
      ../drivers/pinctrl/sprd/pinctrl-sprd.c:844:44: error: array type has incomplete element type
       static const struct pinconf_generic_params sprd_dt_params[] = {
                                                  ^
      Signed-off-by: NRandy Dunlap <rdunlap@infradead.org>
      Cc: Baolin Wang <baolin.wang@spreadtrum.com>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: linux-gpio@vger.kernel.org
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      aaab90bb
    • C
      pinctrl: sprd: make three local functions static · 045b5792
      Colin Ian King 提交于
      The functions sprd_pmx_get_function_count, sprd_pmx_get_function_name
      and sprd_pmx_get_function_groups are local to the source and do not
      need to be in global scope, so make them static.
      
      Cleans up sparse warnings:
      "symbol 'sprd_pmx_get_function_count' was not declared. Should it be
      static?"
      "symbol 'sprd_pmx_get_function_name' was not declared. Should it be
      static?"
      "symbol 'sprd_pmx_get_function_groups' was not declared. Should it be
      static?"
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      045b5792
    • M
      pinctrl: uniphier: include <linux/build_bug.h> instead of <linux/bug.h> · 6d363bd1
      Masahiro Yamada 提交于
      The #includes <linux/bug.h> is here to use BUILD_BUG_ON_ZERO().
      
      Thanks to commit bc6245e5 ("bug: split BUILD_BUG stuff out into
      <linux/build_bug.h>"), it is now possible to reduce the number of
      headers pulled in.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      6d363bd1
    • C
      nvme-pci: implement the HMB entry number and size limitations · 044a9df1
      Christoph Hellwig 提交于
      Adds support for the new Host Memory Buffer Minimum Descriptor Entry Size
      and Host Memory Maximum Descriptors Entries field that were added in
      TP 4002 HMB Enhancements.  These allow the controller to advertise
      limits for the usual number of segments in the host memory buffer, as
      well as a minimum usable per-segment size.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      044a9df1
    • C
      nvme-pci: propagate (some) errors from host memory buffer setup · 9620cfba
      Christoph Hellwig 提交于
      We want to catch command execution errors when resetting the device, so
      propagate errors from the Set Features when setting up the host memory
      buffer.  We keep ignoring memory allocation failures, as the spec
      clearly says that the controller must work without a host memory buffer.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Cc: stable@vger.kernel.org
      9620cfba
    • A
      nvme-pci: use appropriate initial chunk size for HMB allocation · 30f92d62
      Akinobu Mita 提交于
      The initial chunk size for host memory buffer allocation is currently
      PAGE_SIZE << MAX_ORDER.  MAX_ORDER order allocation is usually failed
      without CONFIG_DMA_CMA.  So the HMB allocation is retried with chunk size
      PAGE_SIZE << (MAX_ORDER - 1) in general, but there is no problem if the
      retry allocation works correctly.
      Signed-off-by: NAkinobu Mita <akinobu.mita@gmail.com>
      [hch: rebased]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Cc: stable@vger.kernel.org
      30f92d62
    • C
      nvme-pci: fix host memory buffer allocation fallback · 92dc6895
      Christoph Hellwig 提交于
      nvme_alloc_host_mem currently contains two loops that are interwinded,
      and the outer retry loop turns out to be broken.  Fix this by untangling
      the two.
      
      Based on a report an initial patch from Akinobu Mita.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reported-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Tested-by: NAkinobu Mita <akinobu.mita@gmail.com>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Cc: stable@vger.kernel.org
      92dc6895
    • C
      nvme: fix lightnvm check · 608cc4b1
      Christoph Hellwig 提交于
      nvme_nvm_ns_supported assumes every device is a pci_dev, which leads to
      reading an incorrect field, or possible even a dereference of unallocated
      memory for fabrics controllers.
      
      Fix this by introducing a quirk for lighnvm capable devices instead.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NMatias Bjørling <mb@lightnvm.io>
      Reviewed-by: NKeith Busch <keith.busch@intel.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      608cc4b1
  3. 11 9月, 2017 7 次提交
    • M
      dax: remove the pmem_dax_ops->flush abstraction · c3ca015f
      Mikulas Patocka 提交于
      Commit abebfbe2 ("dm: add ->flush() dax operation support") is
      buggy. A DM device may be composed of multiple underlying devices and
      all of them need to be flushed. That commit just routes the flush
      request to the first device and ignores the other devices.
      
      It could be fixed by adding more complex logic to the device mapper. But
      there is only one implementation of the method pmem_dax_ops->flush - that
      is pmem_dax_flush() - and it calls arch_wb_cache_pmem(). Consequently, we
      don't need the pmem_dax_ops->flush abstraction at all, we can call
      arch_wb_cache_pmem() directly from dax_flush() because dax_dev->ops->flush
      can't ever reach anything different from arch_wb_cache_pmem().
      
      It should be also pointed out that for some uses of persistent memory it
      is needed to flush only a very small amount of data (such as 1 cacheline),
      and it would be overkill if we go through that device mapper machinery for
      a single flushed cache line.
      
      Fix this by removing the pmem_dax_ops->flush abstraction and call
      arch_wb_cache_pmem() directly from dax_flush(). Also, remove the device
      mapper code that forwards the flushes.
      
      Fixes: abebfbe2 ("dm: add ->flush() dax operation support")
      Cc: stable@vger.kernel.org
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Reviewed-by: NDan Williams <dan.j.williams@intel.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      c3ca015f
    • A
      dm integrity: use init_completion instead of COMPLETION_INITIALIZER_ONSTACK · b5e8ad92
      Arnd Bergmann 提交于
      The new lockdep support for completions causeed the stack usage
      in dm-integrity to explode, in case of write_journal from 504 bytes
      to 1120 (using arm gcc-7.1.1):
      
      drivers/md/dm-integrity.c: In function 'write_journal':
      drivers/md/dm-integrity.c:827:1: error: the frame size of 1120 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
      
      The problem is that not only the size of 'struct completion' grows
      significantly, but we end up having multiple copies of it on the stack
      when we assign it from a local variable after the initial declaration.
      
      COMPLETION_INITIALIZER_ONSTACK() is the right thing to use when we
      want to declare and initialize a completion on the stack. However,
      this driver doesn't do that and instead initializes the completion
      just before it is used.
      
      In this case, init_completion() does the same thing more efficiently,
      and drops the stack usage for the function above down to 496 bytes.
      While the other functions in this file are not bad enough to cause
      a warning, they benefit equally from the change, so I do the change
      across the entire file. In the one place where we reuse a completion,
      I picked the cheaper reinit_completion() over init_completion().
      
      Fixes: cd8084f9 ("locking/lockdep: Apply crossrelease to completions")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NMikulas Patocka <mpatocka@redhat.com>
      Acked-by: NMike Snitzer <snitzer@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      b5e8ad92
    • B
      dm integrity: make blk_integrity_profile structure const · 7c373d66
      Bhumika Goyal 提交于
      Make this structure const as it is only stored in the profile field of a
      blk_integrity structure. This field is of type const, so make structure
      as const.
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      7c373d66
    • H
      dm integrity: do not check integrity for failed read operations · b7e326f7
      Hyunchul Lee 提交于
      Even though read operations fail, dm_integrity_map_continue() calls
      integrity_metadata() to check integrity.  In this case, just complete
      these.
      
      This also makes it so read I/O errors do not generate integrity warnings
      in the kernel log.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NHyunchul Lee <cheol.lee@lge.com>
      Acked-by: NMilan Broz <gmazyland@gmail.com>
      Acked-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      b7e326f7
    • J
      dm log writes: fix >512b sectorsize support · 228bb5b2
      Josef Bacik 提交于
      512b sectors vs device's physical sectorsize was not maintained
      consistently and as such the support for >512b sector devices has bugs.
      The log metadata expects native sectorsize but 512b sectors were being
      stored.  Also, device's sectorsize was assumed when assigning the
      bi_sector for blocks that were being logged.
      
      Fix this up by adding two helpers to convert between bio and dev
      sectors, and use these in the appropriate places to fix the problem and
      make it clear which units go where.  Doing so allows dm-log-writes use
      with 4k devices.
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      228bb5b2
    • J
      dm log writes: don't use all the cpu while waiting to log blocks · 0c79c620
      Josef Bacik 提交于
      The check to see if the logging kthread needs to go to sleep is wrong,
      it checks lc->pending_blocks, which will be non-0 if there are any
      blocks that are pending, whether they are ready to be logged or not.
      What we really want is to go to sleep until it's time to log blocks, so
      change this check so we do actually go to sleep in between flushes.
      Signed-off-by: NJosef Bacik <jbacik@fb.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      0c79c620
    • L
      Revert "firmware: add sanity check on shutdown/suspend" · f007cad1
      Linus Torvalds 提交于
      This reverts commit 81f95076.
      
      It causes random failures of firmware loading at resume time (well,
      random for me, it seems to be more reliable for others) because the
      firmware disabling is not actually synchronous with any particular
      resume event, and at least the btusb driver that uses a workqueue to
      load the firmware at resume seems to occasionally hit the "firmware
      loading is disabled" logic because the firmware loader hasn't gotten the
      resume event yet.
      
      Some kind of sanity check for not trying to load firmware when it's not
      possible might be a good thing, but this commit was not it.
      
      Greg seems to have silently suffered the same issue, and pointed to the
      likely culprit, and Gabriel C verified the revert fixed it for him too.
      Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Pointed-at-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Tested-by: NGabriel C <nix.or.die@gmail.com>
      Cc: Luis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      f007cad1
  4. 10 9月, 2017 13 次提交