6.2.15-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 116/663 kunit: fix bug in the order of lines in debugfs logs
In reply to Greg Kroah-HartmanFrom: Rae Moar <[email protected]>
[ Upstream commit f9a301c3317daa921375da0aec82462ddf019928 ]
Fix bug in debugfs logs that causes an incorrect order of lines in the debugfs log.
Currently, the test counts lines that show the number of tests passed, failed, and skipped, as well as any suite diagnostic lines, appear prior to the individual results, which is a bug.
Ensure the order of printing for the debugfs log is correct. Additionally, add a KTAP header to so the debugfs logs can be valid KTAP.
This is an example of a log prior to these fixes:
KTAP version 1
# Subtest: kunit_status
1..2
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
ok 1 kunit_status
Note the two lines with stats are out of order. This is the same debugfs log after the fixes (in combination with the third patch to remove the extra line):
KTAP version 1
1..1
KTAP version 1
# Subtest: kunit_status
1..2
ok 1 kunit_status_set_failure_test
ok 2 kunit_status_mark_skipped_test
# kunit_status: pass:2 fail:0 skip:0 total:2
# Totals: pass:2 fail:0 skip:0 total:2
ok 1 kunit_status
--- lib/kunit/debugfs.c | 14 ++++++++++++-- lib/kunit/test.c | 21 ++++++++++++++------- 2 files changed, 26 insertions(+), 9 deletions(-)
lib/kunit/debugfs.c +12 -2
@@ -55,14 +55,24 @@ static int debugfs_print_results(struct seq_file *seq, void *v)enum kunit_status success =kunit_suite_has_succeeded (suite);struct kunit_case *test_case; -if (!suite || !suite->log) +if (!suite)return 0 ; -seq_printf (seq,"%s" , suite->log); +/* Print KTAP header so the debugfs log can be parsed as valid KTAP. */ +seq_puts (seq,"KTAP version 1\n" ); +seq_puts (seq,"1..1\n" ); + +/* Print suite header because it is not stored in the test logs. */ +seq_puts (seq,KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); +seq_printf (seq,KUNIT_SUBTEST_INDENT "# Subtest: %s\n" , suite->name); +seq_printf (seq,KUNIT_SUBTEST_INDENT "1..%zd\n" ,kunit_suite_num_test_cases (suite));kunit_suite_for_each_test_case (suite, test_case)debugfs_print_result (seq, suite, test_case); +if (suite->log) +seq_printf (seq,"%s" , suite->log); +seq_printf (seq,"%s %d %s\n" ,kunit_status_to_ok_not_ok (success),1 , suite->name);return 0 ;
lib/kunit/test.c +14 -7
@@ -152,10 +152,18 @@ EXPORT_SYMBOL_GPL(kunit_suite_num_test_cases);static void kunit_print_suite_start (struct kunit_suite *suite) { -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "# Subtest: %s" , +/* +* We do not log the test suite header as doing so would +* mean debugfs display would consist of the test suite +* header prior to individual test results. +* Hence directly printk the suite status, and we will +* separately seq_printf() the suite header for the debugfs +* representation. +*/ +pr_info (KUNIT_SUBTEST_INDENT "KTAP version 1\n" ); +pr_info (KUNIT_SUBTEST_INDENT "# Subtest: %s\n" , suite->name); -kunit_log (KERN_INFO , suite,KUNIT_SUBTEST_INDENT "1..%zd" , +pr_info (KUNIT_SUBTEST_INDENT "1..%zd\n" ,kunit_suite_num_test_cases (suite)); }
@@ -172,10 +180,9 @@ static void kunit_print_ok_not_ok(void *test_or_suite,/* * We do not log the test suite results as doing so would -* mean debugfs display would consist of the test suite -* description and status prior to individual test results. -* Hence directly printk the suite status, and we will -* separately seq_printf() the suite status for the debugfs +* mean debugfs display would consist of an incorrect test +* number. Hence directly printk the suite result, and we will +* separately seq_printf() the suite results for the debugfs * representation. */ if (suite)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 117/663 rcu: Fix missing TICK_DEP_MASK_RCU_EXP dependency check
In reply to Greg Kroah-HartmanFrom: Zqiang <[email protected]>
[ Upstream commit db7b464df9d820186e98a65aa6a10f0d51fbf8ce ]
This commit adds checks for the TICK_DEP_MASK_RCU_EXP bit, thus enabling RCU expedited grace periods to actually force-enable scheduling-clock interrupts on holdout CPUs.
--- include/trace/events/timer.h | 3 ++- kernel/time/tick-sched.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-)
include/trace/events/timer.h +2 -1
@@ -371,7 +371,8 @@ TRACE_EVENT(itimer_expire, tick_dep_name(PERF_EVENTS) \ tick_dep_name(SCHED) \ tick_dep_name(CLOCK_UNSTABLE) \ - tick_dep_name_end(RCU) + tick_dep_name(RCU) \ + tick_dep_name_end(RCU_EXP) #undef tick_dep_name#undef tick_dep_mask_name
kernel/time/tick-sched.c +5 -0
@@ -281,6 +281,11 @@ static bool check_tick_dependency(atomic_t *dep)return true; } +if (val &TICK_DEP_MASK_RCU_EXP ) { +trace_tick_stop (0 ,TICK_DEP_MASK_RCU_EXP ); +return true; + } +return false; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 118/663 selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit 22a8be280383812235131dda18a8212a59fadd2d ]
malloc_and_init_memory() in fill_buf isn't checking if memalign() successfully allocated memory or not before accessing the memory.
Check the return value of memalign() and return NULL if allocating aligned memory fails.
--- tools/testing/selftests/resctrl/fill_buf.c | 2 ++ 1 file changed, 2 insertions(+)
tools/testing/selftests/resctrl/fill_buf.c +2 -0
@@ -68,6 +68,8 @@ static void *malloc_and_init_memory(size_t s)size_t s64;void *p =memalign (PAGE_SIZE , s); +if (!p) +return NULL ; p64 = (uint64_t *)p; s64 = s /sizeof (uint64_t );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 119/663 selftests/resctrl: Move ->setup() call outside of test specific branches
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit c90b3b588e369c20087699316259fa5ebbb16f2d ]
resctrl_val() function is called only by MBM, MBA, and CMT tests which means the else branch is never used.
Both test branches call param->setup().
Remove the unused else branch and place the ->setup() call outside of the test specific branches reducing code duplication.
Stable-dep-of: fa10366cc6f4 ("selftests/resctrl: Allow ->setup() to return errors")
--- tools/testing/selftests/resctrl/resctrl_val.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-)
tools/testing/selftests/resctrl/resctrl_val.c +6 -13
@@ -734,29 +734,22 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)/* Test runs until the callback setup() tells the test to stop. */ while (1 ) { + ret = param->setup (1 , param); +if (ret) { + ret =0 ; +break ; + } +if (!strncmp (resctrl_val,MBM_STR ,sizeof (MBM_STR )) || !strncmp (resctrl_val,MBA_STR ,sizeof (MBA_STR ))) { - ret = param->setup (1 , param); -if (ret) { - ret =0 ; -break ; - } - ret =measure_vals (param, &bw_resc_start);if (ret)break ; }else if (!strncmp (resctrl_val,CMT_STR ,sizeof (CMT_STR ))) { - ret = param->setup (1 , param); -if (ret) { - ret =0 ; -break ; - }sleep (1 ); ret =measure_cache_vals (param, bm_pid);if (ret)break ; - }else { -break ; } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 120/663 selftests/resctrl: Allow ->setup() to return errors
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit fa10366cc6f4cc862871f8938426d85c2481f084 ]
resctrl_val() assumes ->setup() always returns either 0 to continue tests or < 0 in case of the normal termination of tests after x runs. The latter overlaps with normal error returns.
Define END_OF_TESTS (=1) to differentiate the normal termination of tests and return errors as negative values. Alter callers of ->setup() to handle errors properly.
--- tools/testing/selftests/resctrl/cache.c | 4 +++- tools/testing/selftests/resctrl/cat_test.c | 2 +- tools/testing/selftests/resctrl/cmt_test.c | 2 +- tools/testing/selftests/resctrl/mba_test.c | 2 +- tools/testing/selftests/resctrl/mbm_test.c | 2 +- tools/testing/selftests/resctrl/resctrl.h | 2 ++ tools/testing/selftests/resctrl/resctrl_val.c | 4 +++- 7 files changed, 12 insertions(+), 6 deletions(-)
tools/testing/selftests/resctrl/cache.c +3 -1
@@ -244,10 +244,12 @@ int cat_val(struct resctrl_val_param *param)while (1 ) {if (!strncmp (resctrl_val,CAT_STR ,sizeof (CAT_STR ))) { ret = param->setup (1 , param); -if (ret) { +if (ret ==END_OF_TESTS ) { ret =0 ;break ; } +if (ret <0 ) +break ; ret =reset_enable_llc_perf (bm_pid, param->cpu_no);if (ret)break ;
tools/testing/selftests/resctrl/cat_test.c +1 -1
@@ -40,7 +40,7 @@ static int cat_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ;if (p->num_of_runs ==0 ) {sprintf (schemata,"%lx" , p->mask);
tools/testing/selftests/resctrl/cmt_test.c +1 -1
@@ -32,7 +32,7 @@ static int cmt_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (p->num_of_runs >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ; p->num_of_runs++;
tools/testing/selftests/resctrl/mba_test.c +1 -1
@@ -41,7 +41,7 @@ static int mba_setup(int num, ...)return 0 ;if (allocation <ALLOCATION_MIN || allocation >ALLOCATION_MAX ) -return -1 ; +return END_OF_TESTS ;sprintf (allocation_str,"%d" , allocation);
tools/testing/selftests/resctrl/mbm_test.c +1 -1
@@ -95,7 +95,7 @@ static int mbm_setup(int num, ...)/* Run NUM_OF_RUNS times */ if (num_of_runs++ >=NUM_OF_RUNS ) -return -1 ; +return END_OF_TESTS ;va_start (param, num); p = va_arg(param, struct resctrl_val_param *);
tools/testing/selftests/resctrl/resctrl.h +2 -0
@@ -37,6 +37,8 @@#define ARCH_INTEL 1#define ARCH_AMD 2 +#define END_OF_TESTS 1 +#define PARENT_EXIT (err_msg) \ do { \ perror(err_msg); \
tools/testing/selftests/resctrl/resctrl_val.c +3 -1
@@ -735,10 +735,12 @@ int resctrl_val(char **benchmark_cmd, struct resctrl_val_param *param)/* Test runs until the callback setup() tells the test to stop. */ while (1 ) { ret = param->setup (1 , param); -if (ret) { +if (ret ==END_OF_TESTS ) { ret =0 ;break ; } +if (ret <0 ) +break ;if (!strncmp (resctrl_val,MBM_STR ,sizeof (MBM_STR )) || !strncmp (resctrl_val,MBA_STR ,sizeof (MBA_STR ))) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 121/663 selftests/resctrl: Check for return value after write_schemata()
In reply to Greg Kroah-HartmanFrom: Ilpo Järvinen <[email protected]>
[ Upstream commit 0d45c83b95da414e98ad333e723141a94f6e2c64 ]
MBA test case writes schemata but it does not check if the write is successful or not.
Add the error check and return error properly.
--- tools/testing/selftests/resctrl/mba_test.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tools/testing/selftests/resctrl/mba_test.c +6 -1
@@ -28,6 +28,7 @@ static int mba_setup(int num, ...)struct resctrl_val_param *p;char allocation_str[64 ];va_list param; +int ret;va_start (param, num); p = va_arg(param, struct resctrl_val_param *);
@@ -45,7 +46,11 @@ static int mba_setup(int num, ...)sprintf (allocation_str,"%d" , allocation); -write_schemata (p->ctrlgrp, allocation_str, p->cpu_no, p->resctrl_val); + ret =write_schemata (p->ctrlgrp, allocation_str, p->cpu_no, + p->resctrl_val); +if (ret <0 ) +return ret; + allocation -=ALLOCATION_STEP ;return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 122/663 selinux: fix Makefile dependencies of flask.h
In reply to Greg Kroah-HartmanFrom: Ondrej Mosnacek <[email protected]>
[ Upstream commit bcab1adeaad4b39a1e04cb98979a367d08253f03 ]
Make the flask.h target depend on the genheaders binary instead of classmap.h to ensure that it is rebuilt if any of the dependencies of genheaders are changed.
Notably this fixes flask.h not being rebuilt wheninitial_sid_to_string.h is modified.
--- security/selinux/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
security/selinux/Makefile +2 -2
@@ -23,8 +23,8 @@ ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include $(addprefix $(obj)/,$(selinux-y)): $(obj)/flask.h quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h - cmd_flask = scripts/selinux/genheaders/genheaders $(obj)/flask.h $(obj)/av_permissions.h + cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h targets += flask.h av_permissions.h -$(obj)/flask.h: $(src)/include/classmap.h FORCE +$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE $(call if_changed,flask)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 123/663 selinux: ensure av_permissions.h is built when needed
In reply to Greg Kroah-HartmanFrom: Paul Moore <[email protected]>
[ Upstream commit 4ce1f694eb5d8ca607fed8542d32a33b4f1217a5 ]
The Makefile rule responsible for building flask.h and av_permissions.h only lists flask.h as a target which means that av_permissions.h is only generated when flask.h needs to be generated. This patch fixes this by adding av_permissions.h as a target to the rule.
--- security/selinux/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/Makefile +1 -1
@@ -26,5 +26,5 @@ quiet_cmd_flask = GEN $(obj)/flask.h $(obj)/av_permissions.h cmd_flask = $< $(obj)/flask.h $(obj)/av_permissions.h targets += flask.h av_permissions.h -$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE +$(obj)/flask.h $(obj)/av_permissions.h &: scripts/selinux/genheaders/genheaders FORCE $(call if_changed,flask)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 124/663 tpm, tpm_tis: Do not skip reset of original interrupt vector
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit ed9be0e6c892a783800d77a41ca4c7255c6af8c5 ]
If in tpm_tis_probe_irq_single() an error occurs after the original interrupt vector has been read, restore the interrupts before the error is returned.
Since the caller does not check the error value, return -1 in any case that the TPM_CHIP_FLAG_IRQ flag is not set. Since the return value of function tpm_tis_gen_interrupt() is not longer used, make it a void function.
--- drivers/char/tpm/tpm_tis_core.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-)
drivers/char/tpm/tpm_tis_core.c +11 -18
@@ -732,7 +732,7 @@ static irqreturn_t tis_int_handler(int dummy, void *dev_id)return IRQ_HANDLED ; } -static int tpm_tis_gen_interrupt (struct tpm_chip *chip) +static void tpm_tis_gen_interrupt (struct tpm_chip *chip) {const char *desc ="attempting to generate an interrupt" ;u32 cap2;
@@ -741,7 +741,7 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip) ret =request_locality (chip,0 );if (ret <0 ) -return ret; +return ;if (chip->flags &TPM_CHIP_FLAG_TPM2 ) ret =tpm2_get_tpm_pt (chip,0x100 , &cap2, desc);
@@ -749,8 +749,6 @@ static int tpm_tis_gen_interrupt(struct tpm_chip *chip) ret =tpm1_getcap (chip,TPM_CAP_PROP_TIS_TIMEOUT , &cap, desc,0 );release_locality (chip,0 ); - -return ret; }/* Register the IRQ and issue a command that will cause an interrupt. If an
@@ -780,42 +778,37 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, rc =tpm_tis_write8 (priv,TPM_INT_VECTOR (priv->locality), irq);if (rc <0 ) -return rc; + goto restore_irqs; rc =tpm_tis_read32 (priv,TPM_INT_STATUS (priv->locality), &int_status);if (rc <0 ) -return rc; + goto restore_irqs;/* Clear all existing */ rc =tpm_tis_write32 (priv,TPM_INT_STATUS (priv->locality), int_status);if (rc <0 ) -return rc; - + goto restore_irqs;/* Turn on */ rc =tpm_tis_write32 (priv,TPM_INT_ENABLE (priv->locality), intmask |TPM_GLOBAL_INT_ENABLE );if (rc <0 ) -return rc; + goto restore_irqs; priv->irq_tested = false;/* Generate an interrupt by having the core call through to * tpm_tis_send */ - rc =tpm_tis_gen_interrupt (chip); -if (rc <0 ) -return rc; +tpm_tis_gen_interrupt (chip); +restore_irqs:/* tpm_tis_send will either confirm the interrupt is working or it * will call disable_irq which undoes all of the above. */ if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) { - rc =tpm_tis_write8 (priv, original_int_vec, -TPM_INT_VECTOR (priv->locality)); -if (rc <0 ) -return rc; - -return 1 ; +tpm_tis_write8 (priv, original_int_vec, +TPM_INT_VECTOR (priv->locality)); +return -1 ; }return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 125/663 tpm, tpm_tis: Claim locality before writing TPM_INT_ENABLE register
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 282657a8bd7fddcf511b834f43705001668b33a7 ]
In disable_interrupts() the TPM_GLOBAL_INT_ENABLE bit is unset in the TPM_INT_ENABLE register to shut the interrupts off. However modifying the register is only possible with a held locality. So claim the locality before disable_interrupts() is called.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/char/tpm/tpm_tis_core.c +4 -0
@@ -1094,7 +1094,11 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,dev_err (&chip->dev,FW_BUG "TPM interrupt not working, polling instead\n" ); + rc =request_locality (chip,0 ); +if (rc <0 ) + goto out_err;disable_interrupts (chip); +release_locality (chip,0 ); } }else {tpm_tis_probe_irq (chip, intmask);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 126/663 tpm, tpm_tis: Disable interrupts if tpm_tis_probe_irq() failed
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 6d789ad726950e612a7f31044260337237c5b490 ]
Both functions tpm_tis_probe_irq_single() and tpm_tis_probe_irq() may setup the interrupts and then return with an error. This case is indicated by a missing TPM_CHIP_FLAG_IRQ flag in chip->flags.
Currently the interrupt setup is only undone if tpm_tis_probe_irq_single() fails. Undo the setup also if tpm_tis_probe_irq() fails.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/char/tpm/tpm_tis_core.c +11 -11
@@ -1087,21 +1087,21 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, goto out_err; } -if (irq) { +if (irq)tpm_tis_probe_irq_single (chip, intmask,IRQF_SHARED , irq); -if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) { -dev_err (&chip->dev,FW_BUG +else +tpm_tis_probe_irq (chip, intmask); + +if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) { +dev_err (&chip->dev,FW_BUG "TPM interrupt not working, polling instead\n" ); - rc =request_locality (chip,0 ); -if (rc <0 ) - goto out_err; -disable_interrupts (chip); -release_locality (chip,0 ); - } - }else { -tpm_tis_probe_irq (chip, intmask); + rc =request_locality (chip,0 ); +if (rc <0 ) + goto out_err; +disable_interrupts (chip); +release_locality (chip,0 ); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 127/663 tpm, tpm_tis: Claim locality before writing interrupt registers
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 15d7aa4e46eba87242a320f39773aa16faddadee ]
In tpm_tis_probe_single_irq() interrupt registers TPM_INT_VECTOR, TPM_INT_STATUS and TPM_INT_ENABLE are modified to setup the interrupts. Currently these modifications are done without holding a locality thus they have no effect. Fix this by claiming the (default) locality before the registers are written.
Since now tpm_tis_gen_interrupt() is called with the locality already claimed remove locality request and release from this function.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/char/tpm/tpm_tis_core.c +11 -9
@@ -739,16 +739,10 @@ static void tpm_tis_gen_interrupt(struct tpm_chip *chip)cap_t cap;int ret; - ret =request_locality (chip,0 ); -if (ret <0 ) -return ; -if (chip->flags &TPM_CHIP_FLAG_TPM2 ) ret =tpm2_get_tpm_pt (chip,0x100 , &cap2, desc);else ret =tpm1_getcap (chip,TPM_CAP_PROP_TIS_TIMEOUT , &cap, desc,0 ); - -release_locality (chip,0 ); }/* Register the IRQ and issue a command that will cause an interrupt. If an
@@ -771,10 +765,16 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, } priv->irq = irq; + rc =request_locality (chip,0 ); +if (rc <0 ) +return rc; + rc =tpm_tis_read8 (priv,TPM_INT_VECTOR (priv->locality), &original_int_vec); -if (rc <0 ) +if (rc <0 ) { +release_locality (chip, priv->locality);return rc; + } rc =tpm_tis_write8 (priv,TPM_INT_VECTOR (priv->locality), irq);if (rc <0 )
@@ -808,10 +808,12 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask,if (!(chip->flags &TPM_CHIP_FLAG_IRQ )) {tpm_tis_write8 (priv, original_int_vec,TPM_INT_VECTOR (priv->locality)); -return -1 ; + rc =-1 ; } -return 0 ; +release_locality (chip, priv->locality); + +return rc; }/* Try to find the IRQ the TPM is using. This is for legacy x86 systems that
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 128/663 tpm, tpm: Implement usage counter for locality
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 7a2f55d0be296c4e81fd782f3d6c43ed4ec7e265 ]
Implement a usage counter for the (default) locality used by the TPM TIS driver:
Request the locality from the TPM if it has not been claimed yet, otherwise only increment the counter. Also release the locality if the counter is 0 otherwise only decrement the counter. Since in case of SPI the register accesses are locked by means of the SPI bus mutex use a sleepable lock (i.e. also a mutex) to ensure thread-safety of the counter which may be accessed by both a userspace thread and the interrupt handler.
By doing this refactor the names of the amended functions to use a more appropriate prefix.
Stable-dep-of: 955df4f87760 ("tpm, tpm_tis: Claim locality when interrupts are reenabled on resume")
--- drivers/char/tpm/tpm_tis_core.c | 63 +++++++++++++++++++++++---------- drivers/char/tpm/tpm_tis_core.h | 2 ++ 2 files changed, 47 insertions(+), 18 deletions(-)
drivers/char/tpm/tpm_tis_core.c +45 -18
@@ -136,16 +136,27 @@ static bool check_locality(struct tpm_chip *chip, int l)return false; } -static int release_locality (struct tpm_chip *chip,int l) +static int __tpm_tis_relinquish_locality (struct tpm_tis_data *priv,int l) +{ +tpm_tis_write8 (priv,TPM_ACCESS (l),TPM_ACCESS_ACTIVE_LOCALITY ); + +return 0 ; +} + +static int tpm_tis_relinquish_locality (struct tpm_chip *chip,int l) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev); -tpm_tis_write8 (priv,TPM_ACCESS (l),TPM_ACCESS_ACTIVE_LOCALITY ); +mutex_lock (&priv->locality_count_mutex); + priv->locality_count--; +if (priv->locality_count ==0 ) +__tpm_tis_relinquish_locality (priv, l); +mutex_unlock (&priv->locality_count_mutex);return 0 ; } -static int request_locality (struct tpm_chip *chip,int l) +static int __tpm_tis_request_locality (struct tpm_chip *chip,int l) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev);unsigned long stop, timeout;
@@ -186,6 +197,20 @@ static int request_locality(struct tpm_chip *chip, int l)return -1 ; } +static int tpm_tis_request_locality (struct tpm_chip *chip,int l) +{ +struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev); +int ret =0 ; + +mutex_lock (&priv->locality_count_mutex); +if (priv->locality_count ==0 ) + ret =__tpm_tis_request_locality (chip, l); +if (!ret) + priv->locality_count++; +mutex_unlock (&priv->locality_count_mutex); +return ret; +} +static u8 tpm_tis_status (struct tpm_chip *chip) {struct tpm_tis_data *priv =dev_get_drvdata (&chip->dev);
@@ -652,7 +677,7 @@ static int probe_itpm(struct tpm_chip *chip)if (vendor !=TPM_VID_INTEL )return 0 ; -if (request_locality (chip,0 ) !=0 ) +if (tpm_tis_request_locality (chip,0 ) !=0 )return -EBUSY ; rc =tpm_tis_send_data (chip, cmd_getticks, len);
@@ -673,7 +698,7 @@ static int probe_itpm(struct tpm_chip *chip) out:tpm_tis_ready (chip); -release_locality (chip, priv->locality); +tpm_tis_relinquish_locality (chip, priv->locality);return rc; }
@@ -765,14 +790,14 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, } priv->irq = irq; - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 )return rc; rc =tpm_tis_read8 (priv,TPM_INT_VECTOR (priv->locality), &original_int_vec);if (rc <0 ) { -release_locality (chip, priv->locality); +tpm_tis_relinquish_locality (chip, priv->locality);return rc; }
@@ -811,7 +836,7 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, rc =-1 ; } -release_locality (chip, priv->locality); +tpm_tis_relinquish_locality (chip, priv->locality);return rc; }
@@ -927,8 +952,8 @@ static const struct tpm_class_ops tpm_tis = { .req_complete_mask = TPM_STS_DATA_AVAIL | TPM_STS_VALID, .req_complete_val = TPM_STS_DATA_AVAIL | TPM_STS_VALID, .req_canceled = tpm_tis_req_canceled, - .request_locality = request_locality, - .relinquish_locality = release_locality, + .request_locality = tpm_tis_request_locality, + .relinquish_locality = tpm_tis_relinquish_locality, .clk_enable = tpm_tis_clkrun_enable, };
@@ -962,6 +987,8 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq, priv->timeout_min =TPM_TIMEOUT_USECS_MIN ; priv->timeout_max =TPM_TIMEOUT_USECS_MAX ; priv->phy_ops = phy_ops; + priv->locality_count =0 ; +mutex_init (&priv->locality_count_mutex);dev_set_drvdata (&chip->dev, priv);
@@ -1008,14 +1035,14 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,TPM_INTF_DATA_AVAIL_INT |TPM_INTF_STS_VALID_INT ; intmask &= ~TPM_GLOBAL_INT_ENABLE ; - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 ) { rc = -ENODEV ; goto out_err; }tpm_tis_write32 (priv,TPM_INT_ENABLE (priv->locality), intmask); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 ); rc =tpm_chip_start (chip);if (rc)
@@ -1075,13 +1102,13 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,* proper timeouts for the driver. */ - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 ) goto out_err; rc =tpm_get_timeouts (chip); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 );if (rc) {dev_err (dev,"Could not get TPM timeouts and durations\n" );
@@ -1099,11 +1126,11 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,dev_err (&chip->dev,FW_BUG "TPM interrupt not working, polling instead\n" ); - rc =request_locality (chip,0 ); + rc =tpm_tis_request_locality (chip,0 );if (rc <0 ) goto out_err;disable_interrupts (chip); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 ); } }
@@ -1176,13 +1203,13 @@ int tpm_tis_resume(struct device *dev)* an error code but for unknown reason it isn't handled. */ if (!(chip->flags &TPM_CHIP_FLAG_TPM2 )) { - ret =request_locality (chip,0 ); + ret =tpm_tis_request_locality (chip,0 );if (ret <0 )return ret;tpm1_do_selftest (chip); -release_locality (chip,0 ); +tpm_tis_relinquish_locality (chip,0 ); }return 0 ;
drivers/char/tpm/tpm_tis_core.h +2 -0
@@ -91,6 +91,8 @@ enum tpm_tis_flags {struct tpm_tis_data {u16 manufacturer_id; +struct mutex locality_count_mutex; +unsigned int locality_count;int locality;int irq;bool irq_tested;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 129/663 tpm, tpm_tis: Claim locality when interrupts are reenabled on resume
In reply to Greg Kroah-HartmanFrom: Lino Sanfilippo <[email protected]>
[ Upstream commit 955df4f87760b3bb2af253d3fbb12fb712b3ffa6 ]
In tpm_tis_resume() make sure that the locality has been claimed when tpm_tis_reenable_interrupts() is called. Otherwise the writings to the register might not have any effect.
--- drivers/char/tpm/tpm_tis_core.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/char/tpm/tpm_tis_core.c +9 -10
@@ -1191,28 +1191,27 @@ int tpm_tis_resume(struct device *dev)struct tpm_chip *chip =dev_get_drvdata (dev);int ret; + ret =tpm_tis_request_locality (chip,0 ); +if (ret <0 ) +return ret; +if (chip->flags &TPM_CHIP_FLAG_IRQ )tpm_tis_reenable_interrupts (chip); ret =tpm_pm_resume (dev);if (ret) -return ret; + goto out;/* * TPM 1.2 requires self-test on resume. This function actually returns * an error code but for unknown reason it isn't handled. */ -if (!(chip->flags &TPM_CHIP_FLAG_TPM2 )) { - ret =tpm_tis_request_locality (chip,0 ); -if (ret <0 ) -return ret; - +if (!(chip->flags &TPM_CHIP_FLAG_TPM2 ))tpm1_do_selftest (chip); +out: +tpm_tis_relinquish_locality (chip,0 ); -tpm_tis_relinquish_locality (chip,0 ); - } - - return 0; + return ret; }EXPORT_SYMBOL_GPL (tpm_tis_resume);#endif
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 130/663 erofs: stop parsing non-compact HEAD index if clusterofs is invalid
In reply to Greg Kroah-HartmanFrom: Gao Xiang <[email protected]>
[ Upstream commit cc4efd3dd2ac9f89143e5d881609747ecff04164 ]
Syzbot generated a crafted image [1] with a non-compact HEAD index of clusterofs 33024 while valid numbers should be 0 ~ lclustersize-1, which causes the following unexpected behavior as below:
BUG: unable to handle page fault for address: fffff52101a3fff9 #PF: supervisor read access in kernel mode #PF: error_code(0x0000) - not-present page PGD 23ffed067 P4D 23ffed067 PUD 0 Oops: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 4398 Comm: kworker/u5:1 Not tainted 6.3.0-rc6-syzkaller-g09a9639e56c0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/30/2023 Workqueue: erofs_worker z_erofs_decompressqueue_work RIP: 0010:z_erofs_decompress_queue+0xb7e/0x2b40 ... Call Trace: <TASK> z_erofs_decompressqueue_work+0x99/0xe0 process_one_work+0x8f6/0x1170 worker_thread+0xa63/0x1210 kthread+0x270/0x300 ret_from_fork+0x1f/0x30
Note that normal images or images using compact indexes are not impacted. Let's fix this now.
[1] https://lore.kernel.org/r/[email protected]
--- fs/erofs/zmap.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/erofs/zmap.c +4 -0
@@ -211,6 +211,10 @@ static int legacy_load_cluster_from_disk(struct z_erofs_maprecorder *m,if (advise &Z_EROFS_VLE_DI_PARTIAL_REF ) m->partialref = true; m->clusterofs =le16_to_cpu (di->di_clusterofs); +if (m->clusterofs >=1 << vi->z_logical_clusterbits) { +DBG_BUGON (1 ); +return -EFSCORRUPTED ; + } m->pblk =le32_to_cpu (di->di_u.blkaddr);break ;default :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 131/663 erofs: initialize packed inode after root inode is assigned
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit cb9bce79514392a9a216ff67148e05e2d72c28bd ]
As commit 8f7acdae2cd4 ("staging: erofs: kill all failure handling in fill_super()"), move the initialization of packed inode after root inode is assigned, so that the iput() in .put_super() is adequate as the failure handling.
Otherwise, iput() is also needed in .kill_sb(), in case of the mounting fails halfway.
--- fs/erofs/internal.h | 1 + fs/erofs/super.c | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 11 deletions(-)
fs/erofs/internal.h +1 -0
@@ -154,6 +154,7 @@ struct erofs_sb_info {/* what we really care is nid, rather than ino.. */ erofs_nid_t root_nid; +erofs_nid_t packed_nid;/* used for statfs, f_files - f_favail */ u64 inos;
fs/erofs/super.c +11 -11
@@ -381,17 +381,7 @@ static int erofs_read_superblock(struct super_block *sb)#endif sbi->islotbits =ilog2 (sizeof (struct erofs_inode_compact )); sbi->root_nid =le16_to_cpu (dsb->root_nid); -#ifdef CONFIG_EROFS_FS_ZIP - sbi->packed_inode =NULL ; -if (erofs_sb_has_fragments (sbi) && dsb->packed_nid) { - sbi->packed_inode = -erofs_iget (sb,le64_to_cpu (dsb->packed_nid)); -if (IS_ERR (sbi->packed_inode)) { - ret =PTR_ERR (sbi->packed_inode); - goto out; - } - } -#endif + sbi->packed_nid =le64_to_cpu (dsb->packed_nid); sbi->inos =le64_to_cpu (dsb->inos); sbi->build_time =le64_to_cpu (dsb->build_time);
@@ -800,6 +790,16 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)erofs_shrinker_register (sb);/* sb->s_umount is already locked, SB_ACTIVE and SB_BORN are not set */ +#ifdef CONFIG_EROFS_FS_ZIP +if (erofs_sb_has_fragments (sbi) && sbi->packed_nid) { + sbi->packed_inode =erofs_iget (sb, sbi->packed_nid); +if (IS_ERR (sbi->packed_inode)) { + err =PTR_ERR (sbi->packed_inode); + sbi->packed_inode =NULL ; +return err; + } + } +#endif err =erofs_init_managed_cache (sb);if (err)return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 132/663 erofs: fix potential overflow calculating xattr_isize
In reply to Greg Kroah-HartmanFrom: Jingbo Xu <[email protected]>
[ Upstream commit 1b3567a1969b26f709d82a874498c0754ea841c3 ]
Given on-disk i_xattr_icount is 16 bits and xattr_isize is calculated from i_xattr_icount multiplying 4, xattr_isize has a theoretical maximum of 256K (64K * 4).
Thus declare xattr_isize as unsigned int to avoid the potential overflow.
--- fs/erofs/internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/erofs/internal.h +1 -1
@@ -310,7 +310,7 @@ struct erofs_inode {unsigned char datalayout;unsigned char inode_isize; -unsigned short xattr_isize; +unsigned int xattr_isize;unsigned int xattr_shared_count;unsigned int *xattr_shared_xattrs;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 133/663 drm/rockchip: Drop unbalanced obj unref
In reply to Greg Kroah-HartmanFrom: Rob Clark <[email protected]>
[ Upstream commit 8ee3b0e85f6ccd9e6c527bc50eaba774c3bb18d0 ]
In the error path, rockchip_drm_gem_object_mmap() is dropping an obj reference that it doesn't own.
--- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_gem.c +0 -3
@@ -262,9 +262,6 @@ static int rockchip_drm_gem_object_mmap(struct drm_gem_object *obj,else ret =rockchip_drm_gem_object_mmap_dma (obj, vma); -if (ret) -drm_gem_vm_close (vma); -return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 134/663 drm/i915/dg2: Drop one PCI ID
In reply to Greg Kroah-HartmanFrom: Matt Roper <[email protected]>
[ Upstream commit 3a38be31ec82920a871963c086393bc0ba26a655 ]
The bspec was recently updated to remove PCI ID 0x5698; this ID is actually reserved for future use and should not be treated as DG2-G11.
Bspec: 44477
--- include/drm/i915_pciids.h | 1 - 1 file changed, 1 deletion(-)
include/drm/i915_pciids.h +0 -1
@@ -706,7 +706,6 @@INTEL_VGA_DEVICE (0x5693 , info), \INTEL_VGA_DEVICE (0x5694 , info), \INTEL_VGA_DEVICE (0x5695 , info), \ -INTEL_VGA_DEVICE (0x5698 , info), \INTEL_VGA_DEVICE (0x56A5 , info), \INTEL_VGA_DEVICE (0x56A6 , info), \ INTEL_VGA_DEVICE(0x56B0, info), \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 135/663 drm/vgem: add missing mutex_destroy
In reply to Greg Kroah-HartmanFrom: Maíra Canal <[email protected]>
[ Upstream commit 7c18189b14b33c1fbf76480b1bd217877c086e67 ]
vgem_fence_open() instantiates a mutex for a particular fence instance, but never destroys it by calling mutex_destroy() in vgem_fence_close().
So, add the missing mutex_destroy() to guarantee proper resource destruction.
--- drivers/gpu/drm/vgem/vgem_fence.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/vgem/vgem_fence.c +1 -0
@@ -249,4 +249,5 @@ void vgem_fence_close(struct vgem_file *vfile) {idr_for_each (&vfile->fence_idr, __vgem_fence_idr_fini, vfile);idr_destroy (&vfile->fence_idr); +mutex_destroy (&vfile->fence_mutex); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 136/663 drm/probe-helper: Cancel previous job before starting new one
In reply to Greg Kroah-HartmanFrom: Dom Cobley <[email protected]>
[ Upstream commit a8e47884f1906cd7440fafa056adc8817568e73e ]
Currently we schedule a call to output_poll_execute from drm_kms_helper_poll_enable for 10s in future. Later we try to replace that in drm_helper_probe_single_connector_modes with a 0s schedule with delayed_event set.
But as there is already a job in the queue this fails, and the immediate job we wanted with delayed_event set doesn't occur until 10s later.
And that call acts as if connector state has changed, reprobing modes. This has a side effect of waking up a display that has been blanked.
Make sure we cancel the old job before submitting the immediate one.
--- drivers/gpu/drm/drm_probe_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_probe_helper.c +3 -2
@@ -556,8 +556,9 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector,*/ dev->mode_config.delayed_event = true;if (dev->mode_config.poll_enabled) -schedule_delayed_work (&dev->mode_config.output_poll_work, -0 ); +mod_delayed_work (system_wq, + &dev->mode_config.output_poll_work, +0 ); }/* Re-enable polling in case the global poll config changed. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 137/663 drm/amdgpu: register a vga_switcheroo client for MacBooks with apple-gmux
In reply to Greg Kroah-HartmanFrom: Orlando Chamberlain <[email protected]>
[ Upstream commit d37a3929ca0363ed1dce02b2772cd5bc547ca66d ]
Commit 3840c5bcc245 ("drm/amdgpu: disentangle runtime pm and vga_switcheroo") made amdgpu only register a vga_switcheroo client for GPU's with PX, however AMD GPUs in dual gpu Apple Macbooks do need to register, but don't have PX. Instead of AMD's PX, they use apple-gmux.
Use apple_gmux_detect() to identify these gpus, and pci_is_thunderbolt_attached() to ensure eGPUs connected to Dual GPU Macbooks don't register with vga_switcheroo.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +16 -5
@@ -35,6 +35,7 @@#include <linux/devcoredump.h> #include <generated/utsrelease.h> #include <linux/pci-p2pdma.h> +#include <linux/apple-gmux.h> #include <drm/drm_aperture.h> #include <drm/drm_atomic_helper.h>
@@ -3952,12 +3953,15 @@ int amdgpu_device_init(struct amdgpu_device *adev,if ((adev->pdev->class >>8 ) ==PCI_CLASS_DISPLAY_VGA )vga_client_register (adev->pdev, amdgpu_device_vga_set_decode); -if (amdgpu_device_supports_px (ddev)) { - px = true; + px =amdgpu_device_supports_px (ddev); + +if (px || (!pci_is_thunderbolt_attached (adev->pdev) && +apple_gmux_detect (NULL ,NULL )))vga_switcheroo_register_client (adev->pdev, &amdgpu_switcheroo_ops, px); + +if (px)vga_switcheroo_init_domain_pm_ops (adev->dev, &adev->vga_pm_domain); - }if (adev->gmc.xgmi.pending_reset) queue_delayed_work(system_wq, &mgpu_info.delayed_reset_work,
@@ -4063,6 +4067,7 @@ void amdgpu_device_fini_hw(struct amdgpu_device *adev)void amdgpu_device_fini_sw (struct amdgpu_device *adev) {int idx; +bool px;amdgpu_fence_driver_sw_fini (adev);amdgpu_device_ip_fini (adev);
@@ -4082,10 +4087,16 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)kfree (adev->bios); adev->bios =NULL ; -if (amdgpu_device_supports_px (adev_to_drm (adev))) { + + px =amdgpu_device_supports_px (adev_to_drm (adev)); + +if (px || (!pci_is_thunderbolt_attached (adev->pdev) && +apple_gmux_detect (NULL ,NULL )))vga_switcheroo_unregister_client (adev->pdev); + +if (px)vga_switcheroo_fini_domain_pm_ops (adev->dev); - } +if ((adev->pdev->class >>8 ) ==PCI_CLASS_DISPLAY_VGA )vga_client_unregister (adev->pdev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 138/663 tools/x86/kcpuid: Fix avx512bw and avx512lvl fields in Fn00000007
In reply to Greg Kroah-HartmanFrom: Terry Bowman <[email protected]>
[ Upstream commit 4e347bdf44c1fd4296a7b9657a2c0e1bd900fa50 ]
Leaf Fn00000007 contains avx512bw at bit 26 and avx512vl at bit 28. This is incorrect per the SDM. Correct avx512bw to be bit 30 and avx512lvl to be bit 31.
--- tools/arch/x86/kcpuid/cpuid.csv | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/arch/x86/kcpuid/cpuid.csv +2 -2
@@ -184,8 +184,8 @@ 7, 0, EBX, 27, avx512er, AVX512 Exponent Reciproca instr 7, 0, EBX, 28, avx512cd, AVX512 Conflict Detection instr 7, 0, EBX, 29, sha, Intel Secure Hash Algorithm Extensions instr - 7, 0, EBX, 26, avx512bw, AVX512 Byte & Word instr - 7, 0, EBX, 28, avx512vl, AVX512 Vector Length Extentions (VL) + 7, 0, EBX, 30, avx512bw, AVX512 Byte & Word instr + 7, 0, EBX, 31, avx512vl, AVX512 Vector Length Extentions (VL) 7, 0, ECX, 0, prefetchwt1, X 7, 0, ECX, 1, avx512vbmi, AVX512 Vector Byte Manipulation Instructions 7, 0, ECX, 2, umip, User-mode Instruction Prevention
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 139/663 soc: ti: k3-ringacc: Add try_module_get() to k3_dmaring_request_dual_ring()
In reply to Greg Kroah-HartmanFrom: Nicolas Frayer <[email protected]>
[ Upstream commit 5f1732a8683c1da8faaa90d6ffc3bd6d33013a58 ]
When the k3 ring accelerator driver has been modified to add module build support, try_module_get() and module_put() have been added to update the module refcnt. One code path has not been updated and it has introduced an issue where the refcnt is decremented by module_put() in k3_ringacc_ring_free() without being incremented previously. Adding try_module_get() to k3_dmaring_request_dual_ring() ensures the refcnt is kept up to date.
--- drivers/soc/ti/k3-ringacc.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/soc/ti/k3-ringacc.c +7 -0
@@ -406,6 +406,11 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,mutex_lock (&ringacc->req_lock); +if (!try_module_get (ringacc->dev->driver->owner)) { + ret = -EINVAL ; + goto err_module_get; + } +if (test_bit (fwd_id, ringacc->rings_inuse)) { ret = -EBUSY ; goto error;
@@ -421,6 +426,8 @@ static int k3_dmaring_request_dual_ring(struct k3_ringacc *ringacc, int fwd_id,return 0 ; error: +module_put (ringacc->dev->driver->owner); +err_module_get:mutex_unlock (&ringacc->req_lock);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 140/663 soc: ti: pm33xx: Fix refcount leak in am33xx_pm_probe
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit 8f3c307b580a4a6425896007325bddefc36e8d91 ]
wkup_m3_ipc_get() takes refcount, which should be freed by wkup_m3_ipc_put(). Add missing refcount release in the error paths.
--- drivers/soc/ti/pm33xx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/soc/ti/pm33xx.c +3 -2
@@ -527,7 +527,7 @@ static int am33xx_pm_probe(struct platform_device *pdev) ret =am33xx_pm_alloc_sram ();if (ret) -return ret; + goto err_wkup_m3_ipc_put; ret =am33xx_pm_rtc_setup ();if (ret)
@@ -572,13 +572,14 @@ static int am33xx_pm_probe(struct platform_device *pdev)pm_runtime_put_sync (dev); err_pm_runtime_disable:pm_runtime_disable (dev); -wkup_m3_ipc_put (m3_ipc); err_unsetup_rtc:iounmap (rtc_base_virt);clk_put (rtc_fck); err_free_sram:am33xx_pm_free_sram (); pm33xx_dev =NULL ; +err_wkup_m3_ipc_put: +wkup_m3_ipc_put (m3_ipc);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 141/663 arm64: dts: renesas: r8a77990: Remove bogus voltages from OPP table
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit fb76b0fae3ca880363214e1dcd6513ab8bd529e7 ]
According to the R-Car Series, 3rd Generation Hardware User’s Manual Rev. 2.30, the System CPU cores on R-Car E3 do not have their own power supply, but use the common internal power supply (typical 1.03V).
Hence remove the "opp-microvolt" properties from the Operating Performance Points table. They are optional, and unused, when none of the CPU nodes is tied to a regulator using the "cpu-supply" property.
--- arch/arm64/boot/dts/renesas/r8a77990.dtsi | 3 --- 1 file changed, 3 deletions(-)
arch/arm64/boot/dts/renesas/r8a77990.dtsi +0 -3
@@ -49,17 +49,14 @@ opp-shared; opp-800000000 { opp-hz = /bits/ 64 <800000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1200000000 { opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; opp-suspend; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 142/663 arm64: dts: renesas: r8a774c0: Remove bogus voltages from OPP table
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 554edc3e9239bb81e61be9f0f5dbbeb528a69e72 ]
According to the RZ/G Series, 2nd Generation Hardware User’s Manual Rev. 1.11, the System CPU cores on RZ/G2E do not have their own power supply, but use the common internal power supply (typical 1.03V).
Hence remove the "opp-microvolt" properties from the Operating Performance Points table. They are optional, and unused, when none of the CPU nodes is tied to a regulator using the "cpu-supply" property.
--- arch/arm64/boot/dts/renesas/r8a774c0.dtsi | 3 --- 1 file changed, 3 deletions(-)
arch/arm64/boot/dts/renesas/r8a774c0.dtsi +0 -3
@@ -49,17 +49,14 @@ opp-shared; opp-800000000 { opp-hz = /bits/ 64 <800000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1000000000 { opp-hz = /bits/ 64 <1000000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; }; opp-1200000000 { opp-hz = /bits/ 64 <1200000000>; - opp-microvolt = <820000>; clock-latency-ns = <300000>; opp-suspend; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 143/663 arm64: dts: renesas: r9a07g044: Update IRQ numbers for SSI channels
In reply to Greg Kroah-HartmanFrom: Lad Prabhakar <[email protected]>
[ Upstream commit 5da750ddd96454757a3b467e968e3fb70bb12bc8 ]
Quoted 1 line
From R01UH0914EJ0120 Rev.1.20 HW manual the interrupt numbers for SSI
channels have been updated,
SPI 329 - SSIF0 is now marked as reserved
SPI 333 - SSIF1 is now marked as reserved
SPI 335 - SSIF2 is now marked as reserved
SPI 336 - SSIF2 is now marked as reserved
SPI 341 - SSIF3 is now marked as reserved
This patch drops the above IRQs from SoC DTSI.
--- arch/arm64/boot/dts/renesas/r9a07g044.dtsi | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g044.dtsi +7 -12
@@ -175,9 +175,8 @@ reg = <0 0x10049c00 0 0x400>; interrupts = <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 327 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 329 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G044_SSI0_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI0_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -196,9 +195,8 @@ reg = <0 0x1004a000 0 0x400>; interrupts = <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 331 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 333 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G044_SSI1_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI1_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -216,10 +214,8 @@ "renesas,rz-ssi"; reg = <0 0x1004a400 0 0x400>; interrupts = <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 335 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 336 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 337 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + interrupt-names = "int_req", "dma_rt"; clocks = <&cpg CPG_MOD R9A07G044_SSI2_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI2_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -238,9 +234,8 @@ reg = <0 0x1004a800 0 0x400>; interrupts = <GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 339 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 341 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G044_SSI3_PCLK2>, <&cpg CPG_MOD R9A07G044_SSI3_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 144/663 arm64: dts: renesas: r9a07g054: Update IRQ numbers for SSI channels
In reply to Greg Kroah-HartmanFrom: Lad Prabhakar <[email protected]>
[ Upstream commit c2b0dc0e83ef4a74cbe381fd0c84cea16cf067f0 ]
Quoted 1 line
From R01UH0936EJ0120 Rev.1.20 HW manual the interrupt numbers for SSI
channels have been updated,
SPI 329 - SSIF0 is now marked as reserved
SPI 333 - SSIF1 is now marked as reserved
SPI 335 - SSIF2 is now marked as reserved
SPI 336 - SSIF2 is now marked as reserved
SPI 341 - SSIF3 is now marked as reserved
This patch drops the above IRQs from SoC DTSI.
--- arch/arm64/boot/dts/renesas/r9a07g054.dtsi | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g054.dtsi +7 -12
@@ -175,9 +175,8 @@ reg = <0 0x10049c00 0 0x400>; interrupts = <GIC_SPI 326 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 327 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 329 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 328 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G054_SSI0_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI0_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -196,9 +195,8 @@ reg = <0 0x1004a000 0 0x400>; interrupts = <GIC_SPI 330 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 331 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 333 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 332 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G054_SSI1_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI1_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -216,10 +214,8 @@ "renesas,rz-ssi"; reg = <0 0x1004a400 0 0x400>; interrupts = <GIC_SPI 334 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 335 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 336 IRQ_TYPE_EDGE_RISING>, <GIC_SPI 337 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + interrupt-names = "int_req", "dma_rt"; clocks = <&cpg CPG_MOD R9A07G054_SSI2_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI2_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -238,9 +234,8 @@ reg = <0 0x1004a800 0 0x400>; interrupts = <GIC_SPI 338 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 339 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>, - <GIC_SPI 341 IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <GIC_SPI 340 IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G054_SSI3_PCLK2>, <&cpg CPG_MOD R9A07G054_SSI3_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 145/663 arm64: dts: renesas: r9a07g043: Update IRQ numbers for SSI channels
In reply to Greg Kroah-HartmanFrom: Lad Prabhakar <[email protected]>
[ Upstream commit 2a5c9891392dca47f6865a2add1986876e40849c ]
Quoted 1 line
From R01UH0968EJ0100 Rev.1.00 HW manual the interrupt numbers for SSI
channels have been updated,
SPI 329 - SSIF0 is now marked as reserved
SPI 333 - SSIF1 is now marked as reserved
SPI 335 - SSIF2 is now marked as reserved
SPI 336 - SSIF2 is now marked as reserved
SPI 341 - SSIF3 is now marked as reserved
This patch drops the above IRQs from SoC DTSI.
--- arch/arm64/boot/dts/renesas/r9a07g043.dtsi | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/renesas/r9a07g043.dtsi +7 -12
@@ -80,9 +80,8 @@ reg = <0 0x10049c00 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(326) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(327) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(328) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(329) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <SOC_PERIPHERAL_IRQ(328) IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G043_SSI0_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI0_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -101,9 +100,8 @@ reg = <0 0x1004a000 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(330) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(331) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(332) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(333) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <SOC_PERIPHERAL_IRQ(332) IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G043_SSI1_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI1_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -121,10 +119,8 @@ "renesas,rz-ssi"; reg = <0 0x1004a400 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(334) IRQ_TYPE_LEVEL_HIGH>, - <SOC_PERIPHERAL_IRQ(335) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(336) IRQ_TYPE_EDGE_RISING>, <SOC_PERIPHERAL_IRQ(337) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + interrupt-names = "int_req", "dma_rt"; clocks = <&cpg CPG_MOD R9A07G043_SSI2_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI2_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
@@ -143,9 +139,8 @@ reg = <0 0x1004a800 0 0x400>; interrupts = <SOC_PERIPHERAL_IRQ(338) IRQ_TYPE_LEVEL_HIGH>, <SOC_PERIPHERAL_IRQ(339) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(340) IRQ_TYPE_EDGE_RISING>, - <SOC_PERIPHERAL_IRQ(341) IRQ_TYPE_EDGE_RISING>; - interrupt-names = "int_req", "dma_rx", "dma_tx", "dma_rt"; + <SOC_PERIPHERAL_IRQ(340) IRQ_TYPE_EDGE_RISING>; + interrupt-names = "int_req", "dma_rx", "dma_tx"; clocks = <&cpg CPG_MOD R9A07G043_SSI3_PCLK2>, <&cpg CPG_MOD R9A07G043_SSI3_PCLK_SFR>, <&audio_clk1>, <&audio_clk2>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 146/663 drm/mediatek: dp: Only trigger DRM HPD events if bridge is attached
In reply to Greg Kroah-HartmanFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 36b617f7e4ae663fcadd202ea061ca695ca75539 ]
The MediaTek DisplayPort interface bridge driver starts its interrupts as soon as its probed. However when the interrupts trigger the bridge might not have been attached to a DRM device. As drm_helper_hpd_irq_event() does not check whether the passed in drm_device is valid or not, a NULL pointer passed in results in a kernel NULL pointer dereference in it.
Check whether the bridge is attached and only trigger an HPD event if it is.
--- drivers/gpu/drm/mediatek/mtk_dp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/mediatek/mtk_dp.c +2 -1
@@ -1823,7 +1823,8 @@ static irqreturn_t mtk_dp_hpd_event_thread(int hpd, void *dev)spin_unlock_irqrestore (&mtk_dp->irq_thread_lock, flags);if (status &MTK_DP_THREAD_CABLE_STATE_CHG ) { -drm_helper_hpd_irq_event (mtk_dp->bridge.dev); +if (mtk_dp->bridge.dev) +drm_helper_hpd_irq_event (mtk_dp->bridge.dev);if (!mtk_dp->train_info.cable_plugged_in) {mtk_dp_disable_sdp_aui (mtk_dp);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 147/663 drm/msm/disp/dpu: check for crtc enable rather than crtc active to release shared resources
In reply to Greg Kroah-HartmanFrom: Vinod Polimera <[email protected]>
[ Upstream commit b6975693846b562c4d3e0e60cc884affc5bdac00 ]
According to KMS documentation, The driver must not release any shared resources if active is set to false but enable still true.
Patchwork: https://patchwork.freedesktop.org/patch/524726/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +1 -1
@@ -654,7 +654,7 @@ static int dpu_encoder_virt_atomic_check(if (drm_atomic_crtc_needs_modeset (crtc_state)) {dpu_rm_release (global_state, drm_enc); -if (!crtc_state->active_changed || crtc_state->active) +if (!crtc_state->active_changed || crtc_state->enable) ret =dpu_rm_reserve (&dpu_kms->rm, global_state, drm_enc, crtc_state, topology); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 148/663 EDAC/skx: Fix overflows on the DRAM row address mapping arrays
In reply to Greg Kroah-HartmanFrom: Qiuxu Zhuo <[email protected]>
[ Upstream commit 71b1e3ba3fed5a34c5fac6d3a15c2634b04c1eb7 ]
The current DRAM row address mapping arrays skx_{open,close}_row[] only support ranks with sizes up to 16G. Decoding a rank address to a DRAM row address for a 32G rank by using either one of the above arrays by the skx_edac driver, will result in an overflow on the array.
For a 32G rank, the most significant DRAM row address bit (the bit17) is mapped from the bit34 of the rank address. Add this new mapping item to both arrays to fix the overflow issue.
--- drivers/edac/skx_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/skx_base.c +2 -2
@@ -510,7 +510,7 @@ static bool skx_rir_decode(struct decoded_addr *res) }static u8 skx_close_row[] = { -15 ,16 ,17 ,18 ,20 ,21 ,22 ,28 ,10 ,11 ,12 ,13 ,29 ,30 ,31 ,32 ,33 +15 ,16 ,17 ,18 ,20 ,21 ,22 ,28 ,10 ,11 ,12 ,13 ,29 ,30 ,31 ,32 ,33 ,34 };static u8 skx_close_column[] = {
@@ -518,7 +518,7 @@ static u8 skx_close_column[] = { };static u8 skx_open_row[] = { -14 ,15 ,16 ,20 ,28 ,21 ,22 ,23 ,24 ,25 ,26 ,27 ,29 ,30 ,31 ,32 ,33 +14 ,15 ,16 ,20 ,28 ,21 ,22 ,23 ,24 ,25 ,26 ,27 ,29 ,30 ,31 ,32 ,33 ,34 };static u8 skx_open_column[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 149/663 ARM: dts: qcom-apq8064: Fix opp table child name
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit b9745c275246a7e43c34d1b3be5ff9a9f3cf9305 ]
The opp-320000000 name is rather misleading with the opp-hz value of 450 MHz. Fix it!
--- arch/arm/boot/dts/qcom-apq8064.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-apq8064.dtsi +1 -1
@@ -1261,7 +1261,7 @@ gpu_opp_table: opp-table { compatible = "operating-points-v2"; - opp-320000000 { + opp-450000000 { opp-hz = /bits/ 64 <450000000>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 150/663 regulator: core: Shorten off-on-delay-us for always-on/boot-on by time since booted
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 691c1fcda5351ed98a44610b7dccc0e3ee920020 ]
This is very close to a straight revert of commit 218320fec294 ("regulator: core: Fix off-on-delay-us for always-on/boot-on regulators"). We've identified that patch as causing a boot speed regression on sc7180-trogdor boards. While boot speed certainly isn't more important than making sure that power sequencing is correct, looking closely at the original change it doesn't seem to have been fully justified. It mentions "cycling issues" without describing exactly what the issues were. That means it's possible that the cycling issues were really a problem that should be fixed in a different way.
Let's take a careful look at how we should handle regulators that have an off-on-delay and that are boot-on or always-on. Linux currently doesn't have any way to identify whether a GPIO regulator was already on when the kernel booted. That means that when the kernel boots we probe a regulator, see that it wants boot-on / always-on we, and then turn the regulator on. We could be in one of two cases when we do this:
a) The regulator might have been left on by the bootloader and we're ensuring that it stays on.
b) The regulator might have been left off by the bootloader and we're just now turning it on.
For case a) we definitely don't need any sort of delay. For case b) we _might_ need some delay in case the bootloader turned the regulator off _right_ before booting the kernel. To get the proper delay for case b) then we can just assume a last_off of 0, which is what it gets initialized to by default.
As per above, we can't tell whether we're in case a) or case b) so we'll assume the longer delay (case b). This basically puts the code to how it was before commit 218320fec294 ("regulator: core: Fix off-on-delay-us for always-on/boot-on regulators"). However, we add one important change: we make sure that the delay is actually honored if last_off is 0. Though the original "cycling issues" cited were vague, I'm hopeful that this important extra change will be enough to fix the issues that the initial commit mentioned.
With this fix, I've confined that on a sc7180-trogdor board the delay at boot goes down from 500 ms to ~250 ms. That's not as good as the 0 ms that we had prior to commit 218320fec294 ("regulator: core: Fix off-on-delay-us for always-on/boot-on regulators"), but it's probably safer because we don't know if the bootloader turned the regulator off right before booting.
One note is that it's possible that we could be in a state that's not
a) or b) if there are other issues in the kernel. The only one I can think of is related to pinctrl. If the pinctrl driver being used on a board isn't careful about avoiding glitches when setting up a pin then it's possible that setting up a pin could cause the regulator to "turn off" briefly immediately before the regulator probes. If this is indeed causing problems then the pinctrl driver should be fixed, perhaps in a similar way to what was done in commit d21f4b7ffc22 ("pinctrl: qcom: Avoid glitching lines when we first mux to output")
--- drivers/regulator/core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/regulator/core.c +3 -4
@@ -1583,9 +1583,6 @@ static int set_machine_constraints(struct regulator_dev *rdev) rdev->constraints->always_on = true; } -if (rdev->desc->off_on_delay) - rdev->last_off =ktime_get_boottime (); -/* If the constraints say the regulator should be on at this point * and we have control then make sure it is enabled. */
@@ -1619,6 +1616,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)if (rdev->constraints->always_on) rdev->use_count++; + }else if (rdev->desc->off_on_delay) { + rdev->last_off =ktime_get (); }print_constraints (rdev);
@@ -2668,7 +2667,7 @@ static int _regulator_do_enable(struct regulator_dev *rdev)trace_regulator_enable (rdev_get_name (rdev)); -if (rdev->desc->off_on_delay && rdev->last_off) { +if (rdev->desc->off_on_delay) {/* if needed, keep a distance of off_on_delay from last time * this regulator was disabled. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 151/663 arm64: dts: ti: k3-am62-main: Fix GPIO numbers in DT
In reply to Greg Kroah-HartmanFrom: Nitin Yadav <[email protected]>
[ Upstream commit 28c8f2189d80c8b37068c367e9864b5aa530f208 ]
Fix number of gpio pins in main_gpio0 & main_gpio1 DT nodes according to AM62x SK datasheet. The Link of datasheet is in the following line:
https://www.ti.com/lit/ds/symlink/am625.pdf?ts=1673852494660
Section: 6.3.10 GPIO (Page No. 63-67)
--- arch/arm64/boot/dts/ti/k3-am62-main.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62-main.dtsi +2 -2
@@ -461,7 +461,7 @@ <193>, <194>, <195>; interrupt-controller; #interrupt-cells = <2>; - ti,ngpio = <87>; + ti,ngpio = <92>; ti,davinci-gpio-unbanked = <0>; power-domains = <&k3_pds 77 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 77 0>;
@@ -478,7 +478,7 @@ <183>, <184>, <185>; interrupt-controller; #interrupt-cells = <2>; - ti,ngpio = <88>; + ti,ngpio = <52>; ti,davinci-gpio-unbanked = <0>; power-domains = <&k3_pds 78 TI_SCI_PD_EXCLUSIVE>; clocks = <&k3_clks 78 0>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 152/663 arm64: dts: ti: k3-am62a7-sk: Fix DDR size to full 4GB
In reply to Greg Kroah-HartmanFrom: Devarsh Thakkar <[email protected]>
[ Upstream commit a1bc0d6084dba8a31831c65318a8a8e46f00906f ]
All revisions of AM62A7-SK board have 4GB LPDDR4 Micron MT53E2G32D4DE-046 AUT:B memory. Commit 38c4a08c820c ("arm64: dts: ti:
Add support for AM62A7-SK") enabled just 2GB due to a schematics error in early revision of the board. Fix it by enabling full 4GB available on the platform.
Design docs: https://www.ti.com/lit/zip/sprr459
--- arch/arm64/boot/dts/ti/k3-am62a7-sk.dts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/ti/k3-am62a7-sk.dts +3 -2
@@ -26,8 +26,9 @@ memory@80000000 { device_type = "memory"; - /* 2G RAM */ - reg = <0x00000000 0x80000000 0x00000000 0x80000000>; + /* 4G RAM */ + reg = <0x00000000 0x80000000 0x00000000 0x80000000>, + <0x00000008 0x80000000 0x00000000 0x80000000>; }; reserved-memory {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 153/663 arm64: dts: ti: k3-j721e-main: Remove ti,strobe-sel property
In reply to Greg Kroah-HartmanFrom: Bhavya Kapoor <[email protected]>
[ Upstream commit 4f4b30a777d3e61603119297965343a37be36435 ]
According to latest errata of J721e [1], (i2024) 'MMCSD: Peripherals Do Not Support HS400' which applies to MMCSD0 subsystem. Speed modes supported has been already updated but missed dropping 'ti,strobe-sel' property which is only required by HS400 speed mode.
Thus, drop 'ti,strobe-sel' property from kernel dtsi for J721e SoC.
[1] https://www.ti.com/lit/er/sprz455/sprz455.pdf
--- arch/arm64/boot/dts/ti/k3-j721e-main.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/ti/k3-j721e-main.dtsi +0 -1
@@ -1180,7 +1180,6 @@ ti,itap-del-sel-mmc-hs = <0xa>; ti,itap-del-sel-ddr52 = <0x3>; ti,trm-icp = <0x8>; - ti,strobe-sel = <0x77>; dma-coherent; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 154/663 arm64: dts: broadcom: bcmbca: bcm4908: fix NAND interrupt name
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 5cca02449490e767289bda38db1577e2c375c084 ]
This fixes:arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: interrupt-names:0: 'nand_ctlrdy' was expected
From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yamlarch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: nand-controller@1800: Unevaluated properties are not allowed ('interrupt-names' was unexpected)
From schema: Documentation/devicetree/bindings/mtd/brcm,brcmnand.yaml
--- arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +1 -1
@@ -538,7 +538,7 @@ reg = <0x1800 0x600>, <0x2000 0x10>; reg-names = "nand", "nand-int-base"; interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "nand"; + interrupt-names = "nand_ctlrdy"; status = "okay"; nandcs: nand@0 {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 155/663 arm64: dts: broadcom: bcmbca: bcm4908: fix LED nodenames
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
[ Upstream commit 23be9f68f933adee8163b8efc9c6bff71410cc7c ]
This fixes:arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dtb: leds@800: 'led-lan@19', 'led-power@11', 'led-wan-red@12', 'led-wan-white@15', 'led-wps@14' do not match any of the regexes: '^led@[a-f0-9]+$', 'pinctrl-[0-9]+'
From schema: Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
--- .../dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908-asus-gt-ac5300.dts +5 -5
@@ -120,7 +120,7 @@ }; &leds { - led-power@11 { + led@11 { reg = <0x11>; function = LED_FUNCTION_POWER; color = <LED_COLOR_ID_WHITE>;
@@ -130,7 +130,7 @@ pinctrl-0 = <&pins_led_17_a>; }; - led-wan-red@12 { + led@12 { reg = <0x12>; function = LED_FUNCTION_WAN; color = <LED_COLOR_ID_RED>;
@@ -139,7 +139,7 @@ pinctrl-0 = <&pins_led_18_a>; }; - led-wps@14 { + led@14 { reg = <0x14>; function = LED_FUNCTION_WPS; color = <LED_COLOR_ID_WHITE>;
@@ -148,7 +148,7 @@ pinctrl-0 = <&pins_led_20_a>; }; - led-wan-white@15 { + led@15 { reg = <0x15>; function = LED_FUNCTION_WAN; color = <LED_COLOR_ID_WHITE>;
@@ -157,7 +157,7 @@ pinctrl-0 = <&pins_led_21_a>; }; - led-lan@19 { + led@19 { reg = <0x19>; function = LED_FUNCTION_LAN; color = <LED_COLOR_ID_WHITE>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 156/663 arm64: dts: broadcom: bcmbca: bcm4908: fix procmon nodename
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
[ Upstream commit f16a8294dd7a02c7ad042cd2e3acc5ea06698dc1 ]
This fixes:arch/arm64/boot/dts/broadcom/bcmbca/bcm94908.dtb: syscon@280000: $nodename:0: 'syscon@280000' does not match '^([a-z][a-z0-9\\-]+-bus|bus|localbus|soc|axi|ahb|apb)(@.+)?$'
From schema: schemas/simple-bus.yaml
--- arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/broadcom/bcmbca/bcm4908.dtsi +1 -1
@@ -254,7 +254,7 @@ }; }; - procmon: syscon@280000 { + procmon: bus@280000 { compatible = "simple-bus"; reg = <0x280000 0x1000>; ranges;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 157/663 arm64: dts: qcom: msm8998: Fix stm-stimulus-base reg name
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit b5d08f08377218b1d2ab4026e427a7788b271c8e ]
The name stm-data-base comes from ancient (msm-3.10 or older) downstream kernels. Upstream uses stm-stimulus-base instead. Fix it.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +1 -1
@@ -1514,7 +1514,7 @@ compatible = "arm,coresight-stm", "arm,primecell"; reg = <0x06002000 0x1000>, <0x16280000 0x180000>; - reg-names = "stm-base", "stm-data-base"; + reg-names = "stm-base", "stm-stimulus-base"; status = "disabled"; clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 158/663 arm64: dts: qcom: sc7280: fix EUD port properties
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit a369c74243ca4ad60b9de0ac5c2207fb4c4117b8 ]
Nodes with unit addresses must have also 'reg' property:
sc7280-herobrine-crd.dtb: eud@88e0000: ports:port@0: 'reg' is a required property
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm64/boot/dts/qcom/sc7280.dtsi +9 -0
@@ -3592,12 +3592,17 @@ <0 0x88e2000 0 0x1000>; interrupts-extended = <&pdc 11 IRQ_TYPE_LEVEL_HIGH>; ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; eud_ep: endpoint { remote-endpoint = <&usb2_role_switch>; }; }; port@1 { + reg = <1>; eud_con: endpoint { remote-endpoint = <&con_eud>; };
@@ -3608,7 +3613,11 @@ eud_typec: connector { compatible = "usb-c-connector"; ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; con_eud: endpoint { remote-endpoint = <&eud_con>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 159/663 arm64: dts: qcom: sdm845: correct dynamic power coefficients
In reply to Greg Kroah-HartmanFrom: Vincent Guittot <[email protected]>
[ Upstream commit 44750f153699b6e4f851a399287e5c8df208d696 ]
While stressing EAS on my dragonboard RB3, I have noticed that LITTLE cores where never selected as the most energy efficient CPU whatever the utilization level of waking task.
energy model framework uses its cost field to estimate the energy with the formula:
nrg = cost of the selected OPP * utilization / CPU's max capacity
which ends up selecting the CPU with lowest cost / max capacity ration as long as the utilization fits in the OPP's capacity.
If we compare the cost of a little OPP with similar capacity of a big OPP like :
OPP(kHz) OPP capacity cost max capacity cost/max capacity LITTLE 1766400 407 351114 407 863 big 1056000 408 520267 1024 508
This can be interpreted as the LITTLE core consumes 70% more than big core for the same compute capacity.
According to [1], LITTLE consumes 10% less than big core for Coremark benchmark at those OPPs. If we consider that everything else stays unchanged, the dynamic-power-coefficient of LITTLE core should be only 53% of the current value: 290 * 53% = 154
Set the dynamic-power-coefficient of CPU0-3 to 154 to fix the energy model.
[1] https://github.com/kdrag0n/freqbench/tree/master/results/sdm845/main
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +4 -4
@@ -198,7 +198,7 @@ reg = <0x0 0x0>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -222,7 +222,7 @@ reg = <0x0 0x100>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -243,7 +243,7 @@ reg = <0x0 0x200>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
@@ -264,7 +264,7 @@ reg = <0x0 0x300>; enable-method = "psci"; capacity-dmips-mhz = <611>; - dynamic-power-coefficient = <290>; + dynamic-power-coefficient = <154>; qcom,freq-domain = <&cpufreq_hw 0>; operating-points-v2 = <&cpu0_opp_table>; interconnects = <&gladiator_noc MASTER_APPSS_PROC 3 &mem_noc SLAVE_EBI1 3>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 160/663 arm64: dts: qcom: sdm845: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 67aa109eee654c76dcc100554e637fa64d5aa099 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +3 -3
@@ -2226,8 +2226,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0xd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0xd00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -2331,7 +2331,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 161/663 arm64: dts: qcom: msm8998: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit c30a27dcfe4545edbda1578b3a63ed6147519cdd ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI address (0x1b200000) specified in the ranges property for I/O region.
--- arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998.dtsi +1 -1
@@ -916,7 +916,7 @@ phy-names = "pciephy"; status = "disabled"; - ranges = <0x01000000 0x0 0x1b200000 0x1b200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x1b200000 0x0 0x100000>, <0x02000000 0x0 0x1b300000 0x1b300000 0x0 0xd00000>; #interrupt-cells = <1>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 162/663 arm64: dts: qcom: sc7280: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 1d4743d6312582978966d38908b69085621b7693 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI address (0x40200000) specified in the ranges property for I/O region.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +1 -1
@@ -2068,7 +2068,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 163/663 arm64: dts: qcom: ipq8074: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit e49eafefe5ab325e38dd074f2005076ffc271e54 ]
For 64KiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x10000. Hence, fix the bogus PCI addresses (0x10200000, 0x20200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses and align them in a single line.
--- arch/arm64/boot/dts/qcom/ipq8074.dtsi | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
arch/arm64/boot/dts/qcom/ipq8074.dtsi +4 -8
@@ -772,10 +772,8 @@ phys = <&pcie_phy1>; phy-names = "pciephy"; - ranges = <0x81000000 0 0x10200000 0x10200000 - 0 0x10000>, /* downstream I/O */ - <0x82000000 0 0x10220000 0x10220000 - 0 0xfde0000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x10200000 0x0 0x10000>, /* I/O */ + <0x82000000 0x0 0x10220000 0x10220000 0x0 0xfde0000>; /* MEM */ interrupts = <GIC_SPI 85 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -836,10 +834,8 @@ phys = <&pcie_phy0>; phy-names = "pciephy"; - ranges = <0x81000000 0 0x20200000 0x20200000 - 0 0x10000>, /* downstream I/O */ - <0x82000000 0 0x20220000 0x20220000 - 0 0xfde0000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x20200000 0x0 0x10000>, /* I/O */ + <0x82000000 0x0 0x20220000 0x20220000 0x0 0xfde0000>; /* MEM */ interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 164/663 arm64: dts: qcom: ipq6018: Add/remove some newlines
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 6db9ed9a128cbae1423d043f3debd8bfa77783fd ]
Some lines were broken very aggresively, presumably to fit under 80 chars and some places could have used a newline, particularly between subsequent nodes. Address all that and remove redundant comments near PCIe ranges while at it so as not to exceed 100 chars needlessly.
Stable-dep-of: 75a6e1fdb351 ("arm64: dts: qcom: ipq6018: Fix the PCI I/O port range")
--- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +12 -14
@@ -96,26 +96,31 @@ opp-microvolt = <725000>; clock-latency-ns = <200000>; }; + opp-1056000000 { opp-hz = /bits/ 64 <1056000000>; opp-microvolt = <787500>; clock-latency-ns = <200000>; }; + opp-1320000000 { opp-hz = /bits/ 64 <1320000000>; opp-microvolt = <862500>; clock-latency-ns = <200000>; }; + opp-1440000000 { opp-hz = /bits/ 64 <1440000000>; opp-microvolt = <925000>; clock-latency-ns = <200000>; }; + opp-1608000000 { opp-hz = /bits/ 64 <1608000000>; opp-microvolt = <987500>; clock-latency-ns = <200000>; }; + opp-1800000000 { opp-hz = /bits/ 64 <1800000000>; opp-microvolt = <1062500>;
@@ -131,8 +136,7 @@ pmuv8: pmu { compatible = "arm,cortex-a53-pmu"; - interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) | - IRQ_TYPE_LEVEL_HIGH)>; + interrupts = <GIC_PPI 7 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_HIGH)>; }; psci: psci {
@@ -437,24 +441,18 @@ phys = <&pcie_phy0>; phy-names = "pciephy"; - ranges = <0x81000000 0 0x20200000 0 0x20200000 - 0 0x10000>, /* downstream I/O */ - <0x82000000 0 0x20220000 0 0x20220000 - 0 0xfde0000>; /* non-prefetchable memory */ + ranges = <0x81000000 0 0x20200000 0 0x20200000 0 0x10000>, + <0x82000000 0 0x20220000 0 0x20220000 0 0xfde0000>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi"; #interrupt-cells = <1>; interrupt-map-mask = <0 0 0 0x7>; - interrupt-map = <0 0 0 1 &intc 0 75 - IRQ_TYPE_LEVEL_HIGH>, /* int_a */ - <0 0 0 2 &intc 0 78 - IRQ_TYPE_LEVEL_HIGH>, /* int_b */ - <0 0 0 3 &intc 0 79 - IRQ_TYPE_LEVEL_HIGH>, /* int_c */ - <0 0 0 4 &intc 0 83 - IRQ_TYPE_LEVEL_HIGH>; /* int_d */ + interrupt-map = <0 0 0 1 &intc 0 75 IRQ_TYPE_LEVEL_HIGH>, /* int_a */ + <0 0 0 2 &intc 0 78 IRQ_TYPE_LEVEL_HIGH>, /* int_b */ + <0 0 0 3 &intc 0 79 IRQ_TYPE_LEVEL_HIGH>, /* int_c */ + <0 0 0 4 &intc 0 83 IRQ_TYPE_LEVEL_HIGH>; /* int_d */ clocks = <&gcc GCC_SYS_NOC_PCIE0_AXI_CLK>, <&gcc GCC_PCIE0_AXI_M_CLK>,
Greg Kroah-Hartman
maintainerPATCH 165/663 arm64: dts: qcom: ipq6018: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 75a6e1fdb351189f55097741e8460ca3f9b2883f ]
For 64KiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x10000. Hence, fix the bogus PCI address (0x20200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/ipq6018.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/ipq6018.dtsi +2 -2
@@ -441,8 +441,8 @@ phys = <&pcie_phy0>; phy-names = "pciephy"; - ranges = <0x81000000 0 0x20200000 0 0x20200000 0 0x10000>, - <0x82000000 0 0x20220000 0 0x20220000 0 0xfde0000>; + ranges = <0x81000000 0x0 0x00000000 0x0 0x20200000 0x0 0x10000>, + <0x82000000 0x0 0x20220000 0x0 0x20220000 0x0 0xfde0000>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Greg Kroah-Hartman
maintainerPATCH 166/663 arm64: dts: qcom: msm8996: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit cf0ac10feb17661987d0018eb9475dc03e2a2253 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x0c200000, 0x0d200000, 0x0e200000) specified in the ranges property for I/O region.
While at it, let's also align the entries.
--- arch/arm64/boot/dts/qcom/msm8996.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/qcom/msm8996.dtsi +6 -6
@@ -1841,8 +1841,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x0c200000 0x0c200000 0x0 0x100000>, - <0x02000000 0x0 0x0c300000 0x0c300000 0x0 0xd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0c200000 0x0 0x100000>, + <0x02000000 0x0 0x0c300000 0x0c300000 0x0 0xd00000>; device_type = "pci";
@@ -1895,8 +1895,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x0d200000 0x0d200000 0x0 0x100000>, - <0x02000000 0x0 0x0d300000 0x0d300000 0x0 0xd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0d200000 0x0 0x100000>, + <0x02000000 0x0 0x0d300000 0x0d300000 0x0 0xd00000>; device_type = "pci";
@@ -1946,8 +1946,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x0e200000 0x0e200000 0x0 0x100000>, - <0x02000000 0x0 0x0e300000 0x0e300000 0x0 0x1d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0e200000 0x0 0x100000>, + <0x02000000 0x0 0x0e300000 0x0e300000 0x0 0x1d00000>; device_type = "pci";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 167/663 arm64: dts: qcom: sm8250: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit e115a4495db687898b8d91d4f16c2cf55bbf167c ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000, 0x64200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8250.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8250.dtsi +4 -4
@@ -1807,8 +1807,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 142 IRQ_TYPE_LEVEL_HIGH>,
@@ -1916,7 +1916,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>;
@@ -2024,7 +2024,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x64200000 0x0 0x64200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x64200000 0x0 0x100000>, <0x02000000 0x0 0x64300000 0x0 0x64300000 0x0 0x3d00000>; interrupts = <GIC_SPI 243 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 168/663 arm64: dts: qcom: sc8280xp: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 89fe81c01715f81c3a7d371e9e5f7d7ae5bc557c ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x30200000, 0x32200000, 0x34200000, 0x38200000, 0x3c200000) specified in the ranges property for I/O region.
--- arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/boot/dts/qcom/sc8280xp.dtsi +5 -5
@@ -902,7 +902,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x30200000 0x0 0x30200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x30200000 0x0 0x100000>, <0x02000000 0x0 0x30300000 0x0 0x30300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -1001,7 +1001,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x32200000 0x0 0x32200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x32200000 0x0 0x100000>, <0x02000000 0x0 0x32300000 0x0 0x32300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -1098,7 +1098,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x34200000 0x0 0x34200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x34200000 0x0 0x100000>, <0x02000000 0x0 0x34300000 0x0 0x34300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -1198,7 +1198,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x38200000 0x0 0x38200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x38200000 0x0 0x100000>, <0x02000000 0x0 0x38300000 0x0 0x38300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
@@ -1295,7 +1295,7 @@ reg-names = "parf", "dbi", "elbi", "atu", "config"; #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x3c200000 0x0 0x3c200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x3c200000 0x0 0x100000>, <0x02000000 0x0 0x3c300000 0x0 0x3c300000 0x0 0x1d00000>; bus-range = <0x00 0xff>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 169/663 arm64: dts: qcom: sm8150: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 422b110b9b0af0afd4a4b19e8fc3ceab9e71d842 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8150.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8150.dtsi +3 -3
@@ -1783,8 +1783,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1879,7 +1879,7 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0x0 0x40200000 0x0 0x100000>, + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_EDGE_RISING>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 170/663 arm64: dts: qcom: sm8450: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit f57903c8f4c77938eb71fc67e4652264a9fa14f9 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI addresses (0x60200000, 0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +4 -4
@@ -1726,8 +1726,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x60200000 0 0x60200000 0x0 0x100000>, - <0x02000000 0x0 0x60300000 0 0x60300000 0x0 0x3d00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x60200000 0x0 0x100000>, + <0x02000000 0x0 0x60300000 0x0 0x60300000 0x0 0x3d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1835,8 +1835,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x01000000 0x0 0x40200000 0 0x40200000 0x0 0x100000>, - <0x02000000 0x0 0x40300000 0 0x40300000 0x0 0x1fd00000>; + ranges = <0x01000000 0x0 0x00000000 0x0 0x40200000 0x0 0x100000>, + <0x02000000 0x0 0x40300000 0x0 0x40300000 0x0 0x1fd00000>; interrupts = <GIC_SPI 307 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 171/663 ARM: dts: qcom: ipq4019: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 2540279e9a9e74fc880d1e4c83754ecfcbe290a0 ]
For 1MiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x100000. Hence, fix the bogus PCI address (0x40200000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm/boot/dts/qcom-ipq4019.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/qcom-ipq4019.dtsi +2 -2
@@ -426,8 +426,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x40200000 0x40200000 0 0x00100000>, - <0x82000000 0 0x40300000 0x40300000 0 0x00d00000>; + ranges = <0x81000000 0x0 0x00000000 0x40200000 0x0 0x00100000>, + <0x82000000 0x0 0x40300000 0x40300000 0x0 0x00d00000>; interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 172/663 ARM: dts: qcom: ipq8064: Fix the PCI I/O port range
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 0b16b34e491629016109e56747ad64588074194b ]
For 64KiB of the I/O region, the I/O ports of the legacy PCI devices are located in the range of 0x0 to 0x10000. Hence, fix the bogus PCI addresses (0x0fe00000, 0x31e00000, 0x35e00000) specified in the ranges property for I/O region.
While at it, let's use the missing 0x prefix for the addresses.
--- arch/arm/boot/dts/qcom-ipq8064.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/qcom-ipq8064.dtsi +6 -6
@@ -1082,8 +1082,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x0fe00000 0x0fe00000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0x08000000 0x08000000 0 0x07e00000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x0fe00000 0x0 0x00010000 /* I/O */ + 0x82000000 0x0 0x08000000 0x08000000 0x0 0x07e00000>; /* MEM */ interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1133,8 +1133,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x31e00000 0x31e00000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0x2e000000 0x2e000000 0 0x03e00000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x31e00000 0x0 0x00010000 /* I/O */ + 0x82000000 0x0 0x2e000000 0x2e000000 0x0 0x03e00000>; /* MEM */ interrupts = <GIC_SPI 57 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
@@ -1184,8 +1184,8 @@ #address-cells = <3>; #size-cells = <2>; - ranges = <0x81000000 0 0x35e00000 0x35e00000 0 0x00010000 /* downstream I/O */ - 0x82000000 0 0x32000000 0x32000000 0 0x03e00000>; /* non-prefetchable memory */ + ranges = <0x81000000 0x0 0x00000000 0x35e00000 0x0 0x00010000 /* I/O */ + 0x82000000 0x0 0x32000000 0x32000000 0x0 0x03e00000>; /* MEM */ interrupts = <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; interrupt-names = "msi";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 173/663 arm64: dts: qcom: msm8976: Add and provide xo clk to rpmcc
In reply to Greg Kroah-HartmanFrom: Adam Skladowski <[email protected]>
[ Upstream commit 4a2c9b9e1215c557c17a48e3fabe9b1674c1d608 ]
In order for consumers of RPMCC XO clock to probe successfully their parent needs to be feed with reference clock to obtain proper rate, add fixed xo-board clock and supply it to rpmcc to make consumers happy. Frequency setting is left per board basis just like on other recent trees.
--- arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi | 4 ++++ arch/arm64/boot/dts/qcom/msm8976.dtsi | 9 +++++++++ 2 files changed, 13 insertions(+)
arch/arm64/boot/dts/qcom/msm8956-sony-xperia-loire.dtsi +4 -0
@@ -280,3 +280,7 @@ vdda3p3-supply = <&pm8950_l13>; status = "okay"; }; + +&xo_board { + clock-frequency = <19200000>; +};
arch/arm64/boot/dts/qcom/msm8976.dtsi +9 -0
@@ -20,6 +20,13 @@ chosen { }; + clocks { + xo_board: xo-board { + compatible = "fixed-clock"; + #clock-cells = <0>; + }; + }; + cpus { #address-cells = <1>; #size-cells = <0>;
@@ -351,6 +358,8 @@ rpmcc: clock-controller { compatible = "qcom,rpmcc-msm8976", "qcom,rpmcc"; + clocks = <&xo_board>; + clock-names = "xo"; #clock-cells = <1>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 174/663 ARM: dts: qcom: sdx55: Fix the unit address of PCIe EP node
In reply to Greg Kroah-HartmanFrom: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 3b76b736cd9933ff88764ffec01cbd859c1475e7 ]
Unit address of PCIe EP node should be 0x1c00000 as it has to match the first address specified in the reg property.
This also requires sorting the node in the ascending order.
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 78 +++++++++++++++---------------- 1 file changed, 39 insertions(+), 39 deletions(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +39 -39
@@ -303,6 +303,45 @@ status = "disabled"; }; + pcie_ep: pcie-ep@1c00000 { + compatible = "qcom,sdx55-pcie-ep"; + reg = <0x01c00000 0x3000>, + <0x40000000 0xf1d>, + <0x40000f20 0xc8>, + <0x40001000 0x1000>, + <0x40200000 0x100000>, + <0x01c03000 0x3000>; + reg-names = "parf", "dbi", "elbi", "atu", "addr_space", + "mmio"; + + qcom,perst-regs = <&tcsr 0xb258 0xb270>; + + clocks = <&gcc GCC_PCIE_AUX_CLK>, + <&gcc GCC_PCIE_CFG_AHB_CLK>, + <&gcc GCC_PCIE_MSTR_AXI_CLK>, + <&gcc GCC_PCIE_SLV_AXI_CLK>, + <&gcc GCC_PCIE_SLV_Q2A_AXI_CLK>, + <&gcc GCC_PCIE_SLEEP_CLK>, + <&gcc GCC_PCIE_0_CLKREF_CLK>; + clock-names = "aux", "cfg", "bus_master", "bus_slave", + "slave_q2a", "sleep", "ref"; + + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, + <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; + interrupt-names = "global", "doorbell"; + reset-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>; + resets = <&gcc GCC_PCIE_BCR>; + reset-names = "core"; + power-domains = <&gcc PCIE_GDSC>; + phys = <&pcie0_lane>; + phy-names = "pciephy"; + max-link-speed = <3>; + num-lanes = <2>; + + status = "disabled"; + }; + pcie0_phy: phy@1c07000 { compatible = "qcom,sdx55-qmp-pcie-phy"; reg = <0x01c07000 0x1c4>;
@@ -400,45 +439,6 @@ status = "disabled"; }; - pcie_ep: pcie-ep@40000000 { - compatible = "qcom,sdx55-pcie-ep"; - reg = <0x01c00000 0x3000>, - <0x40000000 0xf1d>, - <0x40000f20 0xc8>, - <0x40001000 0x1000>, - <0x40200000 0x100000>, - <0x01c03000 0x3000>; - reg-names = "parf", "dbi", "elbi", "atu", "addr_space", - "mmio"; - - qcom,perst-regs = <&tcsr 0xb258 0xb270>; - - clocks = <&gcc GCC_PCIE_AUX_CLK>, - <&gcc GCC_PCIE_CFG_AHB_CLK>, - <&gcc GCC_PCIE_MSTR_AXI_CLK>, - <&gcc GCC_PCIE_SLV_AXI_CLK>, - <&gcc GCC_PCIE_SLV_Q2A_AXI_CLK>, - <&gcc GCC_PCIE_SLEEP_CLK>, - <&gcc GCC_PCIE_0_CLKREF_CLK>; - clock-names = "aux", "cfg", "bus_master", "bus_slave", - "slave_q2a", "sleep", "ref"; - - interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 145 IRQ_TYPE_LEVEL_HIGH>; - interrupt-names = "global", "doorbell"; - reset-gpios = <&tlmm 57 GPIO_ACTIVE_LOW>; - wake-gpios = <&tlmm 53 GPIO_ACTIVE_LOW>; - resets = <&gcc GCC_PCIE_BCR>; - reset-names = "core"; - power-domains = <&gcc PCIE_GDSC>; - phys = <&pcie0_lane>; - phy-names = "pciephy"; - max-link-speed = <3>; - num-lanes = <2>; - - status = "disabled"; - }; - remoteproc_mpss: remoteproc@4080000 { compatible = "qcom,sdx55-mpss-pas"; reg = <0x04080000 0x4040>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 175/663 x86/MCE/AMD: Use an u64 for bank_map
In reply to Greg Kroah-HartmanFrom: Muralidhara M K <[email protected]>
[ Upstream commit 4c1cdec319b9aadb65737c3eb1f5cb74bd6aa156 ]
Thee maximum number of MCA banks is 64 (MAX_NR_BANKS), see
a0bc32b3cacf ("x86/mce: Increase maximum number of banks to 64").
However, the bank_map which contains a bitfield of which banks to initialize is of type unsigned int and that overflows when those bit numbers are >= 32, leading to UBSAN complaining correctly:
UBSAN: shift-out-of-bounds in arch/x86/kernel/cpu/mce/amd.c:1365:38 shift exponent 32 is too large for 32-bit type 'int'
Change the bank_map to a u64 and use the proper BIT_ULL() macro when modifying bits in there.
[ bp: Rewrite commit message. ]
--- arch/x86/kernel/cpu/mce/amd.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
arch/x86/kernel/cpu/mce/amd.c +7 -7
@@ -235,10 +235,10 @@ static DEFINE_PER_CPU(struct threshold_bank **, threshold_banks);* A list of the banks enabled on each logical CPU. Controls which respective * descriptors to initialize later in mce_threshold_create_device(). */ -static DEFINE_PER_CPU(unsigned int, bank_map); +static DEFINE_PER_CPU(u64, bank_map);/* Map of banks that have more than MCA_MISC0 available. */ -static DEFINE_PER_CPU(u32, smca_misc_banks_map); +static DEFINE_PER_CPU(u64, smca_misc_banks_map);static void amd_threshold_interrupt (void );static void amd_deferred_error_interrupt (void );
@@ -267,7 +267,7 @@ static void smca_set_misc_banks_map(unsigned int bank, unsigned int cpu)return ;if (low &MASK_BLKPTR_LO ) -per_cpu (smca_misc_banks_map, cpu) |=BIT (bank); +per_cpu (smca_misc_banks_map, cpu) |=BIT_ULL (bank); }
@@ -528,7 +528,7 @@ static u32 smca_get_block_address(unsigned int bank, unsigned int block,if (!block)return MSR_AMD64_SMCA_MCx_MISC (bank); -if (!(per_cpu (smca_misc_banks_map, cpu) &BIT (bank))) +if (!(per_cpu (smca_misc_banks_map, cpu) &BIT_ULL (bank)))return 0 ;return MSR_AMD64_SMCA_MCx_MISCy (bank, block -1 );
@@ -572,7 +572,7 @@ prepare_threshold_block(unsigned int bank, unsigned int block, u32 addr,int new;if (!block) -per_cpu (bank_map, cpu) |= (1 << bank); +per_cpu (bank_map, cpu) |=BIT_ULL (bank);memset (&b,0 ,sizeof (b)); b.cpu = cpu;
@@ -884,7 +884,7 @@ static void amd_threshold_interrupt(void)return ;for (bank =0 ; bank <this_cpu_read (mce_num_banks); ++bank) { -if (!(per_cpu (bank_map, cpu) & (1 << bank))) +if (!(per_cpu (bank_map, cpu) &BIT_ULL (bank)))continue ; first_block = bp[bank]->blocks;
@@ -1362,7 +1362,7 @@ int mce_threshold_create_device(unsigned int cpu)return -ENOMEM ;for (bank =0 ; bank < numbanks; ++bank) { -if (!(this_cpu_read (bank_map) & (1 << bank))) +if (!(this_cpu_read (bank_map) &BIT_ULL (bank)))continue ; err =threshold_create_bank (bp, cpu, bank);if (err) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 176/663 media: bdisp: Add missing check for create_workqueue
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit 2371adeab717d8fe32144a84f3491a03c5838cfb ]
Add the check for the return value of the create_workqueue in order to avoid NULL pointer dereference.
--- drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/platform/st/sti/bdisp/bdisp-v4l2.c +2 -0
@@ -1309,6 +1309,8 @@ static int bdisp_probe(struct platform_device *pdev)init_waitqueue_head (&bdisp->irq_queue);INIT_DELAYED_WORK (&bdisp->timeout_work, bdisp_irq_timeout); bdisp->work_queue =create_workqueue (BDISP_NAME ); +if (!bdisp->work_queue) +return -ENOMEM ;spin_lock_init (&bdisp->slock);mutex_init (&bdisp->lock);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 177/663 media: platform: mtk-mdp3: Add missing check and free for ida_alloc
In reply to Greg Kroah-HartmanFrom: Jiasheng Jiang <[email protected]>
[ Upstream commit d00f592250782538cda87745607695b0fe27dcd4 ]
Add the check for the return value of the ida_alloc in order to avoid NULL pointer dereference.
Moreover, free allocated "ctx->id" if mdp_m2m_open fails later in order to avoid memory leak.
--- drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/mdp3/mtk-mdp3-m2m.c +7 -1
@@ -566,7 +566,11 @@ static int mdp_m2m_open(struct file *file) goto err_free_ctx; } - ctx->id =ida_alloc (&mdp->mdp_ida,GFP_KERNEL ); + ret =ida_alloc (&mdp->mdp_ida,GFP_KERNEL ); +if (ret <0 ) + goto err_unlock_mutex; + ctx->id = ret; + ctx->mdp_dev = mdp;v4l2_fh_init (&ctx->fh, vdev);
@@ -617,6 +621,8 @@ static int mdp_m2m_open(struct file *file)v4l2_fh_del (&ctx->fh); err_exit_fh:v4l2_fh_exit (&ctx->fh); +ida_free (&mdp->mdp_ida, ctx->id); +err_unlock_mutex:mutex_unlock (&mdp->m2m_lock); err_free_ctx:kfree (ctx);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 178/663 media: amphion: decoder implement display delay enable
In reply to Greg Kroah-HartmanFrom: Ming Qian <[email protected]>
[ Upstream commit ffa331d9bf9407655fc4c4d57dcc92ed2868e326 ]
amphion vpu support a low latency mode,
when V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE is enabled, decoder can display frame immediately after it's decoded. Only h264 is support yet.
--- drivers/media/platform/amphion/vdec.c | 32 +++++++++++++++++++++ drivers/media/platform/amphion/vpu_codec.h | 3 +- drivers/media/platform/amphion/vpu_malone.c | 4 ++- 3 files changed, 37 insertions(+), 2 deletions(-)
drivers/media/platform/amphion/vdec.c +32 -0
@@ -168,7 +168,31 @@ static const struct vpu_format vdec_formats[] = { {0, 0, 0, 0}, }; +static int vdec_op_s_ctrl (struct v4l2_ctrl *ctrl) +{ +struct vpu_inst *inst =ctrl_to_inst (ctrl); +struct vdec_t *vdec = inst->priv; +int ret =0 ; + +vpu_inst_lock (inst); +switch (ctrl->id) { +case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE : + vdec->params.display_delay_enable = ctrl->val; +break ; +case V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY : + vdec->params.display_delay = ctrl->val; +break ; +default : + ret = -EINVAL ; +break ; + } +vpu_inst_unlock (inst); + +return ret; +} +static const struct v4l2_ctrl_ops vdec_ctrl_ops = { + .s_ctrl = vdec_op_s_ctrl, .g_volatile_ctrl = vpu_helper_g_volatile_ctrl, };
@@ -181,6 +205,14 @@ static int vdec_ctrl_init(struct vpu_inst *inst)if (ret)return ret; +v4l2_ctrl_new_std (&inst->ctrl_handler, &vdec_ctrl_ops, +V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY , +0 ,0 ,1 ,0 ); + +v4l2_ctrl_new_std (&inst->ctrl_handler, &vdec_ctrl_ops, +V4L2_CID_MPEG_VIDEO_DEC_DISPLAY_DELAY_ENABLE , +0 ,1 ,1 ,0 ); + ctrl =v4l2_ctrl_new_std (&inst->ctrl_handler, &vdec_ctrl_ops,V4L2_CID_MIN_BUFFERS_FOR_CAPTURE ,1 ,32 ,1 ,2 );if (ctrl)
drivers/media/platform/amphion/vpu_codec.h +2 -1
@@ -55,7 +55,8 @@ struct vpu_encode_params {struct vpu_decode_params {u32 codec_format;u32 output_format; -u32 b_dis_reorder; +u32 display_delay_enable; +u32 display_delay;u32 b_non_frame;u32 frame_count;u32 end_flag;
drivers/media/platform/amphion/vpu_malone.c +3 -1
@@ -641,7 +641,9 @@ static int vpu_malone_set_params(struct vpu_shared_addr *shared, hc->jpg[instance].jpg_mjpeg_interlaced =0 ; } - hc->codec_param[instance].disp_imm = params->b_dis_reorder ?1 :0 ; + hc->codec_param[instance].disp_imm = params->display_delay_enable ?1 :0 ; +if (malone_format !=MALONE_FMT_AVC ) + hc->codec_param[instance].disp_imm =0 ; hc->codec_param[instance].dbglog_enable =0 ; iface->dbglog_desc.level =0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 179/663 media: av7110: prevent underflow in write_ts_to_decoder()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit eed9496a0501357aa326ddd6b71408189ed872eb ]
The buf[4] value comes from the user via ts_play(). It is a value in the u8 range. The final length we pass to av7110_ipack_instant_repack() is "len - (buf[4] + 1) - 4" so add a check to ensure that the length is not negative. It's not clear that passing a negative len value does anything bad necessarily, but it's not best practice.
With the new bounds checking the "if (!len)" condition is no longer possible or required so remove that.
--- drivers/staging/media/deprecated/saa7146/av7110/av7110_av.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/deprecated/saa7146/av7110/av7110_av.c +2 -2
@@ -823,10 +823,10 @@ static int write_ts_to_decoder(struct av7110 *av7110, int type, const u8 *buf, sav7110_ipack_flush (ipack);if (buf[3 ] &ADAPT_FIELD ) { +if (buf[4 ] > len -1 -4 ) +return 0 ; len -= buf[4 ] +1 ; buf += buf[4 ] +1 ; -if (!len) -return 0 ; }av7110_ipack_instant_repack (buf +4 , len -4 , ipack);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 180/663 firmware: qcom_scm: Clear download bit during reboot
In reply to Greg Kroah-HartmanFrom: Mukesh Ojha <[email protected]>
[ Upstream commit 781d32d1c9709fd25655c4e3e3e15370ae4ae4db ]
During normal restart of a system download bit should be cleared irrespective of whether download mode is set or not.
--- drivers/firmware/qcom_scm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/qcom_scm.c +1 -2
@@ -1418,8 +1418,7 @@ static int qcom_scm_probe(struct platform_device *pdev)static void qcom_scm_shutdown (struct platform_device *pdev) {/* Clean shutdown, disable download mode to allow normal restart */ -if (download_mode) -qcom_scm_set_download_mode (false); +qcom_scm_set_download_mode (false); }static const struct of_device_id qcom_scm_dt_match[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 181/663 drm/bridge: adv7533: Fix adv7533_mode_valid for adv7533 and adv7535
In reply to Greg Kroah-HartmanFrom: Adam Ford <[email protected]>
[ Upstream commit ee0285e13455fdbce5de315bdbe91b5f198a2a06 ]
When dynamically switching lanes was removed, the intent of the code was to check to make sure that higher speed items used 4 lanes, but it had the unintended consequence of removing the slower speeds for 4-lane users.
This attempts to remedy this by doing a check to see that the max frequency doesn't exceed the chip limit, and a second check to make sure that the max bit-rate doesn't exceed the number of lanes * max bit rate / lane.
--- drivers/gpu/drm/bridge/adv7511/adv7533.c | 25 +++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-)
drivers/gpu/drm/bridge/adv7511/adv7533.c +11 -14
@@ -103,22 +103,19 @@ void adv7533_dsi_power_off(struct adv7511 *adv)enum drm_mode_status adv7533_mode_valid (struct adv7511 *adv,const struct drm_display_mode *mode) { -int lanes; +unsigned long max_lane_freq;struct mipi_dsi_device *dsi = adv->dsi; +u8 bpp =mipi_dsi_pixel_format_to_bpp (dsi->format); -if (mode->clock >80000 ) - lanes =4 ; -else - lanes =3 ; - -/* -* TODO: add support for dynamic switching of lanes -* by using the bridge pre_enable() op . Till then filter -* out the modes which shall need different number of lanes -* than what was configured in the device tree. -*/ -if (lanes != dsi->lanes) -return MODE_BAD ; +/* Check max clock for either 7533 or 7535 */ +if (mode->clock > (adv->type ==ADV7533 ?80000 :148500 )) +return MODE_CLOCK_HIGH ; + +/* Check max clock for each lane */ + max_lane_freq = (adv->type ==ADV7533 ?800000 :891000 ); + +if (mode->clock * bpp > max_lane_freq * adv->num_dsi_lanes) +return MODE_CLOCK_HIGH ;return MODE_OK ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 182/663 media: max9286: Free control handler
In reply to Greg Kroah-HartmanFrom: Laurent Pinchart <[email protected]>
[ Upstream commit bfce6a12e5ba1edde95126aa06778027f16115d4 ]
The control handler is leaked in some probe-time error paths, as well as in the remove path. Fix it.
--- drivers/media/i2c/max9286.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/i2c/max9286.c +1 -0
@@ -941,6 +941,7 @@ static int max9286_v4l2_register(struct max9286_priv *priv)static void max9286_v4l2_unregister (struct max9286_priv *priv) {fwnode_handle_put (priv->sd.fwnode); +v4l2_ctrl_handler_free (&priv->ctrls);v4l2_async_unregister_subdev (&priv->sd);max9286_v4l2_notifier_unregister (priv); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 183/663 accel: Link to compute accelerator subsystem intro
In reply to Greg Kroah-HartmanFrom: Bagas Sanjaya <[email protected]>
[ Upstream commit 6d179f84f274a87da51f24ac3e9427221bbaed51 ]
Commit 2c204f3d53218d ("accel: add dedicated minor for accelerator devices") adds link to accelerator nodes section of DRM internals doc (Documentation/gpu/drm-internals.rst), but the target doesn't exist. Instead, there is only an introduction doc for computer accelerator subsytem.
Link to that doc until there is documentation of accelerator internals.
--- include/drm/drm_file.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/drm/drm_file.h +2 -1
@@ -408,7 +408,8 @@ static inline bool drm_is_render_client(const struct drm_file *file_priv)* Returns true if this is an open file of the compute acceleration node, i.e. * &drm_file.minor of @file_priv is a accel minor. * -* See also the :ref:`section on accel nodes <drm_accel_node>`. +* See also :doc:`Introduction to compute accelerators subsystem +* </accel/introduction>`. */ static inline bool drm_is_accel_client (const struct drm_file *file_priv) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 184/663 arm64: dts: ti: k3-am625: Correct L2 cache size to 512KB
In reply to Greg Kroah-HartmanFrom: Vignesh Raghavendra <[email protected]>
[ Upstream commit 6974371cab1c488a53960945cb139b20ebb5f16b ]
Per AM62x SoC datasheet[0] L2 cache is 512KB.
[0] https://www.ti.com/lit/gpn/am625 Page 1.
--- arch/arm64/boot/dts/ti/k3-am625.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am625.dtsi +1 -1
@@ -147,7 +147,7 @@ L2_0: l2-cache0 { compatible = "cache"; cache-level = <2>; - cache-size = <0x40000>; + cache-size = <0x80000>; cache-line-size = <64>; cache-sets = <512>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 185/663 arm64: dts: ti: k3-am62a7: Correct L2 cache size to 512KB
In reply to Greg Kroah-HartmanFrom: Vignesh Raghavendra <[email protected]>
[ Upstream commit 438b8dc949bf45979c32553e96086ff1c6e2504e ]
Per AM62Ax SoC datasheet[0] L2 cache is 512KB.
[0] https://www.ti.com/lit/gpn/am62a7 Page 1.
--- arch/arm64/boot/dts/ti/k3-am62a7.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/ti/k3-am62a7.dtsi +1 -1
@@ -96,7 +96,7 @@ L2_0: l2-cache0 { compatible = "cache"; cache-level = <2>; - cache-size = <0x40000>; + cache-size = <0x80000>; cache-line-size = <64>; cache-sets = <512>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 186/663 drm/msm/adreno: drop bogus pm_runtime_set_active()
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
[ Upstream commit db7662d076c973072d788bd0e8130e04430307a1 ]
The runtime PM status can only be updated while runtime PM is disabled.
Drop the bogus pm_runtime_set_active() call that was made after enabling runtime PM and which (incidentally but correctly) left the runtime PM status set to 'suspended'.
Patchwork: https://patchwork.freedesktop.org/patch/524972/
--- drivers/gpu/drm/msm/adreno/adreno_device.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/msm/adreno/adreno_device.c +0 -3
@@ -438,9 +438,6 @@ struct msm_gpu *adreno_load_gpu(struct drm_device *dev)*/ pm_runtime_enable (&pdev->dev); -/* Make sure pm runtime is active and reset any previous errors */ -pm_runtime_set_active (&pdev->dev); - ret =pm_runtime_get_sync (&pdev->dev);if (ret <0 ) {pm_runtime_put_sync (&pdev->dev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 187/663 drm: msm: adreno: Disable preemption on Adreno 510
In reply to Greg Kroah-HartmanFrom: Adam Skladowski <[email protected]>
[ Upstream commit 010c8bbad2cb8c33c47963e29f051f1e917e45a5 ]
Downstream driver appears to not support preemption on A510 target, trying to use one make device slow and fill log with rings related errors. Set num_rings to 1 to disable preemption.
Patchwork: https://patchwork.freedesktop.org/patch/526898/
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +7 -1
@@ -1743,6 +1743,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)struct a5xx_gpu *a5xx_gpu =NULL ;struct adreno_gpu *adreno_gpu;struct msm_gpu *gpu; +unsigned int nr_rings;int ret;if (!pdev) {
@@ -1763,7 +1764,12 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev)check_speed_bin (&pdev->dev); - ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs,4 ); + nr_rings =4 ; + +if (adreno_is_a510 (adreno_gpu)) + nr_rings =1 ; + + ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs, nr_rings);if (ret) {a5xx_destroy (&(a5xx_gpu->base.base));return ERR_PTR (ret);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 188/663 virt/coco/sev-guest: Double-buffer messages
In reply to Greg Kroah-HartmanFrom: Dionna Glaze <[email protected]>
[ Upstream commit 965006103a14703cc42043bbf9b5e0cdf7a468ad ]
The encryption algorithms read and write directly to shared unencrypted memory, which may leak information as well as permit the host to tamper with the message integrity. Instead, copy whole messages in or out as needed before doing any computation on them.
--- drivers/virt/coco/sev-guest/sev-guest.c | 27 +++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-)
drivers/virt/coco/sev-guest/sev-guest.c +23 -4
@@ -46,7 +46,15 @@ struct snp_guest_dev {void *certs_data;struct snp_guest_crypto *crypto; +/* request and response are in unencrypted memory */ struct snp_guest_msg *request, *response; + +/* +* Avoid information leakage by double-buffering shared messages +* in fields that are in regular encrypted memory. +*/ +struct snp_guest_msg secret_request, secret_response; +struct snp_secrets_page_layout *layout;struct snp_req_data input;u32 *os_area_msg_seqno;
@@ -266,14 +274,17 @@ static int dec_payload(struct snp_guest_dev *snp_dev, struct snp_guest_msg *msg,static int verify_and_dec_payload (struct snp_guest_dev *snp_dev,void *payload,u32 sz) {struct snp_guest_crypto *crypto = snp_dev->crypto; -struct snp_guest_msg *resp = snp_dev->response; -struct snp_guest_msg *req = snp_dev->request; +struct snp_guest_msg *resp = &snp_dev->secret_response; +struct snp_guest_msg *req = &snp_dev->secret_request;struct snp_guest_msg_hdr *req_hdr = &req->hdr;struct snp_guest_msg_hdr *resp_hdr = &resp->hdr;dev_dbg (snp_dev->dev,"response [seqno %lld type %d version %d sz %d]\n" , resp_hdr->msg_seqno, resp_hdr->msg_type, resp_hdr->msg_version, resp_hdr->msg_sz); +/* Copy response from shared memory to encrypted memory. */ +memcpy (resp, snp_dev->response,sizeof (*resp)); +/* Verify that the sequence counter is incremented by 1 */ if (unlikely (resp_hdr->msg_seqno != (req_hdr->msg_seqno +1 )))return -EBADMSG ;
@@ -297,7 +308,7 @@ static int verify_and_dec_payload(struct snp_guest_dev *snp_dev, void *payload,static int enc_payload (struct snp_guest_dev *snp_dev,u64 seqno,int version,u8 type,void *payload,size_t sz) { -struct snp_guest_msg *req = snp_dev->request; +struct snp_guest_msg *req = &snp_dev->secret_request;struct snp_guest_msg_hdr *hdr = &req->hdr;memset (req,0 ,sizeof (*req));
@@ -417,13 +428,21 @@ static int handle_guest_request(struct snp_guest_dev *snp_dev, u64 exit_code, inif (!seqno)return -EIO ; +/* Clear shared memory's response for the host to populate. */ memset (snp_dev->response,0 ,sizeof (struct snp_guest_msg )); -/* Encrypt the userspace provided payload */ +/* Encrypt the userspace provided payload in snp_dev->secret_request. */ rc =enc_payload (snp_dev, seqno, msg_ver, type, req_buf, req_sz);if (rc)return rc; +/* +* Write the fully encrypted request to the shared unencrypted +* request page. +*/ +memcpy (snp_dev->request, &snp_dev->secret_request, +sizeof (snp_dev->secret_request)); + rc =__handle_guest_request (snp_dev, exit_code, fw_err);if (rc) {if (rc == -EIO && *fw_err ==SNP_GUEST_REQ_INVALID_LEN )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 189/663 arm64: dts: qcom: sm8350-microsoft-surface: fix USB dual-role mode property
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 0beda02e530f8fc571877939645cb20ade113027 ]
The "dr_mode" is a property of USB DWC3 node, not the Qualcomm wrapper
one:
sm8350-microsoft-surface-duo2.dtb: usb@a6f8800: 'dr_mode' does not match any of the regexes: '^usb@[0-9a-f]+$', 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/sm8350-microsoft-surface-duo2.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/qcom/sm8350-microsoft-surface-duo2.dts +3 -0
@@ -341,6 +341,9 @@ &usb_1 { status = "okay"; +}; + +&usb_1_dwc3 { dr_mode = "peripheral"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 190/663 drm/amd/display/dc/dce60/Makefile: Fix previous attempt to silence known override-init warnings
In reply to Greg Kroah-HartmanFrom: Lee Jones <[email protected]>
[ Upstream commit 4082b9f5ead4966797dddcfef0905d59e5a83873 ]
Fixes the following W=1 kernel build warning(s):
drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:157:21: note: in expansion of macro ‘mmCRTC1_DCFE_MEM_LIGHT_SLEEP_CNTL’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.h:170:9: note: in expansion of macro ‘SRI’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:183:17: note: in expansion of macro ‘XFM_COMMON_REG_LIST_DCE60’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:188:17: note: in expansion of macro ‘transform_regs’ drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_d.h:722:43: warning: initialized field overwritten [-Woverride-init] drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:157:21: note: in expansion of macro ‘mmCRTC2_DCFE_MEM_LIGHT_SLEEP_CNTL’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce/dce_transform.h:170:9: note: in expansion of macro ‘SRI’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:183:17: note: in expansion of macro ‘XFM_COMMON_REG_LIST_DCE60’ drivers/gpu/drm/amd/amdgpu/../display/dc/dce60/dce60_resource.c:189:17: note: in expansion of macro ‘transform_regs’ drivers/gpu/drm/amd/amdgpu/../include/asic_reg/dce/dce_6_0_d.h:722:43: note: (near initialization for ‘xfm_regs[2].DCFE_MEM_LIGHT_SLEEP_CN
[100 lines snipped for brevity]
--- drivers/gpu/drm/amd/display/dc/dce60/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dce60/Makefile +1 -1
@@ -23,7 +23,7 @@ # Makefile for the 'controller' sub-component of DAL. # It provides the control and status of HW CRTC block. -CFLAGS_AMDDALPATH)/dc/dce60/dce60_resource.o = $(call cc-disable-warning, override-init) +CFLAGS_$(AMDDALPATH)/dc/dce60/dce60_resource.o = $(call cc-disable-warning, override-init) DCE60 = dce60_timing_generator.o dce60_hw_sequencer.o \ dce60_resource.o
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 191/663 ACPI: processor: Fix evaluating _PDC method when running as Xen dom0
In reply to Greg Kroah-HartmanFrom: Roger Pau Monne <[email protected]>
[ Upstream commit 073828e954459b883f23e53999d31e4c55ab9654 ]
In ACPI systems, the OS can direct power management, as opposed to the firmware. This OS-directed Power Management is called OSPM. Part of telling the firmware that the OS going to direct power management is making ACPI "_PDC" (Processor Driver Capabilities) calls. These _PDC methods must be evaluated for every processor object. If these _PDC calls are not completed for every processor it can lead to inconsistency and later failures in things like the CPU frequency driver.
In a Xen system, the dom0 kernel is responsible for system-wide power management. The dom0 kernel is in charge of OSPM. However, the number of CPUs available to dom0 can be different than the number of CPUs physically present on the system.
This leads to a problem: the dom0 kernel needs to evaluate _PDC for all the processors, but it can't always see them.
In dom0 kernels, ignore the existing ACPI method for determining if a processor is physically present because it might not be accurate. Instead, ask the hypervisor for this information.
Fix this by introducing a custom function to use when running as Xen dom0 in order to check whether a processor object matches a CPU that's online. Such checking is done using the existing information fetched by the Xen pCPU subsystem, extending it to also store the ACPI ID.
This ensures that _PDC method gets evaluated for all physically online CPUs, regardless of the number of CPUs made available to dom0.
--- drivers/acpi/processor_pdc.c | 11 +++++++++++ drivers/xen/pcpu.c | 20 ++++++++++++++++++++ include/xen/xen.h | 11 +++++++++++ 3 files changed, 42 insertions(+)
drivers/acpi/processor_pdc.c +11 -0
@@ -14,6 +14,8 @@#include <linux/acpi.h> #include <acpi/processor.h> +#include <xen/xen.h> +#include "internal.h" static bool __init processor_physically_present (acpi_handle handle)
@@ -47,6 +49,15 @@ static bool __init processor_physically_present(acpi_handle handle)return false; } +if (xen_initial_domain ()) +/* +* When running as a Xen dom0 the number of processors Linux +* sees can be different from the real number of processors on +* the system, and we still need to execute _PDC for all of +* them. +*/ +return xen_processor_present (acpi_id); + type = (acpi_type ==ACPI_TYPE_DEVICE ) ?1 :0 ; cpuid =acpi_get_cpuid (handle, type, acpi_id);
drivers/xen/pcpu.c +20 -0
@@ -58,6 +58,7 @@ struct pcpu {struct list_head list;struct device dev;uint32_t cpu_id; +uint32_t acpi_id;uint32_t flags; };
@@ -249,6 +250,7 @@ static struct pcpu *create_and_register_pcpu(struct xenpf_pcpuinfo *info)INIT_LIST_HEAD (&pcpu->list); pcpu->cpu_id = info->xen_cpuid; + pcpu->acpi_id = info->acpi_id; pcpu->flags = info->flags;/* Need hold on xen_pcpu_lock before pcpu list manipulations */
@@ -381,3 +383,21 @@ static int __init xen_pcpu_init(void)return ret; }arch_initcall (xen_pcpu_init); + +#ifdef CONFIG_ACPI +bool __init xen_processor_present (uint32_t acpi_id) +{ +const struct pcpu *pcpu; +bool online = false; + +mutex_lock (&xen_pcpu_lock); +list_for_each_entry (pcpu, &xen_pcpus, list) +if (pcpu->acpi_id == acpi_id) { + online = pcpu->flags &XEN_PCPU_FLAGS_ONLINE ; +break ; + } +mutex_unlock (&xen_pcpu_lock); + +return online; +} +#endif
include/xen/xen.h +11 -0
@@ -71,4 +71,15 @@ static inline void xen_free_unpopulated_pages(unsigned int nr_pages, }#endif +#if defined(CONFIG_XEN_DOM0 ) && defined(CONFIG_ACPI ) && defined(CONFIG_X86 ) +bool __init xen_processor_present (uint32_t acpi_id); +#else +#include <linux/bug.h> +static inline bool xen_processor_present (uint32_t acpi_id) +{ +BUG (); +return false; +} +#endif +#endif /* _XEN_XEN_H */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 192/663 mmc: sdhci-of-esdhc: fix quirk to ignore command inhibit for data
In reply to Greg Kroah-HartmanFrom: Georgii Kruglov <[email protected]>
[ Upstream commit 0dd8316037a2a6d85b2be208bef9991de7b42170 ]
If spec_reg is equal to 'SDHCI_PRESENT_STATE', esdhc_readl_fixup() fixes up register value and returns it immediately. As a result, the further block
(spec_reg == SDHCI_PRESENT_STATE)
&&(esdhc->quirk_ignore_data_inhibit == true),
is never executed.
The patch merges the second block into the first one.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/mmc/host/sdhci-of-esdhc.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-)
drivers/mmc/host/sdhci-of-esdhc.c +11 -13
@@ -133,6 +133,7 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,return ret; } } +/* * The DAT[3:0] line signal levels and the CMD line signal level are * not compatible with standard SDHC register. The line signal levels
@@ -144,6 +145,16 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host, ret = value &0x000fffff ; ret |= (value >>4 ) &SDHCI_DATA_LVL_MASK ; ret |= (value <<1 ) &SDHCI_CMD_LVL ; + +/* +* Some controllers have unreliable Data Line Active +* bit for commands with busy signal. This affects +* Command Inhibit (data) bit. Just ignore it since +* MMC core driver has already polled card status +* with CMD13 after any command with busy siganl. +*/ +if (esdhc->quirk_ignore_data_inhibit) + ret &= ~SDHCI_DATA_INHIBIT ;return ret; }
@@ -158,19 +169,6 @@ static u32 esdhc_readl_fixup(struct sdhci_host *host,return ret; } -/* -* Some controllers have unreliable Data Line Active -* bit for commands with busy signal. This affects -* Command Inhibit (data) bit. Just ignore it since -* MMC core driver has already polled card status -* with CMD13 after any command with busy siganl. -*/ -if ((spec_reg ==SDHCI_PRESENT_STATE ) && - (esdhc->quirk_ignore_data_inhibit == true)) { - ret = value & ~SDHCI_DATA_INHIBIT ; -return ret; - } - ret = value;return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 193/663 arm64: dts: qcom: sm8450: fix pcie1 gpios properties name
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit e57430d2483506f046e39bf8c61159dde88aede2 ]
Add the final "s" to the pgio properties and fix the invalid "enable" name to the correct "wake", checked against the HDK8450 schematics.
--- arch/arm64/boot/dts/qcom/sm8450.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/sm8450.dtsi +2 -2
@@ -1883,8 +1883,8 @@ phys = <&pcie1_lane>; phy-names = "pciephy"; - perst-gpio = <&tlmm 97 GPIO_ACTIVE_LOW>; - enable-gpio = <&tlmm 99 GPIO_ACTIVE_HIGH>; + perst-gpios = <&tlmm 97 GPIO_ACTIVE_LOW>; + wake-gpios = <&tlmm 99 GPIO_ACTIVE_HIGH>; pinctrl-names = "default"; pinctrl-0 = <&pcie1_default_state>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 194/663 drm: rcar-du: Fix a NULL vs IS_ERR() bug
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 40f43730f43699ce8557e4fe59622d4f4b69f44a ]
The drmm_encoder_alloc() function returns error pointers. It never returns NULL. Fix the check accordingly.
--- drivers/gpu/drm/rcar-du/rcar_du_encoder.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/rcar-du/rcar_du_encoder.c +2 -2
@@ -109,8 +109,8 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, renc = drmm_encoder_alloc(&rcdu->ddev, struct rcar_du_encoder, base, &rcar_du_encoder_funcs,DRM_MODE_ENCODER_NONE ,NULL ); -if (!renc) -return -ENOMEM ; +if (IS_ERR (renc)) +return PTR_ERR (renc); renc->output = output;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 195/663 ARM: dts: gta04: fix excess dma channel usage
In reply to Greg Kroah-HartmanFrom: H. Nikolaus Schaller <[email protected]>
[ Upstream commit a622310f7f0185da02e42cdb06475f533efaae60 ]
OMAP processors support 32 channels but there is no check or inspect this except booting a device and looking at dmesg reports of not available channels.
Recently some more subsystems with DMA (aes1+2) were added filling the list of dma channels beyond the limit of 32 (even if other parameters indicate 96 or 128 channels). This leads to random subsystem failures i(e.g. mcbsp for audio) after boot or boot messages that DMA can not be initialized.
Another symptom is that
/sys/kernel/debug/dmaengine/summary
has 32 entries and does not show all required channels.
Fix by disabling unused (on the GTA04 hardware) mcspi1...4. Each SPI channel allocates 4 DMA channels rapidly filling the available ones.
Disabling unused SPI modules on the OMAP3 SoC may also save some energy (has not been checked).
Message-Id: <[email protected]>
--- arch/arm/boot/dts/omap3-gta04.dtsi | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm/boot/dts/omap3-gta04.dtsi +16 -0
@@ -612,6 +612,22 @@ clock-frequency = <100000>; }; +&mcspi1 { + status = "disabled"; +}; + +&mcspi2 { + status = "disabled"; +}; + +&mcspi3 { + status = "disabled"; +}; + +&mcspi4 { + status = "disabled"; +}; + &usb_otg_hs { interface-type = <0>; usb-phy = <&usb2_phy>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 196/663 firmware: arm_scmi: Fix xfers allocation on Rx channel
In reply to Greg Kroah-HartmanFrom: Cristian Marussi <[email protected]>
[ Upstream commit b2ccba9e8cdc6fb3985cc227844e7c6af309ffb1 ]
Two distinct pools of xfer descriptors are allocated at initialization
time: one (Tx) used to provide xfers to track commands and their replies (or delayed replies) and another (Rx) to pick xfers from to be used for processing notifications.
Such pools, though, are allocated globally to be used by the whole SCMI instance, they are not allocated per-channel and as such the allocation of notifications xfers cannot be simply skipped if no Rx channel was found for the base protocol common channel, because there could be defined more optional per-protocol dedicated channels that instead support Rx channels.
Change the conditional check to skip allocation for the notification pool only if no Rx channel has been detected on any per-channel protocol at all.
--- drivers/firmware/arm_scmi/driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/arm_scmi/driver.c +1 -1
@@ -1981,7 +1981,7 @@ static int scmi_xfer_info_init(struct scmi_info *sinfo)return ret; ret =__scmi_xfer_info_init (sinfo, &sinfo->tx_minfo); -if (!ret &&idr_find (&sinfo->rx_idr,SCMI_PROTOCOL_BASE )) +if (!ret && !idr_is_empty (&sinfo->rx_idr)) ret =__scmi_xfer_info_init (sinfo, &sinfo->rx_minfo);return ret;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 197/663 perf/arm-cmn: Move overlapping wp_combine field
In reply to Greg Kroah-HartmanFrom: Ilkka Koskinen <[email protected]>
[ Upstream commit f87e9114b5e590c2c6658ca21d7b714ca240bdd0 ]
As eventid field was expanded to support new mesh versions, it started to overlap with wp_combine field. Move wp_combine to fix the issue.
--- drivers/perf/arm-cmn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm-cmn.c +1 -1
@@ -166,7 +166,7 @@#define CMN_EVENT_BYNODEID (event) FIELD_GET(CMN_CONFIG_BYNODEID, (event)->attr.config)#define CMN_EVENT_NODEID (event) FIELD_GET(CMN_CONFIG_NODEID, (event)->attr.config) -#define CMN_CONFIG_WP_COMBINE GENMASK_ULL(27, 24) +#define CMN_CONFIG_WP_COMBINE GENMASK_ULL(30, 27)#define CMN_CONFIG_WP_DEV_SEL GENMASK_ULL(50, 48)#define CMN_CONFIG_WP_CHN_SEL GENMASK_ULL(55, 51)/* Note that we don't yet support the tertiary match group on newer IPs */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 198/663 perf/amlogic: Fix config1/config2 parsing issue
In reply to Greg Kroah-HartmanFrom: Jiucheng Xu <[email protected]>
[ Upstream commit c61e5720f23273269cc67ffb2908cf9831c8ca9d ]
The 3th argument of for_each_set_bit is incorrect, fix them.
--- drivers/perf/amlogic/meson_ddr_pmu_core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/perf/amlogic/meson_ddr_pmu_core.c +6 -2
@@ -156,10 +156,14 @@ static int meson_ddr_perf_event_add(struct perf_event *event, int flags)u64 config2 = event->attr.config2;int i; -for_each_set_bit (i, (const unsigned long *)&config1,sizeof (config1)) +for_each_set_bit (i, + (const unsigned long *)&config1, +BITS_PER_TYPE (config1))meson_ddr_set_axi_filter (event, i); -for_each_set_bit (i, (const unsigned long *)&config2,sizeof (config2)) +for_each_set_bit (i, + (const unsigned long *)&config2, +BITS_PER_TYPE (config2))meson_ddr_set_axi_filter (event, i +64 );if (flags &PERF_EF_START )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 199/663 ARM: dts: stm32: fix spi1 pin assignment on stm32mp15
In reply to Greg Kroah-HartmanFrom: Alexandre Torgue <[email protected]>
[ Upstream commit 1b9f0ec81af0012aae30aa3b4c711ad71d42e246 ]
Bank A and B IOs can't be handled by the pin controller 'Z'. This patch assign spi1 pin definition to the correct controller.
--- arch/arm/boot/dts/stm32mp15-pinctrl.dtsi | 30 ++++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-)
arch/arm/boot/dts/stm32mp15-pinctrl.dtsi +15 -15
@@ -1880,6 +1880,21 @@ }; }; + spi1_pins_b: spi1-1 { + pins1 { + pinmux = <STM32_PINMUX('A', 5, AF5)>, /* SPI1_SCK */ + <STM32_PINMUX('B', 5, AF5)>; /* SPI1_MOSI */ + bias-disable; + drive-push-pull; + slew-rate = <1>; + }; + + pins2 { + pinmux = <STM32_PINMUX('A', 6, AF5)>; /* SPI1_MISO */ + bias-disable; + }; + }; + spi2_pins_a: spi2-0 { pins1 { pinmux = <STM32_PINMUX('B', 10, AF5)>, /* SPI2_SCK */
@@ -2448,19 +2463,4 @@ bias-disable; }; }; - - spi1_pins_b: spi1-1 { - pins1 { - pinmux = <STM32_PINMUX('A', 5, AF5)>, /* SPI1_SCK */ - <STM32_PINMUX('B', 5, AF5)>; /* SPI1_MOSI */ - bias-disable; - drive-push-pull; - slew-rate = <1>; - }; - - pins2 { - pinmux = <STM32_PINMUX('A', 6, AF5)>; /* SPI1_MISO */ - bias-disable; - }; - }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 200/663 arm64: dts: apple: t8103: Disable unused PCIe ports
In reply to Greg Kroah-HartmanFrom: Janne Grunau <[email protected]>
[ Upstream commit a0189fdfb73dac856b8fa9b9f9581e5099c9391f ]
The PCIe ports are unused (without devices) so disable them instead of removing them.
--- arch/arm64/boot/dts/apple/t8103-j274.dts | 10 ++++++++++ arch/arm64/boot/dts/apple/t8103-j293.dts | 15 --------------- arch/arm64/boot/dts/apple/t8103-j313.dts | 15 --------------- arch/arm64/boot/dts/apple/t8103-j456.dts | 10 ++++++++++ arch/arm64/boot/dts/apple/t8103-j457.dts | 11 +++-------- arch/arm64/boot/dts/apple/t8103.dtsi | 4 ++++ 6 files changed, 27 insertions(+), 38 deletions(-)
arch/arm64/boot/dts/apple/t8103-j274.dts +10 -0
@@ -37,10 +37,12 @@ &port01 { bus-range = <2 2>; + status = "okay"; }; &port02 { bus-range = <3 3>; + status = "okay"; ethernet0: ethernet@0,0 { reg = <0x30000 0x0 0x0 0x0 0x0>; /* To be filled by the loader */
@@ -48,6 +50,14 @@ }; }; +&pcie0_dart_1 { + status = "okay"; +}; + +&pcie0_dart_2 { + status = "okay"; +}; + &i2c2 { status = "okay"; };
arch/arm64/boot/dts/apple/t8103-j293.dts +0 -15
@@ -25,21 +25,6 @@ brcm,board-type = "apple,honshu"; }; -/* - * Remove unused PCIe ports and disable the associated DARTs. - */ - -&pcie0_dart_1 { - status = "disabled"; -}; - -&pcie0_dart_2 { - status = "disabled"; -}; - -/delete-node/ &port01; -/delete-node/ &port02; - &i2c2 { status = "okay"; };
arch/arm64/boot/dts/apple/t8103-j313.dts +0 -15
@@ -24,18 +24,3 @@ &wifi0 { brcm,board-type = "apple,shikoku"; }; - -/* - * Remove unused PCIe ports and disable the associated DARTs. - */ - -&pcie0_dart_1 { - status = "disabled"; -}; - -&pcie0_dart_2 { - status = "disabled"; -}; - -/delete-node/ &port01; -/delete-node/ &port02;
arch/arm64/boot/dts/apple/t8103-j456.dts +10 -0
@@ -55,13 +55,23 @@ &port01 { bus-range = <2 2>; + status = "okay"; }; &port02 { bus-range = <3 3>; + status = "okay"; ethernet0: ethernet@0,0 { reg = <0x30000 0x0 0x0 0x0 0x0>; /* To be filled by the loader */ local-mac-address = [00 10 18 00 00 00]; }; }; + +&pcie0_dart_1 { + status = "okay"; +}; + +&pcie0_dart_2 { + status = "okay"; +};
arch/arm64/boot/dts/apple/t8103-j457.dts +3 -8
@@ -37,6 +37,7 @@ &port02 { bus-range = <3 3>; + status = "okay"; ethernet0: ethernet@0,0 { reg = <0x30000 0x0 0x0 0x0 0x0>; /* To be filled by the loader */
@@ -44,12 +45,6 @@ }; }; -/* - * Remove unused PCIe port and disable the associated DART. - */ - -&pcie0_dart_1 { - status = "disabled"; +&pcie0_dart_2 { + status = "okay"; }; - -/delete-node/ &port01;
arch/arm64/boot/dts/apple/t8103.dtsi +4 -0
@@ -724,6 +724,7 @@ interrupt-parent = <&aic>; interrupts = <AIC_IRQ 699 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&ps_apcie_gp>; + status = "disabled"; }; pcie0_dart_2: iommu@683008000 {
@@ -733,6 +734,7 @@ interrupt-parent = <&aic>; interrupts = <AIC_IRQ 702 IRQ_TYPE_LEVEL_HIGH>; power-domains = <&ps_apcie_gp>; + status = "disabled"; }; pcie0: pcie@690000000 {
@@ -807,6 +809,7 @@ <0 0 0 2 &port01 0 0 0 1>, <0 0 0 3 &port01 0 0 0 2>, <0 0 0 4 &port01 0 0 0 3>; + status = "disabled"; }; port02: pci@2,0 {
@@ -826,6 +829,7 @@ <0 0 0 2 &port02 0 0 0 1>, <0 0 0 3 &port02 0 0 0 2>, <0 0 0 4 &port02 0 0 0 3>; + status = "disabled"; }; }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 201/663 cpufreq: mediatek: fix passing zero to PTR_ERR
In reply to Greg Kroah-HartmanFrom: Jia-Wei Chang <[email protected]>
[ Upstream commit d51c63230994f167126d9d8381011b4cb2b0ad22 ]
In order to prevent passing zero to 'PTR_ERR' in mtk_cpu_dvfs_info_init(), we fix the return value of of_get_cci() using error pointer by explicitly casting error number.
--- drivers/cpufreq/mediatek-cpufreq.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +5 -5
@@ -373,13 +373,13 @@ static struct device *of_get_cci(struct device *cpu_dev)struct platform_device *pdev; np =of_parse_phandle (cpu_dev->of_node,"mediatek,cci" ,0 ); -if (IS_ERR_OR_NULL (np)) -return NULL ; +if (!np) +return ERR_PTR (-ENODEV ); pdev =of_find_device_by_node (np);of_node_put (np); -if (IS_ERR_OR_NULL (pdev)) -return NULL ; +if (!pdev) +return ERR_PTR (-ENODEV );return &pdev->dev; }
@@ -401,7 +401,7 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) info->ccifreq_bound = false;if (info->soc_data->ccifreq_supported) { info->cci_dev =of_get_cci (info->cpu_dev); -if (IS_ERR_OR_NULL (info->cci_dev)) { +if (IS_ERR (info->cci_dev)) { ret =PTR_ERR (info->cci_dev);dev_err (cpu_dev,"cpu%d: failed to get cci device\n" , cpu);return -ENODEV ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 202/663 cpufreq: mediatek: fix KP caused by handler usage after regulator_put/clk_put
In reply to Greg Kroah-HartmanFrom: Jia-Wei Chang <[email protected]>
[ Upstream commit d51e106240bc755cbe59634b70d567c192b045b2 ]
Any kind of failure in mtk_cpu_dvfs_info_init() will lead to calling regulator_put() or clk_put() and the KP will occur since the regulator/clk handlers are used after released in mtk_cpu_dvfs_info_release().
To prevent the usage after regulator_put()/clk_put(), the regulator/clk handlers are addressed in a way of "Free the Last Thing Style".
--- drivers/cpufreq/mediatek-cpufreq.c | 62 +++++++++++++++--------------- 1 file changed, 30 insertions(+), 32 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +30 -32
@@ -420,7 +420,7 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) ret =PTR_ERR (info->inter_clk);dev_err_probe (cpu_dev, ret,"cpu%d: failed to get intermediate clk\n" , cpu); - goto out_free_resources; + goto out_free_mux_clock; } info->proc_reg =regulator_get_optional (cpu_dev,"proc" );
@@ -428,13 +428,13 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) ret =PTR_ERR (info->proc_reg);dev_err_probe (cpu_dev, ret,"cpu%d: failed to get proc regulator\n" , cpu); - goto out_free_resources; + goto out_free_inter_clock; } ret =regulator_enable (info->proc_reg);if (ret) {dev_warn (cpu_dev,"cpu%d: failed to enable vproc\n" , cpu); - goto out_free_resources; + goto out_free_proc_reg; }/* Both presence and absence of sram regulator are valid cases. */
@@ -442,14 +442,14 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)if (IS_ERR (info->sram_reg)) { ret =PTR_ERR (info->sram_reg);if (ret == -EPROBE_DEFER ) - goto out_free_resources; + goto out_disable_proc_reg; info->sram_reg =NULL ; }else { ret =regulator_enable (info->sram_reg);if (ret) {dev_warn (cpu_dev,"cpu%d: failed to enable vsram\n" , cpu); - goto out_free_resources; + goto out_free_sram_reg; } }
@@ -458,13 +458,13 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu)if (ret) {dev_err (cpu_dev,"cpu%d: failed to get OPP-sharing information\n" , cpu); - goto out_free_resources; + goto out_disable_sram_reg; } ret =dev_pm_opp_of_cpumask_add_table (&info->cpus);if (ret) {dev_warn (cpu_dev,"cpu%d: no OPP table\n" , cpu); - goto out_free_resources; + goto out_disable_sram_reg; } ret =clk_prepare_enable (info->cpu_clk);
@@ -533,43 +533,41 @@ static int mtk_cpu_dvfs_info_init(struct mtk_cpu_dvfs_info *info, int cpu) out_free_opp_table:dev_pm_opp_of_cpumask_remove_table (&info->cpus); -out_free_resources: -if (regulator_is_enabled (info->proc_reg)) -regulator_disable (info->proc_reg); -if (info->sram_reg &®ulator_is_enabled (info->sram_reg)) +out_disable_sram_reg: +if (info->sram_reg)regulator_disable (info->sram_reg); -if (!IS_ERR (info->proc_reg)) -regulator_put (info->proc_reg); -if (!IS_ERR (info->sram_reg)) +out_free_sram_reg: +if (info->sram_reg)regulator_put (info->sram_reg); -if (!IS_ERR (info->cpu_clk)) -clk_put (info->cpu_clk); -if (!IS_ERR (info->inter_clk)) -clk_put (info->inter_clk); + +out_disable_proc_reg: +regulator_disable (info->proc_reg); + +out_free_proc_reg: +regulator_put (info->proc_reg); + +out_free_inter_clock: +clk_put (info->inter_clk); + +out_free_mux_clock: +clk_put (info->cpu_clk);return ret; }static void mtk_cpu_dvfs_info_release (struct mtk_cpu_dvfs_info *info) { -if (!IS_ERR (info->proc_reg)) { -regulator_disable (info->proc_reg); -regulator_put (info->proc_reg); - } -if (!IS_ERR (info->sram_reg)) { +regulator_disable (info->proc_reg); +regulator_put (info->proc_reg); +if (info->sram_reg) {regulator_disable (info->sram_reg);regulator_put (info->sram_reg); } -if (!IS_ERR (info->cpu_clk)) { -clk_disable_unprepare (info->cpu_clk); -clk_put (info->cpu_clk); - } -if (!IS_ERR (info->inter_clk)) { -clk_disable_unprepare (info->inter_clk); -clk_put (info->inter_clk); - } - +clk_disable_unprepare (info->cpu_clk); +clk_put (info->cpu_clk); +clk_disable_unprepare (info->inter_clk); +clk_put (info->inter_clk);dev_pm_opp_of_cpumask_remove_table (&info->cpus);dev_pm_opp_unregister_notifier (info->cpu_dev, &info->opp_nb); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 203/663 cpufreq: mediatek: raise proc/sram max voltage for MT8516
In reply to Greg Kroah-HartmanFrom: Jia-Wei Chang <[email protected]>
[ Upstream commit d3296bb4cafd4bad4a5cf2eeab9d19cc94f9e30e ]
Since the upper boundary of proc/sram voltage of MT8516 is 1300 mV, which is greater than the value of MT2701 1150 mV, we fix it by adding the corresponding platform data and specify proc/sram_max_volt to support MT8516.
--- drivers/cpufreq/mediatek-cpufreq.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +11 -2
@@ -711,20 +711,29 @@ static const struct mtk_cpufreq_platform_data mt8186_platform_data = { .ccifreq_supported = true, }; +static const struct mtk_cpufreq_platform_data mt8516_platform_data = { + .min_volt_shift =100000 , + .max_volt_shift =200000 , + .proc_max_volt =1310000 , + .sram_min_volt =0 , + .sram_max_volt =1310000 , + .ccifreq_supported = false, +}; +/* List of machines supported by this driver */ static const struct of_device_id mtk_cpufreq_machines[]__initconst = { { .compatible ="mediatek,mt2701" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt2712" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt7622" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt7623" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt8167" , .data = &mt2701_platform_data }, + { .compatible ="mediatek,mt8167" , .data = &mt8516_platform_data }, { .compatible ="mediatek,mt817x" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8173" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8176" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8183" , .data = &mt8183_platform_data }, { .compatible ="mediatek,mt8186" , .data = &mt8186_platform_data }, { .compatible ="mediatek,mt8365" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt8516" , .data = &mt2701_platform_data }, + { .compatible ="mediatek,mt8516" , .data = &mt8516_platform_data }, { } };MODULE_DEVICE_TABLE (of, mtk_cpufreq_machines);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 204/663 cpufreq: mediatek: Raise proc and sram max voltage for MT7622/7623
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 0883426fd07e39355362e3f2eb9aee1a154dcaf6 ]
During the addition of SRAM voltage tracking for CCI scaling, this driver got some voltage limits set for the vtrack algorithm: these were moved to platform data first, then enforced in a later commit 6a17b3876bc8 ("cpufreq: mediatek: Refine mtk_cpufreq_voltage_tracking()") using these as max values for the regulator_set_voltage() calls.
In this case, the vsram/vproc constraints for MT7622 and MT7623 were supposed to be the same as MT2701 (and a number of other SoCs), but that turned out to be a mistake because the aforementioned two SoCs' maximum voltage for both VPROC and VPROC_SRAM is 1.36V.
Fix that by adding new platform data for MT7622/7623 declaring the right {proc,sram}_max_volt parameter.
--- drivers/cpufreq/mediatek-cpufreq.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
drivers/cpufreq/mediatek-cpufreq.c +11 -2
@@ -693,6 +693,15 @@ static const struct mtk_cpufreq_platform_data mt2701_platform_data = { .ccifreq_supported = false, }; +static const struct mtk_cpufreq_platform_data mt7622_platform_data = { + .min_volt_shift =100000 , + .max_volt_shift =200000 , + .proc_max_volt =1360000 , + .sram_min_volt =0 , + .sram_max_volt =1360000 , + .ccifreq_supported = false, +}; +static const struct mtk_cpufreq_platform_data mt8183_platform_data = { .min_volt_shift =100000 , .max_volt_shift =200000 ,
@@ -724,8 +733,8 @@ static const struct mtk_cpufreq_platform_data mt8516_platform_data = {static const struct of_device_id mtk_cpufreq_machines[]__initconst = { { .compatible ="mediatek,mt2701" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt2712" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt7622" , .data = &mt2701_platform_data }, - { .compatible ="mediatek,mt7623" , .data = &mt2701_platform_data }, + { .compatible ="mediatek,mt7622" , .data = &mt7622_platform_data }, + { .compatible ="mediatek,mt7623" , .data = &mt7622_platform_data }, { .compatible ="mediatek,mt8167" , .data = &mt8516_platform_data }, { .compatible ="mediatek,mt817x" , .data = &mt2701_platform_data }, { .compatible ="mediatek,mt8173" , .data = &mt2701_platform_data },
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 205/663 cpufreq: qcom-cpufreq-hw: Revert adding cpufreq qos
In reply to Greg Kroah-HartmanFrom: Bjorn Andersson <[email protected]>
[ Upstream commit e2b47e585931a988c856fd4ba31e1296f749aee3 ]
The OSM/EPSS hardware controls the frequency of each CPU cluster based on requests from the OS and various throttling events in the system. While throttling is in effect the related dcvs interrupt will be kept high. The purpose of the code handling this interrupt is to continuously report the thermal pressure based on the throttled frequency.
The reasoning for adding QoS control to this mechanism is not entirely clear, but the introduction of commit 'c4c0efb06f17 ("cpufreq:
qcom-cpufreq-hw: Add cpufreq qos for LMh")' causes the scaling_max_frequncy to be set to the throttled frequency. On the next iteration of polling, the throttled frequency is above or equal to the newly requested frequency, so the polling is stopped.
With cpufreq limiting the max frequency, the hardware no longer report a throttling state and no further updates to thermal pressure or qos state are made.
The result of this is that scaling_max_frequency can only go down, and the system becomes slower and slower every time a thermal throttling event is reported by the hardware.
Even if the logic could be improved, there is no reason for software to limit the max freqency in response to the hardware limiting the max frequency. At best software will follow the reported hardware state, but typically it will cause slower backoff of the throttling.
This reverts commit c4c0efb06f17fa4a37ad99e7752b18a5405c76dc.
--- drivers/cpufreq/qcom-cpufreq-hw.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/cpufreq/qcom-cpufreq-hw.c +0 -14
@@ -14,7 +14,6 @@#include <linux/of_address.h> #include <linux/of_platform.h> #include <linux/pm_opp.h> -#include <linux/pm_qos.h> #include <linux/slab.h> #include <linux/spinlock.h> #include <linux/units.h>
@@ -57,8 +56,6 @@ struct qcom_cpufreq_data {struct clk_hw cpu_clk;bool per_core_dcvs; - -struct freq_qos_request throttle_freq_req; }; static struct {
@@ -348,8 +345,6 @@ static void qcom_lmh_dcvs_notify(struct qcom_cpufreq_data *data) throttled_freq = freq_hz /HZ_PER_KHZ ; -freq_qos_update_request (&data->throttle_freq_req, throttled_freq); -/* Update thermal pressure (the boost frequencies are accepted) */ arch_update_thermal_pressure (policy->related_cpus, throttled_freq);
@@ -442,14 +437,6 @@ static int qcom_cpufreq_hw_lmh_init(struct cpufreq_policy *policy, int index)if (data->throttle_irq <0 )return data->throttle_irq; - ret =freq_qos_add_request (&policy->constraints, - &data->throttle_freq_req,FREQ_QOS_MAX , -FREQ_QOS_MAX_DEFAULT_VALUE ); -if (ret <0 ) { -dev_err (&pdev->dev,"Failed to add freq constraint (%d)\n" , ret); -return ret; - } - data->cancel_throttle = false; data->policy = policy;
@@ -516,7 +503,6 @@ static void qcom_cpufreq_hw_lmh_exit(struct qcom_cpufreq_data *data)if (data->throttle_irq <=0 )return ; -freq_qos_remove_request (&data->throttle_freq_req);free_irq (data->throttle_irq, data); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 206/663 arm64: dts: mediatek: mt8192-asurada: Fix voltage constraint for Vgpu
In reply to Greg Kroah-HartmanFrom: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit ff4c868ba8df9dcd144ab4943a50adca1cf33ba2 ]
The MT8192 SoC specifies a maximum voltage for the GPU's digital supply of 0.88V and the GPU OPPs are declaring a maximum voltage of 0.80V.
In order to keep the GPU voltage in the safe range, change the maximum voltage for mt6315@7's vbuck1 to 0.80V as sending, for any mistake, 1.193V would be catastrophic.
--- arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi +1 -1
@@ -935,7 +935,7 @@ regulator-compatible = "vbuck1"; regulator-name = "Vgpu"; regulator-min-microvolt = <606250>; - regulator-max-microvolt = <1193750>; + regulator-max-microvolt = <800000>; regulator-enable-ramp-delay = <256>; regulator-allowed-modes = <0 1 2>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 207/663 ACPI: VIOT: Initialize the correct IOMMU fwspec
In reply to Greg Kroah-HartmanFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit 47d26684185d09e083669bbbd0c465ab3493a51f ]
When setting up DMA for a PCI device, we need to initialize its iommu_fwspec with all possible alias RIDs (such as PCI bridges). To do this we use pci_for_each_dma_alias() which calls viot_pci_dev_iommu_init(). This function incorrectly initializes the fwspec of the bridge instead of the device being configured. Fix it by passing the original device as context to pci_for_each_dma_alias().
--- drivers/acpi/viot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/viot.c +3 -2
@@ -328,6 +328,7 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data) {u32 epid;struct viot_endpoint *ep; +struct device *aliased_dev = data;u32 domain_nr =pci_domain_nr (pdev->bus);list_for_each_entry (ep, &viot_pci_ranges, list) {
@@ -338,7 +339,7 @@ static int viot_pci_dev_iommu_init(struct pci_dev *pdev, u16 dev_id, void *data) epid = ((domain_nr - ep->segment_start) <<16 ) + dev_id - ep->bdf_start + ep->endpoint_id; -return viot_dev_iommu_init (&pdev->dev, ep->viommu, +return viot_dev_iommu_init (aliased_dev, ep->viommu, epid); } }
@@ -372,7 +373,7 @@ int viot_iommu_configure(struct device *dev) {if (dev_is_pci (dev))return pci_for_each_dma_alias (to_pci_dev (dev), - viot_pci_dev_iommu_init,NULL ); + viot_pci_dev_iommu_init, dev);else if (dev_is_platform (dev))return viot_mmio_dev_iommu_init (to_platform_device (dev));return -ENODEV ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 208/663 drm/lima/lima_drv: Add missing unwind goto in lima_pdev_probe()
In reply to Greg Kroah-HartmanFrom: Harshit Mogalapalli <[email protected]>
[ Upstream commit c5647cae2704e58d1c4e5fedbf63f11bca6376c9 ]
Smatch reports:drivers/gpu/drm/lima/lima_drv.c:396 lima_pdev_probe() warn:
missing unwind goto?
Store return value in err and goto 'err_out0' which has lima_sched_slab_fini() before returning.
--- drivers/gpu/drm/lima/lima_drv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/lima/lima_drv.c +4 -2
@@ -392,8 +392,10 @@ static int lima_pdev_probe(struct platform_device *pdev)/* Allocate and initialize the DRM device. */ ddev =drm_dev_alloc (&lima_drm_driver, &pdev->dev); -if (IS_ERR (ddev)) -return PTR_ERR (ddev); +if (IS_ERR (ddev)) { + err =PTR_ERR (ddev); + goto err_out0; + } ddev->dev_private = ldev; ldev->ddev = ddev;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 209/663 drm/mediatek: dp: Change the aux retries times when receiving AUX_DEFER
In reply to Greg Kroah-HartmanFrom: Xinlei Lee <[email protected]>
[ Upstream commit 9243d70e05c5989f84f840612965f96b524da925 ]
DP 1.4a Section 2.8.7.1.5.6.1:
A DP Source device shall retry at least seven times upon receiving AUX_DEFER before giving up the AUX transaction.
The drm_dp_i2c_do_msg() function in the drm_dp_helper.c file will judge the status of the msg->reply parameter passed to aux_transfer for different processing.
--- drivers/gpu/drm/mediatek/mtk_dp.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/gpu/drm/mediatek/mtk_dp.c +5 -7
@@ -806,10 +806,9 @@ static int mtk_dp_aux_wait_for_completion(struct mtk_dp *mtk_dp, bool is_read) }static int mtk_dp_aux_do_transfer (struct mtk_dp *mtk_dp,bool is_read,u8 cmd, -u32 addr,u8 *buf,size_t length) +u32 addr,u8 *buf,size_t length,u8 *reply_cmd) {int ret; -u32 reply_cmd;if (is_read && (length >DP_AUX_MAX_PAYLOAD_BYTES || (cmd ==DP_AUX_NATIVE_READ && !length)))
@@ -841,10 +840,10 @@ static int mtk_dp_aux_do_transfer(struct mtk_dp *mtk_dp, bool is_read, u8 cmd,/* Wait for feedback from sink device. */ ret =mtk_dp_aux_wait_for_completion (mtk_dp, is_read); - reply_cmd =mtk_dp_read (mtk_dp,MTK_DP_AUX_P0_3624 ) & -AUX_RX_REPLY_COMMAND_AUX_TX_P0_MASK ; + *reply_cmd =mtk_dp_read (mtk_dp,MTK_DP_AUX_P0_3624 ) & +AUX_RX_REPLY_COMMAND_AUX_TX_P0_MASK ; -if (ret || reply_cmd) { +if (ret) {u32 phy_status =mtk_dp_read (mtk_dp,MTK_DP_AUX_P0_3628 ) &AUX_RX_PHY_STATE_AUX_TX_P0_MASK ;if (phy_status !=AUX_RX_PHY_STATE_AUX_TX_P0_RX_IDLE ) {
@@ -2071,7 +2070,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, ret =mtk_dp_aux_do_transfer (mtk_dp, is_read, request, msg->address + accessed_bytes, msg->buffer + accessed_bytes, - to_access); + to_access, &msg->reply);if (ret) { drm_info(mtk_dp->drm_dev,
@@ -2081,7 +2080,6 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, accessed_bytes += to_access; }while (accessed_bytes < msg->size); - msg->reply =DP_AUX_NATIVE_REPLY_ACK |DP_AUX_I2C_REPLY_ACK ;return msg->size; err: msg->reply =DP_AUX_NATIVE_REPLY_NACK |DP_AUX_I2C_REPLY_NACK ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 210/663 mailbox: mpfs: switch to txdone_poll
In reply to Greg Kroah-HartmanFrom: Conor Dooley <[email protected]>
[ Upstream commit b5984a9844fc45cd301a28fb56f3de95f7e20f3c ]
The system controller on PolarFire SoC has no interrupt to signify that the TX has been completed. The interrupt instead signals that a service requested by the mailbox client has succeeded. If a service fails, there will be no interrupt delivered.
Switch to polling the busy register to determine whether transmission has completed.
--- drivers/mailbox/mailbox-mpfs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/mailbox/mailbox-mpfs.c +10 -2
@@ -79,6 +79,13 @@ static bool mpfs_mbox_busy(struct mpfs_mbox *mbox)return status &SCB_STATUS_BUSY_MASK ; } +static bool mpfs_mbox_last_tx_done (struct mbox_chan *chan) +{ +struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv; + +return !mpfs_mbox_busy (mbox); +} +static int mpfs_mbox_send_data (struct mbox_chan *chan,void *data) {struct mpfs_mbox *mbox = (struct mpfs_mbox *)chan->con_priv;
@@ -182,7 +189,6 @@ static irqreturn_t mpfs_mbox_inbox_isr(int irq, void *data)mpfs_mbox_rx_data (chan); -mbox_chan_txdone (chan,0 );return IRQ_HANDLED ; }
@@ -212,6 +218,7 @@ static const struct mbox_chan_ops mpfs_mbox_ops = { .send_data = mpfs_mbox_send_data, .startup = mpfs_mbox_startup, .shutdown = mpfs_mbox_shutdown, + .last_tx_done = mpfs_mbox_last_tx_done, };static int mpfs_mbox_probe (struct platform_device *pdev)
@@ -247,7 +254,8 @@ static int mpfs_mbox_probe(struct platform_device *pdev) mbox->controller.num_chans =1 ; mbox->controller.chans = mbox->chans; mbox->controller.ops = &mpfs_mbox_ops; - mbox->controller.txdone_irq = true; + mbox->controller.txdone_poll = true; + mbox->controller.txpoll_period =10u ; ret =devm_mbox_controller_register (&pdev->dev, &mbox->controller);if (ret) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 211/663 soc: bcm: brcmstb: biuctrl: fix of_iomap leak
In reply to Greg Kroah-HartmanFrom: Zhaoyang Li <[email protected]>
[ Upstream commit c3fbced9af885a6f217fd95509a613d6590916ce ]
Smatch reports:
drivers/soc/bcm/brcmstb/biuctrl.c:291 setup_hifcpubiuctrl_regs() warn:
'cpubiuctrl_base' from of_iomap() not released on lines: 291.
This is because in setup_hifcpubiuctrl_regs(),cpubiuctrl_base is not released when handle error, which may cause a leak. To fix this, iounmap is added when handle error.
--- drivers/soc/bcm/brcmstb/biuctrl.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/soc/bcm/brcmstb/biuctrl.c +4 -0
@@ -288,6 +288,10 @@ static int __init setup_hifcpubiuctrl_regs(struct device_node *np)if (BRCM_ID (family_id) ==0x7260 &&BRCM_REV (family_id) ==0 ) cpubiuctrl_regs = b53_cpubiuctrl_no_wb_regs; out: +if (ret && cpubiuctrl_base) { +iounmap (cpubiuctrl_base); + cpubiuctrl_base =NULL ; + }return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 212/663 soc: renesas: renesas-soc: Release chipid from ioremap()
In reply to Greg Kroah-HartmanFrom: Li Yang <[email protected]>
[ Upstream commit fc187a46a8e682f0f1167b230792b88de01ceaa0 ]
Smatch reports:
drivers/soc/renesas/renesas-soc.c:536 renesas_soc_init() warn:
'chipid' from ioremap() not released on lines: 475.
If soc_dev_atrr allocation is failed, function renesas_soc_init() will return without releasing 'chipid' from ioremap().
Fix this by adding function iounmap().
--- drivers/soc/renesas/renesas-soc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/soc/renesas/renesas-soc.c +4 -1
@@ -471,8 +471,11 @@ static int __init renesas_soc_init(void) } soc_dev_attr =kzalloc (sizeof (*soc_dev_attr),GFP_KERNEL ); -if (!soc_dev_attr) +if (!soc_dev_attr) { +if (chipid) +iounmap (chipid);return -ENOMEM ; + } np =of_find_node_by_path ("/" );of_property_read_string (np,"model" , &soc_dev_attr->machine);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 213/663 gpu: host1x: Fix potential double free if IOMMU is disabled
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 8466ff24a37a9a18fb935e90dda64f049131ae28 ]
If context device has no IOMMU, the 'cdl->devs' is freed in error path, but host1x_memory_context_list_init() doesn't return an error code, so the module can be loaded successfully, when it's unloading, the host1x_memory_context_list_free() is called in host1x_remove(), it will cause double free. Set the 'cdl->devs' to NULL after freeing it to avoid double free.
--- drivers/gpu/host1x/context.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/host1x/context.c +1 -0
@@ -87,6 +87,7 @@ int host1x_memory_context_list_init(struct host1x *host1x)device_del (&cdl->devs[i].dev);kfree (cdl->devs); + cdl->devs =NULL ; cdl->len =0 ;return err;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 214/663 gpu: host1x: Fix memory leak of device names
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 55879dad0f3ae8468444b42f785ad79eac05fe5b ]
The device names allocated by dev_set_name() need be freed before module unloading, but they can not be freed because the kobject's refcount which was set in device_initialize() has not be decreased to 0.
As comment of device_add() says, if it fails, use only put_device() drop the refcount, then the name will be freed in kobejct_cleanup().
device_del() and put_device() can be replaced with device_unregister(), so call it to unregister the added successfully devices, and just call put_device() to the not added device.
Add a release() function to device to avoid null release() function WARNING in device_release(), it's empty, because the context devices are freed together in host1x_memory_context_list_free().
--- drivers/gpu/host1x/context.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-)
drivers/gpu/host1x/context.c +15 -8
@@ -13,6 +13,11 @@#include "context.h" #include "dev.h" +static void host1x_memory_context_release (struct device *dev) +{ +/* context device is freed in host1x_memory_context_list_free() */ +} +int host1x_memory_context_list_init (struct host1x *host1x) {struct host1x_memory_context_list *cdl = &host1x->context_list;
@@ -53,28 +58,30 @@ int host1x_memory_context_list_init(struct host1x *host1x)dev_set_name (&ctx->dev,"host1x-ctx.%d" , i); ctx->dev.bus = &host1x_context_device_bus_type; ctx->dev.parent = host1x->dev; + ctx->dev.release = host1x_memory_context_release;dma_set_max_seg_size (&ctx->dev,UINT_MAX ); err =device_add (&ctx->dev);if (err) {dev_err (host1x->dev,"could not add context device %d: %d\n" , i, err); - goto del_devices; +put_device (&ctx->dev); + goto unreg_devices; } err =of_dma_configure_id (&ctx->dev, node, true, &i);if (err) {dev_err (host1x->dev,"IOMMU configuration failed for context device %d: %d\n" , i, err); -device_del (&ctx->dev); - goto del_devices; +device_unregister (&ctx->dev); + goto unreg_devices; } fwspec =dev_iommu_fwspec_get (&ctx->dev);if (!fwspec || !device_iommu_mapped (&ctx->dev)) {dev_err (host1x->dev,"Context device %d has no IOMMU!\n" , i); -device_del (&ctx->dev); - goto del_devices; +device_unregister (&ctx->dev); + goto unreg_devices; } ctx->stream_id = fwspec->ids[0 ] &0xffff ;
@@ -82,9 +89,9 @@ int host1x_memory_context_list_init(struct host1x *host1x)return 0 ; -del_devices: +unreg_devices:while (i--) -device_del (&cdl->devs[i].dev); +device_unregister (&cdl->devs[i].dev);kfree (cdl->devs); cdl->devs =NULL ;
@@ -98,7 +105,7 @@ void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl)unsigned int i;for (i =0 ; i < cdl->len; i++) -device_del (&cdl->devs[i].dev); +device_unregister (&cdl->devs[i].dev);kfree (cdl->devs); cdl->len =0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 215/663 arm64: dts: qcom: sc7280-herobrine-villager: correct trackpad supply
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit de88b1759b35086d5e63736fb604ea2d06486b1a ]
The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other Herobrine boards which use elan,ekth3000 with valid VCC:
sc7280-herobrine-villager-r1-lte.dtb: trackpad@2c: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280-herobrine-villager.dtsi +1 -1
@@ -33,7 +33,7 @@ ap_tp_i2c: &i2c0 { interrupts = <7 IRQ_TYPE_EDGE_FALLING>; hid-descr-addr = <0x20>; - vcc-supply = <&pp3300_z1>; + vdd-supply = <&pp3300_z1>; wakeup-source; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 216/663 arm64: dts: qcom: sc7180-trogdor-lazor: correct trackpad supply
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 52e2996f253d82520011340d40dbc1c76ea79208 ]
The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other boards which use elan,ekth3000 with valid VCC:
sc7180-trogdor-lazor-limozeen-nots-r4.dtb: trackpad@2c: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
--- .../boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dts +1 -1
@@ -26,7 +26,7 @@ interrupt-parent = <&tlmm>; interrupts = <58 IRQ_TYPE_EDGE_FALLING>; - vcc-supply = <&pp3300_fp_tp>; + vdd-supply = <&pp3300_fp_tp>; hid-descr-addr = <0x20>; wakeup-source;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 217/663 arm64: dts: qcom: sc7180-trogdor-pazquel: correct trackpad supply
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 24f39eec6a70768e7c2eb2f3d8158f45050ff75a ]
The hid-over-i2c takes VDD, not VCC supply. Fix copy-pasta from other boards which use elan,ekth3000 with valid VCC:
sc7180-trogdor-pazquel360-lte.dtb: trackpad@15: 'vcc-supply' does not match any of the regexes: 'pinctrl-[0-9]+'
--- arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7180-trogdor-pazquel.dtsi +1 -1
@@ -39,7 +39,7 @@ interrupt-parent = <&tlmm>; interrupts = <0 IRQ_TYPE_EDGE_FALLING>; - vcc-supply = <&pp3300_fp_tp>; + vdd-supply = <&pp3300_fp_tp>; post-power-on-delay-ms = <100>; hid-descr-addr = <0x0001>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 218/663 arm64: dts: qcom: msm8998-oneplus-cheeseburger: revert "fix backlight pin function"
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 97b4fdc6b82d6d5cfb92a9b164540278720fb700 ]
This reverts commit 46546f28825cf3a5ef6873b9cf947cd85c8a7258 because it mistakenly took PMIC pinctrl/GPIO as TLMM. The TLMM pinctrl uses "gpio" function, but PMIC uses "normal", so original code was correct:
msm8998-oneplus-cheeseburger.dtb: pmic@2: gpio@c000:button-backlight-state: 'oneOf' conditional failed, one must be fixed:
'gpio' is not one of ['normal', 'paired', 'func1', 'func2', 'dtest1', 'dtest2', 'dtest3', 'dtest4', 'func3', 'func4']
--- arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dts +1 -1
@@ -34,7 +34,7 @@ &pmi8998_gpio { button_backlight_default: button-backlight-state { pins = "gpio5"; - function = "gpio"; + function = "normal"; bias-pull-down; qcom,drive-strength = <PMIC_GPIO_STRENGTH_NO>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 219/663 arm64: dts: qcom: msm8994-kitakami: drop unit address from PMI8994 regulator
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 3555dd528ba9c08d6ccd56239c695dbeac3b63e3 ]
The PMIC regulators are not supposed to have unit addresses.
--- arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8994-sony-xperia-kitakami.dtsi +1 -2
@@ -173,8 +173,7 @@ * power domain.. which still isn't enough and forces us to bind * OXILI_CX and OXILI_GX together! */ - vdd_gfx: s2@1700 { - reg = <0x1700 0x100>; + vdd_gfx: s2 { regulator-name = "VDD_GFX"; regulator-min-microvolt = <980000>; regulator-max-microvolt = <980000>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 220/663 arm64: dts: qcom: msm8994-msft-lumia-octagon: drop unit address from PMI8994 regulator
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 7a202df0f3eed006e4a9e7c06d62cf67be56c14c ]
The PMIC regulators are not supposed to have unit addresses.
--- arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8994-msft-lumia-octagon.dtsi +1 -2
@@ -542,8 +542,7 @@ }; &pmi8994_spmi_regulators { - vdd_gfx: s2@1700 { - reg = <0x1700 0x100>; + vdd_gfx: s2 { regulator-min-microvolt = <980000>; regulator-max-microvolt = <980000>; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 221/663 arm64: dts: qcom: apq8096-db820c: drop unit address from PMI8994 regulator
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit ec57cbce1a6d9384f8ac1ff966b204dc262f4927 ]
The PMIC regulators are not supposed to have unit addresses.
--- arch/arm64/boot/dts/qcom/apq8096-db820c.dts | 3 +-- arch/arm64/boot/dts/qcom/pmi8994.dtsi | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/apq8096-db820c.dts +1 -2
@@ -706,8 +706,7 @@ &pmi8994_spmi_regulators { vdd_s2-supply = <&vph_pwr>; - vdd_gfx: s2@1700 { - reg = <0x1700 0x100>; + vdd_gfx: s2 { regulator-name = "VDD_GFX"; regulator-min-microvolt = <980000>; regulator-max-microvolt = <980000>;
arch/arm64/boot/dts/qcom/pmi8994.dtsi +0 -2
@@ -49,8 +49,6 @@ pmi8994_spmi_regulators: regulators { compatible = "qcom,pmi8994-regulators"; - #address-cells = <1>; - #size-cells = <1>; }; pmi8994_wled: wled@d800 {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 222/663 drm/ttm/pool: Fix ttm_pool_alloc error path
In reply to Greg Kroah-HartmanFrom: Thomas Hellström <[email protected]>
[ Upstream commit 379989e7cbdc7aa7496a00ee286ec146c7599cf0 ]
When hitting an error, the error path forgot to unmap dma mappings and could call set_pages_wb() on already uncached pages.
Fix this by introducing a common ttm_pool_free_range() function that does the right thing.
v2:
- Simplify that common function (Christian König)
v3:
- Rename that common function to ttm_pool_free_range() (Christian König)
--- drivers/gpu/drm/ttm/ttm_pool.c | 81 +++++++++++++++++++++------------- 1 file changed, 51 insertions(+), 30 deletions(-)
drivers/gpu/drm/ttm/ttm_pool.c +51 -30
@@ -366,6 +366,43 @@ static int ttm_pool_page_allocated(struct ttm_pool *pool, unsigned int order,return 0 ; } +/** +* ttm_pool_free_range() - Free a range of TTM pages +* @pool: The pool used for allocating. +* @tt: The struct ttm_tt holding the page pointers. +* @caching: The page caching mode used by the range. +* @start_page: index for first page to free. +* @end_page: index for last page to free + 1. +* +* During allocation the ttm_tt page-vector may be populated with ranges of +* pages with different attributes if allocation hit an error without being +* able to completely fulfill the allocation. This function can be used +* to free these individual ranges. +*/ +static void ttm_pool_free_range (struct ttm_pool *pool,struct ttm_tt *tt, +enum ttm_caching caching, +pgoff_t start_page,pgoff_t end_page) +{ +struct page **pages = tt->pages; +unsigned int order; +pgoff_t i, nr; + +for (i = start_page; i < end_page; i += nr, pages += nr) { +struct ttm_pool_type *pt =NULL ; + + order =ttm_pool_page_order (pool, *pages); + nr = (1UL << order); +if (tt->dma_address) +ttm_pool_unmap (pool, tt->dma_address[i], nr); + + pt =ttm_pool_select_type (pool, caching, order); +if (pt) +ttm_pool_type_give (pt, *pages); +else +ttm_pool_free_page (pool, caching, order, *pages); + } +} +/** * ttm_pool_alloc - Fill a ttm_tt object *
@@ -381,12 +418,14 @@ static int ttm_pool_page_allocated(struct ttm_pool *pool, unsigned int order,int ttm_pool_alloc (struct ttm_pool *pool,struct ttm_tt *tt,struct ttm_operation_ctx *ctx) { -unsigned long num_pages = tt->num_pages; +pgoff_t num_pages = tt->num_pages;dma_addr_t *dma_addr = tt->dma_address;struct page **caching = tt->pages;struct page **pages = tt->pages; +enum ttm_caching page_caching;gfp_t gfp_flags =GFP_USER ; -unsigned int i, order; +pgoff_t caching_divide; +unsigned int order;struct page *p;int r;
@@ -409,6 +448,7 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt, order = min_t(unsigned int, order, __fls(num_pages))) {struct ttm_pool_type *pt; + page_caching = tt->caching; pt =ttm_pool_select_type (pool, tt->caching, order); p = pt ?ttm_pool_type_take (pt) :NULL ;if (p) {
@@ -417,6 +457,7 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,if (r) goto error_free_page; + caching = pages; do { r = ttm_pool_page_allocated(pool, order, p, &dma_addr,
@@ -425,14 +466,15 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,if (r) goto error_free_page; + caching = pages;if (num_pages < (1 << order))break ; p =ttm_pool_type_take (pt); }while (p); - caching = pages; } + page_caching = ttm_cached;while (num_pages >= (1 << order) && (p =ttm_pool_alloc_page (pool, gfp_flags, order))) {
@@ -441,6 +483,7 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt, tt->caching);if (r) goto error_free_page; + caching = pages; } r =ttm_pool_page_allocated (pool, order, p, &dma_addr, &num_pages, &pages);
@@ -467,15 +510,13 @@ int ttm_pool_alloc(struct ttm_pool *pool, struct ttm_tt *tt,return 0 ; error_free_page: -ttm_pool_free_page (pool, tt->caching, order, p); +ttm_pool_free_page (pool, page_caching, order, p); error_free_all: num_pages = tt->num_pages - num_pages; -for (i =0 ; i < num_pages; ) { - order =ttm_pool_page_order (pool, tt->pages[i]); -ttm_pool_free_page (pool, tt->caching, order, tt->pages[i]); - i +=1 << order; - } + caching_divide = caching - tt->pages; +ttm_pool_free_range (pool, tt, tt->caching,0 , caching_divide); +ttm_pool_free_range (pool, tt, ttm_cached, caching_divide, num_pages);return r; }
@@ -491,27 +532,7 @@ EXPORT_SYMBOL(ttm_pool_alloc);*/ void ttm_pool_free (struct ttm_pool *pool,struct ttm_tt *tt) { -unsigned int i; - -for (i =0 ; i < tt->num_pages; ) { -struct page *p = tt->pages[i]; -unsigned int order, num_pages; -struct ttm_pool_type *pt; - - order =ttm_pool_page_order (pool, p); - num_pages =1ULL << order; -if (tt->dma_address) -ttm_pool_unmap (pool, tt->dma_address[i], num_pages); - - pt =ttm_pool_select_type (pool, tt->caching, order); -if (pt) -ttm_pool_type_give (pt, tt->pages[i]); -else -ttm_pool_free_page (pool, tt->caching, order, - tt->pages[i]); - - i += num_pages; - } +ttm_pool_free_range (pool, tt, tt->caching,0 , tt->num_pages);while (atomic_long_read (&allocated_pages) > page_pool_size)ttm_pool_shrink ();
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 223/663 regulator: core: Consistently set mutex_owner when using ww_mutex_lock_slow()
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit b83a1772be854f87602de14726737d3e5b06e1f4 ]
When a codepath locks a rdev using ww_mutex_lock_slow() directly then that codepath is responsible for incrementing the "ref_cnt" and also setting the "mutex_owner" to "current".
The regulator core consistently got that right for "ref_cnt" but didn't always get it right for "mutex_owner". Let's fix this.
It's unlikely that this truly matters because the "mutex_owner" is only needed if we're going to do subsequent locking of the same rdev. However, even though it's not truly needed it seems less surprising if we consistently set "mutex_owner" properly.
--- drivers/regulator/core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/regulator/core.c +2 -0
@@ -334,6 +334,7 @@ static void regulator_lock_dependent(struct regulator_dev *rdev,ww_mutex_lock_slow (&new_contended_rdev->mutex, ww_ctx); old_contended_rdev = new_contended_rdev; old_contended_rdev->ref_cnt++; + old_contended_rdev->mutex_owner = current; } err = regulator_lock_recursive(rdev,
@@ -6048,6 +6049,7 @@ static void regulator_summary_lock(struct ww_acquire_ctx *ww_ctx)ww_mutex_lock_slow (&new_contended_rdev->mutex, ww_ctx); old_contended_rdev = new_contended_rdev; old_contended_rdev->ref_cnt++; + old_contended_rdev->mutex_owner = current; } err = regulator_summary_lock_all(ww_ctx,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 224/663 regulator: core: Avoid lockdep reports when resolving supplies
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit cba6cfdc7c3f1516f0d08ddfb24e689af0932573 ]
An automated bot told me that there was a potential lockdep problem
with regulators. This was on the chromeos-5.15 kernel, but I see
nothing that would be different downstream compared to upstream. The
bot said:
============================================
WARNING: possible recursive locking detected 5.15.104-lockdep-17461-gc1e499ed6604 #1 Not tainted
--------------------------------------------
kworker/u16:4/115 is trying to acquire lock:
ffffff8083110170 (regulator_ww_class_mutex){+.+.}-{3:3}, at: create_regulator+0x398/0x7ec
but task is already holding lock:
ffffff808378e170 (regulator_ww_class_mutex){+.+.}-{3:3}, at: ww_mutex_trylock+0x3c/0x7b8
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
----
lock(regulator_ww_class_mutex);
lock(regulator_ww_class_mutex);*** DEADLOCK ***
May be due to missing lock nesting notation
4 locks held by kworker/u16:4/115:
#0: ffffff808006a948 ((wq_completion)events_unbound){+.+.}-{0:0}, at: process_one_work+0x520/0x1348 #1: ffffffc00e0a7cc0 ((work_completion)(&entry->work)){+.+.}-{0:0}, at: process_one_work+0x55c/0x1348 #2: ffffff80828a2260 (&dev->mutex){....}-{3:3}, at: __device_attach_async_helper+0xd0/0x2a4 #3: ffffff808378e170 (regulator_ww_class_mutex){+.+.}-{3:3}, at: ww_mutex_trylock+0x3c/0x7b8
stack backtrace: CPU: 2 PID: 115 Comm: kworker/u16:4 Not tainted 5.15.104-lockdep-17461-gc1e499ed6604 #1 9292e52fa83c0e23762b2b3aa1bacf5787a4d5da Hardware name: Google Quackingstick (rev0+) (DT) Workqueue: events_unbound async_run_entry_fn Call trace: dump_backtrace+0x0/0x4ec show_stack+0x34/0x50 dump_stack_lvl+0xdc/0x11c dump_stack+0x1c/0x48 __lock_acquire+0x16d4/0x6c74 lock_acquire+0x208/0x750 __mutex_lock_common+0x11c/0x11f8 ww_mutex_lock+0xc0/0x440 create_regulator+0x398/0x7ec regulator_resolve_supply+0x654/0x7c4 regulator_register_resolve_supply+0x30/0x120 class_for_each_device+0x1b8/0x230 regulator_register+0x17a4/0x1f40 devm_regulator_register+0x60/0xd0 reg_fixed_voltage_probe+0x728/0xaec platform_probe+0x150/0x1c8 really_probe+0x274/0xa20 __driver_probe_device+0x1dc/0x3f4 driver_probe_device+0x78/0x1c0 __device_attach_driver+0x1ac/0x2c8 bus_for_each_drv+0x11c/0x190 __device_attach_async_helper+0x1e4/0x2a4 async_run_entry_fn+0xa0/0x3ac process_one_work+0x638/0x1348 worker_thread+0x4a8/0x9c4 kthread+0x2e4/0x3a0 ret_from_fork+0x10/0x20
The problem was first reported soon after we made many of the regulators probe asynchronously, though nothing I've seen implies that the problems couldn't have also happened even without that.
I haven't personally been able to reproduce the lockdep issue, but the issue does look somewhat legitimate. Specifically, it looks like in regulator_resolve_supply() we are holding a "rdev" lock while calling set_supply() -> create_regulator() which grabs the lock of a _different_ "rdev" (the one for our supply). This is not necessarily safe from a lockdep perspective since there is no documented ordering between these two locks.
In reality, we should always be locking a regulator before the supplying regulator, so I don't expect there to be any real deadlocks in practice. However, the regulator framework in general doesn't express this to lockdep.
Let's fix the issue by simply grabbing the two locks involved in the same way we grab multiple locks elsewhere in the regulator framework:
using the "wound/wait" mechanisms.
--- drivers/regulator/core.c | 91 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 83 insertions(+), 8 deletions(-)
drivers/regulator/core.c +83 -8
@@ -207,6 +207,78 @@ static void regulator_unlock(struct regulator_dev *rdev)mutex_unlock (®ulator_nesting_mutex); } +/** +* regulator_lock_two - lock two regulators +* @rdev1: first regulator +* @rdev2: second regulator +* @ww_ctx: w/w mutex acquire context +* +* Locks both rdevs using the regulator_ww_class. +*/ +static void regulator_lock_two (struct regulator_dev *rdev1, +struct regulator_dev *rdev2, +struct ww_acquire_ctx *ww_ctx) +{ +struct regulator_dev *tmp; +int ret; + +ww_acquire_init (ww_ctx, ®ulator_ww_class); + +/* Try to just grab both of them */ + ret =regulator_lock_nested (rdev1, ww_ctx); +WARN_ON (ret); + ret =regulator_lock_nested (rdev2, ww_ctx); +if (ret != -EDEADLOCK ) { +WARN_ON (ret); + goto exit; + } + +while (true) { +/* +* Start of loop: rdev1 was locked and rdev2 was contended. +* Need to unlock rdev1, slowly lock rdev2, then try rdev1 +* again. +*/ +regulator_unlock (rdev1); + +ww_mutex_lock_slow (&rdev2->mutex, ww_ctx); + rdev2->ref_cnt++; + rdev2->mutex_owner = current; + ret =regulator_lock_nested (rdev1, ww_ctx); + +if (ret == -EDEADLOCK ) { +/* More contention; swap which needs to be slow */ + tmp = rdev1; + rdev1 = rdev2; + rdev2 = tmp; + }else { +WARN_ON (ret); +break ; + } + } + +exit: +ww_acquire_done (ww_ctx); +} + +/** +* regulator_unlock_two - unlock two regulators +* @rdev1: first regulator +* @rdev2: second regulator +* @ww_ctx: w/w mutex acquire context +* +* The inverse of regulator_lock_two(). +*/ + +static void regulator_unlock_two (struct regulator_dev *rdev1, +struct regulator_dev *rdev2, +struct ww_acquire_ctx *ww_ctx) +{ +regulator_unlock (rdev2); +regulator_unlock (rdev1); +ww_acquire_fini (ww_ctx); +} +static bool regulator_supply_is_couple (struct regulator_dev *rdev) {struct regulator_dev *c_rdev;
@@ -1627,8 +1699,8 @@ static int set_machine_constraints(struct regulator_dev *rdev)/** * set_supply - set regulator supply regulator -* @rdev: regulator name -* @supply_rdev: supply regulator name +* @rdev: regulator (locked) +* @supply_rdev: supply regulator (locked)) * * Called by platform initialisation code to set the supply regulator for this * regulator. This ensures that a regulators supply will also be enabled by the
@@ -1800,6 +1872,8 @@ static struct regulator *create_regulator(struct regulator_dev *rdev,struct regulator *regulator;int err =0 ; +lockdep_assert_held_once (&rdev->mutex.base); +if (dev) {char buf[REG_STR_SIZE ];int size;
@@ -1827,9 +1901,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, regulator->rdev = rdev; regulator->supply_name = supply_name; -regulator_lock (rdev);list_add (®ulator->list, &rdev->consumer_list); -regulator_unlock (rdev);if (dev) { regulator->dev = dev;
@@ -1995,6 +2067,7 @@ static int regulator_resolve_supply(struct regulator_dev *rdev) {struct regulator_dev *r;struct device *dev = rdev->dev.parent; +struct ww_acquire_ctx ww_ctx;int ret =0 ;/* No supply to resolve? */
@@ -2061,23 +2134,23 @@ static int regulator_resolve_supply(struct regulator_dev *rdev)* between rdev->supply null check and setting rdev->supply in * set_supply() from concurrent tasks. */ -regulator_lock (rdev); +regulator_lock_two (rdev, r, &ww_ctx);/* Supply just resolved by a concurrent task? */ if (rdev->supply) { -regulator_unlock (rdev); +regulator_unlock_two (rdev, r, &ww_ctx);put_device (&r->dev); goto out; } ret =set_supply (rdev, r);if (ret <0 ) { -regulator_unlock (rdev); +regulator_unlock_two (rdev, r, &ww_ctx);put_device (&r->dev); goto out; } -regulator_unlock (rdev); +regulator_unlock_two (rdev, r, &ww_ctx);/* * In set_machine_constraints() we may have turned this regulator on
@@ -2190,7 +2263,9 @@ struct regulator *_regulator_get(struct device *dev, const char *id,return regulator; } +regulator_lock (rdev); regulator =create_regulator (rdev, dev, id); +regulator_unlock (rdev);if (regulator ==NULL ) { regulator =ERR_PTR (-ENOMEM );module_put (rdev->owner);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 225/663 x86/apic: Fix atomic update of offset in reserve_eilvt_offset()
In reply to Greg Kroah-HartmanFrom: Uros Bizjak <[email protected]>
[ Upstream commit f96fb2df3eb31ede1b34b0521560967310267750 ]
The detection of atomic update failure in reserve_eilvt_offset() is not correct. The value returned by atomic_cmpxchg() should be compared to the old value from the location to be updated.
If these two are the same, then atomic update succeeded and "eilvt_offsets[offset]" location is updated to "new" in an atomic way.
Otherwise, the atomic update failed and it should be retried with the value from "eilvt_offsets[offset]" - exactly what atomic_try_cmpxchg() does in a correct and more optimal way.
--- arch/x86/kernel/apic/apic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/x86/kernel/apic/apic.c +2 -3
@@ -422,10 +422,9 @@ static unsigned int reserve_eilvt_offset(int offset, unsigned int new)if (vector && !eilvt_entry_is_changeable (vector, new))/* may not change if vectors are different */ return rsvd; - rsvd =atomic_cmpxchg (&eilvt_offsets[offset], rsvd, new); - }while (rsvd != new); + }while (!atomic_try_cmpxchg (&eilvt_offsets[offset], &rsvd, new)); - rsvd &= ~APIC_EILVT_MASKED ; + rsvd = new & ~APIC_EILVT_MASKED ;if (rsvd && rsvd != vector)pr_info ("LVT offset %d assigned for vector 0x%02x\n" , offset, rsvd);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 226/663 soc: qcom: rpmh-rsc: Support RSC v3 minor versions
In reply to Greg Kroah-HartmanFrom: Tushar Nimkar <[email protected]>
[ Upstream commit 88704a0cd71909c3107561261412a5d5beb23358 ]
RSC v3 register offsets are same for all minor versions of v3. Fix a minor version check to pick correct offsets for all v3 minor versions.
--- drivers/soc/qcom/rpmh-rsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/rpmh-rsc.c +1 -1
@@ -1073,7 +1073,7 @@ static int rpmh_rsc_probe(struct platform_device *pdev) drv->ver.minor = rsc_id & (MINOR_VER_MASK <<MINOR_VER_SHIFT ); drv->ver.minor >>=MINOR_VER_SHIFT ; -if (drv->ver.major ==3 && drv->ver.minor ==0 ) +if (drv->ver.major ==3 && drv->ver.minor >=0 ) drv->regs = rpmh_rsc_reg_offset_ver_3_0;else drv->regs = rpmh_rsc_reg_offset_ver_2_7;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 227/663 arm64: dts: qcom: msm8994-angler: Fix cont_splash_mem mapping
In reply to Greg Kroah-HartmanFrom: Petr Vorel <[email protected]>
[ Upstream commit fe88480a6be92ecbf6f205ff3a7d7e5ded0562dd ]
Angler's cont_splash_mem mapping is shorter in downstream [1], therefore 380cd3a34b7f was wrong. Obviously also 0e5ded926f2a was wrong (workaround which fixed booting at the time).
This fixes error:
[ 0.000000] memory@3401000 (0x0000000003401000--0x0000000005601000) overlaps with tzapp@4800000 (0x0000000004800000--0x0000000006100000)
--- arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts +6 -1
@@ -2,7 +2,7 @@ /* * Copyright (c) 2015, Huawei Inc. All rights reserved. * Copyright (c) 2016, The Linux Foundation. All rights reserved. - * Copyright (c) 2021-2022, Petr Vorel <[email protected]> + * Copyright (c) 2021-2023, Petr Vorel <[email protected]> */ /dts-v1/;
@@ -31,6 +31,11 @@ #size-cells = <2>; ranges; + cont_splash_mem: memory@3401000 { + reg = <0 0x03401000 0 0x1000000>; + no-map; + }; + tzapp_mem: tzapp@4800000 { reg = <0 0x04800000 0 0x1900000>; no-map;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 228/663 arm64: dts: qcom: msm8994-angler: removed clash with smem_region
In reply to Greg Kroah-HartmanFrom: Petr Vorel <[email protected]>
[ Upstream commit c85c8a992794dfcd7cea7a41871710c27c5592a6 ]
This fixes memory overlap error:
[ 0.000000] reserved@6300000 (0x0000000006300000--0x0000000007000000) overlaps with smem_region@6a00000 (0x0000000006a00000--0x0000000006c00000)
smem_region is the same as in downstream (qcom,smem) [1], therefore split reserved memory into two sections on either side of smem_region.
Not adding labels as it's not expected to be used.
--- arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi | 5 ----- arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts | 4 ++-- arch/arm64/boot/dts/qcom/msm8994.dtsi | 5 +++++ 3 files changed, 7 insertions(+), 7 deletions(-)
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi +0 -5
@@ -60,11 +60,6 @@ reg = <0x0 0x05000000 0x0 0x1a00000>; no-map; }; - - reserved@6c00000 { - reg = <0x0 0x06c00000 0x0 0x400000>; - no-map; - }; }; };
arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts +2 -2
@@ -41,8 +41,8 @@ no-map; }; - removed_region: reserved@6300000 { - reg = <0 0x06300000 0 0xD00000>; + reserved@6300000 { + reg = <0 0x06300000 0 0x700000>; no-map; }; };
arch/arm64/boot/dts/qcom/msm8994.dtsi +5 -0
@@ -228,6 +228,11 @@ reg = <0 0xc9400000 0 0x3f00000>; no-map; }; + + reserved@6c00000 { + reg = <0 0x06c00000 0 0x400000>; + no-map; + }; }; smd {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 229/663 arm64: dts: sc7180: Rename qspi data12 as data23
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit d84f8f2687bdc67f20262e822b206419bcfd0038 ]
There are 4 qspi data pins: data0, data1, data2, and data3. Currently we have a shared pin state for data0 and data1 (2 lane config) and a pin state for data2 and data3 (you'd enable both this and the 2 lane state for 4 lanes). The second state is obviously misnamed. Fix it.
--- arch/arm64/boot/dts/qcom/sc7180.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7180.dtsi +1 -1
@@ -1512,7 +1512,7 @@ function = "qspi_data"; }; - qspi_data12: qspi-data12-state { + qspi_data23: qspi-data23-state { pins = "gpio66", "gpio67"; function = "qspi_data"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 230/663 arm64: dts: sc7280: Rename qspi data12 as data23
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 14acf21c0d3f7b7298ffcd2e5b5db4a476ec6202 ]
There are 4 qspi data pins: data0, data1, data2, and data3. Currently we have a shared pin state for data0 and data1 (2 lane config) and a pin state for data2 and data3 (you'd enable both this and the 2 lane state for 4 lanes). The second state is obviously misnamed. Fix it.
--- arch/arm64/boot/dts/qcom/sc7280.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sc7280.dtsi +1 -1
@@ -4349,7 +4349,7 @@ function = "qspi_data"; }; - qspi_data12: qspi-data12-state { + qspi_data23: qspi-data23-state { pins = "gpio16", "gpio17"; function = "qspi_data"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 231/663 arm64: dts: sdm845: Rename qspi data12 as data23
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 37f7349b56decc91c66f8039712e63740b1f25f9 ]
There are 4 qspi data pins: data0, data1, data2, and data3. Currently we have a shared pin state for data0 and data1 (2 lane config) and a pin state for data2 and data3 (you'd enable both this and the 2 lane state for 4 lanes). The second state is obviously misnamed. Fix it.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -1
@@ -2705,7 +2705,7 @@ }; }; - qspi_data12: qspi-data12 { + qspi_data23: qspi-data23 { pinmux-data { pins = "gpio93", "gpio94"; function = "qspi_data";
Greg Kroah-Hartman
maintainerPATCH 232/663 media: mtk-jpeg: Fixes jpeghw multi-core judgement
In reply to Greg Kroah-HartmanFrom: kyrie wu <[email protected]>
[ Upstream commit 75c38caf66a10983acc5a59069bfc9492c43d682 ]
some chips have multi-hw, but others have only one, modify the condition of multi-hw judgement
--- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c | 5 ++++- drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +4 -1
@@ -1692,7 +1692,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)return -EINVAL ; } -if (list_empty (&pdev->dev.devres_head)) { +if (!jpeg->variant->multi_core) {INIT_DELAYED_WORK (&jpeg->job_timeout_work, mtk_jpeg_job_timeout_work);
@@ -1874,6 +1874,7 @@ static const struct mtk_jpeg_variant mtk_jpeg_drvdata = { .ioctl_ops = &mtk_jpeg_enc_ioctl_ops, .out_q_default_fourcc = V4L2_PIX_FMT_YUYV, .cap_q_default_fourcc = V4L2_PIX_FMT_JPEG, + .multi_core = false, };static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = {
@@ -1885,6 +1886,7 @@ static struct mtk_jpeg_variant mtk8195_jpegenc_drvdata = { .ioctl_ops = &mtk_jpeg_enc_ioctl_ops, .out_q_default_fourcc = V4L2_PIX_FMT_YUYV, .cap_q_default_fourcc = V4L2_PIX_FMT_JPEG, + .multi_core = true, };static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = {
@@ -1896,6 +1898,7 @@ static const struct mtk_jpeg_variant mtk8195_jpegdec_drvdata = { .ioctl_ops = &mtk_jpeg_dec_ioctl_ops, .out_q_default_fourcc = V4L2_PIX_FMT_JPEG, .cap_q_default_fourcc = V4L2_PIX_FMT_YUV420M, + .multi_core = true, };#if defined(CONFIG_OF )
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.h +2 -0
@@ -60,6 +60,7 @@ enum mtk_jpeg_ctx_state {* @ioctl_ops: the callback of jpeg v4l2_ioctl_ops * @out_q_default_fourcc: output queue default fourcc * @cap_q_default_fourcc: capture queue default fourcc +* @multi_core: mark jpeg hw is multi_core or not */ struct mtk_jpeg_variant {struct clk_bulk_data *clks;
@@ -74,6 +75,7 @@ struct mtk_jpeg_variant {const struct v4l2_ioctl_ops *ioctl_ops;u32 out_q_default_fourcc;u32 cap_q_default_fourcc; +bool multi_core; };struct mtk_jpeg_src_buf {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 233/663 media: mtk-jpeg: Fixes jpeg enc&dec worker sw flow
In reply to Greg Kroah-HartmanFrom: kyrie wu <[email protected]>
[ Upstream commit 86379bd9d399e2c5fd638a869af223d4910725c3 ]
1. Move removing buffer after sw setting and before hw setting in enc&dec worker to prevents the operation of removing the buffer twice if the sw setting fails.
2. Remove the redundant operation of queue work in the jpegenc irq handler because the jpegenc worker has called v4l2_m2m_job_finish to do it.
--- .../media/platform/mediatek/jpeg/mtk_jpeg_core.c | 14 +++++++------- .../media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c | 4 ---- 2 files changed, 7 insertions(+), 11 deletions(-)
drivers/media/platform/mediatek/jpeg/mtk_jpeg_core.c +7 -7
@@ -1025,9 +1025,6 @@ static void mtk_jpegenc_worker(struct work_struct *work)if (!dst_buf) goto getbuf_fail; -v4l2_m2m_src_buf_remove (ctx->fh.m2m_ctx); -v4l2_m2m_dst_buf_remove (ctx->fh.m2m_ctx); -v4l2_m2m_buf_copy_metadata (src_buf, dst_buf, true);mtk_jpegenc_set_hw_param (ctx, hw_id, src_buf, dst_buf);
@@ -1045,6 +1042,9 @@ static void mtk_jpegenc_worker(struct work_struct *work) goto enc_end; } +v4l2_m2m_src_buf_remove (ctx->fh.m2m_ctx); +v4l2_m2m_dst_buf_remove (ctx->fh.m2m_ctx); +schedule_delayed_work (&comp_jpeg[hw_id]->job_timeout_work,msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC ));
@@ -1220,9 +1220,6 @@ static void mtk_jpegdec_worker(struct work_struct *work)if (!dst_buf) goto getbuf_fail; -v4l2_m2m_src_buf_remove (ctx->fh.m2m_ctx); -v4l2_m2m_dst_buf_remove (ctx->fh.m2m_ctx); -v4l2_m2m_buf_copy_metadata (src_buf, dst_buf, true); jpeg_src_buf =mtk_jpeg_vb2_to_srcbuf (&src_buf->vb2_buf); jpeg_dst_buf =mtk_jpeg_vb2_to_srcbuf (&dst_buf->vb2_buf);
@@ -1231,7 +1228,7 @@ static void mtk_jpegdec_worker(struct work_struct *work) &jpeg_src_buf->dec_param)) {mtk_jpeg_queue_src_chg_event (ctx); ctx->state =MTK_JPEG_SOURCE_CHANGE ; - goto dec_end; + goto getbuf_fail; } jpeg_src_buf->curr_ctx = ctx;
@@ -1254,6 +1251,9 @@ static void mtk_jpegdec_worker(struct work_struct *work) goto clk_end; } +v4l2_m2m_src_buf_remove (ctx->fh.m2m_ctx); +v4l2_m2m_dst_buf_remove (ctx->fh.m2m_ctx); +schedule_delayed_work (&comp_jpeg[hw_id]->job_timeout_work,msecs_to_jiffies (MTK_JPEG_HW_TIMEOUT_MSEC ));
drivers/media/platform/mediatek/jpeg/mtk_jpeg_enc_hw.c +0 -4
@@ -286,10 +286,6 @@ static irqreturn_t mtk_jpegenc_hw_irq_handler(int irq, void *priv)mtk_jpegenc_put_buf (jpeg);pm_runtime_put (ctx->jpeg->dev);clk_disable_unprepare (jpeg->venc_clk.clks->clk); -if (!list_empty (&ctx->fh.m2m_ctx->out_q_ctx.rdy_queue) || - !list_empty (&ctx->fh.m2m_ctx->cap_q_ctx.rdy_queue)) { -queue_work (master_jpeg->workqueue, &ctx->jpeg_work); - } jpeg->hw_state =MTK_JPEG_HW_IDLE ;wake_up (&master_jpeg->enc_hw_wq);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 234/663 media: mediatek: vcodec: Use 4K frame size when supported by stateful decoder
In reply to Greg Kroah-HartmanFrom: Pin-yen Lin <[email protected]>
[ Upstream commit e25528e1dbe52784ac250071653104a8adc848e2 ]
After commit b018be06f3c7 ("media: mediatek: vcodec: Read max resolution from dec_capability"), the stateful video decoder driver never really sets its output frame size to 4K.
Parse the decoder capability reported by the firmware, and update the output frame size in mtk_init_vdec_params to enable 4K frame size when available.
--- .../mediatek/vcodec/mtk_vcodec_dec_stateful.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateful.c +11 -1
@@ -11,7 +11,7 @@#include "mtk_vcodec_dec_pm.h" #include "vdec_drv_if.h" -static const struct mtk_video_fmt mtk_video_formats[] = { +static struct mtk_video_fmt mtk_video_formats[] = { { .fourcc =V4L2_PIX_FMT_H264 , .type =MTK_FMT_DEC ,
@@ -580,6 +580,16 @@ static int mtk_vcodec_dec_ctrls_setup(struct mtk_vcodec_ctx *ctx)static void mtk_init_vdec_params (struct mtk_vcodec_ctx *ctx) { +unsigned int i; + +if (!(ctx->dev->dec_capability &VCODEC_CAPABILITY_4K_DISABLED )) { +for (i =0 ; i < num_supported_formats; i++) { + mtk_video_formats[i].frmsize.max_width = +VCODEC_DEC_4K_CODED_WIDTH ; + mtk_video_formats[i].frmsize.max_height = +VCODEC_DEC_4K_CODED_HEIGHT ; + } + } }static struct vb2_ops mtk_vdec_frame_vb2_ops = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 235/663 media: mediatek: vcodec: Make MM21 the default capture format
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit 6d020d81b91af80a977061e82de25cafa4456af5 ]
Given that only the MM21 capture format is supported by userspace tools (like gstreamer and libyuv), make it the default capture format.
This allows us to force the MM21 format even when a MM21 and MT21C capable firmware is available (which is needed while dynamic format switching isn't implemented in the driver), without causing the following regressions on v4l2-compliance:
fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT
test VIDIOC_G_FMT: FAIL
fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT
test VIDIOC_TRY_FMT: FAIL
fail: v4l2-test-formats.cpp(478): pixelformat 3132544d (MT21) for buftype 9 not reported by ENUM_FMT
test VIDIOC_S_FMT: FAIL
--- .../platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c +4 -4
@@ -390,14 +390,14 @@ static void mtk_vcodec_get_supported_formats(struct mtk_vcodec_ctx *ctx)if (num_formats)return ; -if (ctx->dev->dec_capability &MTK_VDEC_FORMAT_MM21 ) { -mtk_vcodec_add_formats (V4L2_PIX_FMT_MM21 , ctx); - cap_format_count++; - }if (ctx->dev->dec_capability &MTK_VDEC_FORMAT_MT21C ) {mtk_vcodec_add_formats (V4L2_PIX_FMT_MT21C , ctx); cap_format_count++; } +if (ctx->dev->dec_capability &MTK_VDEC_FORMAT_MM21 ) { +mtk_vcodec_add_formats (V4L2_PIX_FMT_MM21 , ctx); + cap_format_count++; + }if (ctx->dev->dec_capability &MTK_VDEC_FORMAT_H264_SLICE ) {mtk_vcodec_add_formats (V4L2_PIX_FMT_H264_SLICE , ctx); out_format_count++;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 236/663 media: mediatek: vcodec: Force capture queue format to MM21
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit 68c7df527657a9e962da7b5b9c0308557357d8dc ]
While the decoder can produce frames in both MM21 and MT21C formats, only MM21 is currently supported by userspace tools (like gstreamer and libyuv). In order to ensure userspace keeps working after the SCP firmware is updated to support both MM21 and MT21C formats, force the MM21 format for the capture queue.
This is meant as a stopgap solution while dynamic format switching between MM21 and MT21C isn't implemented in the driver.
--- .../platform/mediatek/vcodec/mtk_vcodec_dec.c | 24 +++---------------- 1 file changed, 3 insertions(+), 21 deletions(-)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec.c +3 -21
@@ -39,10 +39,9 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index) {const struct mtk_vcodec_dec_pdata *dec_pdata = ctx->dev->vdec_pdata;const struct mtk_video_fmt *fmt; -struct mtk_q_data *q_data;int num_frame_count =0 , i; -bool ret = true; + fmt = &dec_pdata->vdec_formats[format_index];for (i =0 ; i < *dec_pdata->num_formats; i++) {if (dec_pdata->vdec_formats[i].type !=MTK_FMT_FRAME )continue ;
@@ -50,27 +49,10 @@ static bool mtk_vdec_get_cap_fmt(struct mtk_vcodec_ctx *ctx, int format_index) num_frame_count++; } -if (num_frame_count ==1 ) +if (num_frame_count ==1 || fmt->fourcc ==V4L2_PIX_FMT_MM21 )return true; - fmt = &dec_pdata->vdec_formats[format_index]; - q_data = &ctx->q_data[MTK_Q_DATA_SRC ]; -switch (q_data->fmt->fourcc) { -case V4L2_PIX_FMT_VP8_FRAME : -if (fmt->fourcc ==V4L2_PIX_FMT_MM21 ) - ret = true; -break ; -case V4L2_PIX_FMT_H264_SLICE : -case V4L2_PIX_FMT_VP9_FRAME : -if (fmt->fourcc ==V4L2_PIX_FMT_MM21 ) - ret = false; -break ; -default : - ret = true; -break ; - } - -return ret; +return false; } static struct mtk_q_data *mtk_vdec_get_q_data(struct mtk_vcodec_ctx *ctx,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 237/663 media: mediatek: vcodec: add params to record lat and core lat_buf count
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit 5bbb6e2ca67477ab41163b32e6b3444faea74a5e ]
Using lat_buf to share decoder information between lat and core work queue, adding params to record the buf count.
--- .../platform/mediatek/vcodec/vdec_msg_queue.c | 23 ++++++++++++++++++- .../platform/mediatek/vcodec/vdec_msg_queue.h | 6 +++++ 2 files changed, 28 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +22 -1
@@ -52,6 +52,22 @@ static struct list_head *vdec_get_buf_list(int hardware_index, struct vdec_lat_b } } +static void vdec_msg_queue_inc (struct vdec_msg_queue *msg_queue,int hardware_index) +{ +if (hardware_index ==MTK_VDEC_CORE ) +atomic_inc (&msg_queue->core_list_cnt); +else +atomic_inc (&msg_queue->lat_list_cnt); +} + +static void vdec_msg_queue_dec (struct vdec_msg_queue *msg_queue,int hardware_index) +{ +if (hardware_index ==MTK_VDEC_CORE ) +atomic_dec (&msg_queue->core_list_cnt); +else +atomic_dec (&msg_queue->lat_list_cnt); +} +int vdec_msg_queue_qbuf (struct vdec_msg_queue_ctx *msg_ctx,struct vdec_lat_buf *buf) {struct list_head *head;
@@ -66,6 +82,7 @@ int vdec_msg_queue_qbuf(struct vdec_msg_queue_ctx *msg_ctx, struct vdec_lat_buflist_add_tail (head, &msg_ctx->ready_queue); msg_ctx->ready_num++; +vdec_msg_queue_inc (&buf->ctx->msg_queue, msg_ctx->hardware_index);if (msg_ctx->hardware_index !=MTK_VDEC_CORE )wake_up_all (&msg_ctx->ready_to_use);else
@@ -127,6 +144,7 @@ struct vdec_lat_buf *vdec_msg_queue_dqbuf(struct vdec_msg_queue_ctx *msg_ctx)return NULL ; }list_del (head); +vdec_msg_queue_dec (&buf->ctx->msg_queue, msg_ctx->hardware_index); msg_ctx->ready_num--; mtk_v4l2_debug(3, "dqueue buf type:%d addr: 0x%p num: %d",
@@ -241,10 +259,13 @@ int vdec_msg_queue_init(struct vdec_msg_queue *msg_queue,vdec_msg_queue_init_ctx (&msg_queue->lat_ctx,MTK_VDEC_LAT0 );INIT_WORK (&msg_queue->core_work, vdec_msg_queue_core_work); + +atomic_set (&msg_queue->lat_list_cnt,0 ); +atomic_set (&msg_queue->core_list_cnt,0 ); + msg_queue->wdma_addr.size =vde_msg_queue_get_trans_size (ctx->picinfo.buf_w, ctx->picinfo.buf_h); - err =mtk_vcodec_mem_alloc (ctx, &msg_queue->wdma_addr);if (err) {mtk_v4l2_err ("failed to allocate wdma_addr buf" );
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h +6 -0
@@ -72,6 +72,9 @@ struct vdec_lat_buf {* @wdma_wptr_addr: ube write point * @core_work: core hardware work * @lat_ctx: used to store lat buffer list +* +* @lat_list_cnt: used to record each instance lat list count +* @core_list_cnt: used to record each instance core list count */ struct vdec_msg_queue {struct vdec_lat_buf lat_buf[NUM_BUFFER_COUNT ];
@@ -82,6 +85,9 @@ struct vdec_msg_queue {struct work_struct core_work;struct vdec_msg_queue_ctx lat_ctx; + +atomic_t lat_list_cnt; +atomic_t core_list_cnt; };/**
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 238/663 media: mediatek: vcodec: using each instance lat_buf count replace core ready list
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit f7a3780cf96925670736582b9a623a2c9ffb4166 ]
Core Hardware decoder depends on each instance lat_buf count, calling queue_work decode again when the lat_buf count of each instance isn't zero.
--- drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +1 -1
@@ -239,7 +239,7 @@ static void vdec_msg_queue_core_work(struct work_struct *work)mtk_vcodec_dec_disable_hardware (ctx,MTK_VDEC_CORE );vdec_msg_queue_qbuf (&ctx->msg_queue.lat_ctx, lat_buf); -if (!list_empty (&dev->msg_queue_core_ctx.ready_queue)) { +if (atomic_read (&lat_buf->ctx->msg_queue.core_list_cnt)) {mtk_v4l2_debug (3 ,"re-schedule to decode for core: %d" , dev->msg_queue_core_ctx.ready_num);queue_work (dev->core_workqueue, &msg_queue->core_work);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 239/663 media: mediatek: vcodec: move lat_buf to the top of core list
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit 2cfca6c1bf8074175ea7a3b6b47f77ebdef8f701 ]
Current instance will decode done when begin to wait lat buf full, move the lat_buf of current instance to the top of core list to make sure current instance's lat_buf will be used firstly.
--- .../platform/mediatek/vcodec/vdec_msg_queue.c | 21 ++++++++++++++++++- .../platform/mediatek/vcodec/vdec_msg_queue.h | 2 ++ 2 files changed, 22 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +20 -1
@@ -174,8 +174,26 @@ void vdec_msg_queue_update_ube_wptr(struct vdec_msg_queue *msg_queue, uint64_t ubool vdec_msg_queue_wait_lat_buf_full (struct vdec_msg_queue *msg_queue) { +struct vdec_lat_buf *buf, *tmp; +struct list_head *list_core[3 ]; +struct vdec_msg_queue_ctx *core_ctx; +int ret, i, in_core_count =0 ;long timeout_jiff; -int ret; + + core_ctx = &msg_queue->ctx->dev->msg_queue_core_ctx; +spin_lock (&core_ctx->ready_lock); +list_for_each_entry_safe (buf, tmp, &core_ctx->ready_queue, core_list) { +if (buf && buf->ctx == msg_queue->ctx) { + list_core[in_core_count++] = &buf->core_list; +list_del (&buf->core_list); + } + } + +for (i =0 ; i < in_core_count; i++) { +list_add (list_core[in_core_count - (1 + i)], &core_ctx->ready_queue); +queue_work (msg_queue->ctx->dev->core_workqueue, &msg_queue->core_work); + } +spin_unlock (&core_ctx->ready_lock); timeout_jiff =msecs_to_jiffies (1000 * (NUM_BUFFER_COUNT +2 )); ret = wait_event_timeout(msg_queue->lat_ctx.ready_to_use,
@@ -257,6 +275,7 @@ int vdec_msg_queue_init(struct vdec_msg_queue *msg_queue,if (msg_queue->wdma_addr.size)return 0 ; + msg_queue->ctx = ctx;vdec_msg_queue_init_ctx (&msg_queue->lat_ctx,MTK_VDEC_LAT0 );INIT_WORK (&msg_queue->core_work, vdec_msg_queue_core_work);
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h +2 -0
@@ -72,6 +72,7 @@ struct vdec_lat_buf {* @wdma_wptr_addr: ube write point * @core_work: core hardware work * @lat_ctx: used to store lat buffer list +* @ctx: point to mtk_vcodec_ctx * * @lat_list_cnt: used to record each instance lat list count * @core_list_cnt: used to record each instance core list count
@@ -85,6 +86,7 @@ struct vdec_msg_queue {struct work_struct core_work;struct vdec_msg_queue_ctx lat_ctx; +struct mtk_vcodec_ctx *ctx;atomic_t lat_list_cnt;atomic_t core_list_cnt;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 240/663 media: mediatek: vcodec: add core decode done event
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit d227af847ac2d7d90350124a1b2451e4fc1f050c ]
Need to make sure core decode done before current instance is free.
--- drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c | 4 +++- drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +3 -1
@@ -196,7 +196,7 @@ bool vdec_msg_queue_wait_lat_buf_full(struct vdec_msg_queue *msg_queue)spin_unlock (&core_ctx->ready_lock); timeout_jiff =msecs_to_jiffies (1000 * (NUM_BUFFER_COUNT +2 )); - ret =wait_event_timeout (msg_queue->lat_ctx.ready_to_use, + ret =wait_event_timeout (msg_queue->ctx->msg_queue.core_dec_done, msg_queue->lat_ctx.ready_num ==NUM_BUFFER_COUNT , timeout_jiff);if (ret) {
@@ -257,6 +257,7 @@ static void vdec_msg_queue_core_work(struct work_struct *work)mtk_vcodec_dec_disable_hardware (ctx,MTK_VDEC_CORE );vdec_msg_queue_qbuf (&ctx->msg_queue.lat_ctx, lat_buf); +wake_up_all (&ctx->msg_queue.core_dec_done);if (atomic_read (&lat_buf->ctx->msg_queue.core_list_cnt)) {mtk_v4l2_debug (3 ,"re-schedule to decode for core: %d" , dev->msg_queue_core_ctx.ready_num);
@@ -281,6 +282,7 @@ int vdec_msg_queue_init(struct vdec_msg_queue *msg_queue,atomic_set (&msg_queue->lat_list_cnt,0 );atomic_set (&msg_queue->core_list_cnt,0 ); +init_waitqueue_head (&msg_queue->core_dec_done); msg_queue->wdma_addr.size = vde_msg_queue_get_trans_size(ctx->picinfo.buf_w,
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h +2 -0
@@ -76,6 +76,7 @@ struct vdec_lat_buf {* * @lat_list_cnt: used to record each instance lat list count * @core_list_cnt: used to record each instance core list count +* @core_dec_done: core work queue decode done event */ struct vdec_msg_queue {struct vdec_lat_buf lat_buf[NUM_BUFFER_COUNT ];
@@ -90,6 +91,7 @@ struct vdec_msg_queue {atomic_t lat_list_cnt;atomic_t core_list_cnt; +wait_queue_head_t core_dec_done; };/**
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 241/663 media: mediatek: vcodec: remove unused lat_buf
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit af50b13dd3d7d5dbc1f08add1c462398e926a053 ]
Remove unused lat_buf from core list, or leading to core list access NULL point.
--- .../platform/mediatek/vcodec/vdec_msg_queue.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +15 -3
@@ -177,7 +177,7 @@ bool vdec_msg_queue_wait_lat_buf_full(struct vdec_msg_queue *msg_queue)struct vdec_lat_buf *buf, *tmp;struct list_head *list_core[3 ];struct vdec_msg_queue_ctx *core_ctx; -int ret, i, in_core_count =0 ; +int ret, i, in_core_count =0 , count =0 ;long timeout_jiff; core_ctx = &msg_queue->ctx->dev->msg_queue_core_ctx;
@@ -204,8 +204,20 @@ bool vdec_msg_queue_wait_lat_buf_full(struct vdec_msg_queue *msg_queue) msg_queue->lat_ctx.ready_num);return true; } -mtk_v4l2_err ("failed with lat buf isn't full: %d" , - msg_queue->lat_ctx.ready_num); + +spin_lock (&core_ctx->ready_lock); +list_for_each_entry_safe (buf, tmp, &core_ctx->ready_queue, core_list) { +if (buf && buf->ctx == msg_queue->ctx) { + count++; +list_del (&buf->core_list); + } + } +spin_unlock (&core_ctx->ready_lock); + +mtk_v4l2_err ("failed with lat buf isn't full: list(%d %d) count:%d" , +atomic_read (&msg_queue->lat_list_cnt), +atomic_read (&msg_queue->core_list_cnt), count); +return false; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 242/663 media: mediatek: vcodec: making sure queue_work successfully
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit 2e0ef56d81cb2569624d288b7e95a8a2734a7c74 ]
Putting core work to work queue using queue_work maybe fail, call queue_work again when the count of core work in work queue is less than core_list_cnt, making sure all the buffer in core list can be scheduled.
--- .../platform/mediatek/vcodec/vdec_msg_queue.c | 31 ++++++++++++++----- .../platform/mediatek/vcodec/vdec_msg_queue.h | 2 ++ 2 files changed, 25 insertions(+), 8 deletions(-)
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.c +23 -8
@@ -71,6 +71,7 @@ static void vdec_msg_queue_dec(struct vdec_msg_queue *msg_queue, int hardware_inint vdec_msg_queue_qbuf (struct vdec_msg_queue_ctx *msg_ctx,struct vdec_lat_buf *buf) {struct list_head *head; +int status; head =vdec_get_buf_list (msg_ctx->hardware_index, buf);if (!head) {
@@ -83,11 +84,17 @@ int vdec_msg_queue_qbuf(struct vdec_msg_queue_ctx *msg_ctx, struct vdec_lat_buf msg_ctx->ready_num++;vdec_msg_queue_inc (&buf->ctx->msg_queue, msg_ctx->hardware_index); -if (msg_ctx->hardware_index !=MTK_VDEC_CORE ) +if (msg_ctx->hardware_index !=MTK_VDEC_CORE ) {wake_up_all (&msg_ctx->ready_to_use); -else -queue_work (buf->ctx->dev->core_workqueue, - &buf->ctx->msg_queue.core_work); + }else { +if (buf->ctx->msg_queue.core_work_cnt < +atomic_read (&buf->ctx->msg_queue.core_list_cnt)) { + status =queue_work (buf->ctx->dev->core_workqueue, + &buf->ctx->msg_queue.core_work); +if (status) + buf->ctx->msg_queue.core_work_cnt++; + } + }mtk_v4l2_debug (3 ,"enqueue buf type: %d addr: 0x%p num: %d" , msg_ctx->hardware_index, buf, msg_ctx->ready_num);
@@ -254,6 +261,7 @@ static void vdec_msg_queue_core_work(struct work_struct *work) container_of(msg_queue, struct mtk_vcodec_ctx, msg_queue);struct mtk_vcodec_dev *dev = ctx->dev;struct vdec_lat_buf *lat_buf; +int status; lat_buf =vdec_msg_queue_dqbuf (&dev->msg_queue_core_ctx);if (!lat_buf)
@@ -270,11 +278,17 @@ static void vdec_msg_queue_core_work(struct work_struct *work)vdec_msg_queue_qbuf (&ctx->msg_queue.lat_ctx, lat_buf);wake_up_all (&ctx->msg_queue.core_dec_done); -if (atomic_read (&lat_buf->ctx->msg_queue.core_list_cnt)) { -mtk_v4l2_debug (3 ,"re-schedule to decode for core: %d" , - dev->msg_queue_core_ctx.ready_num); -queue_work (dev->core_workqueue, &msg_queue->core_work); +spin_lock (&dev->msg_queue_core_ctx.ready_lock); + lat_buf->ctx->msg_queue.core_work_cnt--; + +if (lat_buf->ctx->msg_queue.core_work_cnt < +atomic_read (&lat_buf->ctx->msg_queue.core_list_cnt)) { + status =queue_work (lat_buf->ctx->dev->core_workqueue, + &lat_buf->ctx->msg_queue.core_work); +if (status) + lat_buf->ctx->msg_queue.core_work_cnt++; } +spin_unlock (&dev->msg_queue_core_ctx.ready_lock); } int vdec_msg_queue_init(struct vdec_msg_queue *msg_queue,
@@ -289,6 +303,7 @@ int vdec_msg_queue_init(struct vdec_msg_queue *msg_queue,return 0 ; msg_queue->ctx = ctx; + msg_queue->core_work_cnt =0 ;vdec_msg_queue_init_ctx (&msg_queue->lat_ctx,MTK_VDEC_LAT0 );INIT_WORK (&msg_queue->core_work, vdec_msg_queue_core_work);
drivers/media/platform/mediatek/vcodec/vdec_msg_queue.h +2 -0
@@ -77,6 +77,7 @@ struct vdec_lat_buf {* @lat_list_cnt: used to record each instance lat list count * @core_list_cnt: used to record each instance core list count * @core_dec_done: core work queue decode done event +* @core_work_cnt: the number of core work in work queue */ struct vdec_msg_queue {struct vdec_lat_buf lat_buf[NUM_BUFFER_COUNT ];
@@ -92,6 +93,7 @@ struct vdec_msg_queue {atomic_t lat_list_cnt;atomic_t core_list_cnt;wait_queue_head_t core_dec_done; +int core_work_cnt; };/**
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 243/663 media: mediatek: vcodec: change lat thread decode error condition
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit 960badda95f10fb0c60f6f64978b19eafa9507a7 ]
If lat thread can't get lat buffer, it should be that current instance don't be schedulded, the driver can't free the src buffer directly.
--- .../platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c | 6 ++++-- .../platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c | 2 +- .../platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c +4 -2
@@ -258,8 +258,10 @@ static void mtk_vdec_worker(struct work_struct *work)if (src_buf_req)v4l2_ctrl_request_complete (src_buf_req, &ctx->ctrl_hdl); }else { -v4l2_m2m_src_buf_remove (ctx->m2m_ctx); -v4l2_m2m_buf_done (vb2_v4l2_src, state); +if (ret != -EAGAIN ) { +v4l2_m2m_src_buf_remove (ctx->m2m_ctx); +v4l2_m2m_buf_done (vb2_v4l2_src, state); + }v4l2_m2m_job_finish (dev->m2m_dev_dec, ctx->m2m_ctx); } }
drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_multi_if.c +1 -1
@@ -597,7 +597,7 @@ static int vdec_h264_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs, lat_buf =vdec_msg_queue_dqbuf (&inst->ctx->msg_queue.lat_ctx);if (!lat_buf) {mtk_vcodec_err (inst,"failed to get lat buffer" ); -return -EINVAL ; +return -EAGAIN ; } share_info = lat_buf->private_data; src_buf_info = container_of(bs, struct mtk_video_dec_buf, bs_buffer);
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_req_lat_if.c +1 -1
@@ -2070,7 +2070,7 @@ static int vdec_vp9_slice_lat_decode(void *h_vdec, struct mtk_vcodec_mem *bs, lat_buf =vdec_msg_queue_dqbuf (&instance->ctx->msg_queue.lat_ctx);if (!lat_buf) {mtk_vcodec_err (instance,"Failed to get VP9 lat buf\n" ); -return -EBUSY ; +return -EAGAIN ; } pfc = (struct vdec_vp9_slice_pfc *)lat_buf->private_data;if (!pfc) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 244/663 media: cedrus: fix use after free bug in cedrus_remove due to race condition
In reply to Greg Kroah-HartmanFrom: Zheng Wang <[email protected]>
[ Upstream commit 50d0a7aea4809cef87979d4669911276aa23b71f ]
In cedrus_probe, dev->watchdog_work is bound with cedrus_watchdog function. In cedrus_device_run, it will started by schedule_delayed_work. If there is an unfinished work in cedrus_remove, there may be a race condition and trigger UAF bug.
CPU0 CPU1
|cedrus_watchdog
cedrus_remove |
v4l2_m2m_release |
kfree(m2m_dev) |
|
| v4l2_m2m_get_curr_priv
| m2m_dev //useFix it by canceling the worker in cedrus_remove.
--- drivers/staging/media/sunxi/cedrus/cedrus.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/media/sunxi/cedrus/cedrus.c +1 -0
@@ -547,6 +547,7 @@ static int cedrus_remove(struct platform_device *pdev) {struct cedrus_dev *dev =platform_get_drvdata (pdev); +cancel_delayed_work_sync (&dev->watchdog_work);if (media_devnode_is_registered (dev->mdev.devnode)) {media_device_unregister (&dev->mdev);v4l2_m2m_unregister_media_controller (dev->m2m_dev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 245/663 media: rkvdec: fix use after free bug in rkvdec_remove
In reply to Greg Kroah-HartmanFrom: Zheng Wang <[email protected]>
[ Upstream commit 3228cec23b8b29215e18090c6ba635840190993d ]
In rkvdec_probe, rkvdec->watchdog_work is bound with rkvdec_watchdog_func. Then rkvdec_vp9_run may be called to start the work.
If we remove the module which will call rkvdec_remove
to make cleanup, there may be a unfinished work. The possible sequence is as follows, which will cause a typical UAF bug.
Fix it by canceling the work before cleanup in rkvdec_remove.
CPU0 CPU1
|rkvdec_watchdog_func
rkvdec_remove |
rkvdec_v4l2_cleanup|
v4l2_m2m_release |
kfree(m2m_dev); |
|
| v4l2_m2m_get_curr_priv
| m2m_dev->curr_ctx //use--- drivers/staging/media/rkvdec/rkvdec.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/staging/media/rkvdec/rkvdec.c +2 -0
@@ -1066,6 +1066,8 @@ static int rkvdec_remove(struct platform_device *pdev) {struct rkvdec_dev *rkvdec =platform_get_drvdata (pdev); +cancel_delayed_work_sync (&rkvdec->watchdog_work); +rkvdec_v4l2_cleanup (rkvdec);pm_runtime_disable (&pdev->dev);pm_runtime_dont_use_autosuspend (&pdev->dev);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 246/663 platform/x86/amd/pmf: Move out of BIOS SMN pair for driver probe
In reply to Greg Kroah-HartmanFrom: Shyam Sundar S K <[email protected]>
[ Upstream commit aec8298c093f052fc8a86f9411b69b23953b0edb ]
The current SMN index used for the driver probe seems to be meant for the BIOS pair and there are potential concurrency problems that can occur with an inopportune SMI.
It is been advised to use SMN_INDEX_0 instead of SMN_INDEX_2, which is what amd_nb.c provides and this function has protections to ensure that only one caller can use it at a time.
--- drivers/platform/x86/amd/pmf/Kconfig | 1 + drivers/platform/x86/amd/pmf/core.c | 22 +++++----------------- 2 files changed, 6 insertions(+), 17 deletions(-)
drivers/platform/x86/amd/pmf/Kconfig +1 -0
@@ -7,6 +7,7 @@ config AMD_PMF tristate "AMD Platform Management Framework" depends on ACPI && PCI depends on POWER_SUPPLY + depends on AMD_NB select ACPI_PLATFORM_PROFILE help This driver provides support for the AMD Platform Management Framework.
drivers/platform/x86/amd/pmf/core.c +5 -17
@@ -8,6 +8,7 @@* Author: Shyam Sundar S K <[email protected]> */ +#include <asm/amd_nb.h> #include <linux/debugfs.h> #include <linux/iopoll.h> #include <linux/module.h>
@@ -22,8 +23,6 @@#define AMD_PMF_REGISTER_ARGUMENT 0xA58/* Base address of SMU for mapping physical address to virtual address */ -#define AMD_PMF_SMU_INDEX_ADDRESS 0xB8 -#define AMD_PMF_SMU_INDEX_DATA 0xBC#define AMD_PMF_MAPPING_SIZE 0x01000#define AMD_PMF_BASE_ADDR_OFFSET 0x10000#define AMD_PMF_BASE_ADDR_LO 0x13B102E8
@@ -348,30 +347,19 @@ static int amd_pmf_probe(struct platform_device *pdev) } dev->cpu_id = rdev->device; - err =pci_write_config_dword (rdev,AMD_PMF_SMU_INDEX_ADDRESS ,AMD_PMF_BASE_ADDR_LO ); -if (err) { -dev_err (dev->dev,"error writing to 0x%x\n" ,AMD_PMF_SMU_INDEX_ADDRESS ); -pci_dev_put (rdev); -return pcibios_err_to_errno (err); - } - err =pci_read_config_dword (rdev,AMD_PMF_SMU_INDEX_DATA , &val); + err =amd_smn_read (0 ,AMD_PMF_BASE_ADDR_LO , &val);if (err) { +dev_err (dev->dev,"error in reading from 0x%x\n" ,AMD_PMF_BASE_ADDR_LO );pci_dev_put (rdev);return pcibios_err_to_errno (err); } base_addr_lo = val &AMD_PMF_BASE_ADDR_HI_MASK ; - err =pci_write_config_dword (rdev,AMD_PMF_SMU_INDEX_ADDRESS ,AMD_PMF_BASE_ADDR_HI ); -if (err) { -dev_err (dev->dev,"error writing to 0x%x\n" ,AMD_PMF_SMU_INDEX_ADDRESS ); -pci_dev_put (rdev); -return pcibios_err_to_errno (err); - } - - err =pci_read_config_dword (rdev,AMD_PMF_SMU_INDEX_DATA , &val); + err =amd_smn_read (0 ,AMD_PMF_BASE_ADDR_HI , &val);if (err) { +dev_err (dev->dev,"error in reading from 0x%x\n" ,AMD_PMF_BASE_ADDR_HI );pci_dev_put (rdev);return pcibios_err_to_errno (err); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 247/663 platform/x86/amd: pmc: Dont try to read SMU version on Picasso
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
[ Upstream commit b845772677ea19b8e4c032bc07393ef32de4ee39 ]
Picasso doesn't support the command in the uPEP mailbox to try to read the SMU version.
--- drivers/platform/x86/amd/pmc.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/x86/amd/pmc.c +3 -0
@@ -377,6 +377,9 @@ static int amd_pmc_get_smu_version(struct amd_pmc_dev *dev)int rc;u32 val; +if (dev->cpu_id ==AMD_CPU_ID_PCO ) +return -ENODEV ; + rc =amd_pmc_send_cmd (dev,0 , &val,SMU_MSG_GETSMUVERSION ,1 );if (rc)return rc;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 248/663 platform/x86/amd: pmc: Hide SMU version and program attributes for Picasso
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
[ Upstream commit 5ec9ee0d464750d72972d5685edf675824e259a1 ]
As the command to get version isn't supported on Picasso, we shouldn't be exposing this into sysfs either.
--- drivers/platform/x86/amd/pmc.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/platform/x86/amd/pmc.c +20 -1
@@ -426,12 +426,31 @@ static ssize_t smu_program_show(struct device *d, struct device_attribute *attr,static DEVICE_ATTR_RO (smu_fw_version);static DEVICE_ATTR_RO (smu_program); +static umode_t pmc_attr_is_visible (struct kobject *kobj,struct attribute *attr,int idx) +{ +struct device *dev =kobj_to_dev (kobj); +struct amd_pmc_dev *pdev =dev_get_drvdata (dev); + +if (pdev->cpu_id ==AMD_CPU_ID_PCO ) +return 0 ; +return 0444 ; +} +static struct attribute *pmc_attrs[] = { &dev_attr_smu_fw_version.attr, &dev_attr_smu_program.attr,NULL , }; -ATTRIBUTE_GROUPS (pmc); + +static struct attribute_group pmc_attr_group = { + .attrs = pmc_attrs, + .is_visible = pmc_attr_is_visible, +}; + +static const struct attribute_group *pmc_groups[] = { + &pmc_attr_group, +NULL , +};static int smu_fw_info_show (struct seq_file *s,void *unused) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 249/663 platform/x86/amd: pmc: Dont dump data after resume from s0i3 on picasso
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
[ Upstream commit 7abc3618b65304d409d9489d77e4a8f047842fb7 ]
This command isn't supported on Picasso, so guard against running it to avoid errors like SMU cmd unknown. err: 0xfe in the logs.
--- drivers/platform/x86/amd/pmc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/platform/x86/amd/pmc.c +9 -1
@@ -809,6 +809,14 @@ static void amd_pmc_s2idle_check(void)dev_err (pdev->dev,"error writing to STB: %d\n" , rc); } +static int amd_pmc_dump_data (struct amd_pmc_dev *pdev) +{ +if (pdev->cpu_id ==AMD_CPU_ID_PCO ) +return -ENODEV ; + +return amd_pmc_send_cmd (pdev,0 ,NULL ,SMU_MSG_LOG_DUMP_DATA ,0 ); +} +static void amd_pmc_s2idle_restore (void ) {struct amd_pmc_dev *pdev = &pmc;
@@ -821,7 +829,7 @@ static void amd_pmc_s2idle_restore(void)dev_err (pdev->dev,"resume failed: %d\n" , rc);/* Let SMU know that we are looking for stats */ -amd_pmc_send_cmd (pdev,0 ,NULL ,SMU_MSG_LOG_DUMP_DATA ,0 ); +amd_pmc_dump_data (pdev); rc =amd_pmc_write_stb (pdev,AMD_PMC_STB_S2IDLE_RESTORE );if (rc)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 250/663 platform/x86/amd: pmc: Move idlemask check into `amd_pmc_idlemask_read`
In reply to Greg Kroah-HartmanFrom: Mario Limonciello <[email protected]>
[ Upstream commit 9217bd1d7699f34a01b26ba14ff38c1714ce1185 ]
The version check requirement for idle mask support actually only applies to RN/CZN/BRC platforms.
So far no issues have happened because the PMFW version string is bigger on other supported systems. This can be reset for any new platform so move the check to only RN/CZN/BRC case.
--- drivers/platform/x86/amd/pmc.c | 74 +++++++++++++++------------------- 1 file changed, 33 insertions(+), 41 deletions(-)
drivers/platform/x86/amd/pmc.c +33 -41
@@ -314,33 +314,6 @@ static int amd_pmc_setup_smu_logging(struct amd_pmc_dev *dev)return 0 ; } -static int amd_pmc_idlemask_read (struct amd_pmc_dev *pdev,struct device *dev, -struct seq_file *s) -{ -u32 val; - -switch (pdev->cpu_id) { -case AMD_CPU_ID_CZN : - val =amd_pmc_reg_read (pdev,AMD_PMC_SCRATCH_REG_CZN ); -break ; -case AMD_CPU_ID_YC : -case AMD_CPU_ID_CB : -case AMD_CPU_ID_PS : - val =amd_pmc_reg_read (pdev,AMD_PMC_SCRATCH_REG_YC ); -break ; -default : -return -EINVAL ; - } - -if (dev) -dev_dbg (pdev->dev,"SMU idlemask s0i3: 0x%x\n" , val); - -if (s) -seq_printf (s,"SMU idlemask : 0x%x\n" , val); - -return 0 ; -} -static int get_metrics_table (struct amd_pmc_dev *pdev,struct smu_metrics *table) {if (!pdev->smu_virt_addr) {
@@ -517,28 +490,47 @@ static int s0ix_stats_show(struct seq_file *s, void *unused) }DEFINE_SHOW_ATTRIBUTE (s0ix_stats); -static int amd_pmc_idlemask_show (struct seq_file *s,void *unused) +static int amd_pmc_idlemask_read (struct amd_pmc_dev *pdev,struct device *dev, +struct seq_file *s) { -struct amd_pmc_dev *dev = s->private; +u32 val;int rc; -/* we haven't yet read SMU version */ -if (!dev->major) { - rc =amd_pmc_get_smu_version (dev); -if (rc) -return rc; +switch (pdev->cpu_id) { +case AMD_CPU_ID_CZN : +/* we haven't yet read SMU version */ +if (!pdev->major) { + rc =amd_pmc_get_smu_version (pdev); +if (rc) +return rc; + } +if (pdev->major >56 || (pdev->major >=55 && pdev->minor >=37 )) + val =amd_pmc_reg_read (pdev,AMD_PMC_SCRATCH_REG_CZN ); +else +return -EINVAL ; +break ; +case AMD_CPU_ID_YC : +case AMD_CPU_ID_CB : +case AMD_CPU_ID_PS : + val =amd_pmc_reg_read (pdev,AMD_PMC_SCRATCH_REG_YC ); +break ; +default : +return -EINVAL ; } -if (dev->major >56 || (dev->major >=55 && dev->minor >=37 )) { - rc =amd_pmc_idlemask_read (dev,NULL , s); -if (rc) -return rc; - }else { -seq_puts (s,"Unsupported SMU version for Idlemask\n" ); - } +if (dev) +dev_dbg (pdev->dev,"SMU idlemask s0i3: 0x%x\n" , val); + +if (s) +seq_printf (s,"SMU idlemask : 0x%x\n" , val);return 0 ; } + +static int amd_pmc_idlemask_show (struct seq_file *s,void *unused) +{ +return amd_pmc_idlemask_read (s->private,NULL , s); +}DEFINE_SHOW_ATTRIBUTE (amd_pmc_idlemask);static void amd_pmc_dbgfs_unregister (struct amd_pmc_dev *dev)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 251/663 platform/x86/amd: pmc: Utilize SMN index 0 for driver probe
In reply to Greg Kroah-HartmanFrom: Shyam Sundar S K <[email protected]>
[ Upstream commit 310e782a99c7f16fb533a45d8f9c16defefa5aab ]
The current SMN index used for the driver probe seems to be meant for the BIOS pair and there are potential concurrency problems that can occur with an inopportune SMI.
It is been advised to use SMN_INDEX_0 instead of SMN_INDEX_2, which is what amd_nb.c provides and this function has protections to ensure that only one caller can use it at a time.
--- drivers/platform/x86/amd/Kconfig | 2 +- drivers/platform/x86/amd/pmc.c | 23 +++++------------------ 2 files changed, 6 insertions(+), 19 deletions(-)
drivers/platform/x86/amd/Kconfig +1 -1
@@ -7,7 +7,7 @@ source "drivers/platform/x86/amd/pmf/Kconfig" config AMD_PMC tristate "AMD SoC PMC driver" - depends on ACPI && PCI && RTC_CLASS + depends on ACPI && PCI && RTC_CLASS && AMD_NB select SERIO help The driver provides support for AMD Power Management Controller
drivers/platform/x86/amd/pmc.c +5 -18
@@ -10,6 +10,7 @@#define pr_fmt (fmt) KBUILD_MODNAME ": " fmt +#include <asm/amd_nb.h> #include <linux/acpi.h> #include <linux/bitfield.h> #include <linux/bits.h>
@@ -55,8 +56,6 @@#define S2D_TELEMETRY_DRAMBYTES_MAX 0x1000000/* Base address of SMU for mapping physical address to virtual address */ -#define AMD_PMC_SMU_INDEX_ADDRESS 0xB8 -#define AMD_PMC_SMU_INDEX_DATA 0xBC#define AMD_PMC_MAPPING_SIZE 0x01000#define AMD_PMC_BASE_ADDR_OFFSET 0x10000#define AMD_PMC_BASE_ADDR_LO 0x13B102E8
@@ -962,30 +961,18 @@ static int amd_pmc_probe(struct platform_device *pdev) dev->cpu_id = rdev->device; dev->rdev = rdev; - err =pci_write_config_dword (rdev,AMD_PMC_SMU_INDEX_ADDRESS ,AMD_PMC_BASE_ADDR_LO ); -if (err) { -dev_err (dev->dev,"error writing to 0x%x\n" ,AMD_PMC_SMU_INDEX_ADDRESS ); - err =pcibios_err_to_errno (err); - goto err_pci_dev_put; - } - - err =pci_read_config_dword (rdev,AMD_PMC_SMU_INDEX_DATA , &val); + err =amd_smn_read (0 ,AMD_PMC_BASE_ADDR_LO , &val);if (err) { +dev_err (dev->dev,"error reading 0x%x\n" ,AMD_PMC_BASE_ADDR_LO ); err =pcibios_err_to_errno (err); goto err_pci_dev_put; } base_addr_lo = val &AMD_PMC_BASE_ADDR_HI_MASK ; - err =pci_write_config_dword (rdev,AMD_PMC_SMU_INDEX_ADDRESS ,AMD_PMC_BASE_ADDR_HI ); -if (err) { -dev_err (dev->dev,"error writing to 0x%x\n" ,AMD_PMC_SMU_INDEX_ADDRESS ); - err =pcibios_err_to_errno (err); - goto err_pci_dev_put; - } - - err =pci_read_config_dword (rdev,AMD_PMC_SMU_INDEX_DATA , &val); + err =amd_smn_read (0 ,AMD_PMC_BASE_ADDR_HI , &val);if (err) { +dev_err (dev->dev,"error reading 0x%x\n" ,AMD_PMC_BASE_ADDR_HI ); err =pcibios_err_to_errno (err); goto err_pci_dev_put; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 252/663 platform/x86/amd: pmc: Move out of BIOS SMN pair for STB init
In reply to Greg Kroah-HartmanFrom: Shyam Sundar S K <[email protected]>
[ Upstream commit 8d99129eef8f42377b41c1bacee9f8ce806e9f44 ]
The current SMN index used for the driver probe seems to be meant for the BIOS pair and there are potential concurrency problems that can occur with an inopportune SMI.
It is been advised to use SMN_INDEX_0 instead of SMN_INDEX_6, which is what amd_nb.c provides and this function has protections to ensure that only one caller can use it at a time.
--- drivers/platform/x86/amd/pmc.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-)
drivers/platform/x86/amd/pmc.c +4 -22
@@ -38,8 +38,6 @@#define AMD_PMC_SCRATCH_REG_YC 0xD14/* STB Registers */ -#define AMD_PMC_STB_INDEX_ADDRESS 0xF8 -#define AMD_PMC_STB_INDEX_DATA 0xFC#define AMD_PMC_STB_PMI_0 0x03E30600#define AMD_PMC_STB_S2IDLE_PREPARE 0xC6000001#define AMD_PMC_STB_S2IDLE_RESTORE 0xC6000002
@@ -901,17 +899,9 @@ static int amd_pmc_write_stb(struct amd_pmc_dev *dev, u32 data) {int err; - err =pci_write_config_dword (dev->rdev,AMD_PMC_STB_INDEX_ADDRESS ,AMD_PMC_STB_PMI_0 ); + err =amd_smn_write (0 ,AMD_PMC_STB_PMI_0 , data);if (err) { -dev_err (dev->dev,"failed to write addr in stb: 0x%X\n" , -AMD_PMC_STB_INDEX_ADDRESS ); -return pcibios_err_to_errno (err); - } - - err =pci_write_config_dword (dev->rdev,AMD_PMC_STB_INDEX_DATA , data); -if (err) { -dev_err (dev->dev,"failed to write data in stb: 0x%X\n" , -AMD_PMC_STB_INDEX_DATA ); +dev_err (dev->dev,"failed to write data in stb: 0x%X\n" ,AMD_PMC_STB_PMI_0 );return pcibios_err_to_errno (err); }
@@ -923,18 +913,10 @@ static int amd_pmc_read_stb(struct amd_pmc_dev *dev, u32 *buf) {int i, err; - err =pci_write_config_dword (dev->rdev,AMD_PMC_STB_INDEX_ADDRESS ,AMD_PMC_STB_PMI_0 ); -if (err) { -dev_err (dev->dev,"error writing addr to stb: 0x%X\n" , -AMD_PMC_STB_INDEX_ADDRESS ); -return pcibios_err_to_errno (err); - } -for (i =0 ; i <FIFO_SIZE ; i++) { - err =pci_read_config_dword (dev->rdev,AMD_PMC_STB_INDEX_DATA , buf++); + err =amd_smn_read (0 ,AMD_PMC_STB_PMI_0 , buf++);if (err) { -dev_err (dev->dev,"error reading data from stb: 0x%X\n" , -AMD_PMC_STB_INDEX_DATA ); +dev_err (dev->dev,"error reading data from stb: 0x%X\n" ,AMD_PMC_STB_PMI_0 );return pcibios_err_to_errno (err); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 253/663 media: dm1105: Fix use after free bug in dm1105_remove due to race condition
In reply to Greg Kroah-HartmanFrom: Zheng Wang <[email protected]>
[ Upstream commit 5abda7a16698d4d1f47af1168d8fa2c640116b4a ]
In dm1105_probe, it called dm1105_ir_init and bound &dm1105->ir.work with dm1105_emit_key.
When it handles IRQ request with dm1105_irq, it may call schedule_work to start the work.
When we call dm1105_remove to remove the driver, there may be a sequence as follows:
Fix it by finishing the work before cleanup in dm1105_remove
CPU0 CPU1
|dm1105_emit_key
dm1105_remove |
dm1105_ir_exit |
rc_unregister_device |
rc_free_device |
rc_dev_release |
kfree(dev); |
|
| rc_keydown
| //use--- drivers/media/pci/dm1105/dm1105.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/pci/dm1105/dm1105.c +1 -0
@@ -1176,6 +1176,7 @@ static void dm1105_remove(struct pci_dev *pdev)struct dvb_demux *dvbdemux = &dev->demux;struct dmx_demux *dmx = &dvbdemux->dmx; +cancel_work_sync (&dev->ir.work);dm1105_ir_exit (dev); dmx->close (dmx);dvb_net_release (&dev->dvbnet);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 254/663 media: saa7134: fix use after free bug in saa7134_finidev due to race condition
In reply to Greg Kroah-HartmanFrom: Zheng Wang <[email protected]>
[ Upstream commit 30cf57da176cca80f11df0d9b7f71581fe601389 ]
In saa7134_initdev, it will call saa7134_hwinit1. There are three function invoking here: saa7134_video_init1, saa7134_ts_init1 and saa7134_vbi_init1.
All of them will init a timer with same function. Take saa7134_video_init1 as an example. It'll bound &dev->video_q.timeout with saa7134_buffer_timeout.
In buffer_activate, the timer funtcion is started.
If we remove the module or device which will call saa7134_finidev to make cleanup, there may be a unfinished work. The possible sequence is as follows, which will cause a typical UAF bug.
Fix it by canceling the timer works accordingly before cleanup in saa7134_finidev.
CPU0 CPU1
|saa7134_buffer_timeout
saa7134_finidev |
kfree(dev); |
|
| saa7134_buffer_next
| //use dev--- drivers/media/pci/saa7134/saa7134-ts.c | 1 + drivers/media/pci/saa7134/saa7134-vbi.c | 1 + drivers/media/pci/saa7134/saa7134-video.c | 1 + 3 files changed, 3 insertions(+)
drivers/media/pci/saa7134/saa7134-ts.c +1 -0
@@ -300,6 +300,7 @@ int saa7134_ts_start(struct saa7134_dev *dev)int saa7134_ts_fini (struct saa7134_dev *dev) { +del_timer_sync (&dev->ts_q.timeout);saa7134_pgtable_free (dev->pci, &dev->ts_q.pt);return 0 ; }
drivers/media/pci/saa7134/saa7134-vbi.c +1 -0
@@ -185,6 +185,7 @@ int saa7134_vbi_init1(struct saa7134_dev *dev)int saa7134_vbi_fini (struct saa7134_dev *dev) {/* nothing */ +del_timer_sync (&dev->vbi_q.timeout);return 0 ; }
drivers/media/pci/saa7134/saa7134-video.c +1 -0
@@ -2146,6 +2146,7 @@ int saa7134_video_init1(struct saa7134_dev *dev)void saa7134_video_fini (struct saa7134_dev *dev) { +del_timer_sync (&dev->video_q.timeout);/* free stuff */ saa7134_pgtable_free (dev->pci, &dev->video_q.pt);saa7134_pgtable_free (dev->pci, &dev->vbi_q.pt);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 255/663 media: platform: mtk-mdp3: fix potential frame size overflow in mdp_try_fmt_mplane()
In reply to Greg Kroah-HartmanFrom: Moudy Ho <[email protected]>
[ Upstream commit 4168720753ce6c14c5d3a35302fc2e1841383443 ]
Fix overflow risk when setting certain formats whose frame size exceeds a RGB24 with 7723x7723 resolution.
For example, a 7723x7724 RGB24 frame:
1. bpl (byte per line) = 7723 * 3.
2. Overflow occurs when bpl * 7724 * depth.
--- drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/media/platform/mediatek/mdp3/mtk-mdp3-regs.c +6 -4
@@ -4,6 +4,7 @@* Author: Ping-Hsun Wu <[email protected]> */ +#include <linux/math64.h> #include <media/v4l2-common.h> #include <media/videobuf2-v4l2.h> #include <media/videobuf2-dma-contig.h>
@@ -428,14 +429,15 @@ const struct mdp_format *mdp_try_fmt_mplane(struct v4l2_format *f,u32 bpl = pix_mp->plane_fmt[i].bytesperline;u32 min_si, max_si;u32 si = pix_mp->plane_fmt[i].sizeimage; +u64 di; bpl =clamp (bpl, min_bpl, max_bpl); pix_mp->plane_fmt[i].bytesperline = bpl; - min_si = (bpl * pix_mp->height * fmt->depth[i]) / - fmt->row_depth[i]; - max_si = (bpl * s.max_height * fmt->depth[i]) / - fmt->row_depth[i]; + di = (u64 )bpl * pix_mp->height * fmt->depth[i]; + min_si = (u32 )div_u64 (di, fmt->row_depth[i]); + di = (u64 )bpl * s.max_height * fmt->depth[i]; + max_si = (u32 )div_u64 (di, fmt->row_depth[i]); si =clamp (si, min_si, max_si); pix_mp->plane_fmt[i].sizeimage = si;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 256/663 media: vsp1: Replace vb2_is_streaming() with vb2_start_streaming_called()
In reply to Greg Kroah-HartmanFrom: Laurent Pinchart <[email protected]>
[ Upstream commit 52d8caca3d533cc499f1255be25576ffd936ec95 ]
The vsp1 driver uses the vb2_is_streaming() function in its .buf_queue() handler to check if the .start_streaming() operation has been called, and decide whether to just add the buffer to an internal queue, or also trigger a hardware run. vb2_is_streaming() relies on the vb2_queue structure's streaming field, which used to be set only after calling the .start_streaming() operation.
Commit a10b21532574 ("media: vb2: add (un)prepare_streaming queue ops") changed this, setting the .streaming field in vb2_core_streamon() before enqueuing buffers to the driver and calling .start_streaming(). This broke the vsp1 driver which now believes that .start_streaming() has been called when it hasn't, leading to a crash:
[ 881.058705] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000020 [ 881.067495] Mem abort info: [ 881.070290] ESR = 0x0000000096000006 [ 881.074042] EC = 0x25: DABT (current EL), IL = 32 bits [ 881.079358] SET = 0, FnV = 0 [ 881.082414] EA = 0, S1PTW = 0 [ 881.085558] FSC = 0x06: level 2 translation fault [ 881.090439] Data abort info: [ 881.093320] ISV = 0, ISS = 0x00000006 [ 881.097157] CM = 0, WnR = 0 [ 881.100126] user pgtable: 4k pages, 48-bit VAs, pgdp=000000004fa51000 [ 881.106573] [0000000000000020] pgd=080000004f36e003, p4d=080000004f36e003, pud=080000004f7ec003, pmd=0000000000000000 [ 881.117217] Internal error: Oops: 0000000096000006 [#1] PREEMPT SMP [ 881.123494] Modules linked in: rcar_fdp1 v4l2_mem2mem [ 881.128572] CPU: 0 PID: 1271 Comm: yavta Tainted: G B 6.2.0-rc1-00023-g6c94e2e99343 #556 [ 881.138061] Hardware name: Renesas Salvator-X 2nd version board based on r8a77965 (DT) [ 881.145981] pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--) [ 881.152951] pc : vsp1_dl_list_add_body+0xa8/0xe0 [ 881.157580] lr : vsp1_dl_list_add_body+0x34/0xe0 [ 881.162206] sp : ffff80000c267710 [ 881.165522] x29: ffff80000c267710 x28: ffff000010938ae8 x27: ffff000013a8dd98 [ 881.172683] x26: ffff000010938098 x25: ffff000013a8dc00 x24: ffff000010ed6ba8 [ 881.179841] x23: ffff00000faa4000 x22: 0000000000000000 x21: 0000000000000020 [ 881.186998] x20: ffff00000faa4000 x19: 0000000000000000 x18: 0000000000000000 [ 881.194154] x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000 [ 881.201309] x14: 0000000000000000 x13: 746e696174206c65 x12: ffff70000157043d [ 881.208465] x11: 1ffff0000157043c x10: ffff70000157043c x9 : dfff800000000000 [ 881.215622] x8 : ffff80000ab821e7 x7 : 00008ffffea8fbc4 x6 : 0000000000000001 [ 881.222779] x5 : ffff80000ab821e0 x4 : ffff70000157043d x3 : 0000000000000020 [ 881.229936] x2 : 0000000000000020 x1 : ffff00000e4f6400 x0 : 0000000000000000 [ 881.237092] Call trace: [ 881.239542] vsp1_dl_list_add_body+0xa8/0xe0 [ 881.243822] vsp1_video_pipeline_run+0x270/0x2a0 [ 881.248449] vsp1_video_buffer_queue+0x1c0/0x1d0 [ 881.253076] __enqueue_in_driver+0xbc/0x260 [ 881.257269] vb2_start_streaming+0x48/0x200 [ 881.261461] vb2_core_streamon+0x13c/0x280 [ 881.265565] vb2_streamon+0x3c/0x90 [ 881.269064] vsp1_video_streamon+0x2fc/0x3e0 [ 881.273344] v4l_streamon+0x50/0x70 [ 881.276844] __video_do_ioctl+0x2bc/0x5d0 [ 881.280861] video_usercopy+0x2a8/0xc80 [ 881.284704] video_ioctl2+0x20/0x40 [ 881.288201] v4l2_ioctl+0xa4/0xc0 [ 881.291525] __arm64_sys_ioctl+0xe8/0x110 [ 881.295543] invoke_syscall+0x68/0x190 [ 881.299303] el0_svc_common.constprop.0+0x88/0x170 [ 881.304105] do_el0_svc+0x4c/0xf0 [ 881.307430] el0_svc+0x4c/0xa0 [ 881.310494] el0t_64_sync_handler+0xbc/0x140 [ 881.314773] el0t_64_sync+0x190/0x194 [ 881.318450] Code: d50323bf d65f03c0 91008263 f9800071 (885f7c60) [ 881.324551] ---[ end trace 0000000000000000 ]--- [ 881.329173] note: yavta[1271] exited with preempt_count 1
A different regression report sent to the linux-media mailing list ([1]) was answered with a claim that the vb2_is_streaming() function has never been meant for this purpose. The document of the function, as well as of the struct vb2_queue streaming field, is sparse, so this claim may be hard to verify.
The information needed by the vsp1 driver to decide how to process queued buffers is also available from the vb2_start_streaming_called() function. Use it instead of vb2_is_streaming() to fix the problem.
[1] https://lore.kernel.org/linux-media/[email protected]/
--- drivers/media/platform/renesas/vsp1/vsp1_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/renesas/vsp1/vsp1_video.c +1 -1
@@ -776,7 +776,7 @@ static void vsp1_video_buffer_queue(struct vb2_buffer *vb) video->rwpf->mem = buf->mem; pipe->buffers_ready |=1 << video->pipe_index; -if (vb2_is_streaming (&video->queue) && +if (vb2_start_streaming_called (&video->queue) &&vsp1_pipeline_ready (pipe))vsp1_video_pipeline_run (pipe);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 257/663 platform: Provide a remove callback that returns no value
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 5c5a7680e67ba6fbbb5f4d79fa41485450c1985c ]
struct platform_driver::remove returning an integer made driver authors expect that returning an error code was proper error handling. However the driver core ignores the error and continues to remove the device because there is nothing the core could do anyhow and reentering the remove callback again is only calling for trouble.
So this is an source for errors typically yielding resource leaks in the error path.
As there are too many platform drivers to neatly convert them all to return void in a single go, do it in several steps after this patch:
a) Convert all drivers to implement .remove_new() returning void instead
of .remove() returning int;
b) Change struct platform_driver::remove() to return void and so make
it identical to .remove_new(); c) Change all drivers back to .remove() now with the better prototype;
d) drop struct platform_driver::remove_new().
While this touches all drivers eventually twice, steps a) and c) can be done one driver after another and so reduces coordination efforts immensely and simplifies review.
Stable-dep-of: c766c90faf93 ("media: rcar_fdp1: Fix refcount leak in probe and remove function")
--- drivers/base/platform.c | 4 +++- include/linux/platform_device.h | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-)
drivers/base/platform.c +3 -1
@@ -1416,7 +1416,9 @@ static void platform_remove(struct device *_dev)struct platform_driver *drv =to_platform_driver (_dev->driver);struct platform_device *dev =to_platform_device (_dev); -if (drv->remove) { +if (drv->remove_new) { + drv->remove_new (dev); + }else if (drv->remove) {int ret = drv->remove (dev);if (ret)
include/linux/platform_device.h +11 -0
@@ -207,7 +207,18 @@ extern void platform_device_put(struct platform_device *pdev);struct platform_driver {int (*probe)(struct platform_device *); + +/* +* Traditionally the remove callback returned an int which however is +* ignored by the driver core. This led to wrong expectations by driver +* authors who thought returning an error code was a valid error +* handling strategy. To convert to a callback returning void, new +* drivers should implement .remove_new() until the conversion it done +* that eventually makes .remove() return void. +*/ int (*remove)(struct platform_device *); +void (*remove_new)(struct platform_device *); +void (*shutdown)(struct platform_device *);int (*suspend)(struct platform_device *,pm_message_t state);int (*resume)(struct platform_device *);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 258/663 media: rcar_fdp1: Convert to platform remove callback returning void
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 0e82d3715fd208de567b8e4307fbf91ae5e57db4 ]
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void.
Trivially convert this driver from always returning zero in the remove callback to the void returning variant.
Stable-dep-of: c766c90faf93 ("media: rcar_fdp1: Fix refcount leak in probe and remove function")
--- drivers/media/platform/renesas/rcar_fdp1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/media/platform/renesas/rcar_fdp1.c +2 -4
@@ -2396,7 +2396,7 @@ static int fdp1_probe(struct platform_device *pdev)return ret; } -static int fdp1_remove (struct platform_device *pdev) +static void fdp1_remove (struct platform_device *pdev) {struct fdp1_dev *fdp1 =platform_get_drvdata (pdev);
@@ -2404,8 +2404,6 @@ static int fdp1_remove(struct platform_device *pdev)video_unregister_device (&fdp1->vfd);v4l2_device_unregister (&fdp1->v4l2_dev);pm_runtime_disable (&pdev->dev); - -return 0 ; }static int __maybe_unused fdp1_pm_runtime_suspend (struct device *dev)
@@ -2441,7 +2439,7 @@ MODULE_DEVICE_TABLE(of, fdp1_dt_ids);static struct platform_driver fdp1_pdrv = { .probe = fdp1_probe, - .remove = fdp1_remove, + .remove_new = fdp1_remove, .driver = { .name =DRIVER_NAME , .of_match_table = fdp1_dt_ids,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 259/663 media: rcar_fdp1: Fix refcount leak in probe and remove function
In reply to Greg Kroah-HartmanFrom: Miaoqian Lin <[email protected]>
[ Upstream commit c766c90faf93897b77c9c5daa603cffab85ba907 ]
rcar_fcp_get() take reference, which should be balanced with rcar_fcp_put(). Add missing rcar_fcp_put() in fdp1_remove and the error paths of fdp1_probe() to fix this.
--- drivers/media/platform/renesas/rcar_fdp1.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/media/platform/renesas/rcar_fdp1.c +8 -3
@@ -2313,8 +2313,10 @@ static int fdp1_probe(struct platform_device *pdev)/* Determine our clock rate */ clk =clk_get (&pdev->dev,NULL ); -if (IS_ERR (clk)) -return PTR_ERR (clk); +if (IS_ERR (clk)) { + ret =PTR_ERR (clk); + goto put_dev; + } fdp1->clk_rate =clk_get_rate (clk);clk_put (clk);
@@ -2323,7 +2325,7 @@ static int fdp1_probe(struct platform_device *pdev) ret =v4l2_device_register (&pdev->dev, &fdp1->v4l2_dev);if (ret) {v4l2_err (&fdp1->v4l2_dev,"Failed to register video device\n" ); -return ret; + goto put_dev; }/* M2M registration */
@@ -2393,6 +2395,8 @@ static int fdp1_probe(struct platform_device *pdev) unreg_dev:v4l2_device_unregister (&fdp1->v4l2_dev); +put_dev: +rcar_fcp_put (fdp1->fcp);return ret; }
@@ -2404,6 +2408,7 @@ static void fdp1_remove(struct platform_device *pdev)video_unregister_device (&fdp1->vfd);v4l2_device_unregister (&fdp1->v4l2_dev);pm_runtime_disable (&pdev->dev); +rcar_fcp_put (fdp1->fcp); }static int __maybe_unused fdp1_pm_runtime_suspend (struct device *dev)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 260/663 media: v4l: async: Return async sub-devices to subnotifier list
In reply to Greg Kroah-HartmanFrom: Sakari Ailus <[email protected]>
[ Upstream commit 5276c9df9c2ab9a43b534bfb56bdb10899cd3a22 ]
When an async notifier is unregistered, the async sub-devices in the notifier's done list will disappear with the notifier. However this is currently also done to the sub-notifiers that remain registered. Their sub-devices only need to be unbound while the async sub-devices themselves need to be returned to the sub-notifier's waiting list. Do this now.
--- drivers/media/v4l2-core/v4l2-async.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/media/v4l2-core/v4l2-async.c +8 -5
@@ -414,7 +414,8 @@ static void v4l2_async_cleanup(struct v4l2_subdev *sd)/* Unbind all sub-devices in the notifier tree. */ static void -v4l2_async_nf_unbind_all_subdevs (struct v4l2_async_notifier *notifier) +v4l2_async_nf_unbind_all_subdevs (struct v4l2_async_notifier *notifier, +bool readd) {struct v4l2_subdev *sd, *tmp;
@@ -423,9 +424,11 @@ v4l2_async_nf_unbind_all_subdevs(struct v4l2_async_notifier *notifier)v4l2_async_find_subdev_notifier (sd);if (subdev_notifier) -v4l2_async_nf_unbind_all_subdevs (subdev_notifier); +v4l2_async_nf_unbind_all_subdevs (subdev_notifier, true);v4l2_async_nf_call_unbind (notifier, sd, sd->asd); +if (readd) +list_add_tail (&sd->asd->list, ¬ifier->waiting);v4l2_async_cleanup (sd);list_move (&sd->async_list, &subdev_list);
@@ -557,7 +560,7 @@ static int __v4l2_async_nf_register(struct v4l2_async_notifier *notifier)/* * On failure, unbind all sub-devices registered through this notifier. */ -v4l2_async_nf_unbind_all_subdevs (notifier); +v4l2_async_nf_unbind_all_subdevs (notifier, false); err_unlock:mutex_unlock (&list_lock);
@@ -607,7 +610,7 @@ __v4l2_async_nf_unregister(struct v4l2_async_notifier *notifier)if (!notifier || (!notifier->v4l2_dev && !notifier->sd))return ; -v4l2_async_nf_unbind_all_subdevs (notifier); +v4l2_async_nf_unbind_all_subdevs (notifier, false); notifier->sd =NULL ; notifier->v4l2_dev =NULL ;
@@ -805,7 +808,7 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)*/ subdev_notifier =v4l2_async_find_subdev_notifier (sd);if (subdev_notifier) -v4l2_async_nf_unbind_all_subdevs (subdev_notifier); +v4l2_async_nf_unbind_all_subdevs (subdev_notifier, false);if (sd->asd)v4l2_async_nf_call_unbind (notifier, sd, sd->asd);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 261/663 media: hi846: Fix memleak in hi846_init_controls()
In reply to Greg Kroah-HartmanFrom: Wei Chen <[email protected]>
[ Upstream commit 2649c1a20e8e399ee955d0e22192f9992662c3d2 ]
hi846_init_controls doesn't clean the allocated ctrl_hdlr in case there is a failure, which causes memleak. Add v4l2_ctrl_handler_free to free the resource properly.
--- drivers/media/i2c/hi846.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/media/i2c/hi846.c +8 -3
@@ -1472,21 +1472,26 @@ static int hi846_init_controls(struct hi846 *hi846)if (ctrl_hdlr->error) {dev_err (&client->dev,"v4l ctrl handler error: %d\n" , ctrl_hdlr->error); -return ctrl_hdlr->error; + ret = ctrl_hdlr->error; + goto error; } ret =v4l2_fwnode_device_parse (&client->dev, &props);if (ret) -return ret; + goto error; ret =v4l2_ctrl_new_fwnode_properties (ctrl_hdlr, &hi846_ctrl_ops, &props);if (ret) -return ret; + goto error; hi846->sd.ctrl_handler = ctrl_hdlr;return 0 ; + +error: +v4l2_ctrl_handler_free (ctrl_hdlr); +return ret; }static int hi846_set_video_mode (struct hi846 *hi846,int fps)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 262/663 drm/amd/display: Fix potential null dereference
In reply to Greg Kroah-HartmanFrom: Igor Artemiev <[email protected]>
[ Upstream commit 52f1783ff4146344342422c1cd94fcb4ce39b6fe ]
The adev->dm.dc pointer can be NULL and dereferenced in amdgpu_dm_fini() without checking.
Add a NULL pointer check before calling dc_dmub_srv_destroy().
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
@@ -1771,7 +1771,8 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)dc_deinit_callbacks (adev->dm.dc);#endif -dc_dmub_srv_destroy (&adev->dm.dc->ctx->dmub_srv); +if (adev->dm.dc) +dc_dmub_srv_destroy (&adev->dm.dc->ctx->dmub_srv);if (dc_enable_dmub_notifications (adev->dm.dc)) {kfree (adev->dm.dmub_notify);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 263/663 media: rc: gpio-ir-recv: Fix support for wake-up
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit 9c592f8ab114875fdb3b2040f01818e53de44991 ]
The driver was intended from the start to be a wake-up source for the system, however due to the absence of a suitable call to device_set_wakeup_capable(), the device_may_wakeup() call used to decide whether to enable the GPIO interrupt as a wake-up source would never happen. Lookup the DT standard "wakeup-source" property and call device_init_wakeup() to ensure the device is flagged as being wakeup capable.
--- drivers/media/rc/gpio-ir-recv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/rc/gpio-ir-recv.c +2 -0
@@ -103,6 +103,8 @@ static int gpio_ir_recv_probe(struct platform_device *pdev) rcdev->map_name =RC_MAP_EMPTY ; gpio_dev->rcdev = rcdev; +if (of_property_read_bool (np,"wakeup-source" )) +device_init_wakeup (dev, true); rc =devm_rc_register_device (dev, rcdev);if (rc <0 ) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 264/663 media: venus: dec: Fix handling of the start cmd
In reply to Greg Kroah-HartmanFrom: Michał Krawczyk <[email protected]>
[ Upstream commit 50248ad9f190d527cbd578190ca769729518b703 ]
The decoder driver should clear the last_buffer_dequeued flag of the capture queue upon receiving V4L2_DEC_CMD_START.
The last_buffer_dequeued flag is set upon receiving EOS (which always happens upon receiving V4L2_DEC_CMD_STOP).
Without this patch, after issuing the V4L2_DEC_CMD_STOP and V4L2_DEC_CMD_START, the vb2_dqbuf() function will always fail, even if the buffers are completed by the hardware.
--- drivers/media/platform/qcom/venus/vdec.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/media/platform/qcom/venus/vdec.c +8 -0
@@ -526,6 +526,7 @@ static int vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd) { struct venus_inst *inst = to_inst(file); +struct vb2_queue *dst_vq;struct hfi_frame_data fdata = {0 };int ret;
@@ -556,6 +557,13 @@ vdec_decoder_cmd(struct file *file, void *fh, struct v4l2_decoder_cmd *cmd) inst->codec_state =VENUS_DEC_STATE_DRAIN ; inst->drain_active = true; } + }else if (cmd->cmd ==V4L2_DEC_CMD_START && + inst->codec_state ==VENUS_DEC_STATE_STOPPED ) { + dst_vq =v4l2_m2m_get_vq (inst->fh.m2m_ctx, +V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE ); +vb2_clear_last_buffer_dequeued (dst_vq); + + inst->codec_state =VENUS_DEC_STATE_DECODING ; } unlock:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 265/663 media: venus: dec: Fix capture formats enumeration order
In reply to Greg Kroah-HartmanFrom: Javier Martinez Canillas <[email protected]>
[ Upstream commit a9d45ec74c8e68aaafe90191928eddbf79f4644f ]
Commit 9593126dae3e ("media: venus: Add a handling of QC08C compressed format") and commit cef92b14e653 ("media: venus: Add a handling of QC10C compressed format") added support for the QC08C and QC10C compressed formats respectively.
But these also caused a regression, because the new formats where added at the beginning of the vdec_formats[] array and the vdec_inst_init() function sets the default format output and capture using fixed indexes of that array:
static void vdec_inst_init(struct venus_inst *inst) {
...
inst->fmt_out = &vdec_formats[8]; inst->fmt_cap = &vdec_formats[0];
...
}
Since now V4L2_PIX_FMT_NV12 is not the first entry in the array anymore, the default capture format is not set to that as it was done before.
Both commits changed the first index to keep inst->fmt_out default format set to V4L2_PIX_FMT_H264, but did not update the latter to keep .fmt_out default format set to V4L2_PIX_FMT_NV12.
Rather than updating the index to the current V4L2_PIX_FMT_NV12 position, let's reorder the entries so that this format is the first entry again.
This would also make VIDIOC_ENUM_FMT report the V4L2_PIX_FMT_NV12 format with an index 0 as it did before the QC08C and QC10C formats were added.
--- drivers/media/platform/qcom/venus/vdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/media/platform/qcom/venus/vdec.c +4 -4
@@ -31,15 +31,15 @@*/ static const struct venus_format vdec_formats[] = { { - .pixfmt =V4L2_PIX_FMT_QC08C , + .pixfmt =V4L2_PIX_FMT_NV12 , .num_planes =1 , .type =V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE , }, { - .pixfmt =V4L2_PIX_FMT_QC10C , + .pixfmt =V4L2_PIX_FMT_QC08C , .num_planes =1 , .type =V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE , - },{ - .pixfmt =V4L2_PIX_FMT_NV12 , + }, { + .pixfmt =V4L2_PIX_FMT_QC10C , .num_planes =1 , .type =V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE , }, {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 266/663 regulator: stm32-pwr: fix of_iomap leak
In reply to Greg Kroah-HartmanFrom: YAN SHI <[email protected]>
[ Upstream commit c4a413e56d16a2ae84e6d8992f215c4dcc7fac20 ]
Smatch reports:drivers/regulator/stm32-pwr.c:166 stm32_pwr_regulator_probe() warn:
'base' from of_iomap() not released on lines: 151,166.
In stm32_pwr_regulator_probe(), base is not released when devm_kzalloc() fails to allocate memory or devm_regulator_register() fails to register a new regulator device, which may cause a leak.
To fix this issue, replace of_iomap() with devm_platform_ioremap_resource(). devm_platform_ioremap_resource() is a specialized function for platform devices.
It allows 'base' to be automatically released whether the probe function succeeds or fails.
Besides, use IS_ERR(base) instead of !base
as the return value of devm_platform_ioremap_resource() can either be a pointer to the remapped memory or an ERR_PTR() encoded error code if the operation fails.
--- drivers/regulator/stm32-pwr.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/regulator/stm32-pwr.c +3 -4
@@ -129,17 +129,16 @@ static const struct regulator_desc stm32_pwr_desc[] = {static int stm32_pwr_regulator_probe (struct platform_device *pdev) { -struct device_node *np = pdev->dev.of_node;struct stm32_pwr_reg *priv;void __iomem *base;struct regulator_dev *rdev;struct regulator_config config = { };int i, ret =0 ; - base =of_iomap (np,0 ); -if (!base) { + base =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (base)) {dev_err (&pdev->dev,"Unable to map IO memory\n" ); -return -ENOMEM ; +return PTR_ERR (base); } config.dev = &pdev->dev;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 267/663 x86/ioapic: Dont return 0 from arch_dynirq_lower_bound()
In reply to Greg Kroah-HartmanFrom: Saurabh Sengar <[email protected]>
[ Upstream commit 5af507bef93c09a94fb8f058213b489178f4cbe5 ]
arch_dynirq_lower_bound() is invoked by the core interrupt code to retrieve the lowest possible Linux interrupt number for dynamically allocated interrupts like MSI.
The x86 implementation uses this to exclude the IO/APIC GSI space. This works correctly as long as there is an IO/APIC registered, but returns 0 if not. This has been observed in VMs where the BIOS does not advertise an IO/APIC.
0 is an invalid interrupt number except for the legacy timer interrupt on x86. The return value is unchecked in the core code, so it ends up to allocate interrupt number 0 which is subsequently considered to be invalid by the caller, e.g. the MSI allocation code.
The function has already a check for 0 in the case that an IO/APIC is registered, as ioapic_dynirq_base is 0 in case of device tree setups.
Consolidate this and zero check for both ioapic_dynirq_base and gsi_top, which is used in the case that no IO/APIC is registered.
--- arch/x86/kernel/apic/io_apic.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
arch/x86/kernel/apic/io_apic.c +9 -5
@@ -2480,17 +2480,21 @@ static int io_apic_get_redir_entries(int ioapic)unsigned int arch_dynirq_lower_bound (unsigned int from) { +unsigned int ret; +/* * dmar_alloc_hwirq() may be called before setup_IO_APIC(), so use * gsi_top if ioapic_dynirq_base hasn't been initialized yet. */ -if (!ioapic_initialized) -return gsi_top; + ret = ioapic_dynirq_base ? : gsi_top; +/* -* For DT enabled machines ioapic_dynirq_base is irrelevant and not -* updated. So simply return @from if ioapic_dynirq_base == 0. +* For DT enabled machines ioapic_dynirq_base is irrelevant and +* always 0. gsi_top can be 0 if there is no IO/APIC registered. +* 0 is an invalid interrupt number for dynamic allocations. Return +* @from instead. */ -return ioapic_dynirq_base ? : from; +return ret ? : from; }#ifdef CONFIG_X86_32
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 268/663 arm64: kgdb: Set PSTATE.SS to 1 to re-enable single-step
In reply to Greg Kroah-HartmanFrom: Sumit Garg <[email protected]>
[ Upstream commit af6c0bd59f4f3ad5daad2f7b777954b1954551d5 ]
Currently only the first attempt to single-step has any effect. After that all further stepping remains "stuck" at the same program counter value.
Refer to the ARM Architecture Reference Manual (ARM DDI 0487E.a) D2.12, PSTATE.SS=1 should be set at each step before transferring the PE to the 'Active-not-pending' state. The problem here is PSTATE.SS=1 is not set since the second single-step.
After the first single-step, the PE transferes to the 'Inactive' state, with PSTATE.SS=0 and MDSCR.SS=1, thus PSTATE.SS won't be set to 1 due to kernel_active_single_step()=true. Then the PE transferes to the 'Active-pending' state when ERET and returns to the debugger by step exception.
Before this patch:
==================
Entering kdb (current=0xffff3376039f0000, pid 1) on processor 0 due to Keyboard Entry [0]kdb>
[0]kdb>
[0]kdb> bp write_sysrq_trigger
Instruction(i) BP #0 at 0xffffa45c13d09290 (write_sysrq_trigger)
is enabled addr at ffffa45c13d09290, hardtype=0 installed=0
[0]kdb> go
$ echo h > /proc/sysrq-trigger
Entering kdb (current=0xffff4f7e453f8000, pid 175) on processor 1 due to Breakpoint @ 0xffffad651a309290 [1]kdb> ss
Entering kdb (current=0xffff4f7e453f8000, pid 175) on processor 1 due to SS trap @ 0xffffad651a309294 [1]kdb> ss
Entering kdb (current=0xffff4f7e453f8000, pid 175) on processor 1 due to SS trap @ 0xffffad651a309294 [1]kdb>
After this patch:
=================
Entering kdb (current=0xffff6851c39f0000, pid 1) on processor 0 due to Keyboard Entry [0]kdb> bp write_sysrq_trigger
Instruction(i) BP #0 at 0xffffc02d2dd09290 (write_sysrq_trigger)
is enabled addr at ffffc02d2dd09290, hardtype=0 installed=0
[0]kdb> go
$ echo h > /proc/sysrq-trigger
Entering kdb (current=0xffff6851c53c1840, pid 174) on processor 1 due to Breakpoint @ 0xffffc02d2dd09290 [1]kdb> ss
Entering kdb (current=0xffff6851c53c1840, pid 174) on processor 1 due to SS trap @ 0xffffc02d2dd09294 [1]kdb> ss
Entering kdb (current=0xffff6851c53c1840, pid 174) on processor 1 due to SS trap @ 0xffffc02d2dd09298 [1]kdb> ss
Entering kdb (current=0xffff6851c53c1840, pid 174) on processor 1 due to SS trap @ 0xffffc02d2dd0929c [1]kdb>
--- arch/arm64/include/asm/debug-monitors.h | 1 + arch/arm64/kernel/debug-monitors.c | 5 +++++ arch/arm64/kernel/kgdb.c | 2 ++ 3 files changed, 8 insertions(+)
arch/arm64/include/asm/debug-monitors.h +1 -0
@@ -104,6 +104,7 @@ void user_regs_reset_single_step(struct user_pt_regs *regs,void kernel_enable_single_step (struct pt_regs *regs);void kernel_disable_single_step (void );int kernel_active_single_step (void ); +void kernel_rewind_single_step (struct pt_regs *regs);#ifdef CONFIG_HAVE_HW_BREAKPOINT int reinstall_suspended_bps (struct pt_regs *regs);
arch/arm64/kernel/debug-monitors.c +5 -0
@@ -438,6 +438,11 @@ int kernel_active_single_step(void) }NOKPROBE_SYMBOL (kernel_active_single_step); +void kernel_rewind_single_step (struct pt_regs *regs) +{ +set_regs_spsr_ss (regs); +} +/* ptrace API */ void user_enable_single_step (struct task_struct *task) {
arch/arm64/kernel/kgdb.c +2 -0
@@ -224,6 +224,8 @@ int kgdb_arch_handle_exception(int exception_vector, int signo,*/ if (!kernel_active_single_step ())kernel_enable_single_step (linux_regs); +else +kernel_rewind_single_step (linux_regs); err =0 ;break ;default :
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 269/663 perf/arm-cmn: Fix port detection for CMN-700
In reply to Greg Kroah-HartmanFrom: Robin Murphy <[email protected]>
[ Upstream commit 2ad91e44e6b0c7ef1ed151b3bb2242a2144e6085 ]
When the "extra device ports" configuration was first added, the additional mxp_device_port_connect_info registers were added around the existing mxp_mesh_port_connect_info registers. What I missed about CMN-700 is that it shuffled them around to remove this discontinuity. As such, tweak the definitions and factor out a helper for reading these registers so we can deal with this discrepancy easily, which does at least allow nicely tidying up the callsites. With this we can then also do the nice thing and skip accesses completely rather than relying on RES0 behaviour where we know the extra registers aren't defined.
--- drivers/perf/arm-cmn.c | 57 ++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 27 deletions(-)
drivers/perf/arm-cmn.c +30 -27
@@ -57,14 +57,12 @@#define CMN_INFO_REQ_VC_NUM GENMASK_ULL(1, 0)/* XPs also have some local topology info which has uses too */ -#define CMN_MXP__CONNECT_INFO_P0 0x0008 -#define CMN_MXP__CONNECT_INFO_P1 0x0010 -#define CMN_MXP__CONNECT_INFO_P2 0x0028 -#define CMN_MXP__CONNECT_INFO_P3 0x0030 -#define CMN_MXP__CONNECT_INFO_P4 0x0038 -#define CMN_MXP__CONNECT_INFO_P5 0x0040 +#define CMN_MXP__CONNECT_INFO (p) (0x0008 + 8 * (p))#define CMN__CONNECT_INFO_DEVICE_TYPE GENMASK_ULL(4, 0) +#define CMN_MAX_PORTS 6 +#define CI700_CONNECT_INFO_P2_5_OFFSET 0x10 +/* PMU registers occupy the 3rd 4KB page of each node's region */ #define CMN_PMU_OFFSET 0x2000
@@ -396,6 +394,25 @@ static struct arm_cmn_node *arm_cmn_node(const struct arm_cmn *cmn,return NULL ; } +static u32 arm_cmn_device_connect_info (const struct arm_cmn *cmn, +const struct arm_cmn_node *xp,int port) +{ +int offset =CMN_MXP__CONNECT_INFO (port); + +if (port >=2 ) { +if (cmn->model & (CMN600 |CMN650 )) +return 0 ; +/* +* CI-700 may have extra ports, but still has the +* mesh_port_connect_info registers in the way. +*/ +if (cmn->model ==CI700 ) + offset +=CI700_CONNECT_INFO_P2_5_OFFSET ; + } + +return readl_relaxed (xp->pmu_base -CMN_PMU_OFFSET + offset); +} +static struct dentry *arm_cmn_debugfs;#ifdef CONFIG_DEBUG_FS
@@ -469,7 +486,7 @@ static int arm_cmn_map_show(struct seq_file *s, void *data) y = cmn->mesh_y;while (y--) {int xp_base = cmn->mesh_x * y; -u8 port[6 ][CMN_MAX_DIMENSION ]; +u8 port[CMN_MAX_PORTS ][CMN_MAX_DIMENSION ];for (x =0 ; x < cmn->mesh_x; x++)seq_puts (s,"--------+" );
@@ -477,14 +494,9 @@ static int arm_cmn_map_show(struct seq_file *s, void *data)seq_printf (s,"\n%d |" , y);for (x =0 ; x < cmn->mesh_x; x++) {struct arm_cmn_node *xp = cmn->xps + xp_base + x; -void __iomem *base = xp->pmu_base -CMN_PMU_OFFSET ; - - port[0 ][x] =readl_relaxed (base +CMN_MXP__CONNECT_INFO_P0 ); - port[1 ][x] =readl_relaxed (base +CMN_MXP__CONNECT_INFO_P1 ); - port[2 ][x] =readl_relaxed (base +CMN_MXP__CONNECT_INFO_P2 ); - port[3 ][x] =readl_relaxed (base +CMN_MXP__CONNECT_INFO_P3 ); - port[4 ][x] =readl_relaxed (base +CMN_MXP__CONNECT_INFO_P4 ); - port[5 ][x] =readl_relaxed (base +CMN_MXP__CONNECT_INFO_P5 ); + +for (p =0 ; p <CMN_MAX_PORTS ; p++) + port[p][x] =arm_cmn_device_connect_info (cmn, xp, p);seq_printf (s," XP #%-2d |" , xp_base + x); }
@@ -2082,18 +2094,9 @@ static int arm_cmn_discover(struct arm_cmn *cmn, unsigned int rgn_offset)* from this, since in that case we will see at least one XP * with port 2 connected, for the HN-D. */ -if (readq_relaxed (xp_region +CMN_MXP__CONNECT_INFO_P0 )) - xp_ports |=BIT (0 ); -if (readq_relaxed (xp_region +CMN_MXP__CONNECT_INFO_P1 )) - xp_ports |=BIT (1 ); -if (readq_relaxed (xp_region +CMN_MXP__CONNECT_INFO_P2 )) - xp_ports |=BIT (2 ); -if (readq_relaxed (xp_region +CMN_MXP__CONNECT_INFO_P3 )) - xp_ports |=BIT (3 ); -if (readq_relaxed (xp_region +CMN_MXP__CONNECT_INFO_P4 )) - xp_ports |=BIT (4 ); -if (readq_relaxed (xp_region +CMN_MXP__CONNECT_INFO_P5 )) - xp_ports |=BIT (5 ); +for (int p =0 ; p <CMN_MAX_PORTS ; p++) +if (arm_cmn_device_connect_info (cmn, xp, p)) + xp_ports |=BIT (p);if (cmn->multi_dtm && (xp_ports &0xc ))arm_cmn_init_dtm (dtm++, xp,1 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 270/663 media: mediatek: vcodec: fix decoder disable pm crash
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit 9d2f13fb47dcab6d094f34ecfd6a879a409722b3 ]
Can't call pm_runtime_disable when the architecture support sub device for 'dev->pm.dev' is NUll, or will get below crash log.
[ 10.771551] pc : _raw_spin_lock_irq+0x4c/0xa0 [ 10.771556] lr : __pm_runtime_disable+0x30/0x130 [ 10.771558] sp : ffffffc01e4cb800 [ 10.771559] x29: ffffffc01e4cb800 x28: ffffffdf082108a8 [ 10.771563] x27: ffffffc01e4cbd70 x26: ffffff8605df55f0 [ 10.771567] x25: 0000000000000002 x24: 0000000000000002 [ 10.771570] x23: ffffff85c0dc9c00 x22: 0000000000000001 [ 10.771573] x21: 0000000000000001 x20: 0000000000000000 [ 10.771577] x19: 00000000000000f4 x18: ffffffdf2e9fbe18 [ 10.771580] x17: 0000000000000000 x16: ffffffdf2df13c74 [ 10.771583] x15: 00000000000002ea x14: 0000000000000058 [ 10.771587] x13: ffffffdf2de1b62c x12: ffffffdf2e9e30e4 [ 10.771590] x11: 0000000000000000 x10: 0000000000000001 [ 10.771593] x9 : 0000000000000000 x8 : 00000000000000f4 [ 10.771596] x7 : 6bff6264632c6264 x6 : 0000000000008000 [ 10.771600] x5 : 0080000000000000 x4 : 0000000000000001 [ 10.771603] x3 : 0000000000000008 x2 : 0000000000000001 [ 10.771608] x1 : 0000000000000000 x0 : 00000000000000f4 [ 10.771613] Call trace: [ 10.771617] _raw_spin_lock_irq+0x4c/0xa0 [ 10.771620] __pm_runtime_disable+0x30/0x130 [ 10.771657] mtk_vcodec_probe+0x69c/0x728 [mtk_vcodec_dec 800cc929d6631f79f9b273254c8db94d0d3500dc] [ 10.771662] platform_drv_probe+0x9c/0xbc [ 10.771665] really_probe+0x13c/0x3a0 [ 10.771668] driver_probe_device+0x84/0xc0 [ 10.771671] device_driver_attach+0x54/0x78
--- drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_drv.c +2 -1
@@ -451,7 +451,8 @@ static int mtk_vcodec_probe(struct platform_device *pdev)if (IS_VDEC_LAT_ARCH (dev->vdec_pdata->hw_arch))destroy_workqueue (dev->core_workqueue); err_res: -pm_runtime_disable (dev->pm.dev); +if (!dev->vdec_pdata->is_subdev_supported) +pm_runtime_disable (dev->pm.dev); err_dec_pm:mtk_vcodec_fw_release (dev->fw_handler);return ret;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 271/663 media: mediatek: vcodec: add remove function for decoder platform driver
In reply to Greg Kroah-HartmanFrom: Yunfei Dong <[email protected]>
[ Upstream commit e2a10b3801061d05d3e3415b9b824251451cfd6c ]
Need to disable decoder power when remove decoder hardware driver, adding remove callback function in the definition of platform driver.
--- .../media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_hw.c +8 -0
@@ -193,8 +193,16 @@ static int mtk_vdec_hw_probe(struct platform_device *pdev)return ret; } +static int mtk_vdec_hw_remove (struct platform_device *pdev) +{ +pm_runtime_disable (&pdev->dev); + +return 0 ; +} +static struct platform_driver mtk_vdec_driver = { .probe = mtk_vdec_hw_probe, + .remove = mtk_vdec_hw_remove, .driver = { .name ="mtk-vdec-comp" , .of_match_table = mtk_vdec_hw_match,
Signature · 1 line
2.39.2