1. 01 7月, 2017 3 次提交
    • C
      PCI/PM: Restore the status of PCI devices across hibernation · e60514bd
      Chen Yu 提交于
      Currently we saw a lot of "No irq handler" errors during hibernation, which
      caused the system hang finally:
      
        ata4.00: qc timeout (cmd 0xec)
        ata4.00: failed to IDENTIFY (I/O error, err_mask=0x4)
        ata4.00: revalidation failed (errno=-5)
        ata4: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
        do_IRQ: 31.151 No irq handler for vector
      
      According to above logs, there is an interrupt triggered and it is
      dispatched to CPU31 with a vector number 151, but there is no handler for
      it, thus this IRQ will not get acked and will cause an IRQ flood which
      kills the system.  To be more specific, the 31.151 is an interrupt from the
      AHCI host controller.
      
      After some investigation, the reason why this issue is triggered is because
      the thaw_noirq() function does not restore the MSI/MSI-X settings across
      hibernation.
      
      The scenario is illustrated below:
      
        1. Before hibernation, IRQ 34 is the handler for the AHCI device, which
           is bound to CPU31.
      
        2. Hibernation starts, the AHCI device is put into low power state.
      
        3. All the nonboot CPUs are put offline, so IRQ 34 has to be migrated to
           the last alive one - CPU0.
      
        4. After the snapshot has been created, all the nonboot CPUs are brought
           up again; IRQ 34 remains bound to CPU0.
      
        5. AHCI devices are put into D0.
      
        6. The snapshot is written to the disk.
      
      The issue is triggered in step 6.  The AHCI interrupt should be delivered
      to CPU0, however it is delivered to the original CPU31 instead, which
      causes the "No irq handler" issue.
      
      Ying Huang has provided a clue that, in step 3 it is possible that writing
      to the register might not take effect as the PCI devices have been
      suspended.
      
      In step 3, the IRQ 34 affinity should be modified from CPU31 to CPU0, but
      in fact it is not.  In __pci_write_msi_msg(), if the device is already in
      low power state, the low level MSI message entry will not be updated but
      cached.  During the device restore process after a normal suspend/resume,
      pci_restore_msi_state() writes the cached MSI back to the hardware.
      
      But this is not the case for hibernation.  pci_restore_msi_state() is not
      currently called in pci_pm_thaw_noirq(), although pci_save_state() has
      saved the necessary PCI cached information in pci_pm_freeze_noirq().
      
      Restore the PCI status for the device during hibernation.  Otherwise the
      status might be lost across hibernation (for example, settings for MSI,
      MSI-X, ATS, ACS, IOV, etc.), which might cause problems during hibernation.
      Suggested-by: NYing Huang <ying.huang@intel.com>
      Suggested-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NChen Yu <yu.c.chen@intel.com>
      [bhelgaas: changelog]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: stable@vger.kernel.org
      Cc: Len Brown <len.brown@intel.com>
      Cc: Dan Williams <dan.j.williams@intel.com>
      Cc: Rui Zhang <rui.zhang@intel.com>
      Cc: Ying Huang <ying.huang@intel.com>
      e60514bd
    • B
      drm/radeon: make MacBook Pro d3_delay quirk more generic · 5938628c
      Bjorn Helgaas 提交于
      The PCI Power Management Spec, r1.2, sec 5.6.1, requires a 10 millisecond
      delay when powering on a device, i.e., transitioning from state D3hot to
      D0.
      
      Apparently some devices require more time, and d1f9809e ("drm/radeon:
      add quirk for d3 delay during switcheroo poweron for apple macbooks") added
      an additional delay for the Radeon device in a MacBook Pro.  4807c5a8
      ("drm/radeon: add a PX quirk list") made the affected device more explicit.
      
      Add a generic PCI quirk to increase the d3_delay.  This means we will use
      the additional delay for *all* wakeups from D3, not just those initiated by
      radeon_switcheroo_set_state().
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NAndreas Boll <andreas.boll.dev@gmail.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      CC: Maarten Lankhorst <maarten.lankhorst@canonical.com>
      5938628c
    • B
      drm/amdgpu: remove unnecessary save/restore of pdev->d3_delay · ee76380c
      Bjorn Helgaas 提交于
      Remove unnecessary save/restore of pdev->d3_delay.
      
      The only assignments to pdev->d3_delay are in radeon_switcheroo_set_state()
      and some quirks, none of which should be relevant in the
      amdgpu_switcheroo_set_state() path.
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: NAndreas Boll <andreas.boll.dev@gmail.com>
      Acked-by: NAlex Deucher <alexander.deucher@amd.com>
      ee76380c
  2. 24 5月, 2017 1 次提交
  3. 23 5月, 2017 4 次提交
  4. 12 5月, 2017 12 次提交
  5. 11 5月, 2017 12 次提交
  6. 10 5月, 2017 6 次提交
  7. 09 5月, 2017 2 次提交
    • M
      qede: Split PF/VF ndos. · be47c555
      Mintz, Yuval 提交于
      PFs and VFs share the same structure of NDOs today,
      and the VFs explicitly fails the ndo_xdp() callback stating
      it doesn't support XDP.
      
      This results in lots of:
      
        [qede_xdp:1032(enp131s2)]VFs don't support XDP
        ------------[ cut here ]------------
        WARNING: CPU: 4 PID: 1426 at net/core/rtnetlink.c:1637 rtnl_dump_ifinfo+0x354/0x3c0
        ...
        Call Trace:
          ? __alloc_skb+0x9b/0x1d0
          netlink_dump+0x122/0x290
          netlink_recvmsg+0x27d/0x430
          sock_recvmsg+0x3d/0x50
        ...
      
      As every dump request for the VF interface info would fail due to
      rtnl_xdp_fill() returning an error code.
      
      To resolve this, introduce a subset of the NDOs meant for the VF
      in a seperate structure and register that one instead for VFs,
      and omit the ndo_xdp initialization.
      
      Fixes: 40b8c454 ("qede: Prevent VFs from using XDP")
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      be47c555
    • R
      qed: Correct doorbell configuration for !4Kb pages · a82dadbc
      Ram Amrani 提交于
      When configuring the doorbell DPI address, driver aligns the start
      address to 4KB [HW-pages] instead of host PAGE_SIZE.
      As a result, RoCE applications might receive addresses which are
      unaligned to pages [when PAGE_SIZE > 4KB], which is a security risk.
      
      Fixes: 51ff1725 ("qed: Add support for RoCE hw init")
      Signed-off-by: NRam Amrani <Ram.Amrani@cavium.com>
      Signed-off-by: NYuval Mintz <Yuval.Mintz@cavium.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a82dadbc