From: Greg Kroah-Hartman Date: Sun, 5 Nov 2017 15:25:00 +0000 (+0100) Subject: 4.4-stable patches X-Git-Tag: v3.18.80~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3b626b11280c032af861cd35bc1b4fb6128d060d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: drm-amdgpu-return-enoent-from-uvd-6.0-early-init-for-harvesting.patch ocfs2-fstrim-fix-start-offset-of-first-cluster-group-during-fstrim.patch --- diff --git a/queue-4.4/drm-amdgpu-return-enoent-from-uvd-6.0-early-init-for-harvesting.patch b/queue-4.4/drm-amdgpu-return-enoent-from-uvd-6.0-early-init-for-harvesting.patch new file mode 100644 index 00000000000..ef34768c3af --- /dev/null +++ b/queue-4.4/drm-amdgpu-return-enoent-from-uvd-6.0-early-init-for-harvesting.patch @@ -0,0 +1,33 @@ +From cb4b02d7cac56a69d8137d8d843507cca9182aed Mon Sep 17 00:00:00 2001 +From: Leo Liu +Date: Tue, 31 Oct 2017 21:03:39 -0400 +Subject: drm/amdgpu: return -ENOENT from uvd 6.0 early init for harvesting + +From: Leo Liu + +commit cb4b02d7cac56a69d8137d8d843507cca9182aed upstream. + +Fixes init failures on polaris cards with harvested UVD. + +Signed-off-by: Leo Liu +Reviewed-by: Alex Deucher +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c ++++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +@@ -83,6 +83,10 @@ static int uvd_v6_0_early_init(void *han + { + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + ++ if (!(adev->flags & AMD_IS_APU) && ++ (RREG32_SMC(ixCC_HARVEST_FUSES) & CC_HARVEST_FUSES__UVD_DISABLE_MASK)) ++ return -ENOENT; ++ + uvd_v6_0_set_ring_funcs(adev); + uvd_v6_0_set_irq_funcs(adev); + diff --git a/queue-4.4/ocfs2-fstrim-fix-start-offset-of-first-cluster-group-during-fstrim.patch b/queue-4.4/ocfs2-fstrim-fix-start-offset-of-first-cluster-group-during-fstrim.patch new file mode 100644 index 00000000000..781f34ba7dc --- /dev/null +++ b/queue-4.4/ocfs2-fstrim-fix-start-offset-of-first-cluster-group-during-fstrim.patch @@ -0,0 +1,89 @@ +From 105ddc93f06ebe3e553f58563d11ed63dbcd59f0 Mon Sep 17 00:00:00 2001 +From: Ashish Samant +Date: Thu, 2 Nov 2017 15:59:37 -0700 +Subject: ocfs2: fstrim: Fix start offset of first cluster group during fstrim + +From: Ashish Samant + +commit 105ddc93f06ebe3e553f58563d11ed63dbcd59f0 upstream. + +The first cluster group descriptor is not stored at the start of the +group but at an offset from the start. We need to take this into +account while doing fstrim on the first cluster group. Otherwise we +will wrongly start fstrim a few blocks after the desired start block and +the range can cross over into the next cluster group and zero out the +group descriptor there. This can cause filesytem corruption that cannot +be fixed by fsck. + +Link: http://lkml.kernel.org/r/1507835579-7308-1-git-send-email-ashish.samant@oracle.com +Signed-off-by: Ashish Samant +Reviewed-by: Junxiao Bi +Reviewed-by: Joseph Qi +Cc: Mark Fasheh +Cc: Joel Becker +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ocfs2/alloc.c | 24 ++++++++++++++++++------ + 1 file changed, 18 insertions(+), 6 deletions(-) + +--- a/fs/ocfs2/alloc.c ++++ b/fs/ocfs2/alloc.c +@@ -7270,13 +7270,24 @@ out: + + static int ocfs2_trim_extent(struct super_block *sb, + struct ocfs2_group_desc *gd, +- u32 start, u32 count) ++ u64 group, u32 start, u32 count) + { + u64 discard, bcount; ++ struct ocfs2_super *osb = OCFS2_SB(sb); + + bcount = ocfs2_clusters_to_blocks(sb, count); +- discard = le64_to_cpu(gd->bg_blkno) + +- ocfs2_clusters_to_blocks(sb, start); ++ discard = ocfs2_clusters_to_blocks(sb, start); ++ ++ /* ++ * For the first cluster group, the gd->bg_blkno is not at the start ++ * of the group, but at an offset from the start. If we add it while ++ * calculating discard for first group, we will wrongly start fstrim a ++ * few blocks after the desried start block and the range can cross ++ * over into the next cluster group. So, add it only if this is not ++ * the first cluster group. ++ */ ++ if (group != osb->first_cluster_group_blkno) ++ discard += le64_to_cpu(gd->bg_blkno); + + trace_ocfs2_trim_extent(sb, (unsigned long long)discard, bcount); + +@@ -7284,7 +7295,7 @@ static int ocfs2_trim_extent(struct supe + } + + static int ocfs2_trim_group(struct super_block *sb, +- struct ocfs2_group_desc *gd, ++ struct ocfs2_group_desc *gd, u64 group, + u32 start, u32 max, u32 minbits) + { + int ret = 0, count = 0, next; +@@ -7303,7 +7314,7 @@ static int ocfs2_trim_group(struct super + next = ocfs2_find_next_bit(bitmap, max, start); + + if ((next - start) >= minbits) { +- ret = ocfs2_trim_extent(sb, gd, ++ ret = ocfs2_trim_extent(sb, gd, group, + start, next - start); + if (ret < 0) { + mlog_errno(ret); +@@ -7401,7 +7412,8 @@ int ocfs2_trim_fs(struct super_block *sb + } + + gd = (struct ocfs2_group_desc *)gd_bh->b_data; +- cnt = ocfs2_trim_group(sb, gd, first_bit, last_bit, minlen); ++ cnt = ocfs2_trim_group(sb, gd, group, ++ first_bit, last_bit, minlen); + brelse(gd_bh); + gd_bh = NULL; + if (cnt < 0) { diff --git a/queue-4.4/series b/queue-4.4/series index 19234d35fbe..28bc02e5530 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -7,3 +7,5 @@ asoc-adau17x1-workaround-for-noise-bug-in-adc.patch arm64-ensure-__dump_instr-checks-addr_limit.patch arm-dts-mvebu-pl310-cache-disable-double-linefill.patch arm-8715-1-add-a-private-asm-unaligned.h.patch +drm-amdgpu-return-enoent-from-uvd-6.0-early-init-for-harvesting.patch +ocfs2-fstrim-fix-start-offset-of-first-cluster-group-during-fstrim.patch