1. 07 Nov, 2018 5 commits
    • Trigger Huang's avatar
      drm/ttm: Fix bo_global and mem_global kfree error · 30f33126
      Trigger Huang authored
      ttm_bo_glob and ttm_mem_glob are defined as structure instance, while
      not allocated by kzalloc, so kfree should not be invoked to release
      them anymore. Otherwise, it will cause the following kernel BUG when
      unloading amdgpu module
      
      [   48.419294] kernel BUG at /build/linux-5s7Xkn/linux-4.15.0/mm/slub.c:3894!
      [   48.419352] invalid opcode: 0000 [#1] SMP PTI
      [   48.419387] Modules linked in: amdgpu(OE-) amdchash(OE) amdttm(OE) amd_sched(OE) amdkcl(OE) amd_iommu_v2 drm_kms_helper drm i2c_algo_bit fb_sys_fops syscopyarea sysfillrect sysimgblt snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hda_core snd_hwdep kvm_intel kvm irqbypass crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_pcm snd_seq_midi snd_seq_midi_event snd_rawmidi pcbc snd_seq snd_seq_device snd_timer aesni_intel snd soundcore joydev aes_x86_64 crypto_simd glue_helper cryptd input_leds mac_hid serio_raw binfmt_misc nfsd auth_rpcgss nfs_acl lockd grace sunrpc sch_fq_codel parport_pc ppdev lp parport ip_tables x_tables autofs4 8139too psmouse i2c_piix4 8139cp mii floppy pata_acpi
      [   48.419782] CPU: 1 PID: 1281 Comm: modprobe Tainted: G           OE    4.15.0-20-generic #21-Ubuntu
      [   48.419838] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Ubuntu-1.8.2-1ubuntu1 04/01/2014
      [   48.419901] RIP: 0010:kfree+0x137/0x180
      [   48.419934] RSP: 0018:ffffb02101273bf8 EFLAGS: 00010246
      [   48.419974] RAX: ffffeee1418ad7e0 RBX: ffffffffc075f100 RCX: ffff8fed7fca7ed0
      [   48.420025] RDX: 0000000000000000 RSI: 000000000003440e RDI: 0000000022400000
      [   48.420073] RBP: ffffb02101273c10 R08: 0000000000000010 R09: ffff8fed7ffd3680
      [   48.420121] R10: ffffeee1418ad7c0 R11: ffff8fed7ffd3000 R12: ffffffffc075e2c0
      [   48.420169] R13: ffffffffc074ec10 R14: ffff8fed73063900 R15: ffff8fed737428e8
      [   48.420216] FS:  00007fdc912ec540(0000) GS:ffff8fed7fc80000(0000) knlGS:0000000000000000
      [   48.420267] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [   48.420308] CR2: 000055fa40c30060 CR3: 000000023470a006 CR4: 00000000003606e0
      [   48.420358] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [   48.420405] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [   48.420452] Call Trace:
      [   48.420485]  ttm_bo_global_kobj_release+0x20/0x30 [amdttm]
      [   48.420528]  kobject_release+0x6a/0x180
      [   48.420562]  kobject_put+0x28/0x50
      [   48.420595]  ttm_bo_global_release+0x36/0x50 [amdttm]
      [   48.420636]  amdttm_bo_device_release+0x119/0x180 [amdttm]
      [   48.420678]  ? amdttm_bo_clean_mm+0xa6/0xf0 [amdttm]
      [   48.420760]  amdgpu_ttm_fini+0xc9/0x180 [amdgpu]
      [   48.420821]  amdgpu_bo_fini+0x12/0x40 [amdgpu]
      [   48.420889]  gmc_v9_0_sw_fini+0x40/0x50 [amdgpu]
      [   48.420947]  amdgpu_device_fini+0x36f/0x4c0 [amdgpu]
      [   48.421007]  amdgpu_driver_unload_kms+0xb4/0x150 [amdgpu]
      [   48.421058]  drm_dev_unregister+0x46/0xf0 [drm]
      [   48.421102]  drm_dev_unplug+0x12/0x70 [drm]
      Signed-off-by: default avatarTrigger Huang <Trigger.Huang@amd.com>
      Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      30f33126
    • Lyude Paul's avatar
      drm/amd/amdgpu/dm: Fix dm_dp_create_fake_mst_encoder() · 0bf19b9f
      Lyude Paul authored
      [why]
      Removing connector reusage from DM to match the rest of the tree ended
      up revealing an issue that was surprisingly subtle. The original amdgpu
      code for DC that was submitted appears to have left a chunk in
      dm_dp_create_fake_mst_encoder() that tries to find a "master encoder",
      the likes of which isn't actually used or stored anywhere. It does so at
      the wrong time as well by trying to access parts of the drm_connector
      from the encoder init before it's actually been initialized. This
      results in a NULL pointer deref on MST hotplugs:
      
      [  160.696613] BUG: unable to handle kernel NULL pointer dereference at 0000000000000000
      [  160.697234] PGD 0 P4D 0
      [  160.697814] Oops: 0010 [#1] SMP PTI
      [  160.698430] CPU: 2 PID: 64 Comm: kworker/2:1 Kdump: loaded Tainted: G           O      4.19.0Lyude-Test+ #2
      [  160.699020] Hardware name: HP HP ZBook 15 G4/8275, BIOS P70 Ver. 01.22 05/17/2018
      [  160.699672] Workqueue: events_long drm_dp_mst_link_probe_work [drm_kms_helper]
      [  160.700322] RIP: 0010:          (null)
      [  160.700920] Code: Bad RIP value.
      [  160.701541] RSP: 0018:ffffc9000029fc78 EFLAGS: 00010206
      [  160.702183] RAX: 0000000000000000 RBX: ffff8804440ed468 RCX: ffff8804440e9158
      [  160.702778] RDX: 0000000000000000 RSI: ffff8804556c5700 RDI: ffff8804440ed000
      [  160.703408] RBP: ffff880458e21800 R08: 0000000000000002 R09: 000000005fca0a25
      [  160.704002] R10: ffff88045a077a3d R11: ffff88045a077a3c R12: ffff8804440ed000
      [  160.704614] R13: ffff880458e21800 R14: ffff8804440e9000 R15: ffff8804440e9000
      [  160.705260] FS:  0000000000000000(0000) GS:ffff88045f280000(0000) knlGS:0000000000000000
      [  160.705854] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  160.706478] CR2: ffffffffffffffd6 CR3: 000000000200a001 CR4: 00000000003606e0
      [  160.707124] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  160.707724] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  160.708372] Call Trace:
      [  160.708998]  ? dm_dp_add_mst_connector+0xed/0x1d0 [amdgpu]
      [  160.709625]  ? drm_dp_add_port+0x2fa/0x470 [drm_kms_helper]
      [  160.710284]  ? wake_up_q+0x54/0x70
      [  160.710877]  ? __mutex_unlock_slowpath.isra.18+0xb3/0x110
      [  160.711512]  ? drm_dp_dpcd_access+0xe7/0x110 [drm_kms_helper]
      [  160.712161]  ? drm_dp_send_link_address+0x155/0x1e0 [drm_kms_helper]
      [  160.712762]  ? drm_dp_check_and_send_link_address+0xa3/0xd0 [drm_kms_helper]
      [  160.713408]  ? drm_dp_mst_link_probe_work+0x4b/0x80 [drm_kms_helper]
      [  160.714013]  ? process_one_work+0x1a1/0x3a0
      [  160.714667]  ? worker_thread+0x30/0x380
      [  160.715326]  ? wq_update_unbound_numa+0x10/0x10
      [  160.715939]  ? kthread+0x112/0x130
      [  160.716591]  ? kthread_create_worker_on_cpu+0x70/0x70
      [  160.717262]  ? ret_from_fork+0x35/0x40
      [  160.717886] Modules linked in: amdgpu(O) vfat fat snd_hda_codec_generic joydev i915 chash gpu_sched ttm i2c_algo_bit drm_kms_helper snd_hda_codec_hdmi hp_wmi syscopyarea iTCO_wdt sysfillrect sparse_keymap sysimgblt fb_sys_fops snd_hda_intel usbhid wmi_bmof drm snd_hda_codec btusb snd_hda_core intel_rapl btrtl x86_pkg_temp_thermal btbcm btintel coretemp snd_pcm crc32_pclmul bluetooth psmouse snd_timer snd pcspkr i2c_i801 mei_me i2c_core soundcore mei tpm_tis wmi tpm_tis_core hp_accel ecdh_generic lis3lv02d tpm video rfkill acpi_pad input_polldev hp_wireless pcc_cpufreq crc32c_intel serio_raw tg3 xhci_pci xhci_hcd [last unloaded: amdgpu]
      [  160.720141] CR2: 0000000000000000
      
      Somehow the connector reusage DM was using for MST connectors managed to
      paper over this issue entirely; hence why this was never caught until
      now.
      
      [how]
      Since this code isn't used anywhere and seems useless anyway, we can
      just drop it entirely. This appears to fix the issue on my HP ZBook with
      an AMD WX4150.
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      0bf19b9f
    • Jerry (Fangzhi) Zuo's avatar
      drm/amd/display: Drop reusing drm connector for MST · 5d8e06a3
      Jerry (Fangzhi) Zuo authored
      [why]
      It is not safe to keep existing connector while entire topology
      has been removed. Could lead potential impact to uapi.
      Entirely unregister all the connectors on the topology,
      and use a new set of connectors when the topology is plugged back
      on.
      
      [How]
      Remove the drm connector entirely each time when the
      corresponding MST topology is gone.
      When hotunplug a connector (e.g., DP2)
      1. Remove connector from userspace.
      2. Drop it's reference.
      When hotplug back on:
      1. Detect new topology, and create new connectors.
      2. Notify userspace with sysfs hotplug event.
      3. Reprobe new connectors, and reassign CRTC from old (e.g., DP2)
      to new (e.g., DP3) connector.
      Signed-off-by: default avatarJerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      5d8e06a3
    • Jerry (Fangzhi) Zuo's avatar
      drm/amd/display: Cleanup MST non-atomic code workaround · 1b32d6e0
      Jerry (Fangzhi) Zuo authored
      [why]
      It is not correct to touch aconnector within atomic_check.
      
      [How]
      It was added as workaround before, and no longer needed.
      Signed-off-by: default avatarJerry (Fangzhi) Zuo <Jerry.Zuo@amd.com>
      Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      1b32d6e0
    • Hawking Zhang's avatar
      drm/amdgpu: fix frame size of amdgpu_xgmi_add_devices excceed 1024 bytes · db004912
      Hawking Zhang authored
      Instead of stack-allocated psp_xgmi_topology_info in function
      amdgpu_xgmi_add_device, dynamically allocated this structure to
      avoid the frame size of this function excceed 1024 bytes
      Signed-off-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
      Reviewed-by: default avatarXiaojie Yuan <xiaojie.yuan@amd.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      db004912
  2. 06 Nov, 2018 17 commits
  3. 05 Nov, 2018 18 commits