From: Greg Kroah-Hartman Date: Mon, 4 Dec 2017 11:43:35 +0000 (+0100) Subject: 4.14-stable patches X-Git-Tag: v3.18.86~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=073d0710af2d36fa6e83fe922ae9b0f5047619e7;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: dma-buf-make-reservation_object_copy_fences-rcu-save.patch drm-amdgpu-correct-reference-clock-value-on-vega10.patch drm-amdgpu-fix-error-handling-in-amdgpu_bo_do_create.patch drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vce_ring_parse_cs.patch drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vm_update_directories.patch drm-amdgpu-properly-allocate-vm-invalidate-eng-v2.patch drm-amdgpu-remove-check-which-is-not-valid-for-certain-vbios.patch drm-ttm-fix-ttm_bo_cleanup_refs_or_queue-once-more.patch hwmon-jc42-optionally-try-to-disable-the-smbus-timeout.patch nvme-pci-add-quirk-for-delay-before-chk-rdy-for-wdc-sn200.patch revert-drm-radeon-dont-switch-vt-on-suspend.patch --- diff --git a/queue-4.14/dma-buf-make-reservation_object_copy_fences-rcu-save.patch b/queue-4.14/dma-buf-make-reservation_object_copy_fences-rcu-save.patch new file mode 100644 index 00000000000..65d123a2919 --- /dev/null +++ b/queue-4.14/dma-buf-make-reservation_object_copy_fences-rcu-save.patch @@ -0,0 +1,112 @@ +From 39e16ba16c147e662bf9fbcee9a99d70d420382f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= +Date: Mon, 4 Sep 2017 21:02:45 +0200 +Subject: dma-buf: make reservation_object_copy_fences rcu save +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian König + +commit 39e16ba16c147e662bf9fbcee9a99d70d420382f upstream. + +Stop requiring that the src reservation object is locked for this operation. + +Acked-by: Chunming Zhou +Signed-off-by: Christian König +Signed-off-by: Alex Deucher +Link: https://patchwork.freedesktop.org/patch/msgid/1504551766-5093-1-git-send-email-deathsimple@vodafone.de +Signed-off-by: Lyude Paul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/dma-buf/reservation.c | 56 +++++++++++++++++++++++++++++++----------- + 1 file changed, 42 insertions(+), 14 deletions(-) + +--- a/drivers/dma-buf/reservation.c ++++ b/drivers/dma-buf/reservation.c +@@ -266,8 +266,7 @@ EXPORT_SYMBOL(reservation_object_add_exc + * @dst: the destination reservation object + * @src: the source reservation object + * +-* Copy all fences from src to dst. Both src->lock as well as dst-lock must be +-* held. ++* Copy all fences from src to dst. dst-lock must be held. + */ + int reservation_object_copy_fences(struct reservation_object *dst, + struct reservation_object *src) +@@ -277,33 +276,62 @@ int reservation_object_copy_fences(struc + size_t size; + unsigned i; + +- src_list = reservation_object_get_list(src); ++ rcu_read_lock(); ++ src_list = rcu_dereference(src->fence); + ++retry: + if (src_list) { +- size = offsetof(typeof(*src_list), +- shared[src_list->shared_count]); ++ unsigned shared_count = src_list->shared_count; ++ ++ size = offsetof(typeof(*src_list), shared[shared_count]); ++ rcu_read_unlock(); ++ + dst_list = kmalloc(size, GFP_KERNEL); + if (!dst_list) + return -ENOMEM; + +- dst_list->shared_count = src_list->shared_count; +- dst_list->shared_max = src_list->shared_count; +- for (i = 0; i < src_list->shared_count; ++i) +- dst_list->shared[i] = +- dma_fence_get(src_list->shared[i]); ++ rcu_read_lock(); ++ src_list = rcu_dereference(src->fence); ++ if (!src_list || src_list->shared_count > shared_count) { ++ kfree(dst_list); ++ goto retry; ++ } ++ ++ dst_list->shared_count = 0; ++ dst_list->shared_max = shared_count; ++ for (i = 0; i < src_list->shared_count; ++i) { ++ struct dma_fence *fence; ++ ++ fence = rcu_dereference(src_list->shared[i]); ++ if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, ++ &fence->flags)) ++ continue; ++ ++ if (!dma_fence_get_rcu(fence)) { ++ kfree(dst_list); ++ src_list = rcu_dereference(src->fence); ++ goto retry; ++ } ++ ++ if (dma_fence_is_signaled(fence)) { ++ dma_fence_put(fence); ++ continue; ++ } ++ ++ dst_list->shared[dst_list->shared_count++] = fence; ++ } + } else { + dst_list = NULL; + } + ++ new = dma_fence_get_rcu_safe(&src->fence_excl); ++ rcu_read_unlock(); ++ + kfree(dst->staged); + dst->staged = NULL; + + src_list = reservation_object_get_list(dst); +- + old = reservation_object_get_excl(dst); +- new = reservation_object_get_excl(src); +- +- dma_fence_get(new); + + preempt_disable(); + write_seqcount_begin(&dst->seq); diff --git a/queue-4.14/drm-amdgpu-correct-reference-clock-value-on-vega10.patch b/queue-4.14/drm-amdgpu-correct-reference-clock-value-on-vega10.patch new file mode 100644 index 00000000000..5464070acc3 --- /dev/null +++ b/queue-4.14/drm-amdgpu-correct-reference-clock-value-on-vega10.patch @@ -0,0 +1,34 @@ +From 76d6172b6fab16455af4b67bb18a3f66011592f8 Mon Sep 17 00:00:00 2001 +From: Ken Wang +Date: Fri, 29 Sep 2017 15:41:43 +0800 +Subject: drm/amdgpu: correct reference clock value on vega10 + +From: Ken Wang + +commit 76d6172b6fab16455af4b67bb18a3f66011592f8 upstream. + +Old value from bringup was wrong. + +Signed-off-by: Ken Wang +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/soc15.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/soc15.c ++++ b/drivers/gpu/drm/amd/amdgpu/soc15.c +@@ -279,10 +279,7 @@ static void soc15_init_golden_registers( + } + static u32 soc15_get_xclk(struct amdgpu_device *adev) + { +- if (adev->asic_type == CHIP_VEGA10) +- return adev->clock.spll.reference_freq/4; +- else +- return adev->clock.spll.reference_freq; ++ return adev->clock.spll.reference_freq; + } + + diff --git a/queue-4.14/drm-amdgpu-fix-error-handling-in-amdgpu_bo_do_create.patch b/queue-4.14/drm-amdgpu-fix-error-handling-in-amdgpu_bo_do_create.patch new file mode 100644 index 00000000000..ad41d739555 --- /dev/null +++ b/queue-4.14/drm-amdgpu-fix-error-handling-in-amdgpu_bo_do_create.patch @@ -0,0 +1,46 @@ +From a695e43712242c354748e9bae5d137d4337a7694 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= +Date: Tue, 31 Oct 2017 09:36:13 +0100 +Subject: drm/amdgpu: fix error handling in amdgpu_bo_do_create +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian König + +commit a695e43712242c354748e9bae5d137d4337a7694 upstream. + +The bo structure is freed up in case of an error, so we can't do any +accounting if that happens. + +Signed-off-by: Christian König +Reviewed-by: Michel Dänzer +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +@@ -391,6 +391,9 @@ int amdgpu_bo_create_restricted(struct a + r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, type, + &bo->placement, page_align, !kernel, NULL, + acc_size, sg, resv, &amdgpu_ttm_bo_destroy); ++ if (unlikely(r != 0)) ++ return r; ++ + bytes_moved = atomic64_read(&adev->num_bytes_moved) - + initial_bytes_moved; + if (adev->mc.visible_vram_size < adev->mc.real_vram_size && +@@ -400,9 +403,6 @@ int amdgpu_bo_create_restricted(struct a + else + amdgpu_cs_report_moved_bytes(adev, bytes_moved, 0); + +- if (unlikely(r != 0)) +- return r; +- + if (kernel) + bo->tbo.priority = 1; + diff --git a/queue-4.14/drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vce_ring_parse_cs.patch b/queue-4.14/drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vce_ring_parse_cs.patch new file mode 100644 index 00000000000..a132d73deeb --- /dev/null +++ b/queue-4.14/drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vce_ring_parse_cs.patch @@ -0,0 +1,38 @@ +From 40a9960b046290939b56ce8e51f365258f27f264 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Sat, 30 Sep 2017 11:13:28 +0300 +Subject: drm/amdgpu: potential uninitialized variable in amdgpu_vce_ring_parse_cs() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Dan Carpenter + +commit 40a9960b046290939b56ce8e51f365258f27f264 upstream. + +We shifted some code around in commit 9cca0b8e5df0 ("drm/amdgpu: move +amdgpu_cs_sysvm_access_required into find_mapping") and now my static +checker complains that "r" might not be initialized at the end of the +function. I've reviewed the code, and that seems possible, but it's +also possible I may have missed something. + +Reviewed-by: Christian König +Signed-off-by: Dan Carpenter +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +@@ -647,7 +647,7 @@ int amdgpu_vce_ring_parse_cs(struct amdg + uint32_t allocated = 0; + uint32_t tmp, handle = 0; + uint32_t *size = &tmp; +- int i, r, idx = 0; ++ int i, r = 0, idx = 0; + + p->job->vm = NULL; + ib->gpu_addr = amdgpu_sa_bo_gpu_addr(ib->sa_bo); diff --git a/queue-4.14/drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vm_update_directories.patch b/queue-4.14/drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vm_update_directories.patch new file mode 100644 index 00000000000..0ee0eaa20c6 --- /dev/null +++ b/queue-4.14/drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vm_update_directories.patch @@ -0,0 +1,38 @@ +From 78aa02c713fcf19e9bc8511ab61a5fd6c877cc01 Mon Sep 17 00:00:00 2001 +From: Dan Carpenter +Date: Sat, 30 Sep 2017 11:14:13 +0300 +Subject: drm/amdgpu: Potential uninitialized variable in amdgpu_vm_update_directories() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Dan Carpenter + +commit 78aa02c713fcf19e9bc8511ab61a5fd6c877cc01 upstream. + +After commit ea09729c9302 ("drm/amdgpu: rework page directory filling +v2") then it becomes a lot harder to verify that "r" is initialized. My +static checker complains and so I've reviewed the code. It does look +like it might be buggy... Anyway, it doesn't hurt to set "r" to zero +at the start. + +Reviewed-by: Christian König +Signed-off-by: Dan Carpenter +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +@@ -1201,7 +1201,7 @@ static void amdgpu_vm_invalidate_level(s + int amdgpu_vm_update_directories(struct amdgpu_device *adev, + struct amdgpu_vm *vm) + { +- int r; ++ int r = 0; + + r = amdgpu_vm_update_level(adev, vm, &vm->root, 0); + if (r) diff --git a/queue-4.14/drm-amdgpu-properly-allocate-vm-invalidate-eng-v2.patch b/queue-4.14/drm-amdgpu-properly-allocate-vm-invalidate-eng-v2.patch new file mode 100644 index 00000000000..00692e146db --- /dev/null +++ b/queue-4.14/drm-amdgpu-properly-allocate-vm-invalidate-eng-v2.patch @@ -0,0 +1,54 @@ +From c5066129af4436ab0da8eefe4289774a5409706d Mon Sep 17 00:00:00 2001 +From: ozeng +Date: Tue, 6 Jun 2017 10:53:28 -0500 +Subject: drm/amdgpu: Properly allocate VM invalidate eng v2 + +From: ozeng + +commit c5066129af4436ab0da8eefe4289774a5409706d upstream. + +v1: Properly allocate TLB invalidation engine to avoid conflict. +v2: Added comments to codes + +Signed-off-by: Oak Zeng +Reviewed-by: Alex Deucher +Acked-by: Christian Konig +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 15 ++++++++++++--- + 1 file changed, 12 insertions(+), 3 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +@@ -395,7 +395,16 @@ static int gmc_v9_0_early_init(void *han + static int gmc_v9_0_late_init(void *handle) + { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; +- unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 3, 3 }; ++ /* ++ * The latest engine allocation on gfx9 is: ++ * Engine 0, 1: idle ++ * Engine 2, 3: firmware ++ * Engine 4~13: amdgpu ring, subject to change when ring number changes ++ * Engine 14~15: idle ++ * Engine 16: kfd tlb invalidation ++ * Engine 17: Gart flushes ++ */ ++ unsigned vm_inv_eng[AMDGPU_MAX_VMHUBS] = { 4, 4 }; + unsigned i; + + for(i = 0; i < adev->num_rings; ++i) { +@@ -408,9 +417,9 @@ static int gmc_v9_0_late_init(void *hand + ring->funcs->vmhub); + } + +- /* Engine 17 is used for GART flushes */ ++ /* Engine 16 is used for KFD and 17 for GART flushes */ + for(i = 0; i < AMDGPU_MAX_VMHUBS; ++i) +- BUG_ON(vm_inv_eng[i] > 17); ++ BUG_ON(vm_inv_eng[i] > 16); + + return amdgpu_irq_get(adev, &adev->mc.vm_fault, 0); + } diff --git a/queue-4.14/drm-amdgpu-remove-check-which-is-not-valid-for-certain-vbios.patch b/queue-4.14/drm-amdgpu-remove-check-which-is-not-valid-for-certain-vbios.patch new file mode 100644 index 00000000000..54dd2ebc44b --- /dev/null +++ b/queue-4.14/drm-amdgpu-remove-check-which-is-not-valid-for-certain-vbios.patch @@ -0,0 +1,35 @@ +From ab6613b7eaefe85dadfc86025e901c55d71c0379 Mon Sep 17 00:00:00 2001 +From: Ken Wang +Date: Wed, 8 Nov 2017 14:48:50 +0800 +Subject: drm/amdgpu: Remove check which is not valid for certain VBIOS + +From: Ken Wang + +commit ab6613b7eaefe85dadfc86025e901c55d71c0379 upstream. + +Fixes vbios fetching on certain headless boards. + +Signed-off-by: Ken Wang +Acked-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c | 6 ------ + 1 file changed, 6 deletions(-) + +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c +@@ -59,12 +59,6 @@ static bool check_atom_bios(uint8_t *bio + return false; + } + +- tmp = bios[0x18] | (bios[0x19] << 8); +- if (bios[tmp + 0x14] != 0x0) { +- DRM_INFO("Not an x86 BIOS ROM\n"); +- return false; +- } +- + bios_header_start = bios[0x48] | (bios[0x49] << 8); + if (!bios_header_start) { + DRM_INFO("Can't locate bios header\n"); diff --git a/queue-4.14/drm-ttm-fix-ttm_bo_cleanup_refs_or_queue-once-more.patch b/queue-4.14/drm-ttm-fix-ttm_bo_cleanup_refs_or_queue-once-more.patch new file mode 100644 index 00000000000..de34e1c99f3 --- /dev/null +++ b/queue-4.14/drm-ttm-fix-ttm_bo_cleanup_refs_or_queue-once-more.patch @@ -0,0 +1,88 @@ +From 378e2d5b504fe0231c557751e58b80fcf717cc20 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Christian=20K=C3=B6nig?= +Date: Mon, 4 Sep 2017 20:58:45 +0200 +Subject: drm/ttm: fix ttm_bo_cleanup_refs_or_queue once more +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Christian König + +commit 378e2d5b504fe0231c557751e58b80fcf717cc20 upstream. + +With shared reservation objects __ttm_bo_reserve() can easily fail even on +destroyed BOs. This prevents correct handling when we need to individualize +the reservation object. + +Fix this by individualizing the object before even trying to reserve it. + +Signed-off-by: Christian König +Acked-by: Chunming Zhou +Signed-off-by: Alex Deucher +Signed-off-by: Lyude Paul +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/ttm/ttm_bo.c | 32 +++++++++++++++++--------------- + 1 file changed, 17 insertions(+), 15 deletions(-) + +--- a/drivers/gpu/drm/ttm/ttm_bo.c ++++ b/drivers/gpu/drm/ttm/ttm_bo.c +@@ -440,28 +440,29 @@ static void ttm_bo_cleanup_refs_or_queue + struct ttm_bo_global *glob = bo->glob; + int ret; + ++ ret = ttm_bo_individualize_resv(bo); ++ if (ret) { ++ /* Last resort, if we fail to allocate memory for the ++ * fences block for the BO to become idle ++ */ ++ reservation_object_wait_timeout_rcu(bo->resv, true, false, ++ 30 * HZ); ++ spin_lock(&glob->lru_lock); ++ goto error; ++ } ++ + spin_lock(&glob->lru_lock); + ret = __ttm_bo_reserve(bo, false, true, NULL); +- + if (!ret) { +- if (!ttm_bo_wait(bo, false, true)) { ++ if (reservation_object_test_signaled_rcu(&bo->ttm_resv, true)) { + ttm_bo_del_from_lru(bo); + spin_unlock(&glob->lru_lock); ++ if (bo->resv != &bo->ttm_resv) ++ reservation_object_unlock(&bo->ttm_resv); + ttm_bo_cleanup_memtype_use(bo); +- + return; + } + +- ret = ttm_bo_individualize_resv(bo); +- if (ret) { +- /* Last resort, if we fail to allocate memory for the +- * fences block for the BO to become idle and free it. +- */ +- spin_unlock(&glob->lru_lock); +- ttm_bo_wait(bo, true, true); +- ttm_bo_cleanup_memtype_use(bo); +- return; +- } + ttm_bo_flush_all_fences(bo); + + /* +@@ -474,11 +475,12 @@ static void ttm_bo_cleanup_refs_or_queue + ttm_bo_add_to_lru(bo); + } + +- if (bo->resv != &bo->ttm_resv) +- reservation_object_unlock(&bo->ttm_resv); + __ttm_bo_unreserve(bo); + } ++ if (bo->resv != &bo->ttm_resv) ++ reservation_object_unlock(&bo->ttm_resv); + ++error: + kref_get(&bo->list_kref); + list_add_tail(&bo->ddestroy, &bdev->ddestroy); + spin_unlock(&glob->lru_lock); diff --git a/queue-4.14/hwmon-jc42-optionally-try-to-disable-the-smbus-timeout.patch b/queue-4.14/hwmon-jc42-optionally-try-to-disable-the-smbus-timeout.patch new file mode 100644 index 00000000000..e14d116fe1a --- /dev/null +++ b/queue-4.14/hwmon-jc42-optionally-try-to-disable-the-smbus-timeout.patch @@ -0,0 +1,96 @@ +From 68615eb01f82256c19e41967bfb3eef902f77033 Mon Sep 17 00:00:00 2001 +From: Peter Rosin +Date: Mon, 27 Nov 2017 17:31:00 +0100 +Subject: hwmon: (jc42) optionally try to disable the SMBUS timeout + +From: Peter Rosin + +commit 68615eb01f82256c19e41967bfb3eef902f77033 upstream. + +With a nxp,se97 chip on an atmel sama5d31 board, the I2C adapter driver +is not always capable of avoiding the 25-35 ms timeout as specified by +the SMBUS protocol. This may cause silent corruption of the last bit of +any transfer, e.g. a one is read instead of a zero if the sensor chip +times out. This also affects the eeprom half of the nxp-se97 chip, where +this silent corruption was originally noticed. Other I2C adapters probably +suffer similar issues, e.g. bit-banging comes to mind as risky... + +The SMBUS register in the nxp chip is not a standard Jedec register, but +it is not special to the nxp chips either, at least the atmel chips +have the same mechanism. Therefore, do not special case this on the +manufacturer, it is opt-in via the device property anyway. + +Signed-off-by: Peter Rosin +Acked-by: Rob Herring +Signed-off-by: Guenter Roeck +Signed-off-by: Greg Kroah-Hartman + +--- + Documentation/devicetree/bindings/hwmon/jc42.txt | 4 ++++ + drivers/hwmon/jc42.c | 21 +++++++++++++++++++++ + 2 files changed, 25 insertions(+) + +--- a/Documentation/devicetree/bindings/hwmon/jc42.txt ++++ b/Documentation/devicetree/bindings/hwmon/jc42.txt +@@ -34,6 +34,10 @@ Required properties: + + - reg: I2C address + ++Optional properties: ++- smbus-timeout-disable: When set, the smbus timeout function will be disabled. ++ This is not supported on all chips. ++ + Example: + + temp-sensor@1a { +--- a/drivers/hwmon/jc42.c ++++ b/drivers/hwmon/jc42.c +@@ -22,6 +22,7 @@ + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#include + #include + #include + #include +@@ -45,6 +46,7 @@ static const unsigned short normal_i2c[] + #define JC42_REG_TEMP 0x05 + #define JC42_REG_MANID 0x06 + #define JC42_REG_DEVICEID 0x07 ++#define JC42_REG_SMBUS 0x22 /* NXP and Atmel, possibly others? */ + + /* Status bits in temperature register */ + #define JC42_ALARM_CRIT_BIT 15 +@@ -75,6 +77,9 @@ static const unsigned short normal_i2c[] + #define GT_MANID 0x1c68 /* Giantec */ + #define GT_MANID2 0x132d /* Giantec, 2nd mfg ID */ + ++/* SMBUS register */ ++#define SMBUS_STMOUT BIT(7) /* SMBus time-out, active low */ ++ + /* Supported chips */ + + /* Analog Devices */ +@@ -495,6 +500,22 @@ static int jc42_probe(struct i2c_client + + data->extended = !!(cap & JC42_CAP_RANGE); + ++ if (device_property_read_bool(dev, "smbus-timeout-disable")) { ++ int smbus; ++ ++ /* ++ * Not all chips support this register, but from a ++ * quick read of various datasheets no chip appears ++ * incompatible with the below attempt to disable ++ * the timeout. And the whole thing is opt-in... ++ */ ++ smbus = i2c_smbus_read_word_swapped(client, JC42_REG_SMBUS); ++ if (smbus < 0) ++ return smbus; ++ i2c_smbus_write_word_swapped(client, JC42_REG_SMBUS, ++ smbus | SMBUS_STMOUT); ++ } ++ + config = i2c_smbus_read_word_swapped(client, JC42_REG_CONFIG); + if (config < 0) + return config; diff --git a/queue-4.14/nvme-pci-add-quirk-for-delay-before-chk-rdy-for-wdc-sn200.patch b/queue-4.14/nvme-pci-add-quirk-for-delay-before-chk-rdy-for-wdc-sn200.patch new file mode 100644 index 00000000000..849daa18c79 --- /dev/null +++ b/queue-4.14/nvme-pci-add-quirk-for-delay-before-chk-rdy-for-wdc-sn200.patch @@ -0,0 +1,42 @@ +From 8c97eeccf0ad8783c057830119467b877bdfced7 Mon Sep 17 00:00:00 2001 +From: Jeff Lien +Date: Tue, 21 Nov 2017 10:44:37 -0600 +Subject: nvme-pci: add quirk for delay before CHK RDY for WDC SN200 + +From: Jeff Lien + +commit 8c97eeccf0ad8783c057830119467b877bdfced7 upstream. + +And increase the existing delay to cover this device as well. + +Signed-off-by: Jeff Lien +Signed-off-by: Christoph Hellwig +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/nvme/host/nvme.h | 2 +- + drivers/nvme/host/pci.c | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +--- a/drivers/nvme/host/nvme.h ++++ b/drivers/nvme/host/nvme.h +@@ -108,7 +108,7 @@ static inline struct nvme_request *nvme_ + * NVME_QUIRK_DELAY_BEFORE_CHK_RDY quirk enabled. The value (in ms) was + * found empirically. + */ +-#define NVME_QUIRK_DELAY_AMOUNT 2000 ++#define NVME_QUIRK_DELAY_AMOUNT 2300 + + enum nvme_ctrl_state { + NVME_CTRL_NEW, +--- a/drivers/nvme/host/pci.c ++++ b/drivers/nvme/host/pci.c +@@ -2519,6 +2519,8 @@ static const struct pci_device_id nvme_i + .driver_data = NVME_QUIRK_IDENTIFY_CNS, }, + { PCI_DEVICE(0x1c58, 0x0003), /* HGST adapter */ + .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, ++ { PCI_DEVICE(0x1c58, 0x0023), /* WDC SN200 adapter */ ++ .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, + { PCI_DEVICE(0x1c5f, 0x0540), /* Memblaze Pblaze4 adapter */ + .driver_data = NVME_QUIRK_DELAY_BEFORE_CHK_RDY, }, + { PCI_DEVICE(0x144d, 0xa821), /* Samsung PM1725 */ diff --git a/queue-4.14/revert-drm-radeon-dont-switch-vt-on-suspend.patch b/queue-4.14/revert-drm-radeon-dont-switch-vt-on-suspend.patch new file mode 100644 index 00000000000..02bdd227e0d --- /dev/null +++ b/queue-4.14/revert-drm-radeon-dont-switch-vt-on-suspend.patch @@ -0,0 +1,37 @@ +From 18c437caa5b18a235dd65cec224eab54bebcee65 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Tue, 14 Nov 2017 17:19:29 -0500 +Subject: Revert "drm/radeon: dont switch vt on suspend" +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Alex Deucher + +commit 18c437caa5b18a235dd65cec224eab54bebcee65 upstream. + +Fixes distorted colors on some cards on resume from suspend. + +This reverts commit b9729b17a414f99c61f4db9ac9f9ed987fa0cbfe. + +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=98832 +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=99163 +Bug: https://bugzilla.kernel.org/show_bug.cgi?id=107001 +Reviewed-by: Michel Dänzer +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_fb.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/gpu/drm/radeon/radeon_fb.c ++++ b/drivers/gpu/drm/radeon/radeon_fb.c +@@ -245,7 +245,6 @@ static int radeonfb_create(struct drm_fb + } + + info->par = rfbdev; +- info->skip_vt_switch = true; + + ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); + if (ret) { diff --git a/queue-4.14/series b/queue-4.14/series index d6e196c180f..18ecca00a58 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -55,3 +55,14 @@ cxl-check-if-vphb-exists-before-iterating-over-afu-devices.patch bcache-fix-building-error-on-mips.patch bcache-only-permit-to-recovery-read-error-when-cache-device-is-clean.patch bcache-recover-data-from-backing-when-data-is-clean.patch +hwmon-jc42-optionally-try-to-disable-the-smbus-timeout.patch +nvme-pci-add-quirk-for-delay-before-chk-rdy-for-wdc-sn200.patch +revert-drm-radeon-dont-switch-vt-on-suspend.patch +drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vce_ring_parse_cs.patch +drm-amdgpu-potential-uninitialized-variable-in-amdgpu_vm_update_directories.patch +drm-amdgpu-correct-reference-clock-value-on-vega10.patch +drm-amdgpu-fix-error-handling-in-amdgpu_bo_do_create.patch +drm-amdgpu-properly-allocate-vm-invalidate-eng-v2.patch +drm-amdgpu-remove-check-which-is-not-valid-for-certain-vbios.patch +drm-ttm-fix-ttm_bo_cleanup_refs_or_queue-once-more.patch +dma-buf-make-reservation_object_copy_fences-rcu-save.patch