From: Greg Kroah-Hartman Date: Tue, 11 Apr 2023 14:17:52 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v5.15.107~16 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=abfbc7c3f440be5cf99d0c4a1540022c69e3ff21;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: drm-bridge-lt9611-fix-pll-being-unable-to-lock.patch revert-media-ti-cal-fix-possible-memory-leak-in-cal_ctx_create.patch selftests-intel_pstate-ftime-is-deprecated.patch --- diff --git a/queue-5.10/drm-bridge-lt9611-fix-pll-being-unable-to-lock.patch b/queue-5.10/drm-bridge-lt9611-fix-pll-being-unable-to-lock.patch new file mode 100644 index 00000000000..53977f029cd --- /dev/null +++ b/queue-5.10/drm-bridge-lt9611-fix-pll-being-unable-to-lock.patch @@ -0,0 +1,37 @@ +From 2a9df204be0bbb896e087f00b9ee3fc559d5a608 Mon Sep 17 00:00:00 2001 +From: Robert Foss +Date: Tue, 13 Dec 2022 16:03:04 +0100 +Subject: drm/bridge: lt9611: Fix PLL being unable to lock + +From: Robert Foss + +commit 2a9df204be0bbb896e087f00b9ee3fc559d5a608 upstream. + +This fixes PLL being unable to lock, and is derived from an equivalent +downstream commit. + +Available LT9611 documentation does not list this register, neither does +LT9611UXC (which is a different chip). + +This commit has been confirmed to fix HDMI output on DragonBoard 845c. + +Suggested-by: Amit Pundir +Reviewed-by: Amit Pundir +Signed-off-by: Robert Foss +Link: https://patchwork.freedesktop.org/patch/msgid/20221213150304.4189760-1-robert.foss@linaro.org +Signed-off-by: Amit Pundir +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/bridge/lontium-lt9611.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/gpu/drm/bridge/lontium-lt9611.c ++++ b/drivers/gpu/drm/bridge/lontium-lt9611.c +@@ -256,6 +256,7 @@ static int lt9611_pll_setup(struct lt961 + { 0x8126, 0x55 }, + { 0x8127, 0x66 }, + { 0x8128, 0x88 }, ++ { 0x812a, 0x20 }, + }; + + regmap_multi_reg_write(lt9611->regmap, reg_cfg, ARRAY_SIZE(reg_cfg)); diff --git a/queue-5.10/revert-media-ti-cal-fix-possible-memory-leak-in-cal_ctx_create.patch b/queue-5.10/revert-media-ti-cal-fix-possible-memory-leak-in-cal_ctx_create.patch new file mode 100644 index 00000000000..c281f715760 --- /dev/null +++ b/queue-5.10/revert-media-ti-cal-fix-possible-memory-leak-in-cal_ctx_create.patch @@ -0,0 +1,43 @@ +From cuigaosheng1@huawei.com Tue Apr 11 16:17:00 2023 +From: Gaosheng Cui +Date: Tue, 4 Apr 2023 09:25:02 +0800 +Subject: Revert "media: ti: cal: fix possible memory leak in cal_ctx_create()" +To: , +Cc: , , , , , +Message-ID: <20230404012502.3061129-1-cuigaosheng1@huawei.com> + +From: Gaosheng Cui + +This reverts commit c7a218cbf67fffcd99b76ae3b5e9c2e8bef17c8c. + +The memory of ctx is allocated by devm_kzalloc in cal_ctx_create, +it should not be freed by kfree when cal_ctx_v4l2_init() fails, +otherwise kfree() will cause double free, so revert this patch. + +The memory of ctx is allocated by kzalloc since commit +9e67f24e4d9 ("media: ti-vpe: cal: fix ctx uninitialization"), +so the fixes tag of patch c7a218cbf67fis not entirely accurate, +mainline should merge this patch, but it should not be merged +into 5.10, so we just revert this patch for this branch. + +Fixes: c7a218cbf67f ("media: ti: cal: fix possible memory leak in cal_ctx_create()") +Signed-off-by: Gaosheng Cui +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/platform/ti-vpe/cal.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/media/platform/ti-vpe/cal.c ++++ b/drivers/media/platform/ti-vpe/cal.c +@@ -624,10 +624,8 @@ static struct cal_ctx *cal_ctx_create(st + ctx->cport = inst; + + ret = cal_ctx_v4l2_init(ctx); +- if (ret) { +- kfree(ctx); ++ if (ret) + return NULL; +- } + + return ctx; + } diff --git a/queue-5.10/selftests-intel_pstate-ftime-is-deprecated.patch b/queue-5.10/selftests-intel_pstate-ftime-is-deprecated.patch new file mode 100644 index 00000000000..f1f56583bb5 --- /dev/null +++ b/queue-5.10/selftests-intel_pstate-ftime-is-deprecated.patch @@ -0,0 +1,96 @@ +From fc4a3a1bf9ad799181e4d4ec9c2598c0405bc27d Mon Sep 17 00:00:00 2001 +From: Tommi Rantala +Date: Mon, 2 Nov 2020 09:39:18 +0200 +Subject: selftests: intel_pstate: ftime() is deprecated +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Tommi Rantala + +commit fc4a3a1bf9ad799181e4d4ec9c2598c0405bc27d upstream. + +Use clock_gettime() instead of deprecated ftime(). + + aperf.c: In function ‘main’: + aperf.c:58:2: warning: ‘ftime’ is deprecated [-Wdeprecated-declarations] + 58 | ftime(&before); + | ^~~~~ + In file included from aperf.c:9: + /usr/include/sys/timeb.h:39:12: note: declared here + 39 | extern int ftime (struct timeb *__timebuf) + | ^~~~~ + +Signed-off-by: Tommi Rantala +Signed-off-by: Shuah Khan +Signed-off-by: Ricardo Cañuelo +Reported-by: kernel test robot +Link: https://lore.kernel.org/oe-kbuild-all/202304060514.ELO1BqLI-lkp@intel.com/ +Signed-off-by: Greg Kroah-Hartman +--- + tools/testing/selftests/intel_pstate/aperf.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +--- a/tools/testing/selftests/intel_pstate/aperf.c ++++ b/tools/testing/selftests/intel_pstate/aperf.c +@@ -10,8 +10,12 @@ + #include + #include + #include ++#include + #include "../kselftest.h" + ++#define MSEC_PER_SEC 1000L ++#define NSEC_PER_MSEC 1000000L ++ + void usage(char *name) { + printf ("Usage: %s cpunum\n", name); + } +@@ -22,7 +26,7 @@ int main(int argc, char **argv) { + long long tsc, old_tsc, new_tsc; + long long aperf, old_aperf, new_aperf; + long long mperf, old_mperf, new_mperf; +- struct timeb before, after; ++ struct timespec before, after; + long long int start, finish, total; + cpu_set_t cpuset; + +@@ -55,7 +59,10 @@ int main(int argc, char **argv) { + return 1; + } + +- ftime(&before); ++ if (clock_gettime(CLOCK_MONOTONIC, &before) < 0) { ++ perror("clock_gettime"); ++ return 1; ++ } + pread(fd, &old_tsc, sizeof(old_tsc), 0x10); + pread(fd, &old_aperf, sizeof(old_mperf), 0xe7); + pread(fd, &old_mperf, sizeof(old_aperf), 0xe8); +@@ -64,7 +71,10 @@ int main(int argc, char **argv) { + sqrt(i); + } + +- ftime(&after); ++ if (clock_gettime(CLOCK_MONOTONIC, &after) < 0) { ++ perror("clock_gettime"); ++ return 1; ++ } + pread(fd, &new_tsc, sizeof(new_tsc), 0x10); + pread(fd, &new_aperf, sizeof(new_mperf), 0xe7); + pread(fd, &new_mperf, sizeof(new_aperf), 0xe8); +@@ -73,11 +83,11 @@ int main(int argc, char **argv) { + aperf = new_aperf-old_aperf; + mperf = new_mperf-old_mperf; + +- start = before.time*1000 + before.millitm; +- finish = after.time*1000 + after.millitm; ++ start = before.tv_sec*MSEC_PER_SEC + before.tv_nsec/NSEC_PER_MSEC; ++ finish = after.tv_sec*MSEC_PER_SEC + after.tv_nsec/NSEC_PER_MSEC; + total = finish - start; + +- printf("runTime: %4.2f\n", 1.0*total/1000); ++ printf("runTime: %4.2f\n", 1.0*total/MSEC_PER_SEC); + printf("freq: %7.0f\n", tsc / (1.0*aperf / (1.0 * mperf)) / total); + return 0; + } diff --git a/queue-5.10/series b/queue-5.10/series index 5585418cab3..e0ad3f3373a 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -45,3 +45,6 @@ drm-panfrost-fix-the-panfrost_mmu_map_fault_addr-error-path.patch drm-nouveau-disp-support-more-modes-by-checking-with-lower-bpc.patch ring-buffer-fix-race-while-reader-and-writer-are-on-the-same-page.patch mm-swap-fix-swap_info_struct-race-between-swapoff-and-get_swap_pages.patch +selftests-intel_pstate-ftime-is-deprecated.patch +drm-bridge-lt9611-fix-pll-being-unable-to-lock.patch +revert-media-ti-cal-fix-possible-memory-leak-in-cal_ctx_create.patch