1. 27 12月, 2021 1 次提交
  2. 21 10月, 2021 1 次提交
  3. 05 10月, 2021 3 次提交
  4. 28 9月, 2021 3 次提交
  5. 24 9月, 2021 1 次提交
  6. 22 9月, 2021 2 次提交
  7. 10 8月, 2021 2 次提交
    • T
      PCI/MSI: Protect msi_desc::masked for multi-MSI · 77e89afc
      Thomas Gleixner 提交于
      Multi-MSI uses a single MSI descriptor and there is a single mask register
      when the device supports per vector masking. To avoid reading back the mask
      register the value is cached in the MSI descriptor and updates are done by
      clearing and setting bits in the cache and writing it to the device.
      
      But nothing protects msi_desc::masked and the mask register from being
      modified concurrently on two different CPUs for two different Linux
      interrupts which belong to the same multi-MSI descriptor.
      
      Add a lock to struct device and protect any operation on the mask and the
      mask register with it.
      
      This makes the update of msi_desc::masked unconditional, but there is no
      place which requires a modification of the hardware register without
      updating the masked cache.
      
      msi_mask_irq() is now an empty wrapper which will be cleaned up in follow
      up changes.
      
      The problem goes way back to the initial support of multi-MSI, but picking
      the commit which introduced the mask cache is a valid cut off point
      (2.6.30).
      
      Fixes: f2440d9a ("PCI MSI: Refactor interrupt masking code")
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Tested-by: NMarc Zyngier <maz@kernel.org>
      Reviewed-by: NMarc Zyngier <maz@kernel.org>
      Cc: stable@vger.kernel.org
      Link: https://lore.kernel.org/r/20210729222542.726833414@linutronix.de
      77e89afc
    • A
      scsi: ufshcd: Fix device links when BOOT WLUN fails to probe · bf25967a
      Adrian Hunter 提交于
      Managed device links are deleted by device_del(). However it is possible to
      add a device link to a consumer before device_add(), and then discovering
      an error prevents the device from being used. In that case normally
      references to the device would be dropped and the device would be deleted.
      However the device link holds a reference to the device, so the device link
      and device remain indefinitely (unless the supplier is deleted).
      
      For UFSHCD, if a LUN fails to probe (e.g. absent BOOT WLUN), the device
      will not have been registered but can still have a device link holding a
      reference to the device. The unwanted device link will prevent runtime
      suspend indefinitely.
      
      Amend device link removal to accept removal of a link with an unregistered
      consumer device (suggested by Rafael), and fix UFSHCD by explicitly
      deleting the device link when SCSI destroys the SCSI device.
      
      Link: https://lore.kernel.org/r/a1c9bac8-b560-b662-f0aa-58c7e000cbbd@intel.com
      Fixes: b294ff3e ("scsi: ufs: core: Enable power management for wlun")
      Reviewed-by: NRafael J. Wysocki <rafael@kernel.org>
      Signed-off-by: NAdrian Hunter <adrian.hunter@intel.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      bf25967a
  8. 24 7月, 2021 1 次提交
    • W
      swiotlb: Convert io_default_tlb_mem to static allocation · 463e862a
      Will Deacon 提交于
      Since commit 69031f50 ("swiotlb: Set dev->dma_io_tlb_mem to the
      swiotlb pool used"), 'struct device' may hold a copy of the global
      'io_default_tlb_mem' pointer if the device is using swiotlb for DMA. A
      subsequent call to swiotlb_exit() will therefore leave dangling pointers
      behind in these device structures, resulting in KASAN splats such as:
      
        |  BUG: KASAN: use-after-free in __iommu_dma_unmap_swiotlb+0x64/0xb0
        |  Read of size 8 at addr ffff8881d7830000 by task swapper/0/0
        |
        |  CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.12.0-rc3-debug #1
        |  Hardware name: HP HP Desktop M01-F1xxx/87D6, BIOS F.12 12/17/2020
        |  Call Trace:
        |   <IRQ>
        |   dump_stack+0x9c/0xcf
        |   print_address_description.constprop.0+0x18/0x130
        |   kasan_report.cold+0x7f/0x111
        |   __iommu_dma_unmap_swiotlb+0x64/0xb0
        |   nvme_pci_complete_rq+0x73/0x130
        |   blk_complete_reqs+0x6f/0x80
        |   __do_softirq+0xfc/0x3be
      
      Convert 'io_default_tlb_mem' to a static structure, so that the
      per-device pointers remain valid after swiotlb_exit() has been invoked.
      All users are updated to reference the static structure directly, using
      the 'nslabs' field to determine whether swiotlb has been initialised.
      The 'slots' array is still allocated dynamically and referenced via a
      pointer rather than a flexible array member.
      
      Cc: Claire Chang <tientzu@chromium.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Fixes: 69031f50 ("swiotlb: Set dev->dma_io_tlb_mem to the swiotlb pool used")
      Reported-by: NNathan Chancellor <nathan@kernel.org>
      Tested-by: NNathan Chancellor <nathan@kernel.org>
      Tested-by: NClaire Chang <tientzu@chromium.org>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NWill Deacon <will@kernel.org>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad@kernel.org>
      463e862a
  9. 21 7月, 2021 1 次提交
  10. 19 7月, 2021 1 次提交
    • C
      printk: index: Add indexing support to dev_printk · ad7d61f1
      Chris Down 提交于
      While for most kinds of issues we have counters, tracepoints, or metrics
      with a stable interface which can reliably be used to indicate issues,
      in order to react to production issues quickly we sometimes need to work
      with the interface which most kernel developers naturally use when
      developing: printk, and printk-esques like dev_printk.
      
      dev_printk is by far the most likely custom subsystem printk to benefit
      from the printk indexing infrastructure, since niche device issues
      brought about by production changes, firmware upgrades, and the like are
      one of the most common things that we need printk infrastructure's
      assistance to monitor.
      
      Often these errors were never expected to practically manifest in
      reality, and exhibit in code without extensive (or any) metrics present.
      As such, there are typically very few options for issue detection
      available to those with large fleets at the time the incident happens,
      and we thus benefit strongly from monitoring netconsole in these
      instances.
      
      As such, add the infrastructure for dev_printk to be indexed in the
      printk index. Even on a minimal kernel config, the coverage of the base
      kernel's printk index is significantly improved:
      
      Before:
      
          [root@ktst ~]# wc -l /sys/kernel/debug/printk/index/vmlinux
          4497 /sys/kernel/debug/printk/index/vmlinux
      
      After:
      
          [root@ktst ~]# wc -l /sys/kernel/debug/printk/index/vmlinux
          5573 /sys/kernel/debug/printk/index/vmlinux
      
      In terms of implementation, in order to trivially disambiguate them,
      dev_printk is now a macro which wraps _dev_printk.
      Signed-off-by: NChris Down <chris@chrisdown.name>
      Cc: Petr Mladek <pmladek@suse.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Reviewed-by: NPetr Mladek <pmladek@suse.com>
      Tested-by: NPetr Mladek <pmladek@suse.com>
      Acked-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NPetr Mladek <pmladek@suse.com>
      Link: https://lore.kernel.org/r/959c7aed1017cb2c9de922e0a820d397e29c6a5a.1623775748.git.chris@chrisdown.name
      ad7d61f1
  11. 17 7月, 2021 3 次提交
  12. 14 7月, 2021 1 次提交
  13. 18 6月, 2021 1 次提交
  14. 27 5月, 2021 1 次提交
    • R
      driver core: Move the "removable" attribute from USB to core · 70f400d4
      Rajat Jain 提交于
      Move the "removable" attribute from USB to core in order to allow it to be
      supported by other subsystem / buses. Individual buses that want to support
      this attribute can populate the removable property of the device while
      enumerating it with the 3 possible values -
       - "unknown"
       - "fixed"
       - "removable"
      Leaving the field unchanged (i.e. "not supported") would mean that the
      attribute would not show up in sysfs for that device. The UAPI (location,
      symantics etc) for the attribute remains unchanged.
      
      Move the "removable" attribute from USB to the device core so it can be
      used by other subsystems / buses.
      
      By default, devices do not have a "removable" attribute in sysfs.
      
      If a subsystem or bus driver wants to support a "removable" attribute, it
      should call device_set_removable() before calling device_register() or
      device_add(), e.g.:
      
          device_set_removable(dev, DEVICE_REMOVABLE);
          device_register(dev);
      
      The possible values and the resulting sysfs attribute contents are:
      
          DEVICE_REMOVABLE_UNKNOWN  ->  "unknown"
          DEVICE_REMOVABLE          ->  "removable"
          DEVICE_FIXED              ->  "fixed"
      
      Convert the USB "removable" attribute to use this new device core
      functionality.  There should be no user-visible change in the location or
      semantics of attribute for USB devices.
      Reviewed-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NRajat Jain <rajatja@google.com>
      Link: https://lore.kernel.org/r/20210524171812.18095-1-rajatja@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      70f400d4
  15. 22 5月, 2021 2 次提交
  16. 14 5月, 2021 1 次提交
  17. 10 5月, 2021 1 次提交
  18. 05 4月, 2021 1 次提交
    • S
      driver core: Improve fw_devlink & deferred_probe_timeout interaction · d46f3e3e
      Saravana Kannan 提交于
      deferred_probe_timeout kernel commandline parameter allows probing of
      consumer devices if the supplier devices don't have any drivers.
      
      fw_devlink=on will indefintely block probe() calls on a device if all
      its suppliers haven't probed successfully. This completely skips calls
      to driver_deferred_probe_check_state() since that's only called when a
      .probe() function calls framework APIs. So fw_devlink=on breaks
      deferred_probe_timeout.
      
      deferred_probe_timeout in its current state also ignores a lot of
      information that's now available to the kernel. It assumes all suppliers
      that haven't probed when the timer expires (or when initcalls are done
      on a static kernel) will never probe and fails any calls to acquire
      resources from these unprobed suppliers.
      
      However, this assumption by deferred_probe_timeout isn't true under many
      conditions. For example:
      - If the consumer happens to be before the supplier in the deferred
        probe list.
      - If the supplier itself is waiting on its supplier to probe.
      
      This patch fixes both these issues by relaxing device links between
      devices only if the supplier doesn't have any driver that could match
      with (NOT bound to) the supplier device. This way, we only fail attempts
      to acquire resources from suppliers that truly don't have any driver vs
      suppliers that just happen to not have probed yet.
      Signed-off-by: NSaravana Kannan <saravanak@google.com>
      Link: https://lore.kernel.org/r/20210402040342.2944858-3-saravanak@google.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d46f3e3e
  19. 02 4月, 2021 1 次提交
  20. 23 3月, 2021 2 次提交
  21. 19 2月, 2021 1 次提交
  22. 13 2月, 2021 1 次提交
  23. 09 2月, 2021 3 次提交
  24. 22 1月, 2021 2 次提交
  25. 12 1月, 2021 1 次提交
  26. 09 1月, 2021 1 次提交
  27. 08 1月, 2021 1 次提交