aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 4f8fb4ecde34..5d8b30fd4534 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -3173,11 +3173,16 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
break;
if (fence) {
- r = dma_fence_wait_timeout(fence, false, tmo);
+ tmo = dma_fence_wait_timeout(fence, false, tmo);
dma_fence_put(fence);
fence = next;
- if (r <= 0)
+ if (tmo == 0) {
+ r = -ETIMEDOUT;
break;
+ } else if (tmo < 0) {
+ r = tmo;
+ break;
+ }
} else {
fence = next;
}
@@ -3188,8 +3193,8 @@ static int amdgpu_device_recover_vram(struct amdgpu_device *adev)
tmo = dma_fence_wait_timeout(fence, false, tmo);
dma_fence_put(fence);
- if (r <= 0 || tmo <= 0) {
- DRM_ERROR("recover vram bo from shadow failed\n");
+ if (r < 0 || tmo <= 0) {
+ DRM_ERROR("recover vram bo from shadow failed, r is %ld, tmo is %ld\n", r, tmo);
return -EIO;
}
@@ -3625,6 +3630,7 @@ static void amdgpu_device_get_min_pci_speed_width(struct amdgpu_device *adev,
struct pci_dev *pdev = adev->pdev;
enum pci_bus_speed cur_speed;
enum pcie_link_width cur_width;
+ u32 ret = 1;
*speed = PCI_SPEED_UNKNOWN;
*width = PCIE_LNK_WIDTH_UNKNOWN;
@@ -3632,6 +3638,10 @@ static void amdgpu_device_get_min_pci_speed_width(struct amdgpu_device *adev,
while (pdev) {
cur_speed = pcie_get_speed_cap(pdev);
cur_width = pcie_get_width_cap(pdev);
+ ret = pcie_bandwidth_available(adev->pdev, NULL,
+ NULL, &cur_width);
+ if (!ret)
+ cur_width = PCIE_LNK_WIDTH_RESRV;
if (cur_speed != PCI_SPEED_UNKNOWN) {
if (*speed == PCI_SPEED_UNKNOWN)
a61917f5db411d1417327d425&follow=1'>squashfs: avoid bio_alloc() failure with 1Mbyte blocksPhillip Lougher1-1/+5 2020-08-21uprobes: __replace_page() avoid BUG in munlock_vma_page()Hugh Dickins1-1/+1 2020-08-21kernel/relay.c: fix memleak on destroy relay channelWei Yongjun1-0/+1 2020-08-21romfs: fix uninitialized memory leak in romfs_dev_read()Jann Horn1-3/+1 2020-08-21mm/rodata_test.c: fix missing function declarationLeon Romanovsky1-0/+1 2020-08-21mm/vunmap: add cond_resched() in vunmap_pmd_rangeAneesh Kumar K.V1-0/+2 2020-08-21khugepaged: adjust VM_BUG_ON_MM() in __khugepaged_enter()Hugh Dickins1-1/+1 2020-08-21hugetlb_cgroup: convert comma to semicolonXu Wang1-2/+2 2020-08-21mailmap: add Andi KleenNick Desaulniers1-0/+1 2020-08-21core/entry: Respect syscall number rewritesThomas Gleixner1-1/+2 2020-08-21x86/entry/64: Do not use RDPID in paranoid entry to accomodate KVMSean Christopherson1-4/+6 2020-08-21MAINTAINERS: Update Mellanox and Cumulus Network addresses to new domainLeon Romanovsky2-29/+31 2020-08-21powerpc/perf/hv-24x7: Move cpumask file to top folder of hv-24x7 driverKajol Jain2-2/+11 2020-08-21powerpc/32s: Fix module loading failure when VMALLOC_END is over 0xf0000000Christophe Leroy1-2/+2 2020-08-21KVM: arm64: Print warning when cpu erratum can cause guests to deadlockRob Herring1-0/+4 2020-08-21arm64: Allow booting of late CPUs affected by erratum 1418040Marc Zyngier1-0/+2 2020-08-21arm64: Move handling of erratum 1418040 into C codeMarc Zyngier2-21/+34 2020-08-21kconfig: qconf: replace deprecated QString::sprintf() with QTextStreamMasahiro Yamada1-54/+62 2020-08-21kconfig: qconf: remove redundant help in the info viewMasahiro Yamada1-6/+1 2020-08-21kconfig: qconf: remove qInfo() to get back Qt4 supportMasahiro Yamada1-2/+0 2020-08-20tipc: call rcu_read_lock() in tipc_aead_encrypt_done()Xin Long1-0/+2 2020-08-20net/sched: act_ct: Fix skb double-free in tcf_ct_handle_fragments() error flowAlaa Hleihel1-1/+1 2020-08-20net: sctp: Fix negotiation of the number of data streams.David Laight1-2/+4 2020-08-20dt-bindings: net: renesas, ether: Improve schema validationGeert Uytterhoeven1-7/+15 2020-08-20gre6: Fix reception with IP6_TNL_F_RCV_DSCP_COPYMark Tomlinson1-1/+9 2020-08-20hv_netvsc: Fix the queue_mapping in netvsc_vf_xmit()Haiyang Zhang1-1/+1 2020-08-20hv_netvsc: Remove "unlikely" from netvsc_select_queueHaiyang Zhang1-1/+1 2020-08-20bpf: selftests: global_funcs: Check err_str before strstrYauheni Kaliuta1-1/+1 2020-08-20bpf: xdp: Fix XDP mode when no mode flags specifiedAndrii Nakryiko1-6/+8 2020-08-20selftests/bpf: Remove test_align leftoversVeronika Kabatova2-2/+1 2020-08-20tools/resolve_btfids: Fix sections with wrong alignmentJiri Olsa1-0/+36 2020-08-20net/smc: Prevent kernel-infoleak in __smc_diag_dump()Peilin Ye1-7/+9 2020-08-20sfc: fix build warnings on 32-bitEdward Cree1-4/+4 2020-08-20net: phy: mscc: Fix a couple of spelling mistakes "spcified" -> "specified"Kaige Li1-2/+2 2020-08-20riscv: Add SiFive drivers to rv32_defconfigBin Meng1-0/+5