1. 21 Apr, 2020 8 commits
  2. 20 Apr, 2020 19 commits
  3. 18 Apr, 2020 3 commits
  4. 17 Apr, 2020 10 commits
    • José Roberto de Souza's avatar
      drm/i915/display: Load DP_TP_CTL/STATUS offset before use it · edcb9028
      José Roberto de Souza authored
      Right now dp.regs.dp_tp_ctl/status are only set during the encoder
      pre_enable() hook, what is causing all reads and writes to those
      registers to go to offset 0x0 before pre_enable() is executed.
      
      So if i915 takes the BIOS state and don't do a modeset any following
      link retraing will fail.
      
      In the case that i915 needs to do a modeset, the DDI disable sequence
      will write to a wrong register not disabling DP 'Transport Enable' in
      DP_TP_CTL, making a HDMI modeset in the same port/transcoder to
      not light up the monitor.
      
      So here for GENs older than 12, that have those registers fixed at
      port offset range it is loading at encoder/port init while for GEN12
      it will keep setting it at encoder pre_enable() and during HW state
      readout.
      
      Fixes: 4444df6e ("drm/i915/tgl: move DP_TP_* to transcoder")
      Cc: Matt Roper <matthew.d.roper@intel.com>
      Cc: Lucas De Marchi <lucas.demarchi@intel.com>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Reviewed-by: default avatarMatt Roper <matthew.d.roper@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414230442.262092-1-jose.souza@intel.com
      edcb9028
    • José Roberto de Souza's avatar
      drm/i915/tc: Do not warn when aux power well of static TC ports timeout · 0f892509
      José Roberto de Souza authored
      This is a expected timeout of static TC ports not conneceted, so
      not throwing warnings that would taint CI.
      
      v3:
      - moved checks to tc_phy_aux_timeout_expected()
      
      v4:
      - moved and add comments to tc_phy_aux_timeout_expected()
      
      v5:
      - only checking tc_legacy_port for TC ports
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-8-jose.souza@intel.com
      0f892509
    • José Roberto de Souza's avatar
      drm/i915/tc: Catch TC users accessing FIA registers without enable aux · 3ed347d1
      José Roberto de Souza authored
      As described in "drm/i915/tc/icl: Implement TC cold sequences" users
      of TC functions should held aux power well during access to avoid
      read garbage due HW in TC cold state.
      
      v3:
      - renamed is_tc_cold_blocked() to assert_tc_cold_blocked()
      - restored the removed 0xffffffff checks
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Tested-by: default avatarYou-Sheng Yang <vicamo.yang@canonical.com>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-7-jose.souza@intel.com
      3ed347d1
    • José Roberto de Souza's avatar
      drm/i915/tc/tgl: Implement TC cold sequences · 3c02934b
      José Roberto de Souza authored
      TC ports can enter in TCCOLD to save power and is required to request
      to PCODE to exit this state before use or read to TC registers.
      
      For TGL there is a new MBOX command to do that with a parameter to ask
      PCODE to exit and block TCCOLD entry or unblock TCCOLD entry.
      
      So adding a new power domain to reuse the refcount and only allow
      TC cold when all TC ports are not in use.
      
      v2:
      - fixed missing case in intel_display_power_domain_str()
      - moved tgl_tc_cold_request to intel_display_power.c
      - renamed TGL_TC_COLD_OFF to TGL_TC_COLD_OFF_POWER_DOMAINS
      - added all TC and TBT aux power domains to
      TGL_TC_COLD_OFF_POWER_DOMAINS
      
      v3:
      - added one msec sleep when PCODE returns -EAGAIN
      - added timeout of 5msec to not loop forever if
      sandybridge_pcode_write_timeout() keeps returning -EAGAIN
      
      v4:
      - Made failure to block or unblock TC cold a error
      - removed 5msec timeout, instead giving PCODE 1msec by up 3 times to
      recover from the internal error
      
      v5:
      - only sleeping 1msec when ret is -EAGAIN
      
      BSpec: 49294
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-6-jose.souza@intel.com
      3c02934b
    • José Roberto de Souza's avatar
      drm/i915/tc: Skip ref held check for TC legacy aux power wells · 7ce40a67
      José Roberto de Souza authored
      As part of ICL TC cold exit sequences we need to request aux power
      well before lock the access to TC ports, so skiping the
      intel_tc_port_ref_held() check for TC legacy ports.
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Tested-by: default avatarYou-Sheng Yang <vicamo.yang@canonical.com>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-5-jose.souza@intel.com
      7ce40a67
    • José Roberto de Souza's avatar
      drm/i915/tc/icl: Implement TC cold sequences · feb7e0ef
      José Roberto de Souza authored
      This is required for legacy/static TC ports as IOM is not aware of
      the connection and will not trigger the TC cold exit.
      
      Just request PCODE to exit TCCOLD is not enough as it could enter
      again before driver makes use of the port, to prevent it BSpec states
      that aux powerwell should be held.
      
      So here embedding the TC cold exit sequence into ICL aux enable,
      it will enable aux and then request TC cold to exit.
      
      The TC cold block(exit and aux hold) and unblock was added to some
      exported TC functions for the others and to access PHY registers,
      callers should enable and keep aux powerwell enabled during access.
      
      Also adding TC cold check and warnig in tc_port_load_fia_params() as
      at this point of the driver initialization we can't request power
      wells, if we get this warning we will need to figure out how to handle
      it.
      
      v2:
      - moved ICL TC cold exit function to intel_display_power
      - using dig_port->tc_legacy_port to only execute sequences for legacy
      ports, hopefully VBTs will have this right
      - fixed check to call _hsw_power_well_continue_enable()
      - calling _hsw_power_well_continue_enable() unconditionally in
      icl_tc_phy_aux_power_well_enable(), if needed we will surpress timeout
      warnings of TC legacy ports
      - only blocking TC cold around fia access
      
      v3:
      - added timeout of 5msec to not loop forever if
      sandybridge_pcode_write_timeout() keeps returning -EAGAIN
      returning -EAGAIN in in icl_tc_cold_exit()
      - removed leftover tc_cold_wakeref
      - added one msec sleep when PCODE returns -EAGAIN
      
      v4:
      - removed 5msec timeout, instead giving 1msec to whoever is using
      PCODE to finish it up to 3 times
      - added a comment about turn TC cold exit failure as a error in future
      
      BSpec: 21750
      Closes: https://gitlab.freedesktop.org/drm/intel/issues/1296
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-4-jose.souza@intel.com
      feb7e0ef
    • José Roberto de Souza's avatar
      drm/i915/display: Split hsw_power_well_enable() into two · f8bb28e6
      José Roberto de Souza authored
      This is a preparation for ICL TC cold exit sequences.
      
      v2:
      - renamed new functions to hsw_power_well_enable_prepare()/complete()
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Tested-by: default avatarYou-Sheng Yang <vicamo.yang@canonical.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-3-jose.souza@intel.com
      f8bb28e6
    • José Roberto de Souza's avatar
      drm/i915/display: Add intel_legacy_aux_to_power_domain() · dba6b0b4
      José Roberto de Souza authored
      This is a similar function to intel_aux_power_domain() but it do not
      care about TBT ports, this will be needed by ICL TC sequences.
      
      v2:
      - renamed to intel_legacy_aux_to_power_domain()
      
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Cooper Chiou <cooper.chiou@intel.com>
      Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Tested-by: default avatarYou-Sheng Yang <vicamo.yang@canonical.com>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-2-jose.souza@intel.com
      dba6b0b4
    • José Roberto de Souza's avatar
      drm/i915/display: Move out code to return the digital_port of the aux ch · 34a3f0b2
      José Roberto de Souza authored
      Moving the code to return the digital port of the aux channel also
      removing the intel_phy_is_tc() to make it generic.
      digital_port will be needed in icl_tc_phy_aux_power_well_enable()
      so adding it as a parameter to icl_tc_port_assert_ref_held().
      
      While at at removing the duplicated call to icl_tc_phy_aux_ch() in
      icl_tc_port_assert_ref_held().
      
      v2:
      - fixed build when DRM_I915_DEBUG_RUNTIME_PM is not set
      - moved to before hsw_wait_for_power_well_enable() as it will be
      needed by hsw_wait_for_power_well_enable() in a future patch
      
      v4:
      - fixed action of if (!dig_port), continue instead of return
      
      Cc: You-Sheng Yang <vicamo@gmail.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Tested-by: default avatarYou-Sheng Yang <vicamo.yang@canonical.com>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200414194956.164323-1-jose.souza@intel.com
      34a3f0b2
    • José Roberto de Souza's avatar
      drm/i915: Add missing deinitialization cases of load failure · c0ff9e5e
      José Roberto de Souza authored
      The intel_display_power_put_async() used in TC cold sequences made
      easy to hit the missing deinitialization of driver in case of load
      failure as seen in the stack trace bellow.
      
      intel_modeset_driver_remove_noirq() had to be removed from
      i915_driver_modeset_remove_noirq() as those are different
      initialialition steps with IRQ and GEM initialization in between then.
      
      [drm:__intel_engine_init_ctx_wa [i915]] Initialized 3 context workarounds on rcs'0
      [drm:__i915_inject_probe_error [i915]] Injecting failure -19 at checkpoint 36 [__uc_init:294]
      [drm:i915_hdcp_component_unbind [i915]] I915 HDCP comp unbind
      [drm:edp_panel_vdd_off_sync [i915]] Turning [ENCODER:275:DDI A] VDD off
      [drm:edp_panel_vdd_off_sync [i915]] PP_STATUS: 0x00000000 PP_CONTROL: 0x00000060
      [drm:intel_power_well_disable [i915]] disabling AUX A
      general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b6b6b: 0000 [#1] PREEMPT SMP NOPTI
      CPU: 3 PID: 1142 Comm: kworker/u16:20 Tainted: G     U            5.6.0-CI-Patchwork_17226+ #1
      Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.2457.A16.1912270059 12/27/2019
      Workqueue: events_unbound intel_display_power_put_async_work [i915]
      RIP: 0010:__intel_display_power_put_domain+0xa5/0x180 [i915]
      Code: 48 85 c0 78 54 44 89 e1 41 bd 01 00 00 00 49 c7 c4 80 44 41 a0 49 d3 e5 eb 0d 48 83 eb 10 48 3b 9d 08 ad 00 00 78 32 48 8b 03 <4c> 85 68 10 74 ea 8b 53 08 85 d2 74 2d 83 ea 01 85 d2 89 53 08 75
      RSP: 0018:ffffc9000061fdb0 EFLAGS: 00010206
      RAX: 6b6b6b6b6b6b6b6b RBX: ffff8884948f5df0 RCX: 000000000000003d
      RDX: 0000000080000001 RSI: 0000000000000000 RDI: 0000000000000000
      RBP: ffff888479be0000 R08: ffff88849a180920 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffa0414480
      R13: 2000000000000000 R14: ffff888479beb320 R15: 2000000000000000
      FS:  0000000000000000(0000) GS:ffff88849ff80000(0000) knlGS:0000000000000000
      CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      CR2: 00005634fa8ed670 CR3: 0000000005610004 CR4: 0000000000760ee0
      PKRU: 55555554
      Call Trace:
       release_async_put_domains+0x9b/0x110 [i915]
       intel_display_power_put_async_work+0x91/0xf0 [i915]
       process_one_work+0x260/0x600
       ? worker_thread+0xc9/0x380
       worker_thread+0x37/0x380
       ? process_one_work+0x600/0x600
       kthread+0x119/0x130
       ? kthread_park+0x80/0x80
       ret_from_fork+0x24/0x50
      Modules linked in: i915(+) vgem snd_hda_codec_hdmi mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul cdc_ether usbnet mii snd_intel_dspcfg ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core e1000e ptp mei_me snd_pcm pps_core mei intel_lpss_pci prime_numbers [last unloaded: i915]
      ---[ end trace b402d1b4060f8b97 ]---
      BUG: sleeping function called from invalid context at kernel/sched/completion.c:99
      in_atomic(): 0, irqs_disabled(): 0, non_block: 0, pid: 1142, name: kworker/u16:20
      INFO: lockdep is turned off.
      Preemption disabled at:
      [<0000000000000000>] 0x0
      CPU: 3 PID: 1142 Comm: kworker/u16:20 Tainted: G     UD           5.6.0-CI-Patchwork_17226+ #1
      Hardware name: Intel Corporation Tiger Lake Client Platform/TigerLake U DDR4 SODIMM RVP, BIOS TGLSFWI1.R00.2457.A16.1912270059 12/27/2019
      Workqueue: events_unbound intel_display_power_put_async_work [i915]
      Call Trace:
       dump_stack+0x71/0x9b
       ___might_sleep+0x178/0x260
       wait_for_completion+0x37/0x1a0
       virt_efi_query_variable_info+0x161/0x1b0
       efi_query_variable_store+0xb3/0x1a0
       ? efivar_entry_set_safe+0x19c/0x220
       efivar_entry_set_safe+0x19c/0x220
       ? efi_pstore_write+0x10b/0x150
       ? efi_pstore_write+0xa0/0x150
       efi_pstore_write+0x10b/0x150
       pstore_dump+0x123/0x340
       kmsg_dump+0x87/0x1b0
       oops_end+0x3e/0x90
       do_general_protection+0x1c3/0x2f0
       general_protection+0x2d/0x40
      RIP: 0010:__intel_display_power_put_domain+0xa5/0x180 [i915]
      Code: 48 85 c0 78 54 44 89 e1 41 bd 01 00 00 00 49 c7 c4 80 44 41 a0 49 d3 e5 eb 0d 48 83 eb 10 48 3b 9d 08 ad 00 00 78 32 48 8b 03 <4c> 85 68 10 74 ea 8b 53 08 85 d2 74 2d 83 ea 01 85 d2 89 53 08 75
      RSP: 0018:ffffc9000061fdb0 EFLAGS: 00010206
      RAX: 6b6b6b6b6b6b6b6b RBX: ffff8884948f5df0 RCX: 000000000000003d
      RDX: 0000000080000001 RSI: 0000000000000000 RDI: 0000000000000000
      RBP: ffff888479be0000 R08: ffff88849a180920 R09: 0000000000000000
      R10: 0000000000000000 R11: 0000000000000000 R12: ffffffffa0414480
      R13: 2000000000000000 R14: ffff888479beb320 R15: 2000000000000000
       release_async_put_domains+0x9b/0x110 [i915]
       intel_display_power_put_async_work+0x91/0xf0 [i915]
       process_one_work+0x260/0x600
       ? worker_thread+0xc9/0x380
       worker_thread+0x37/0x380
       ? process_one_work+0x600/0x600
       kthread+0x119/0x130
       ? kthread_park+0x80/0x80
       ret_from_fork+0x24/0x50
      ------------[ cut here ]------------
      WARNING: CPU: 3 PID: 1142 at kernel/rcu/tree_plugin.h:293 rcu_note_context_switch+0x87/0x650
      Modules linked in: i915(+) vgem snd_hda_codec_hdmi mei_hdcp x86_pkg_temp_thermal coretemp crct10dif_pclmul crc32_pclmul cdc_ether usbnet mii snd_intel_dspcfg ghash_clmulni_intel snd_hda_codec snd_hwdep snd_hda_core e1000e ptp mei_me snd_pcm pps_core mei intel_lpss_pci prime_numbers [last unloaded: i915]
      
      v2:
      - fixed handling in case of failure in drm_vblank_init()
      - moved i915_gem_driver_remove() call to before
      i915_driver_modeset_remove_noirq() this match initialization order too
      
      v3:
      - reverting call swap between i915_reset_error_state() and i915_gem_driver_remove()
      call order
      - improved label naming in i915_driver_modeset_probe_noirq()
      
      Closes: https://gitlab.freedesktop.org/drm/intel/issues/1647
      Cc: Imre Deak <imre.deak@intel.com>
      Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
      Cc: Jani Nikula <jani.nikula@intel.com>
      Reviewed-by: default avatarImre Deak <imre.deak@intel.com>
      Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Signed-off-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
      Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
      Link: https://patchwork.freedesktop.org/patch/msgid/20200416185841.125686-1-jose.souza@intel.com
      c0ff9e5e