1. 10 6月, 2017 1 次提交
  2. 08 6月, 2017 4 次提交
  3. 07 6月, 2017 35 次提交
    • N
      drm/meson: Fix driver bind when only CVBS is available · 8604889f
      Neil Armstrong 提交于
      While introducing HDMI support, component matching on connectors node
      were bypassed since no driver would actually bind on the DT node.
      But when only a CVBS connector is present, only a single node is found
      in the graph, but ignored and a NULL match table is given to the
      component code.
      
      This code permits bypassing the components framework by binding directly
      the DRM driver when no components needs to be loaded.
      
      Fixes: a41e82e6 ("drm/meson: Add support for components")
      Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: NSean Paul <seanpaul@chromium.org>
      Link: http://patchwork.freedesktop.org/patch/msgid/1496067352-8733-1-git-send-email-narmstrong@baylibre.com
      8604889f
    • V
      drm/i915: Fix 90/270 rotated coordinates for FBC · 1065467e
      Ville Syrjälä 提交于
      The clipped src coordinates have already been rotated by 270 degrees for
      when the plane rotation is 90/270 degrees, hence the FBC code should no
      longer swap the width and height.
      
      Cc: stable@vger.kernel.org
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
      Fixes: b63a16f6 ("drm/i915: Compute display surface offset in the plane check hook for SKL+")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170331180056.14086-4-ville.syrjala@linux.intel.comReviewed-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
      Tested-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Reviewed-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      (cherry picked from commit 73714c05)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      1065467e
    • V
      drm/i915: Restore has_fbc=1 for ILK-M · 27fe407c
      Ville Syrjälä 提交于
      Restore the lost has_fbc flag for mobile ILK.
      
      Cc: Carlos Santa <carlos.santa@intel.com>
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Fixes: a1323380 ("drm/i915: Introduce GEN5_FEATURES for device info")
      Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170606133229.12439-1-ville.syrjala@linux.intel.comReviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      (cherry picked from commit c2d1a0ce)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      27fe407c
    • V
      drm/i915: Workaround VLV/CHV DSI scanline counter hardware fail · 8f4d3809
      Ville Syrjälä 提交于
      The scanline counter is bonkers on VLV/CHV DSI. The scanline counter
      increment is not lined up with the start of vblank like it is on
      every other platform and output type. This causes problems for
      both the vblank timestamping and atomic update vblank evasion.
      
      On my FFRD8 machine at least, the scanline counter increment
      happens about 1/3 of a scanline ahead of the start of vblank (which
      is where all register latching happens still). That means we can't
      trust the scanline counter to tell us whether we're in vblank or not
      while we're on that particular line. In order to keep vblank
      timestamping in working condition when called from the vblank irq,
      we'll leave scanline_offset at one, which means that the entire
      line containing the start of vblank is considered to be inside
      the vblank.
      
      For the vblank evasion we'll need to consider that entire line
      to be bad, since we can't tell whether the registers already
      got latched or not. And we can't actually use the start of vblank
      interrupt to get us past that line as the interrupt would fire
      too soon, and then we'd up waiting for the next start of vblank
      instead. One way around that would using the frame start
      interrupt instead since that wouldn't fire until the next
      scanline, but that would require some bigger changes in the
      interrupt code. So for simplicity we'll just poll until we get
      past the bad line.
      
      v2: Adjust the comments a bit
      
      Cc: stable@vger.kernel.org
      Cc: Jonas Aaberg <cja@gmx.net>
      Tested-by: NJonas Aaberg <cja@gmx.net>
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99086Signed-off-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20161215174734.28779-1-ville.syrjala@linux.intel.comTested-by: NMika Kahola <mika.kahola@intel.com>
      Reviewed-by: NMika Kahola <mika.kahola@intel.com>
      (cherry picked from commit ec1b4ee2)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      8f4d3809
    • C
      drm/i915: Fix logical inversion for gen4 quirking · 5857dbfa
      Chris Wilson 提交于
      The assertion that we want to make before disabling the pin of the pages
      for the unknown swizzling quirk is that the quirk is indeed active, and
      that the quirk is disabled before we do apply it to the pages.
      
      Fixes: 2c3a3f44 ("drm/i915: Fix pages pin counting around swizzle quirk")
      Fixes: 957870f9 ("drm/i915: Split out i915_gem_object_set_tiling()")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170521124014.27678-1-chris@chris-wilson.co.uk
      Reviewed-bhy: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit 20bb3771)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      5857dbfa
    • C
      drm/i915: Guard against i915_ggtt_disable_guc() being invoked unconditionally · d90c9890
      Chris Wilson 提交于
      Commit 7c3f86b6 ("drm/i915: Invalidate the guc ggtt TLB upon
      insertion") added the restoration of the invalidation routine after the
      GuC was disabled, but missed that the GuC was unconditionally disabled
      when not used. This then overwrites the invalidate routine for the older
      chipsets, causing havoc and breaking resume as the most obvious victim.
      
      We place the guard inside i915_ggtt_disable_guc() to be backport
      friendly (the bug was introduced into v4.11) but it would be preferred
      to be in more control over when this was guard (i.e. do not try and
      teardown the data structures before we have enabled them). That should
      be true with the reorganisation of the guc loaders.
      Reported-by: NVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Fixes: 7c3f86b6 ("drm/i915: Invalidate the guc ggtt TLB upon insertion")
      Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Oscar Mateo <oscar.mateo@intel.com>
      Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
      Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
      Cc: <stable@vger.kernel.org> # v4.11+
      Link: http://patchwork.freedesktop.org/patch/msgid/20170531190514.3691-1-chris@chris-wilson.co.ukReviewed-by: NMichel Thierry <michel.thierry@intel.com>
      (cherry picked from commit cb60606d)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      d90c9890
    • M
      drm/i915: Always recompute watermarks when distrust_bios_wm is set, v2. · 4e3aed84
      Maarten Lankhorst 提交于
      On some systems there can be a race condition in which no crtc state is
      added to the first atomic commit. This results in all crtc's having a
      null DDB allocation, causing a FIFO underrun on any update until the
      first modeset.
      
      Changes since v1:
      - Do not take the connection_mutex, this is already done below.
      Reported-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Inspired-by: NMahesh Kumar <mahesh1.kumar@intel.com>
      Signed-off-by: NMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Fixes: 98d39494 ("drm/i915/gen9: Compute DDB allocation at atomic
      check time (v4)")
      Cc: <stable@vger.kernel.org> # v4.8+
      Cc: Mahesh Kumar <mahesh1.kumar@intel.com>
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170531154236.27180-1-maarten.lankhorst@linux.intel.comReviewed-by: NMahesh Kumar <mahesh1.kumar@intel.com>
      Reviewed-by: NMatt Roper <matthew.d.roper@intel.com>
      
      (cherry picked from commit 367d73d2)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      4e3aed84
    • I
      drm/i915: Prevent the system suspend complete optimization · 6ab92afc
      Imre Deak 提交于
      Since
      
      commit bac2a909
      Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Date:   Wed Jan 21 02:17:42 2015 +0100
      
          PCI / PM: Avoid resuming PCI devices during system suspend
      
      PCI devices will default to allowing the system suspend complete
      optimization where devices are not woken up during system suspend if
      they were already runtime suspended. This however breaks the i915/HDA
      drivers for two reasons:
      
      - The i915 driver has system suspend specific steps that it needs to
        run, that bring the device to a different state than its runtime
        suspended state.
      
      - The HDA driver's suspend handler requires power that it will request
        from the i915 driver's power domain handler. This in turn requires the
        i915 driver to runtime resume itself, but this won't be possible if the
        suspend complete optimization is in effect: in this case the i915
        runtime PM is disabled and trying to get an RPM reference returns
        -EACCESS.
      
      Solve this by requiring the PCI/PM core to resume the device during
      system suspend which in effect disables the suspend complete optimization.
      
      Regardless of the above commit the optimization stayed disabled for DRM
      devices until
      
      commit d14d2a84
      Author: Lukas Wunner <lukas@wunner.de>
      Date:   Wed Jun 8 12:49:29 2016 +0200
      
          drm: Remove dev_pm_ops from drm_class
      
      so this patch is in practice a fix for this commit. Another reason for
      the bug staying hidden for so long is that the optimization for a device
      is disabled if it's disabled for any of its children devices. i915 may
      have a backlight device as its child which doesn't support runtime PM
      and so doesn't allow the optimization either.  So if this backlight
      device got registered the bug stayed hidden.
      
      Credits to Marta, Tomi and David who enabled pstore logging,
      that caught one instance of this issue across a suspend/
      resume-to-ram and Ville who rememberd that the optimization was enabled
      for some devices at one point.
      
      The first WARN triggered by the problem:
      
      [ 6250.746445] WARNING: CPU: 2 PID: 17384 at drivers/gpu/drm/i915/intel_runtime_pm.c:2846 intel_runtime_pm_get+0x6b/0xd0 [i915]
      [ 6250.746448] pm_runtime_get_sync() failed: -13
      [ 6250.746451] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_hdmi x86_pkg_temp_thermal intel_powerclamp coretemp crct10dif_pclmul crc32_pclmul
      snd_hda_codec_realtek snd_hda_codec_generic ghash_clmulni_intel e1000e snd_hda_codec snd_hwdep snd_hda_core ptp mei_me pps_core snd_pcm lpc_ich mei prime_
      numbers i2c_hid i2c_designware_platform i2c_designware_core [last unloaded: i915]
      [ 6250.746512] CPU: 2 PID: 17384 Comm: kworker/u8:0 Tainted: G     U  W       4.11.0-rc5-CI-CI_DRM_334+ #1
      [ 6250.746515] Hardware name:                  /NUC5i5RYB, BIOS RYBDWi35.86A.0362.2017.0118.0940 01/18/2017
      [ 6250.746521] Workqueue: events_unbound async_run_entry_fn
      [ 6250.746525] Call Trace:
      [ 6250.746530]  dump_stack+0x67/0x92
      [ 6250.746536]  __warn+0xc6/0xe0
      [ 6250.746542]  ? pci_restore_standard_config+0x40/0x40
      [ 6250.746546]  warn_slowpath_fmt+0x46/0x50
      [ 6250.746553]  ? __pm_runtime_resume+0x56/0x80
      [ 6250.746584]  intel_runtime_pm_get+0x6b/0xd0 [i915]
      [ 6250.746610]  intel_display_power_get+0x1b/0x40 [i915]
      [ 6250.746646]  i915_audio_component_get_power+0x15/0x20 [i915]
      [ 6250.746654]  snd_hdac_display_power+0xc8/0x110 [snd_hda_core]
      [ 6250.746661]  azx_runtime_resume+0x218/0x280 [snd_hda_intel]
      [ 6250.746667]  pci_pm_runtime_resume+0x76/0xa0
      [ 6250.746672]  __rpm_callback+0xb4/0x1f0
      [ 6250.746677]  ? pci_restore_standard_config+0x40/0x40
      [ 6250.746682]  rpm_callback+0x1f/0x80
      [ 6250.746686]  ? pci_restore_standard_config+0x40/0x40
      [ 6250.746690]  rpm_resume+0x4ba/0x740
      [ 6250.746698]  __pm_runtime_resume+0x49/0x80
      [ 6250.746703]  pci_pm_suspend+0x57/0x140
      [ 6250.746709]  dpm_run_callback+0x6f/0x330
      [ 6250.746713]  ? pci_pm_freeze+0xe0/0xe0
      [ 6250.746718]  __device_suspend+0xf9/0x370
      [ 6250.746724]  ? dpm_watchdog_set+0x60/0x60
      [ 6250.746730]  async_suspend+0x1a/0x90
      [ 6250.746735]  async_run_entry_fn+0x34/0x160
      [ 6250.746741]  process_one_work+0x1f2/0x6d0
      [ 6250.746749]  worker_thread+0x49/0x4a0
      [ 6250.746755]  kthread+0x107/0x140
      [ 6250.746759]  ? process_one_work+0x6d0/0x6d0
      [ 6250.746763]  ? kthread_create_on_node+0x40/0x40
      [ 6250.746768]  ret_from_fork+0x2e/0x40
      [ 6250.746778] ---[ end trace 102a62fd2160f5e6 ]---
      
      v2:
      - Use the new pci_dev->needs_resume flag, to avoid any overhead during
        the ->pm_prepare hook. (Rafael)
      
      v3:
      - Update commit message to reference the actual regressing commit.
        (Lukas)
      
      v4:
      - Rebase on v4 of patch 1/2.
      
      Fixes: d14d2a84 ("drm: Remove dev_pm_ops from drm_class")
      References: https://bugs.freedesktop.org/show_bug.cgi?id=100378
      References: https://bugs.freedesktop.org/show_bug.cgi?id=100770
      Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: Marta Lofstedt <marta.lofstedt@intel.com>
      Cc: David Weinehall <david.weinehall@linux.intel.com>
      Cc: Tomi Sarvela <tomi.p.sarvela@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Lukas Wunner <lukas@wunner.de>
      Cc: linux-pci@vger.kernel.org
      Cc: <stable@vger.kernel.org> # v4.10.x: 4d071c32 - PCI/PM: Add needs_resume flag
      Cc: <stable@vger.kernel.org> # v4.10.x
      Signed-off-by: NImre Deak <imre.deak@intel.com>
      Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Reported-and-tested-by: NMarta Lofstedt <marta.lofstedt@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/1493726649-32094-2-git-send-email-imre.deak@intel.com
      (cherry picked from commit adfdf85d)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      6ab92afc
    • N
      drm/i915/psr: disable psr2 for resolution greater than 32X20 · bd709898
      Nagaraju, Vathsala 提交于
      psr1 is also disabled for panel resolution  greater than 32X20.
      Added psr2 check to disable only for psr2 panels having resolution
      greater than 32X20.
      
      issue was introduced by
      commit-id : "acf45d11"
      commit message: "PSR2 is restricted to work with panel resolutions
      upto 3200x2000, move the check to intel_psr_match_conditions and fully
      block psr."
      
      v2: (Rodrigo)
         Add previous commit details which introduced the issue
      
      Fixes: acf45d11 ("drm/i915/psr: disable psr2 for resolution greater than 32X20")
      Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
      Cc: Jim Bride <jim.bride@linux.intel.com>
      Cc: Yaroslav Shabalin <yaroslav.shabalin@gmail.com>
      Reported-by: NYaroslav Shabalin <yaroslav.shabalin@gmail.com>
      Reviewed-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Signed-off-by: Nvathsala nagaraju <vathsala.nagaraju@intel.com>
      Signed-off-by: NRodrigo Vivi <rodrigo.vivi@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/49935bdff896ee3140bed471012b9f9110a863a4.1495729964.git.vathsala.nagaraju@intel.com
      (cherry picked from commit bef8c056)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      bd709898
    • C
      drm/i915: Hold a wakeref for probing the ring registers · d9533f19
      Chris Wilson 提交于
      Allow intel_engine_is_idle() to be called outside of the GT wakeref by
      acquiring the device runtime pm for ourselves. This allows the function
      to act as check after we assume the engine is idle and we release the GT
      wakeref held whilst we have requests. At the moment, we do not call it
      outside of an awake context but taking the wakeref as required makes it
      more convenient to use for quick debugging in future.
      
      [ 2613.401647] RPM wakelock ref not held during HW access
      [ 2613.401684] ------------[ cut here ]------------
      [ 2613.401720] WARNING: CPU: 5 PID: 7739 at drivers/gpu/drm/i915/intel_drv.h:1787 gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401731] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_hdmi x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_realtek coretemp snd_hda_codec_generic crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm r8169 mii mei_me lpc_ich mei prime_numbers [last unloaded: i915]
      [ 2613.401823] CPU: 5 PID: 7739 Comm: drv_missed_irq Tainted: G     U          4.12.0-rc2-CI-CI_DRM_421+ #1
      [ 2613.401825] Hardware name: MSI MS-7924/Z97M-G43(MS-7924), BIOS V1.12 02/15/2016
      [ 2613.401840] task: ffff880409e3a740 task.stack: ffffc900084dc000
      [ 2613.401861] RIP: 0010:gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401863] RSP: 0018:ffffc900084dfce8 EFLAGS: 00010292
      [ 2613.401869] RAX: 000000000000002a RBX: ffff8804016a8000 RCX: 0000000000000006
      [ 2613.401871] RDX: 0000000000000006 RSI: ffffffff81cbf2d9 RDI: ffffffff81c9e3a7
      [ 2613.401874] RBP: ffffc900084dfd18 R08: ffff880409e3afc8 R09: 0000000000000000
      [ 2613.401877] R10: 000000008a1c483f R11: 0000000000000000 R12: 000000000000209c
      [ 2613.401879] R13: 0000000000000001 R14: ffff8804016a8000 R15: ffff8804016ac150
      [ 2613.401882] FS:  00007f39ef3dd8c0(0000) GS:ffff88041fb40000(0000) knlGS:0000000000000000
      [ 2613.401885] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 2613.401887] CR2: 00000000023717c8 CR3: 00000002e7b34000 CR4: 00000000001406e0
      [ 2613.401889] Call Trace:
      [ 2613.401912]  intel_engine_is_idle+0x76/0x90 [i915]
      [ 2613.401931]  i915_gem_wait_for_idle+0xe6/0x1e0 [i915]
      [ 2613.401951]  fault_irq_set+0x40/0x90 [i915]
      [ 2613.401970]  i915_ring_test_irq_set+0x42/0x50 [i915]
      [ 2613.401976]  simple_attr_write+0xc7/0xe0
      [ 2613.401981]  full_proxy_write+0x4f/0x70
      [ 2613.401987]  __vfs_write+0x23/0x120
      [ 2613.401992]  ? rcu_read_lock_sched_held+0x75/0x80
      [ 2613.401996]  ? rcu_sync_lockdep_assert+0x2a/0x50
      [ 2613.401999]  ? __sb_start_write+0xfa/0x1f0
      [ 2613.402004]  vfs_write+0xc5/0x1d0
      [ 2613.402008]  ? trace_hardirqs_on_caller+0xe7/0x1c0
      [ 2613.402013]  SyS_write+0x44/0xb0
      [ 2613.402020]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [ 2613.402022] RIP: 0033:0x7f39eded6670
      [ 2613.402025] RSP: 002b:00007fffdcdcb1a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [ 2613.402030] RAX: ffffffffffffffda RBX: ffffffff81470203 RCX: 00007f39eded6670
      [ 2613.402033] RDX: 0000000000000001 RSI: 000000000041bc33 RDI: 0000000000000006
      [ 2613.402036] RBP: ffffc900084dff88 R08: 00007f39ef3dd8c0 R09: 0000000000000001
      [ 2613.402038] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000041bc33
      [ 2613.402041] R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000
      [ 2613.402046]  ? __this_cpu_preempt_check+0x13/0x20
      [ 2613.402052] Code: 01 9b fa e0 0f ff e9 28 fe ff ff 80 3d 6a dd 0e 00 00 0f 85 29 fe ff ff 48 c7 c7 48 19 29 a0 c6 05 56 dd 0e 00 01 e8 da 9a fa e0 <0f> ff e9 0f fe ff ff b9 01 00 00 00 ba 01 00 00 00 44 89 e6 48
      [ 2613.402199] ---[ end trace 31f0cfa93ab632bf ]---
      
      Fixes: 5400367a ("drm/i915: Ensure the engine is idle before manually changing HWS")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Mika Kuoppala <mika.kuoppala@intel.com>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170530121334.17364-2-chris@chris-wilson.co.ukReviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      (cherry picked from commit a091d4ee)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      d9533f19
    • C
      drm/i915: Short-circuit i915_gem_wait_for_idle() if already idle · e0da1963
      Chris Wilson 提交于
      If the device is asleep (no GT wakeref), we know the GPU is already idle.
      If we add an early return, we can avoid touching registers and checking
      hw state outside of the assumed GT wakelock. This prevents causing such
      errors whilst debugging:
      
      [ 2613.401647] RPM wakelock ref not held during HW access
      [ 2613.401684] ------------[ cut here ]------------
      [ 2613.401720] WARNING: CPU: 5 PID: 7739 at drivers/gpu/drm/i915/intel_drv.h:1787 gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401731] Modules linked in: snd_hda_intel i915 vgem snd_hda_codec_hdmi x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_realtek coretemp snd_hda_codec_generic crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core snd_pcm r8169 mii mei_me lpc_ich mei prime_numbers [last unloaded: i915]
      [ 2613.401823] CPU: 5 PID: 7739 Comm: drv_missed_irq Tainted: G     U          4.12.0-rc2-CI-CI_DRM_421+ #1
      [ 2613.401825] Hardware name: MSI MS-7924/Z97M-G43(MS-7924), BIOS V1.12 02/15/2016
      [ 2613.401840] task: ffff880409e3a740 task.stack: ffffc900084dc000
      [ 2613.401861] RIP: 0010:gen6_read32+0x21f/0x2b0 [i915]
      [ 2613.401863] RSP: 0018:ffffc900084dfce8 EFLAGS: 00010292
      [ 2613.401869] RAX: 000000000000002a RBX: ffff8804016a8000 RCX: 0000000000000006
      [ 2613.401871] RDX: 0000000000000006 RSI: ffffffff81cbf2d9 RDI: ffffffff81c9e3a7
      [ 2613.401874] RBP: ffffc900084dfd18 R08: ffff880409e3afc8 R09: 0000000000000000
      [ 2613.401877] R10: 000000008a1c483f R11: 0000000000000000 R12: 000000000000209c
      [ 2613.401879] R13: 0000000000000001 R14: ffff8804016a8000 R15: ffff8804016ac150
      [ 2613.401882] FS:  00007f39ef3dd8c0(0000) GS:ffff88041fb40000(0000) knlGS:0000000000000000
      [ 2613.401885] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 2613.401887] CR2: 00000000023717c8 CR3: 00000002e7b34000 CR4: 00000000001406e0
      [ 2613.401889] Call Trace:
      [ 2613.401912]  intel_engine_is_idle+0x76/0x90 [i915]
      [ 2613.401931]  i915_gem_wait_for_idle+0xe6/0x1e0 [i915]
      [ 2613.401951]  fault_irq_set+0x40/0x90 [i915]
      [ 2613.401970]  i915_ring_test_irq_set+0x42/0x50 [i915]
      [ 2613.401976]  simple_attr_write+0xc7/0xe0
      [ 2613.401981]  full_proxy_write+0x4f/0x70
      [ 2613.401987]  __vfs_write+0x23/0x120
      [ 2613.401992]  ? rcu_read_lock_sched_held+0x75/0x80
      [ 2613.401996]  ? rcu_sync_lockdep_assert+0x2a/0x50
      [ 2613.401999]  ? __sb_start_write+0xfa/0x1f0
      [ 2613.402004]  vfs_write+0xc5/0x1d0
      [ 2613.402008]  ? trace_hardirqs_on_caller+0xe7/0x1c0
      [ 2613.402013]  SyS_write+0x44/0xb0
      [ 2613.402020]  entry_SYSCALL_64_fastpath+0x1c/0xb1
      [ 2613.402022] RIP: 0033:0x7f39eded6670
      [ 2613.402025] RSP: 002b:00007fffdcdcb1a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [ 2613.402030] RAX: ffffffffffffffda RBX: ffffffff81470203 RCX: 00007f39eded6670
      [ 2613.402033] RDX: 0000000000000001 RSI: 000000000041bc33 RDI: 0000000000000006
      [ 2613.402036] RBP: ffffc900084dff88 R08: 00007f39ef3dd8c0 R09: 0000000000000001
      [ 2613.402038] R10: 0000000000000000 R11: 0000000000000246 R12: 000000000041bc33
      [ 2613.402041] R13: 0000000000000006 R14: 0000000000000000 R15: 0000000000000000
      [ 2613.402046]  ? __this_cpu_preempt_check+0x13/0x20
      [ 2613.402052] Code: 01 9b fa e0 0f ff e9 28 fe ff ff 80 3d 6a dd 0e 00 00 0f 85 29 fe ff ff 48 c7 c7 48 19 29 a0 c6 05 56 dd 0e 00 01 e8 da 9a fa e0 <0f> ff e9 0f fe ff ff b9 01 00 00 00 ba 01 00 00 00 44 89 e6 48
      [ 2613.402199] ---[ end trace 31f0cfa93ab632bf ]---
      
      Fixes: 25112b64 ("drm/i915: Wait for all engines to be idle as part of i915_gem_wait_for_idle()")
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170530121334.17364-1-chris@chris-wilson.co.ukReviewed-by: NJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
      (cherry picked from commit 863e9fde)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      e0da1963
    • K
      drm/i915: Disable decoupled MMIO · 4c4c5655
      Kai Chen 提交于
      The decoupled MMIO feature doesn't work as intended by HW team. Enabling
      it with forcewake will only make debugging efforts more difficult, so
      let's disable it.
      
      Fixes: 85ee17eb ("drm/i915/bxt: Broxton decoupled MMIO")
      Cc: Zhe Wang <zhe1.wang@intel.com>
      Cc: Praveen Paneri <praveen.paneri@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Jani Nikula <jani.nikula@linux.intel.com>
      Cc: intel-gfx@lists.freedesktop.org
      Cc: <stable@vger.kernel.org> # v4.10+
      Signed-off-by: NKai Chen <kai.chen@intel.com>
      Reviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170523215812.18328-2-kai.chen@intel.com
      (cherry picked from commit 0051c10a)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      4c4c5655
    • M
      drm/i915/guc: Remove stale comment for q_fail · 4ca9a582
      Michal Wajdeczko 提交于
      This member was dropped long time ago.
      
      Fixes: 774439e1 ("drm/i915/guc: re-optimise i915_guc_client layout")
      Signed-off-by: NMichal Wajdeczko <michal.wajdeczko@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Link: http://patchwork.freedesktop.org/patch/msgid/20170518113104.54400-1-michal.wajdeczko@intel.comReviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      (cherry picked from commit 4afc67be)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      4ca9a582
    • T
      drm/vmwgfx: Bump driver minor and date · 1929e661
      Thomas Hellstrom 提交于
      While the atomic modesetting capability is signaled also elsewhere, also
      reflect it by a driver minor bump.
      Signed-off-by: NThomas Hellstrom <thellstrom@vmware.com>
      1929e661
    • S
      drm/vmwgfx: Remove unused legacy cursor functions · f470a774
      Sinclair Yeh 提交于
      These function implementations and/or declarations are no longer used
      now that atomic is enabled.
      Signed-off-by: NSinclair Yeh <syeh@vmware.com>
      Reported-by: NDaniel Vetter <daniel@ffwll.ch>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      f470a774
    • C
      drm/vmwgfx: fix spelling mistake "exeeds" -> "exceeds" · a2e5a3e2
      Colin Ian King 提交于
      Trivial fix to spelling mistake in DRM_ERROR error message.
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Reviewed-by: NSinclair Yeh <syeh@vmware.com>
      a2e5a3e2
    • S
      drm/vmwgfx: Fix large topology crash · a1ac6339
      Sinclair Yeh 提交于
      The previous attempt at this had an issue with with num_clips > 1
      because it would always end up using the coordinates of the last
      clip while using width and height calculated from the bounding
      box of all the clips.
      
      So if the last clip happens to be not at the top-left corner of
      the bounding box, the CPU blit operation would go out of bounds.
      
      The original intent was to coalesce all the clips into one blit,
      and to do that we need to also track the starting point of the
      content buffer.
      Signed-off-by: NSinclair Yeh <syeh@vmware.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      a1ac6339
    • S
      drm/vmwgfx: Make sure to update STDU when FB is updated · 8a309c8a
      Sinclair Yeh 提交于
      When a new FB is bound, we have to send an update command otherwise
      the new FB may not be shown
      Signed-off-by: NSinclair Yeh <syeh@vmware.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      8a309c8a
    • S
      drm/vmwgfx: Make sure backup_handle is always valid · 07678eca
      Sinclair Yeh 提交于
      When vmw_gb_surface_define_ioctl() is called with an existing buffer,
      we end up returning an uninitialized variable in the backup_handle.
      
      The fix is to first initialize backup_handle to 0 just to be sure, and
      second, when a user-provided buffer is found, we will use the
      req->buffer_handle as the backup_handle.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NMurray McAllister <murray.mcallister@insomniasec.com>
      Signed-off-by: NSinclair Yeh <syeh@vmware.com>
      Reviewed-by: NDeepak Rawat <drawat@vmware.com>
      07678eca
    • D
      drm/vmwgfx: Handle vmalloc() failure in vmw_local_fifo_reserve() · f0c62e98
      Dan Carpenter 提交于
      If vmalloc() fails then we need to a bit of cleanup before returning.
      
      Cc: <stable@vger.kernel.org>
      Fixes: fb1d9738 ("drm/vmwgfx: Add DRM driver for VMware Virtual GPU")
      Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NSinclair Yeh <syeh@vmware.com>
      f0c62e98
    • S
      drm/vmwgfx: Don't create proxy surface for cursor · bbd5fefe
      Sinclair Yeh 提交于
      With atomic, the cursor surface is treated like a FB.  Creating
      a proxy surface for cursor doesn't gain us much benefit.
      
      This fixes the issue on atomic enabled 2D VMs where the cursor
      disappears.
      Signed-off-by: NSinclair Yeh <syeh@vmware.com>
      Reviewed-by: NThomas Hellstrom <thellstrom@vmware.com>
      bbd5fefe
    • V
      drm/vmwgfx: limit the number of mip levels in vmw_gb_surface_define_ioctl() · ee9c4e68
      Vladis Dronov 提交于
      The 'req->mip_levels' parameter in vmw_gb_surface_define_ioctl() is
      a user-controlled 'uint32_t' value which is used as a loop count limit.
      This can lead to a kernel lockup and DoS. Add check for 'req->mip_levels'.
      
      References:
      https://bugzilla.redhat.com/show_bug.cgi?id=1437431
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NVladis Dronov <vdronov@redhat.com>
      Reviewed-by: NSinclair Yeh <syeh@vmware.com>
      ee9c4e68
    • J
      drm/i915: Serialize GTT/Aperture accesses on BXT · d86b18a0
      Jon Bloomfield 提交于
      BXT has a H/W issue with IOMMU which can lead to system hangs when
      Aperture accesses are queued within the GAM behind GTT Accesses.
      
      This patch avoids the condition by wrapping all GTT updates in stop_machine
      and using a flushing read prior to restarting the machine.
      
      The stop_machine guarantees no new Aperture accesses can begin while
      the PTE writes are being emmitted. The flushing read ensures that
      any following Aperture accesses cannot begin until the PTE writes
      have been cleared out of the GAM's fifo.
      
      Only FOLLOWING Aperture accesses need to be separated from in flight
      PTE updates. PTE Writes may follow tightly behind already in flight
      Aperture accesses, so no flushing read is required at the start of
      a PTE update sequence.
      
      This issue was reproduced by running
      	igt/gem_readwrite and
      	igt/gem_render_copy
      simultaneously from different processes, each in a tight loop,
      with INTEL_IOMMU enabled.
      
      This patch was originally published as:
      	drm/i915: Serialize GTT Updates on BXT
      
      [Note: This will cause a performance penalty for some use cases, but
      avoiding hangs trumps performance hits. This may need to be worked
      around in Mesa to recover the lost performance.]
      
      v2: Move bxt/iommu detection into static function
          Remove #ifdef CONFIG_INTEL_IOMMU protection
          Make function names more reflective of purpose
          Move flushing read into static function
      
      v3: Tidy up for checkpatch.pl
      
      Testcase: igt/gem_concurrent_blit
      Signed-off-by: NJon Bloomfield <jon.bloomfield@intel.com>
      Cc: John Harrison <john.C.Harrison@intel.com>
      Cc: Chris Wilson <chris@chris-wilson.co.uk>
      Cc: Daniel Vetter <daniel.vetter@intel.com>
      Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
      Cc: stable@vger.kernel.org
      Link: http://patchwork.freedesktop.org/patch/msgid/1495641251-30022-1-git-send-email-jon.bloomfield@intel.comReviewed-by: NTvrtko Ursulin <tvrtko.ursulin@intel.com>
      Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
      (cherry picked from commit 0ef34ad6)
      Signed-off-by: NJani Nikula <jani.nikula@intel.com>
      d86b18a0
    • J
      xen/privcmd: Support correctly 64KB page granularity when mapping memory · 753c09b5
      Julien Grall 提交于
      Commit 5995a68a "xen/privcmd: Add support for Linux 64KB page granularity" did
      not go far enough to support 64KB in mmap_batch_fn.
      
      The variable 'nr' is the number of 4KB chunk to map. However, when Linux
      is using 64KB page granularity the array of pages (vma->vm_private_data)
      contain one page per 64KB. Fix it by incrementing st->index correctly.
      
      Furthermore, st->va is not correctly incremented as PAGE_SIZE !=
      XEN_PAGE_SIZE.
      
      Fixes: 5995a68a ("xen/privcmd: Add support for Linux 64KB page granularity")
      CC: stable@vger.kernel.org
      Reported-by: NFeng Kan <fkan@apm.com>
      Signed-off-by: NJulien Grall <julien.grall@arm.com>
      Reviewed-by: NBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Signed-off-by: NJuergen Gross <jgross@suse.com>
      753c09b5
    • K
      nvme: relax APST default max latency to 100ms · 9947d6a0
      Kai-Heng Feng 提交于
      Christoph Hellwig suggests we should to make APST work out of the box.
      Hence relax the the default max latency to make them able to enter
      deepest power state on default.
      
      Here are id-ctrl excerpts from two high latency NVMes:
      
      vid     : 0x14a4
      ssvid   : 0x1b4b
      mn      : CX2-GB1024-Q11 NVMe LITEON 1024GB
      ps    3 : mp:0.1000W non-operational enlat:5000 exlat:5000 rrt:3 rrl:3
                rwt:3 rwl:3 idle_power:- active_power:-
      ps    4 : mp:0.0100W non-operational enlat:50000 exlat:100000 rrt:4 rrl:4
                rwt:4 rwl:4 idle_power:- active_power:-
      
      vid     : 0x15b7
      ssvid   : 0x1b4b
      mn      : A400 NVMe SanDisk 512GB
      ps    3 : mp:0.0500W non-operational enlat:51000 exlat:10000 rrt:0 rrl:0
                rwt:0 rwl:0 idle_power:- active_power:-
      ps    4 : mp:0.0055W non-operational enlat:1000000 exlat:100000 rrt:0 rrl:0
                rwt:0 rwl:0 idle_power:- active_power:-
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      9947d6a0
    • K
      nvme: only consider exit latency when choosing useful non-op power states · da87591b
      Kai-Heng Feng 提交于
      When a NVMe is in non-op states, the latency is exlat.
      The latency will be enlat + exlat only when the NVMe tries to transit
      from operational state right atfer it begins to transit to
      non-operational state, which should be a rare case.
      
      Therefore, as Andy Lutomirski suggests, use exlat only when deciding power
      states to trainsit to.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      da87591b
    • J
      nvme-fc: fix missing put reference on controller create failure · 24b7f059
      James Smart 提交于
      The failure case, of a create controller request, called
      nvme_uninit_ctrl() but didn't do a put to allow the nvme
      controller to be deleted.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      24b7f059
    • J
      nvme-fc: on lldd/transport io error, terminate association · f874d5d0
      James Smart 提交于
      Per FC-NVME, when lldd or transport detects an i/o error, the
      connection must be terminated, which in turn requires the association
      to be termianted.  Currently the transport simply creates a nvme
      completion status of transport error and returns the io. The FC-NVME
      spec makes the mandate as initiator and host, depending on the error,
      can get out of sync on outstanding io counts (sqhd/sqtail).
      
      Implement the association teardown on lldd or transport detected
      errors.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      f874d5d0
    • S
      nvme-rdma: fast fail incoming requests while we reconnect · e818a5b4
      Sagi Grimberg 提交于
      When we encounter an transport/controller errors, error recovery
      kicks in which performs:
      1. stops io/admin queues
      2. moves transport queues out of LIVE state
      3. fast fail pending io
      4. schedule periodic reconnects.
      
      But we also need to fast fail incoming IO taht enters after we
      already scheduled. Given that our queue is not LIVE anymore, simply
      restart the request queues to fail in .queue_rq
      Reported-by: NAlex Turin <alex@vastdata.com>
      Reported-by: Nshahar.salzman <shahar.salzman@gmail.com>
      Signed-off-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      e818a5b4
    • R
      nvme-pci: fix multiple ctrl removal scheduling · 82b057ca
      Rakesh Pandit 提交于
      Commit c5f6ce97 tries to address multiple resets but fails as
      work_busy doesn't involve any synchronization and can fail.  This is
      reproducible easily as can be seen by WARNING below which is triggered
      with line:
      
      WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING)
      
      Allowing multiple resets can result in multiple controller removal as
      well if different conditions inside nvme_reset_work fail and which
      might deadlock on device_release_driver.
      
      [  480.327007] WARNING: CPU: 3 PID: 150 at drivers/nvme/host/pci.c:1900 nvme_reset_work+0x36c/0xec0
      [  480.327008] Modules linked in: rfcomm fuse nf_conntrack_netbios_ns nf_conntrack_broadcast...
      [  480.327044]  btusb videobuf2_core ghash_clmulni_intel snd_hwdep cfg80211 acer_wmi hci_uart..
      [  480.327065] CPU: 3 PID: 150 Comm: kworker/u16:2 Not tainted 4.12.0-rc1+ #13
      [  480.327065] Hardware name: Acer Predator G9-591/Mustang_SLS, BIOS V1.10 03/03/2016
      [  480.327066] Workqueue: nvme nvme_reset_work
      [  480.327067] task: ffff880498ad8000 task.stack: ffffc90002218000
      [  480.327068] RIP: 0010:nvme_reset_work+0x36c/0xec0
      [  480.327069] RSP: 0018:ffffc9000221bdb8 EFLAGS: 00010246
      [  480.327070] RAX: 0000000000460000 RBX: ffff880498a98128 RCX: dead000000000200
      [  480.327070] RDX: 0000000000000001 RSI: ffff8804b1028020 RDI: ffff880498a98128
      [  480.327071] RBP: ffffc9000221be50 R08: 0000000000000000 R09: 0000000000000000
      [  480.327071] R10: ffffc90001963ce8 R11: 000000000000020d R12: ffff880498a98000
      [  480.327072] R13: ffff880498a53500 R14: ffff880498a98130 R15: ffff880498a98128
      [  480.327072] FS:  0000000000000000(0000) GS:ffff8804c1cc0000(0000) knlGS:0000000000000000
      [  480.327073] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  480.327074] CR2: 00007ffcf3c37f78 CR3: 0000000001e09000 CR4: 00000000003406e0
      [  480.327074] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  480.327075] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  480.327075] Call Trace:
      [  480.327079]  ? __switch_to+0x227/0x400
      [  480.327081]  process_one_work+0x18c/0x3a0
      [  480.327082]  worker_thread+0x4e/0x3b0
      [  480.327084]  kthread+0x109/0x140
      [  480.327085]  ? process_one_work+0x3a0/0x3a0
      [  480.327087]  ? kthread_park+0x60/0x60
      [  480.327102]  ret_from_fork+0x2c/0x40
      [  480.327103] Code: e8 5a dc ff ff 85 c0 41 89 c1 0f.....
      
      This patch addresses the problem by using state of controller to
      decide whether reset should be queued or not as state change is
      synchronizated using controller spinlock.  Also cancel_work_sync is
      used to make sure remove cancels the reset_work and waits for it to
      finish.  This patch also changes return value from -ENODEV to more
      appropriate -EBUSY if nvme_reset fails to change state.
      
      Fixes: c5f6ce97 ("nvme: don't schedule multiple resets")
      Signed-off-by: NRakesh Pandit <rakesh@tuxera.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      82b057ca
    • M
      nvme: fix hang in remove path · 82654b6b
      Ming Lei 提交于
      We need to start admin queues too in nvme_kill_queues()
      for avoiding hang in remove path[1].
      
      This patch is very similar with 806f026f(nvme: use
      blk_mq_start_hw_queues() in nvme_kill_queues()).
      
      [1] hang stack trace
      [<ffffffff813c9716>] blk_execute_rq+0x56/0x80
      [<ffffffff815cb6e9>] __nvme_submit_sync_cmd+0x89/0xf0
      [<ffffffff815ce7be>] nvme_set_features+0x5e/0x90
      [<ffffffff815ce9f6>] nvme_configure_apst+0x166/0x200
      [<ffffffff815cef45>] nvme_set_latency_tolerance+0x35/0x50
      [<ffffffff8157bd11>] apply_constraint+0xb1/0xc0
      [<ffffffff8157cbb4>] dev_pm_qos_constraints_destroy+0xf4/0x1f0
      [<ffffffff8157b44a>] dpm_sysfs_remove+0x2a/0x60
      [<ffffffff8156d951>] device_del+0x101/0x320
      [<ffffffff8156db8a>] device_unregister+0x1a/0x60
      [<ffffffff8156dc4c>] device_destroy+0x3c/0x50
      [<ffffffff815cd295>] nvme_uninit_ctrl+0x45/0xa0
      [<ffffffff815d4858>] nvme_remove+0x78/0x110
      [<ffffffff81452b69>] pci_device_remove+0x39/0xb0
      [<ffffffff81572935>] device_release_driver_internal+0x155/0x210
      [<ffffffff81572a02>] device_release_driver+0x12/0x20
      [<ffffffff815d36fb>] nvme_remove_dead_ctrl_work+0x6b/0x70
      [<ffffffff810bf3bc>] process_one_work+0x18c/0x3a0
      [<ffffffff810bf61e>] worker_thread+0x4e/0x3b0
      [<ffffffff810c5ac9>] kthread+0x109/0x140
      [<ffffffff8185800c>] ret_from_fork+0x2c/0x40
      [<ffffffffffffffff>] 0xffffffffffffffff
      
      Fixes: c5552fde("nvme: Enable autonomous power state transitions")
      Reported-by: NRakesh Pandit <rakesh@tuxera.com>
      Tested-by: NRakesh Pandit <rakesh@tuxera.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      82654b6b
    • R
      Revert "ACPI / sleep: Ignore spurious SCI wakeups from suspend-to-idle" · f3b7eaae
      Rafael J. Wysocki 提交于
      Revert commit eed4d47e (ACPI / sleep: Ignore spurious SCI wakeups
      from suspend-to-idle) as it turned out to be premature and triggered
      a number of different issues on various systems.
      
      That includes, but is not limited to, premature suspend-to-RAM aborts
      on Dell XPS 13 (9343) reported by Dominik.
      
      The issue the commit in question attempted to address is real and
      will need to be taken care of going forward, but evidently more work
      is needed for this purpose.
      Reported-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f3b7eaae
    • C
      net: stmmac: fix a broken u32 less than zero check · 1d3028f4
      Colin Ian King 提交于
      The check that queue is less or equal to zero is always true
      because queue is a u32; queue is decremented and will wrap around
      and never go -ve. Fix this by making queue an int.
      
      Detected by CoverityScan, CID#1428988 ("Unsigned compared against 0")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1d3028f4
    • N
      net: stmmac: fix completely hung TX when using TSO · 426849e6
      Niklas Cassel 提交于
      stmmac_tso_allocator can fail to set the Last Descriptor bit
      on a descriptor that actually was the last descriptor.
      
      This happens when the buffer of the last descriptor ends
      up having a size of exactly TSO_MAX_BUFF_SIZE.
      
      When the IP eventually reaches the next last descriptor,
      which actually has the bit set, the DMA will hang.
      
      When the DMA hangs, we get a tx timeout, however,
      since stmmac does not do a complete reset of the IP
      in stmmac_tx_timeout, we end up in a state with
      completely hung TX.
      Signed-off-by: NNiklas Cassel <niklas.cassel@axis.com>
      Acked-by: NGiuseppe Cavallaro <peppe.cavallaro@st.com>
      Acked-by: NAlexandre TORGUE <alexandre.torgue@st.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      426849e6
    • M
      net: ethoc: enable NAPI before poll may be scheduled · d220b942
      Max Filippov 提交于
      ethoc_reset enables device interrupts, ethoc_interrupt may schedule a
      NAPI poll before NAPI is enabled in the ethoc_open, which results in
      device being unable to send or receive anything until it's closed and
      reopened. In case the device is flooded with ingress packets it may be
      unable to recover at all.
      Move napi_enable above ethoc_reset in the ethoc_open to fix that.
      
      Fixes: a1702857 ("net: Add support for the OpenCores 10/100 Mbps Ethernet MAC.")
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Reviewed-by: NTobias Klauser <tklauser@distanz.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d220b942