Skip to content
Snippets Groups Projects
  1. Mar 14, 2018
    • Steffen Maier's avatar
      dm mpath: fix passing integrity data · 8c5c1473
      Steffen Maier authored
      
      After v4.12 commit e2460f2a ("dm: mark targets that pass integrity
      data"), dm-multipath, e.g. on DIF+DIX SCSI disk paths, does not support
      block integrity any more. So add it to the whitelist.
      
      This is also a pre-requisite to use block integrity with other dm layer(s)
      on top of multipath, such as kpartx partitions (dm-linear) or LVM.
      
      Also, bump target version to reflect this fix.
      
      Fixes: e2460f2a ("dm: mark targets that pass integrity data")
      Cc: <stable@vger.kernel.org> #4.12+
      Bisected-by: default avatarFedor Loshakov <loshakov@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
      Reviewed-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      8c5c1473
    • Tejun Heo's avatar
      RDMAVT: Fix synchronization around percpu_ref · 74b44bbe
      Tejun Heo authored
      
      rvt_mregion uses percpu_ref for reference counting and RCU to protect
      accesses from lkey_table.  When a rvt_mregion needs to be freed, it
      first gets unregistered from lkey_table and then rvt_check_refs() is
      called to wait for in-flight usages before the rvt_mregion is freed.
      
      rvt_check_refs() seems to have a couple issues.
      
      * It has a fast exit path which tests percpu_ref_is_zero().  However,
        a percpu_ref reading zero doesn't mean that the object can be
        released.  In fact, the ->release() callback might not even have
        started executing yet.  Proceeding with freeing can lead to
        use-after-free.
      
      * lkey_table is RCU protected but there is no RCU grace period in the
        free path.  percpu_ref uses RCU internally but it's sched-RCU whose
        grace periods are different from regular RCU.  Also, it generally
        isn't a good idea to depend on internal behaviors like this.
      
      To address the above issues, this patch removes the fast exit and adds
      an explicit synchronize_rcu().
      
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Acked-by: default avatarDennis Dalessandro <dennis.dalessandro@intel.com>
      Cc: Mike Marciniszyn <mike.marciniszyn@intel.com>
      Cc: linux-rdma@vger.kernel.org
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      74b44bbe
    • Darren Hart (VMware)'s avatar
      platform/x86: Fix dell driver init order · 49368c13
      Darren Hart (VMware) authored
      
      Update the initcall ordering to satisfy the following dependency
      ordering:
      
      1. DCDBAS, ACPI_WMI
      2. DELL_SMBIOS, DELL_RBTN
      3. DELL_LAPTOP, DELL_WMI
      
      By assigning them to the following initcall levels:
      
      subsys_initcall: DCDBAS, ACPI_WMI
      module_init: DELL_SMBIOS, DELL_RBTN
      late_initcall: DELL_LAPTOP, DELL_WMI
      
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Cc: Mario.Limonciello@dell.com
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      49368c13
    • Darren Hart's avatar
      platform/x86: dell-smbios: Resolve dependency error on ACPI_WMI · 75073a64
      Darren Hart authored
      
      Similarly to DCDBAS for DELL_SMBIOS_SMM, if DELL_SMBIOS_WMI is enabled,
      DELL_SMBIOS becomes dependent on ACPI_WMI. Update the depends lines to
      prevent a configuration where DELL_SMBIOS=y and either backend
      dependency =m. Update the comment accordingly.
      
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
      Cc: Dominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      75073a64
  2. Mar 13, 2018
  3. Mar 12, 2018
  4. Mar 11, 2018
  5. Mar 09, 2018
    • Leon Romanovsky's avatar
      RDMA/mlx5: Fix integer overflow while resizing CQ · 28e9091e
      Leon Romanovsky authored
      
      The user can provide very large cqe_size which will cause to integer
      overflow as it can be seen in the following UBSAN warning:
      
      =======================================================================
      UBSAN: Undefined behaviour in drivers/infiniband/hw/mlx5/cq.c:1192:53
      signed integer overflow:
      64870 * 65536 cannot be represented in type 'int'
      CPU: 0 PID: 267 Comm: syzkaller605279 Not tainted 4.15.0+ #90 Hardware
      name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
      rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
      Call Trace:
       dump_stack+0xde/0x164
       ? dma_virt_map_sg+0x22c/0x22c
       ubsan_epilogue+0xe/0x81
       handle_overflow+0x1f3/0x251
       ? __ubsan_handle_negate_overflow+0x19b/0x19b
       ? lock_acquire+0x440/0x440
       mlx5_ib_resize_cq+0x17e7/0x1e40
       ? cyc2ns_read_end+0x10/0x10
       ? native_read_msr_safe+0x6c/0x9b
       ? cyc2ns_read_end+0x10/0x10
       ? mlx5_ib_modify_cq+0x220/0x220
       ? sched_clock_cpu+0x18/0x200
       ? lookup_get_idr_uobject+0x200/0x200
       ? rdma_lookup_get_uobject+0x145/0x2f0
       ib_uverbs_resize_cq+0x207/0x3e0
       ? ib_uverbs_ex_create_cq+0x250/0x250
       ib_uverbs_write+0x7f9/0xef0
       ? cyc2ns_read_end+0x10/0x10
       ? print_irqtrace_events+0x280/0x280
       ? ib_uverbs_ex_create_cq+0x250/0x250
       ? uverbs_devnode+0x110/0x110
       ? sched_clock_cpu+0x18/0x200
       ? do_raw_spin_trylock+0x100/0x100
       ? __lru_cache_add+0x16e/0x290
       __vfs_write+0x10d/0x700
       ? uverbs_devnode+0x110/0x110
       ? kernel_read+0x170/0x170
       ? sched_clock_cpu+0x18/0x200
       ? security_file_permission+0x93/0x260
       vfs_write+0x1b0/0x550
       SyS_write+0xc7/0x1a0
       ? SyS_read+0x1a0/0x1a0
       ? trace_hardirqs_on_thunk+0x1a/0x1c
       entry_SYSCALL_64_fastpath+0x1e/0x8b
      RIP: 0033:0x433549
      RSP: 002b:00007ffe63bd1ea8 EFLAGS: 00000217
      =======================================================================
      
      Cc: syzkaller <syzkaller@googlegroups.com>
      Cc: <stable@vger.kernel.org> # 3.13
      Fixes: bde51583 ("IB/mlx5: Add support for resize CQ")
      Reported-by: default avatarNoa Osherovich <noaos@mellanox.com>
      Reviewed-by: default avatarYishai Hadas <yishaih@mellanox.com>
      Signed-off-by: default avatarLeon Romanovsky <leonro@mellanox.com>
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      28e9091e
    • Doug Ledford's avatar
      Revert "RDMA/mlx5: Fix integer overflow while resizing CQ" · 212a0cbc
      Doug Ledford authored
      The original commit of this patch has a munged log message that is
      missing several of the tags the original author intended to be on the
      patch.  This was due to patchworks misinterpreting a cut-n-paste
      separator line as an end of message line and munging the mbox that was
      used to import the patch:
      
      https://patchwork.kernel.org/patch/10264089/
      
      
      
      The original patch will be reapplied with a fixed commit message so the
      proper tags are applied.
      
      This reverts commit aa0de36a.
      
      Signed-off-by: default avatarDoug Ledford <dledford@redhat.com>
      212a0cbc
    • Hans de Goede's avatar
      usb: typec: tcpm: fusb302: Do not log an error on -EPROBE_DEFER · 7832f6d1
      Hans de Goede authored
      
      Do not log an error if tcpm_register_port() fails with -EPROBE_DEFER.
      
      Fixes: cf140a35 ("typec: fusb302: Use dev_err during probe")
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7832f6d1
    • Fredrik Noring's avatar
      USB: OHCI: Fix NULL dereference in HCDs using HCD_LOCAL_MEM · d6c931ea
      Fredrik Noring authored
      
      Scatter-gather needs to be disabled when using dma_declare_coherent_memory
      and HCD_LOCAL_MEM. Andrea Righi made the equivalent fix for EHCI drivers
      in commit 4307a28e "USB: EHCI: fix NULL pointer dererence in HCDs
      that use HCD_LOCAL_MEM".
      
      The following NULL pointer WARN_ON_ONCE triggered with OHCI drivers:
      
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 49 at drivers/usb/core/hcd.c:1379 hcd_alloc_coherent+0x4c/0xc8
      Modules linked in:
      CPU: 0 PID: 49 Comm: usb-storage Not tainted 4.15.0+ #1014
      Stack : 00000000 00000000 805a78d2 0000003a 81f5c2cc 8053d367 804d77fc 00000031
              805a3a08 00000563 81ee9400 805a0000 00000000 10058c00 81f61b10 805c0000
              00000000 00000000 805a0000 00d9038e 00000004 803ee818 00000006 312e3420
              805c0000 00000000 00000073 81f61958 00000000 00000000 802eb380 804fd538
              00000009 00000563 81ee9400 805a0000 00000002 80056148 00000000 805a0000
              ...
      Call Trace:
      [<578af360>] show_stack+0x74/0x104
      [<2f3702c6>] __warn+0x118/0x120
      [<ae93fc9e>] warn_slowpath_null+0x44/0x58
      [<a891a517>] hcd_alloc_coherent+0x4c/0xc8
      [<3578fa36>] usb_hcd_map_urb_for_dma+0x4d8/0x534
      [<110bc94c>] usb_hcd_submit_urb+0x82c/0x834
      [<02eb5baf>] usb_sg_wait+0x14c/0x1a0
      [<ccd09e85>] usb_stor_bulk_transfer_sglist.part.1+0xac/0x124
      [<87a5c34c>] usb_stor_bulk_srb+0x40/0x60
      [<ff1792ac>] usb_stor_Bulk_transport+0x160/0x37c
      [<b9e2709c>] usb_stor_invoke_transport+0x3c/0x500
      [<004754f4>] usb_stor_control_thread+0x258/0x28c
      [<22edf42e>] kthread+0x134/0x13c
      [<a419ffd0>] ret_from_kernel_thread+0x14/0x1c
      ---[ end trace bcdb825805eefdcc ]---
      
      Signed-off-by: default avatarFredrik Noring <noring@nocrew.org>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6c931ea
    • Colin Ian King's avatar
      usbip: vudc: fix null pointer dereference on udc->lock · df3334c2
      Colin Ian King authored
      
      Currently the driver attempts to spin lock on udc->lock before a NULL
      pointer check is performed on udc, hence there is a potential null
      pointer dereference on udc->lock.  Fix this by moving the null check
      on udc before the lock occurs.
      
      Fixes: ea6873a4 ("usbip: vudc: Add SysFS infrastructure for VUDC")
      Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
      Acked-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
      Reviewed-by: default avatarKrzysztof Opasiak <k.opasiak@samsung.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df3334c2
    • Darren Hart (VMware)'s avatar
      platform/x86: dell-smbios: Resolve dependency error on DCDBAS · 32d7b19b
      Darren Hart (VMware) authored
      
      When the DELL_SMBIOS_SMM backend is enabled, the DELL_SMBIOS symbol
      depends on DELL_DCDBAS, and we must avoid the situation where
      DELL_SMBIOS=y and DCDBAS=m.
      
      Adding the conditional dependency to DELL_SMBIOS such as:
      
      depends !DELL_SMBIOS_SMM || (DCDBAS || DCDBAS=n)
      
      results in the Kconfig tooling complaining about a circular dependency,
      although it appears to work in practice.
      
      Avoid the errors by simplifying the dependency and forcing DELL_SMBIOS
      to be <= DCDBAS if DCDBAS is enabled (thanks to Greg KH for the
      suggestion).
      
      Cc: Mario.Limonciello@dell.com
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      32d7b19b
    • Darren Hart (VMware)'s avatar
      platform/x86: Allow for SMBIOS backend defaults · 329d58b8
      Darren Hart (VMware) authored
      
      Avoid accidental configurations by setting default y for DELL_SMBIOS
      backends. Avoid this impacting the default build size, by making them
      dependent on DELL_SMBIOS, so they only appear when DELL_SMBIOS is
      manually selected, or by DELL_LAPTOP or DELL_WMI.
      
      While DELL_SMBIOS does have a prompt, it does not have any dependencies.
      Keeping DELL_SMBIOS visible, despite being "select"ed by DELL_LAPTOP and
      DELL_WMI, is a deliberate choice to provide context for the WMI and SMM
      backends, which would otherwise appear to float without context within
      the menu.
      
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      329d58b8
    • Mario Limonciello's avatar
      platform/x86: dell-smbios: Link all dell-smbios-* modules together · 25d47027
      Mario Limonciello authored
      
      Some race conditions were raised due to dell-smbios and its backends
      not being ready by the time that a consumer would call one of the
      exported methods.
      
      To avoid this problem, guarantee that all initialization has been
      done by linking them all together and running init for them all.
      
      As part of this change the Kconfig needs to be adjusted so that
      CONFIG_DELL_SMBIOS_SMM and CONFIG_DELL_SMBIOS_WMI are boolean
      rather than modules.
      
      CONFIG_DELL_SMBIOS is a visually selectable option again and both
      CONFIG_DELL_SMBIOS_WMI and CONFIG_DELL_SMBIOS_SMM are optional.
      
      Signed-off-by: default avatarMario Limonciello <mario.limonciello@dell.com>
      [dvhart: Update prompt and help text for DELL_SMBIOS_* backends]
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      25d47027
    • Mario Limonciello's avatar
      platform/x86: dell-smbios: Rename dell-smbios source to dell-smbios-base · 94f77cb1
      Mario Limonciello authored
      
      This is being done to faciliate a later change to link all the dell-smbios
      drivers together.
      
      Signed-off-by: default avatarMario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      94f77cb1
    • Mario Limonciello's avatar
      platform/x86: dell-smbios: Correct some style warnings · b5353962
      Mario Limonciello authored
      
      WARNING: function definition argument 'struct calling_interface_buffer *'
      should also have an identifier name
      +       int (*call_fn)(struct calling_interface_buffer *);
      
      WARNING: Block comments use * on subsequent lines
      +       /* 4 bytes of table header, plus 7 bytes of Dell header,
      	plus at least
      +          6 bytes of entry */
      
      WARNING: Block comments use a trailing */ on a separate line
      +          6 bytes of entry */
      
      Signed-off-by: default avatarMario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      b5353962
    • Kai-Heng Feng's avatar
      xhci: Fix front USB ports on ASUS PRIME B350M-A · 191edc5e
      Kai-Heng Feng authored
      
      When a USB device gets plugged on ASUS PRIME B350M-A's front ports, the
      xHC stops working:
      [  549.114587] xhci_hcd 0000:02:00.0: WARN: xHC CMD_RUN timeout
      [  549.114608] suspend_common(): xhci_pci_suspend+0x0/0xc0 returns -110
      [  549.114638] xhci_hcd 0000:02:00.0: can't suspend (hcd_pci_runtime_suspend returned -110)
      
      Delay before running xHC command CMD_RUN can workaround the issue.
      
      Use a new quirk to make the delay only targets to the affected xHC.
      
      Signed-off-by: default avatarKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      191edc5e
    • Yoshihiro Shimoda's avatar
      usb: host: xhci-plat: revert "usb: host: xhci-plat: enable clk in resume timing" · d56e57ca
      Yoshihiro Shimoda authored
      
      This patch reverts the commit 835e4241 ("usb: host: xhci-plat:
      enable clk in resume timing") because this driver also has runtime PM
      and the commit 56086910 ("clk: renesas: cpg-mssr: Restore module
      clocks during resume") will restore the clock on R-Car H3 environment.
      
      If the xhci_plat_suspend() disables the clk, the system cannot enable
      the clk in resume like the following behavior:
      
      < In resume >
       - genpd_resume_noirq() runs and enable the clk (enable_count = 1)
       - cpg_mssr_resume_noirq() restores the clk register.
        -- Since the clk was disabled in suspend, cpg_mssr_resume_noirq()
           will disable the clk and keep the enable_count.
       - Even if xhci_plat_resume() calls clk_prepare_enable(), since
         the enable_count is 1, the clk will be not enabled.
      
      After this patch is applied, the cpg-mssr driver will save the clk
      as enable, so the clk will be enabled in resume.
      
      Fixes: 835e4241 ("usb: host: xhci-plat: enable clk in resume timing")
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d56e57ca
    • Pete Zaitcev's avatar
      usb: usbmon: Read text within supplied buffer size · a5f59683
      Pete Zaitcev authored
      
      This change fixes buffer overflows and silent data corruption with the
      usbmon device driver text file read operations.
      
      Signed-off-by: default avatarFredrik Noring <noring@nocrew.org>
      Signed-off-by: default avatarPete Zaitcev <zaitcev@redhat.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a5f59683
    • Ross Zwisler's avatar
      loop: Fix lost writes caused by missing flag · 1d037577
      Ross Zwisler authored
      
      The following commit:
      
      commit aa4d8616 ("block: loop: switch to VFS ITER_BVEC")
      
      replaced __do_lo_send_write(), which used ITER_KVEC iterators, with
      lo_write_bvec() which uses ITER_BVEC iterators.  In this change, though,
      the WRITE flag was lost:
      
      -       iov_iter_kvec(&from, ITER_KVEC | WRITE, &kvec, 1, len);
      +       iov_iter_bvec(&i, ITER_BVEC, bvec, 1, bvec->bv_len);
      
      This flag is necessary for the DAX case because we make decisions based on
      whether or not the iterator is a READ or a WRITE in dax_iomap_actor() and
      in dax_iomap_rw().
      
      We end up going through this path in configurations where we combine a PMEM
      device with 4k sectors, a loopback device and DAX.  The consequence of this
      missed flag is that what we intend as a write actually turns into a read in
      the DAX code, so no data is ever written.
      
      The very simplest test case is to create a loopback device and try and
      write a small string to it, then hexdump a few bytes of the device to see
      if the write took.  Without this patch you read back all zeros, with this
      you read back the string you wrote.
      
      For XFS this causes us to fail or panic during the following xfstests:
      
      	xfs/074 xfs/078 xfs/216 xfs/217 xfs/250
      
      For ext4 we have a similar issue where writes never happen, but we don't
      currently have any xfstests that use loopback and show this issue.
      
      Fix this by restoring the WRITE flag argument to iov_iter_bvec().  This
      causes the xfstests to all pass.
      
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: stable@vger.kernel.org
      Fixes: commit aa4d8616 ("block: loop: switch to VFS ITER_BVEC")
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Signed-off-by: default avatarRoss Zwisler <ross.zwisler@linux.intel.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      1d037577
    • Masahiro Yamada's avatar
      clocksource/atmel-st: Add 'depends on HAS_IOMEM' to fix unmet dependency · bd2746f0
      Masahiro Yamada authored
      
      The ATMEL_ST config selects MFD_SYSCON, but does not depend on HAS_IOMEM.
      
      Compile testing on architecture without HAS_IOMEM causes "unmet direct
      dependencies" in Kconfig phase. Detected by "make ARCH=score allyesconfig".
      
      Add the proper dependency to the ATMEL_ST config.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Link: https://lkml.kernel.org/r/1520335233-11277-1-git-send-email-yamada.masahiro@socionext.com
      bd2746f0
  6. Mar 08, 2018
    • Yoshihiro Shimoda's avatar
      usb: host: xhci-rcar: add support for r8a77965 · 015dbeb2
      Yoshihiro Shimoda authored
      
      This patch adds support for r8a77965 (R-Car M3-N).
      
      Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Reviewed-by: default avatarSimon Horman <horms+renesas@verge.net.au>
      Reviewed-by: default avatarRob Herring <robh@kernel.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      015dbeb2
    • Teijo Kinnunen's avatar
      USB: storage: Add JMicron bridge 152d:2567 to unusual_devs.h · 5126a504
      Teijo Kinnunen authored
      
      This USB-SATA controller seems to be similar with JMicron bridge
      152d:2566 already on the list. Adding it here fixes "Invalid
      field in cdb" errors.
      
      Signed-off-by: default avatarTeijo Kinnunen <teijo.kinnunen@code-q.fi>
      Cc: stable@vger.kernel.org
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5126a504
    • James Smart's avatar
      nvme_fc: rework sqsize handling · d157e534
      James Smart authored
      
      Corrected four outstanding issues in the transport around sqsize.
      
      1: Create Connection LS is sending the 1's-based sqsize, should be
      sending the 0's-based value.
      
      2: allocation of hw queue is using the 0's-base size. It should be
      using the 1's-based value.
      
      3: normalization of ctrl.sqsize by MQES is using MQES+1 (1's-based
      value). It should be MQES (0's-based value).
      
      4: Missing clause to ensure queue_count not larger than ctrl->sqsize.
      
      Corrected by:
      Clean up routines that pass queue size around. The queue size value is
      the actual count (1's-based) value and determined from ctrl->sqsize + 1.
      
      Routines that send 0's-based value adapt from queue size.
      
      Sset ctrl->sqsize properly for MQES.
      
      Added clause to nsure queue_count not larger than ctrl->sqsize + 1.
      
      Signed-off-by: default avatarJames Smart <james.smart@broadcom.com>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
      d157e534
    • Lu Baolu's avatar
      usb: xhci: dbc: Fix lockdep warning · a098dc8b
      Lu Baolu authored
      
      The xHCI DbC implementation might enter a deadlock situation because
      there is no sufficient protection against the shared data between
      process and softirq contexts. This can lead to the following lockdep
      warnings. This patch changes to use spin_{,un}lock_irq{save,restore}
      to avoid potential deadlock.
      
      [ 528.248084] ================================
      [ 528.252914] WARNING: inconsistent lock state
      [ 528.257756] 4.15.0-rc1+ #1630 Not tainted
      [ 528.262305] --------------------------------
      [ 528.267145] inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
      [ 528.273953] ksoftirqd/1/17 [HC0[0]:SC1[1]:HE0:SE0] takes:
      [ 528.280075] (&(&port->port_lock)->rlock){+.?.}, at: [<ffffffff815396a8>] dbc_rx_push+0x38/0x1c0
      [ 528.290043] {SOFTIRQ-ON-W} state was registered at:
      [ 528.295570] _raw_spin_lock+0x2f/0x40
      [ 528.299818] dbc_write_complete+0x27/0xa0
      [ 528.304458] xhci_dbc_giveback+0xd1/0x200
      [ 528.309098] xhci_dbc_flush_endpoint_requests+0x50/0x70
      [ 528.315116] xhci_dbc_handle_events+0x696/0x7b0
      [ 528.320349] process_one_work+0x1ee/0x6e0
      [ 528.324988] worker_thread+0x4a/0x430
      [ 528.329236] kthread+0x13e/0x170
      [ 528.332992] ret_from_fork+0x24/0x30
      [ 528.337141] irq event stamp: 2861
      [ 528.340897] hardirqs last enabled at (2860): [<ffffffff810674ea>] tasklet_action+0x6a/0x250
      [ 528.350460] hardirqs last disabled at (2861): [<ffffffff817dc1ef>] _raw_spin_lock_irq+0xf/0x40
      [ 528.360219] softirqs last enabled at (2852): [<ffffffff817e0e8c>] __do_softirq+0x3dc/0x4f9
      [ 528.369683] softirqs last disabled at (2857): [<ffffffff8106805b>] run_ksoftirqd+0x1b/0x60
      [ 528.379048]
      [ 528.379048] other info that might help us debug this:
      [ 528.386443] Possible unsafe locking scenario:
      [ 528.386443]
      [ 528.393150] CPU0
      [ 528.395917] ----
      [ 528.398687] lock(&(&port->port_lock)->rlock);
      [ 528.403821] <Interrupt>
      [ 528.406786] lock(&(&port->port_lock)->rlock);
      [ 528.412116]
      [ 528.412116] *** DEADLOCK ***
      [ 528.412116]
      [ 528.418825] no locks held by ksoftirqd/1/17.
      [ 528.423662]
      [ 528.423662] stack backtrace:
      [ 528.428598] CPU: 1 PID: 17 Comm: ksoftirqd/1 Not tainted 4.15.0-rc1+ #1630
      [ 528.436387] Call Trace:
      [ 528.439158] dump_stack+0x5e/0x8e
      [ 528.442914] print_usage_bug+0x1fc/0x220
      [ 528.447357] mark_lock+0x4db/0x5a0
      [ 528.451210] __lock_acquire+0x726/0x1130
      [ 528.455655] ? __lock_acquire+0x557/0x1130
      [ 528.460296] lock_acquire+0xa2/0x200
      [ 528.464347] ? dbc_rx_push+0x38/0x1c0
      [ 528.468496] _raw_spin_lock_irq+0x35/0x40
      [ 528.473038] ? dbc_rx_push+0x38/0x1c0
      [ 528.477186] dbc_rx_push+0x38/0x1c0
      [ 528.481139] tasklet_action+0x1d2/0x250
      [ 528.485483] __do_softirq+0x1dc/0x4f9
      [ 528.489630] run_ksoftirqd+0x1b/0x60
      [ 528.493682] smpboot_thread_fn+0x179/0x270
      [ 528.498324] kthread+0x13e/0x170
      [ 528.501981] ? sort_range+0x20/0x20
      [ 528.505933] ? kthread_delayed_work_timer_fn+0x80/0x80
      [ 528.511755] ret_from_fork+0x24/0x30
      
      Fixes: dfba2174 ("usb: xhci: Add DbC support in xHCI driver")
      Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a098dc8b
    • Mathias Nyman's avatar
      xhci: fix endpoint context tracer output · 97ef0faf
      Mathias Nyman authored
      
      Fix incorrent values showed for max Primary stream and
      Linear stream array (LSA) values in the endpoint context
      decoder.
      
      Fixes: 19a7d0d6 ("usb: host: xhci: add Slot and EP Context tracers")
      Cc: <stable@vger.kernel.org> # v4.12+
      Signed-off-by: default avatarMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      97ef0faf
    • Roland Dreier's avatar
      nvme-fabrics: Ignore nr_io_queues option for discovery controllers · 0475821e
      Roland Dreier authored
      
      This removes a dependency on the order options are passed when creating
      a fabrics controller.  With the old code, if "nr_io_queues" appears before
      an "nqn" option specifying the discovery controller, then nr_io_queues
      is overridden with zero.  If "nr_io_queues" appears after specifying the
      discovery controller, then the nr_io_queues option is used to set the
      number of queues, and the driver attempts to establish IO connections
      to the discovery controller (which doesn't work).
      
      It seems better to ignore (and warn about) the "nr_io_queues" option
      if userspace has already asked to connect to the discovery controller.
      
      Signed-off-by: default avatarRoland Dreier <roland@purestorage.com>
      Reviewed-by: default avatarJames Smart <james.smart@broadcom.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
      0475821e
    • Arvind Yadav's avatar
      xen: xenbus: use put_device() instead of kfree() · 351b2bcc
      Arvind Yadav authored
      
      Never directly free @dev after calling device_register(), even
      if it returned an error! Always use put_device() to give up the
      reference initialized.
      
      Signed-off-by: default avatarArvind Yadav <arvind.yadav.cs@gmail.com>
      Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
      Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
      351b2bcc
    • Dmitry Torokhov's avatar
      Revert "platform/chrome: chromeos_laptop: make chromeos_laptop const" · fc88bbda
      Dmitry Torokhov authored
      
      This reverts commit a376cd91 because
      chromeos_laptop instances should not be marked as "const" (at this
      time), since i2c_peripheral is being modified (we change "state" and
      "tries") when we instantiate devices.
      
      Signed-off-by: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarBenson Leung <bleung@chromium.org>
      fc88bbda
  7. Mar 07, 2018
Loading