6.13.12-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 1/414 ASoC: Intel: adl: add 2xrt1316 audio configuration
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bard Liao <[email protected]>
commit 8b36447c9ae102539d82d6278971b23b20d87629 upstream.
That is a speaker only configuration and 2 rt1316 are on link 0 and 2.
--- sound/soc/intel/common/soc-acpi-intel-adl-match.c | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+)
sound/soc/intel/common/soc-acpi-intel-adl-match.c +29 -0
@@ -214,6 +214,15 @@ static const struct snd_soc_acpi_adr_dev } }; +static const struct snd_soc_acpi_adr_device rt1316_2_group2_adr[] = { + { + .adr =0x000232025D131601ull , + .num_endpoints =1 , + .endpoints = &spk_r_endpoint, + .name_prefix ="rt1316-2" + } +}; +static const struct snd_soc_acpi_adr_device rt1316_1_single_adr[] = { { .adr =0x000130025D131601ull ,
@@ -547,6 +556,20 @@ static const struct snd_soc_acpi_link_ad {} }; +static const struct snd_soc_acpi_link_adr adl_sdw_rt1316_link02[] = { + { + .mask =BIT (0 ), + .num_adr =ARRAY_SIZE (rt1316_0_group2_adr), + .adr_d = rt1316_0_group2_adr, + }, + { + .mask =BIT (2 ), + .num_adr =ARRAY_SIZE (rt1316_2_group2_adr), + .adr_d = rt1316_2_group2_adr, + }, + {} +}; +static const struct snd_soc_acpi_codecs adl_max98357a_amp = { .num_codecs =1 , .codecs = {"MX98357A" }
@@ -749,6 +772,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_in .drv_name = "sof_sdw", .sof_tplg_filename = "sof-adl-sdw-max98373-rt5682.tplg", }, + { + .link_mask = BIT(0) | BIT(2), + .links = adl_sdw_rt1316_link02, + .drv_name = "sof_sdw", + .sof_tplg_filename = "sof-adl-rt1316-l02.tplg", + }, {}, };EXPORT_SYMBOL_GPL (snd_soc_acpi_intel_adl_sdw_machines);
Greg Kroah-Hartman
maintainerPATCH 10/414 drm/xe/hw_engine: define sysfs_ops on all directories
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tejas Upadhyay <[email protected]>
[ Upstream commit a5c71fd5b69b9da77e5e0b268e69e256932ba49c ]
Sysfs_ops needs to be defined on all directories which can have attr files with set/get method. Add sysfs_ops to even those directories which is currently empty but would have attr files with set/get method in future. Leave .default with default sysfs_ops as it will never have setter method.
V2(Himal/Rodrigo):
- use single sysfs_ops for all dir and attr with set/get
- add default ops as ./default does not need runtime pm at all
--- drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 108 +++++++++--------- 1 file changed, 52 insertions(+), 56 deletions(-)
drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c +52 -56
@@ -32,14 +32,61 @@ bool xe_hw_engine_timeout_in_range(u64 timeout, u64 min, u64 max)return timeout >= min && timeout <= max; } -static void kobj_xe_hw_engine_release (struct kobject *kobj) +static void xe_hw_engine_sysfs_kobj_release (struct kobject *kobj) {kfree (kobj); } +static ssize_t xe_hw_engine_class_sysfs_attr_show (struct kobject *kobj, +struct attribute *attr, +char *buf) +{ +struct xe_device *xe =kobj_to_xe (kobj); +struct kobj_attribute *kattr; +ssize_t ret = -EIO ; + + kattr = container_of(attr, struct kobj_attribute, attr); +if (kattr->show) { +xe_pm_runtime_get (xe); + ret = kattr->show (kobj, kattr, buf); +xe_pm_runtime_put (xe); + } + +return ret; +} + +static ssize_t xe_hw_engine_class_sysfs_attr_store (struct kobject *kobj, +struct attribute *attr, +const char *buf, +size_t count) +{ +struct xe_device *xe =kobj_to_xe (kobj); +struct kobj_attribute *kattr; +ssize_t ret = -EIO ; + + kattr = container_of(attr, struct kobj_attribute, attr); +if (kattr->store) { +xe_pm_runtime_get (xe); + ret = kattr->store (kobj, kattr, buf, count); +xe_pm_runtime_put (xe); + } + +return ret; +} + +static const struct sysfs_ops xe_hw_engine_class_sysfs_ops = { + .show = xe_hw_engine_class_sysfs_attr_show, + .store = xe_hw_engine_class_sysfs_attr_store, +}; +static const struct kobj_type kobj_xe_hw_engine_type = { - .release = kobj_xe_hw_engine_release, - .sysfs_ops = &kobj_sysfs_ops + .release = xe_hw_engine_sysfs_kobj_release, + .sysfs_ops = &xe_hw_engine_class_sysfs_ops, +}; + +static const struct kobj_type kobj_xe_hw_engine_type_def = { + .release = xe_hw_engine_sysfs_kobj_release, + .sysfs_ops = &kobj_sysfs_ops, }; static ssize_t job_timeout_max_store(struct kobject *kobj,
@@ -543,7 +590,7 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe,if (!kobj)return -ENOMEM ; -kobject_init (kobj, &kobj_xe_hw_engine_type); +kobject_init (kobj, &kobj_xe_hw_engine_type_def); err =kobject_add (kobj, parent,"%s" ,".defaults" );if (err) goto err_object;
@@ -559,57 +606,6 @@ static int xe_add_hw_engine_class_defaults(struct xe_device *xe,return err; } -static void xe_hw_engine_sysfs_kobj_release (struct kobject *kobj) -{ -kfree (kobj); -} - -static ssize_t xe_hw_engine_class_sysfs_attr_show (struct kobject *kobj, -struct attribute *attr, -char *buf) -{ -struct xe_device *xe =kobj_to_xe (kobj); -struct kobj_attribute *kattr; -ssize_t ret = -EIO ; - - kattr = container_of(attr, struct kobj_attribute, attr); -if (kattr->show) { -xe_pm_runtime_get (xe); - ret = kattr->show (kobj, kattr, buf); -xe_pm_runtime_put (xe); - } - -return ret; -} - -static ssize_t xe_hw_engine_class_sysfs_attr_store (struct kobject *kobj, -struct attribute *attr, -const char *buf, -size_t count) -{ -struct xe_device *xe =kobj_to_xe (kobj); -struct kobj_attribute *kattr; -ssize_t ret = -EIO ; - - kattr = container_of(attr, struct kobj_attribute, attr); -if (kattr->store) { -xe_pm_runtime_get (xe); - ret = kattr->store (kobj, kattr, buf, count); -xe_pm_runtime_put (xe); - } - -return ret; -} - -static const struct sysfs_ops xe_hw_engine_class_sysfs_ops = { - .show = xe_hw_engine_class_sysfs_attr_show, - .store = xe_hw_engine_class_sysfs_attr_store, -}; - -static const struct kobj_type xe_hw_engine_sysfs_kobj_type = { - .release = xe_hw_engine_sysfs_kobj_release, - .sysfs_ops = &xe_hw_engine_class_sysfs_ops, -};static void hw_engine_class_sysfs_fini (void *arg) {
@@ -640,7 +636,7 @@ int xe_hw_engine_class_sysfs_init(struct xe_gt *gt)if (!kobj)return -ENOMEM ; -kobject_init (kobj, &xe_hw_engine_sysfs_kobj_type); +kobject_init (kobj, &kobj_xe_hw_engine_type); err =kobject_add (kobj, gt->sysfs,"engines" );if (err)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 11/414 drm/xe: Restore EIO errno return when GuC PC start fails
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rodrigo Vivi <[email protected]>
[ Upstream commit 88ecb66b9956a14577d513a6c8c28bb2e7989703 ]
Commit b4b05e53b550 ("drm/xe/guc_pc: Retry and wait longer for GuC PC start"), leads to the following Smatch static checker warning:
drivers/gpu/drm/xe/xe_guc_pc.c:1073 xe_guc_pc_start()
warn: missing error code here? '_dev_err()' failed. 'ret' = '0'
--- drivers/gpu/drm/xe/xe_guc_pc.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/xe/xe_guc_pc.c +1 -0
@@ -1019,6 +1019,7 @@ int xe_guc_pc_start(struct xe_guc_pc *pc)if (wait_for_pc_state (pc,SLPC_GLOBAL_STATE_RUNNING ,SLPC_RESET_EXTENDED_TIMEOUT_MS )) {xe_gt_err (gt,"GuC PC Start failed: Dynamic GT frequency control and GT sleep states are now disabled.\n" ); + ret = -EIO ; goto out; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 12/414 ata: pata_pxa: Fix potential NULL pointer dereference in pxa_ata_probe()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Henry Martin <[email protected]>
[ Upstream commit ad320e408a8c95a282ab9c05cdf0c9b95e317985 ]
devm_ioremap() returns NULL on error. Currently, pxa_ata_probe() does not check for this case, which can result in a NULL pointer dereference.
Add NULL check after devm_ioremap() to prevent this issue.
--- drivers/ata/pata_pxa.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/ata/pata_pxa.c +6 -0
@@ -223,10 +223,16 @@ static int pxa_ata_probe(struct platform_device *pdev) ap->ioaddr.cmd_addr =devm_ioremap (&pdev->dev, cmd_res->start,resource_size (cmd_res)); +if (!ap->ioaddr.cmd_addr) +return -ENOMEM ; ap->ioaddr.ctl_addr =devm_ioremap (&pdev->dev, ctl_res->start,resource_size (ctl_res)); +if (!ap->ioaddr.ctl_addr) +return -ENOMEM ; ap->ioaddr.bmdma_addr =devm_ioremap (&pdev->dev, dma_res->start,resource_size (dma_res)); +if (!ap->ioaddr.bmdma_addr) +return -ENOMEM ;/* * Adjust register offsets
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 2/414 cgroup/cpuset: Fix incorrect isolated_cpus update in update_parent_effective_cpumask()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <[email protected]>
[ Upstream commit 668e041662e92ab3ebcb9eb606d3ec01884546ab ]
Before commit f0af1bfc27b5 ("cgroup/cpuset: Relax constraints to partition & cpus changes"), a cpuset partition cannot be enabled if not all the requested CPUs can be granted from the parent cpuset. After that commit, a cpuset partition can be created even if the requested exclusive CPUs contain CPUs not allowed its parent. The delmask containing exclusive CPUs to be removed from its parent wasn't adjusted accordingly.
That is not a problem until the introduction of a new isolated_cpus mask in commit 11e5f407b64a ("cgroup/cpuset: Keep track of CPUs in isolated partitions") as the CPUs in the delmask may be added directly into isolated_cpus.
As a result, isolated_cpus may incorrectly contain CPUs that are not isolated leading to incorrect data reporting. Fix this by adjusting the delmask to reflect the actual exclusive CPUs for the creation of the partition.
--- kernel/cgroup/cpuset.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/cgroup/cpuset.c +3 -3
@@ -1680,9 +1680,9 @@ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,if (nocpu)return PERR_NOCPUS ; -cpumask_copy (tmp->delmask, xcpus); - deleting = true; - subparts_delta++; + deleting =cpumask_and (tmp->delmask, xcpus, parent->effective_xcpus); +if (deleting) + subparts_delta++; new_prs = (cmd == partcmd_enable) ?PRS_ROOT :PRS_ISOLATED ; }else if (cmd == partcmd_disable) {/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 3/414 cgroup/cpuset: Fix error handling in remote_partition_disable()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <[email protected]>
[ Upstream commit 8bf450f3aec3d1bbd725d179502c64b8992588e4 ]
When remote_partition_disable() is called to disable a remote partition, it always sets the partition to an invalid partition state. It should only do so if an error code (prs_err) has been set. Correct that and add proper error code in places where remote_partition_disable() is called due to error.
--- kernel/cgroup/cpuset.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-)
kernel/cgroup/cpuset.c +20 -9
@@ -1407,6 +1407,7 @@ static int remote_partition_enable(struct cpuset *cs, int new_prs,list_add (&cs->remote_sibling, &remote_children);spin_unlock_irq (&callback_lock);update_unbound_workqueue_cpumask (isolcpus_updated); + cs->prs_err =0 ;/* * Propagate changes in top_cpuset's effective_cpus down the hierarchy.
@@ -1437,9 +1438,11 @@ static void remote_partition_disable(struct cpuset *cs, struct tmpmasks *tmp)list_del_init (&cs->remote_sibling); isolcpus_updated =partition_xcpus_del (cs->partition_root_state,NULL , tmp->new_cpus); - cs->partition_root_state = -cs->partition_root_state; -if (!cs->prs_err) - cs->prs_err =PERR_INVCPUS ; +if (cs->prs_err) + cs->partition_root_state = -cs->partition_root_state; +else + cs->partition_root_state =PRS_MEMBER ; +reset_partition_data (cs);spin_unlock_irq (&callback_lock);update_unbound_workqueue_cpumask (isolcpus_updated);
@@ -1472,8 +1475,10 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *newmask,WARN_ON_ONCE (!cpumask_subset (cs->effective_xcpus, subpartitions_cpus)); -if (cpumask_empty (newmask)) +if (cpumask_empty (newmask)) { + cs->prs_err =PERR_CPUSEMPTY ; goto invalidate; + } adding =cpumask_andnot (tmp->addmask, newmask, cs->effective_xcpus); deleting =cpumask_andnot (tmp->delmask, cs->effective_xcpus, newmask);
@@ -1483,10 +1488,15 @@ static void remote_cpus_update(struct cpuset *cs, struct cpumask *newmask,* not allocated to other partitions and there are effective_cpus * left in the top cpuset. */ -if (adding && (!capable (CAP_SYS_ADMIN ) || -cpumask_intersects (tmp->addmask, subpartitions_cpus) || -cpumask_subset (top_cpuset.effective_cpus, tmp->addmask))) - goto invalidate; +if (adding) { +if (!capable (CAP_SYS_ADMIN )) + cs->prs_err =PERR_ACCESS ; +else if (cpumask_intersects (tmp->addmask, subpartitions_cpus) || +cpumask_subset (top_cpuset.effective_cpus, tmp->addmask)) + cs->prs_err =PERR_NOCPUS ; +if (cs->prs_err) + goto invalidate; + }spin_lock_irq (&callback_lock);if (adding)
@@ -1602,7 +1612,7 @@ static bool prstate_housekeeping_conflict(int prstate, struct cpumask *new_cpus)* The partcmd_update command is used by update_cpumasks_hier() with newmask * NULL and update_cpumask() with newmask set. The partcmd_invalidate is used * by update_cpumask() with NULL newmask. In both cases, the callers won't -* check for error and so partition_root_state and prs_error will be updated +* check for error and so partition_root_state and prs_err will be updated * directly. */ static int update_parent_effective_cpumask(struct cpuset *cs, int cmd,
@@ -3740,6 +3750,7 @@ static void cpuset_hotplug_update_tasks(struct cpuset *cs, struct tmpmasks *tmp)if (remote &&cpumask_empty (&new_cpus) &&partition_is_populated (cs,NULL )) { + cs->prs_err =PERR_HOTPLUG ;remote_partition_disable (cs, tmp);compute_effective_cpumask (&new_cpus, cs, parent); remote = false;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 4/414 cgroup/cpuset: Fix race between newly created partition and dying one
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Waiman Long <[email protected]>
[ Upstream commit a22b3d54de94f82ca057cc2ebf9496fa91ebf698 ]
There is a possible race between removing a cgroup diectory that is a partition root and the creation of a new partition. The partition to be removed can be dying but still online, it doesn't not currently participate in checking for exclusive CPUs conflict, but the exclusive CPUs are still there in subpartitions_cpus and isolated_cpus. These two cpumasks are global states that affect the operation of cpuset partitions. The exclusive CPUs in dying cpusets will only be removed when cpuset_css_offline() function is called after an RCU delay.
As a result, it is possible that a new partition can be created with exclusive CPUs that overlap with those of a dying one. When that dying partition is finally offlined, it removes those overlapping exclusive CPUs from subpartitions_cpus and maybe isolated_cpus resulting in an incorrect CPU configuration.
This bug was found when a warning was triggered in remote_partition_disable() during testing because the subpartitions_cpus mask was empty.
One possible way to fix this is to iterate the dying cpusets as well and avoid using the exclusive CPUs in those dying cpusets. However, this can still cause random partition creation failures or other anomalies due to racing. A better way to fix this race is to reset the partition state at the moment when a cpuset is being killed.
Introduce a new css_killed() CSS function pointer and call it, if defined, before setting CSS_DYING flag in kill_css(). Also update the css_is_dying() helper to use the CSS_DYING flag introduced by commit 33c35aa48178 ("cgroup: Prevent kill_css() from being called more than once") for proper synchronization.
Add a new cpuset_css_killed() function to reset the partition state of a valid partition root if it is being killed.
--- include/linux/cgroup-defs.h | 1 + include/linux/cgroup.h | 2 +- kernel/cgroup/cgroup.c | 6 ++++++ kernel/cgroup/cpuset.c | 20 +++++++++++++++++--- 4 files changed, 25 insertions(+), 4 deletions(-)
include/linux/cgroup-defs.h +1 -0
@@ -711,6 +711,7 @@ struct cgroup_subsys {void (*css_released)(struct cgroup_subsys_state *css);void (*css_free)(struct cgroup_subsys_state *css);void (*css_reset)(struct cgroup_subsys_state *css); +void (*css_killed)(struct cgroup_subsys_state *css);void (*css_rstat_flush)(struct cgroup_subsys_state *css,int cpu);int (*css_extra_stat_show)(struct seq_file *seq,struct cgroup_subsys_state *css);
include/linux/cgroup.h +1 -1
@@ -343,7 +343,7 @@ static inline u64 cgroup_id(const struct cgroup *cgrp)*/ static inline bool css_is_dying (struct cgroup_subsys_state *css) { -return !(css->flags &CSS_NO_REF ) &&percpu_ref_is_dying (&css->refcnt); +return css->flags &CSS_DYING ; }static inline void cgroup_get (struct cgroup *cgrp)
kernel/cgroup/cgroup.c +6 -0
@@ -5909,6 +5909,12 @@ static void kill_css(struct cgroup_subsys_state *css)if (css->flags &CSS_DYING )return ; +/* +* Call css_killed(), if defined, before setting the CSS_DYING flag +*/ +if (css->ss->css_killed) + css->ss->css_killed (css); + css->flags |=CSS_DYING ;/*
kernel/cgroup/cpuset.c +17 -3
@@ -3486,9 +3486,6 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css)cpus_read_lock ();mutex_lock (&cpuset_mutex); -if (is_partition_valid (cs)) -update_prstate (cs,0 ); -if (!cpuset_v2 () &&is_sched_load_balance (cs))cpuset_update_flag (CS_SCHED_LOAD_BALANCE , cs,0 );
@@ -3499,6 +3496,22 @@ static void cpuset_css_offline(struct cgroup_subsys_state *css)cpus_read_unlock (); } +static void cpuset_css_killed (struct cgroup_subsys_state *css) +{ +struct cpuset *cs =css_cs (css); + +cpus_read_lock (); +mutex_lock (&cpuset_mutex); + +/* Reset valid partition back to member */ +if (is_partition_valid (cs)) +update_prstate (cs,PRS_MEMBER ); + +mutex_unlock (&cpuset_mutex); +cpus_read_unlock (); + +} +static void cpuset_css_free (struct cgroup_subsys_state *css) {struct cpuset *cs =css_cs (css);
@@ -3620,6 +3633,7 @@ struct cgroup_subsys cpuset_cgrp_subsys = { .css_alloc = cpuset_css_alloc, .css_online = cpuset_css_online, .css_offline = cpuset_css_offline, + .css_killed = cpuset_css_killed, .css_free = cpuset_css_free, .can_attach = cpuset_can_attach, .cancel_attach = cpuset_cancel_attach,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 5/414 gpiolib: of: Fix the choice for Ingenic NAND quirk
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andy Shevchenko <[email protected]>
[ Upstream commit 2b9c536430126c233552cdcd6ec9d5077454ece4 ]
The Ingenic NAND quirk has been added under CONFIG_LCD_HX8357 ifdeffery which sounds quite wrong. Fix the choice for Ingenic NAND quirk by wrapping it into own ifdeffery related to the respective driver.
--- drivers/gpio/gpiolib-of.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpio/gpiolib-of.c +2 -0
@@ -193,6 +193,8 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np, */ { "himax,hx8357", "gpios-reset", false }, { "himax,hx8369", "gpios-reset", false }, +#endif +#if IS_ENABLED(CONFIG_MTD_NAND_JZ4780) /* * The rb-gpios semantics was undocumented and qi,lb60 (along with * the ingenic driver) got it wrong. The active state encodes the
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 6/414 selftests/futex: futex_waitv wouldblock test should fail
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Liaw <[email protected]>
[ Upstream commit 7d50e00fef2832e98d7e06bbfc85c1d66ee110ca ]
Testcase should fail if -EWOULDBLOCK is not returned when expected value differs from actual value from the waiter.
--- .../testing/selftests/futex/functional/futex_wait_wouldblock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/futex/functional/futex_wait_wouldblock.c +1 -1
@@ -98,7 +98,7 @@ int main(int argc, char *argv[])info ("Calling futex_waitv on f1: %u @ %p with val=%u\n" , f1, &f1, f1+1 ); res =futex_waitv (&waitv,1 ,0 , &to,CLOCK_MONOTONIC );if (!res || errno !=EWOULDBLOCK ) { -ksft_test_result_pass ("futex_waitv returned: %d %s\n" , +ksft_test_result_fail ("futex_waitv returned: %d %s\n" , res ? errno : res, res ?strerror (errno) :"" ); ret =RET_FAIL ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 7/414 ublk: fix handling recovery & reissue in ublk_abort_queue()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ming Lei <[email protected]>
[ Upstream commit 6ee6bd5d4fce502a5b5a2ea805e9ff16e6aa890f ]
Commit 8284066946e6 ("ublk: grab request reference when the request is handled by userspace") doesn't grab request reference in case of recovery reissue. Then the request can be requeued & re-dispatch & failed when canceling uring command.
If it is one zc request, the request can be freed before io_uring returns the zc buffer back, then cause kernel panic:
[ 126.773061] BUG: kernel NULL pointer dereference, address: 00000000000000c8 [ 126.773657] #PF: supervisor read access in kernel mode [ 126.774052] #PF: error_code(0x0000) - not-present page [ 126.774455] PGD 0 P4D 0 [ 126.774698] Oops: Oops: 0000 [#1] SMP NOPTI [ 126.775034] CPU: 13 UID: 0 PID: 1612 Comm: kworker/u64:55 Not tainted 6.14.0_blk+ #182 PREEMPT(full) [ 126.775676] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-1.fc39 04/01/2014 [ 126.776275] Workqueue: iou_exit io_ring_exit_work [ 126.776651] RIP: 0010:ublk_io_release+0x14/0x130 [ublk_drv]
Fixes it by always grabbing request reference for aborting the request.
--- drivers/block/ublk_drv.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
drivers/block/ublk_drv.c +26 -4
@@ -1094,6 +1094,25 @@ static void ublk_complete_rq(struct kref *ref)__ublk_complete_rq (req); } +static void ublk_do_fail_rq (struct request *req) +{ +struct ublk_queue *ubq = req->mq_hctx->driver_data; + +if (ublk_nosrv_should_reissue_outstanding (ubq->dev)) +blk_mq_requeue_request (req, false); +else +__ublk_complete_rq (req); +} + +static void ublk_fail_rq_fn (struct kref *ref) +{ + struct ublk_rq_data *data = container_of(ref, struct ublk_rq_data, + ref); +struct request *req =blk_mq_rq_from_pdu (data); + +ublk_do_fail_rq (req); +} +/* * Since __ublk_rq_task_work always fails requests immediately during * exiting, __ublk_fail_req() is only called from abort context during
@@ -1107,10 +1126,13 @@ static void __ublk_fail_req(struct ublk_queue *ubq, struct ublk_io *io, {WARN_ON_ONCE (io->flags &UBLK_IO_FLAG_ACTIVE ); -if (ublk_nosrv_should_reissue_outstanding (ubq->dev)) -blk_mq_requeue_request (req, false); -else -ublk_put_req_ref (ubq, req); +if (ublk_need_req_ref (ubq)) { +struct ublk_rq_data *data =blk_mq_rq_to_pdu (req); + +kref_put (&data->ref, ublk_fail_rq_fn); + }else { +ublk_do_fail_rq (req); + } } static void ubq_complete_io_cmd(struct ublk_io *io, int res,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 8/414 drm/i915: Disable RPG during live selftest
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Badal Nilawar <[email protected]>
[ Upstream commit 9d3d9776bd3bd9c32d460dfe6c3363134de578bc ]
The Forcewake timeout issue has been observed on Gen 12.0 and above. To address this, disable Render Power-Gating (RPG) during live self-tests for these generations. The temporary workaround 'drm/i915/mtl: do not enable render power-gating on MTL' disables RPG globally, which is unnecessary since the issues were only seen during self-tests.
v2: take runtime pm wakeref
--- drivers/gpu/drm/i915/gt/intel_rc6.c | 19 ++++--------------- .../gpu/drm/i915/selftests/i915_selftest.c | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/gt/intel_rc6.c +4 -15
@@ -117,21 +117,10 @@ static void gen11_rc6_enable(struct intel_rc6 *rc6)GEN6_RC_CTL_RC6_ENABLE |GEN6_RC_CTL_EI_MODE (1 ); -/* -* BSpec 52698 - Render powergating must be off. -* FIXME BSpec is outdated, disabling powergating for MTL is just -* temporary wa and should be removed after fixing real cause -* of forcewake timeouts. -*/ -if (IS_GFX_GT_IP_RANGE (gt,IP_VER (12 ,70 ),IP_VER (12 ,74 ))) - pg_enable = -GEN9_MEDIA_PG_ENABLE | -GEN11_MEDIA_SAMPLER_PG_ENABLE ; -else - pg_enable = -GEN9_RENDER_PG_ENABLE | -GEN9_MEDIA_PG_ENABLE | -GEN11_MEDIA_SAMPLER_PG_ENABLE ; + pg_enable = +GEN9_RENDER_PG_ENABLE | +GEN9_MEDIA_PG_ENABLE | +GEN11_MEDIA_SAMPLER_PG_ENABLE ;if (GRAPHICS_VER (gt->i915) >=12 && !IS_DG1 (gt->i915)) {for (i =0 ; i <I915_MAX_VCS ; i++)
drivers/gpu/drm/i915/selftests/i915_selftest.c +18 -0
@@ -23,7 +23,9 @@#include <linux/random.h> +#include "gt/intel_gt.h" #include "gt/intel_gt_pm.h" +#include "gt/intel_gt_regs.h" #include "gt/uc/intel_gsc_fw.h" #include "i915_driver.h"
@@ -253,11 +255,27 @@ int i915_mock_selftests(void)int i915_live_selftests (struct pci_dev *pdev) {struct drm_i915_private *i915 =pdev_to_i915 (pdev); +struct intel_uncore *uncore = &i915->uncore;int err; +u32 pg_enable; +intel_wakeref_t wakeref;if (!i915_selftest.live)return 0 ; +/* +* FIXME Disable render powergating, this is temporary wa and should be removed +* after fixing real cause of forcewake timeouts. +*/ + with_intel_runtime_pm(uncore->rpm, wakeref) { +if (IS_GFX_GT_IP_RANGE (to_gt (i915),IP_VER (12 ,00 ),IP_VER (12 ,74 ))) { + pg_enable =intel_uncore_read (uncore,GEN9_PG_ENABLE ); +if (pg_enable &GEN9_RENDER_PG_ENABLE ) +intel_uncore_write_fw (uncore,GEN9_PG_ENABLE , + pg_enable & ~GEN9_RENDER_PG_ENABLE ); + } + } +__wait_gsc_proxy_completed (i915);__wait_gsc_huc_load_completed (i915);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 9/414 x86/acpi: Dont limit CPUs to 1 for Xen PV guests due to disabled ACPI
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Petr Vaněk <[email protected]>
[ Upstream commit 8b37357a78d7fa13d88ea822b35b40137da1c85e ]
Xen disables ACPI for PV guests in DomU, which causes acpi_mps_check() to return 1 when CONFIG_X86_MPPARSE is not set. As a result, the local APIC is disabled and the guest is later limited to a single vCPU, despite being configured with more.
This regression was introduced in version 6.9 in commit 7c0edad3643f ("x86/cpu/topology: Rework possible CPU management"), which added an early check that limits CPUs to 1 if apic_is_disabled.
Update the acpi_mps_check() logic to return 0 early when running as a Xen PV guest in DomU, preventing APIC from being disabled in this specific case and restoring correct multi-vCPU behaviour.
--- arch/x86/kernel/acpi/boot.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/x86/kernel/acpi/boot.c +11 -0
@@ -23,6 +23,8 @@#include <linux/serial_core.h> #include <linux/pgtable.h> +#include <xen/xen.h> +#include <asm/e820/api.h> #include <asm/irqdomain.h> #include <asm/pci_x86.h>
@@ -1732,6 +1734,15 @@ int __init acpi_mps_check(void) {#if defined(CONFIG_X86_LOCAL_APIC ) && !defined(CONFIG_X86_MPPARSE )/* mptable code is not built-in*/ + +/* +* Xen disables ACPI in PV DomU guests but it still emulates APIC and +* supports SMP. Returning early here ensures that APIC is not disabled +* unnecessarily and the guest is not limited to a single vCPU. +*/ +if (xen_pv_domain () && !xen_initial_domain ()) +return 0 ; +if (acpi_disabled || acpi_noirq) {pr_warn ("MPS support code is not built-in, using acpi=off or acpi=noirq or pci=noacpi may have problem\n" );return 1 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainercover 6.13.12-rc1 review
This is the start of the stable review cycle for the 6.13.12 release. There are 414 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 19 Apr 2025 17:49:48 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.13.12-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.13.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 6.13.12-rc1
Thomas Richter <[email protected]>
s390/cpumf: Fix double free on error in cpumf_pmu_event_init()
Arseniy Krasnov <[email protected]>
Bluetooth: hci_uart: Fix another race during initialization
Myrrh Periwinkle <[email protected]>
x86/e820: Fix handling of subpage regions when calculating nosave ranges in e820__register_nosave_regions()
Jeff Layton <[email protected]>
nfsd: don't ignore the return code of svc_proc_register()
Chuck Lever <[email protected]>
NFSD: Fix CB_GETATTR status fix
Olga Kornievskaia <[email protected]>
NFSD: fix decoding in nfs4_xdr_dec_cb_getattr
Nathan Chancellor <[email protected]>
ACPI: platform-profile: Fix CFI violation when accessing sysfs files
Kirill A. Shutemov <[email protected]>
x86/paravirt: Move halt paravirt calls under CONFIG_PARAVIRT
Yi Liu <[email protected]>
iommufd: Fail replace if device has not been attached
Nicolin Chen <[email protected]>
iommufd: Make attach_handle generic than fault specific
Douglas Anderson <[email protected]>
arm64: errata: Add newer ARM cores to the spectre_bhb_loop_affected() lists
Nícolas F. R. A. Prado <[email protected]>
thermal/drivers/mediatek/lvts: Disable Stage 3 thermal threshold
Nícolas F. R. A. Prado <[email protected]>
thermal/drivers/mediatek/lvts: Disable monitor mode during suspend
Kevin Hao <[email protected]>
spi: fsl-qspi: Fix double cleanup in probe error path
Han Xu <[email protected]>
spi: fsl-qspi: use devm function instead of driver remove
Cong Liu <[email protected]>
selftests: mptcp: fix incorrect fd checks in main_loop
Geliang Tang <[email protected]>
selftests: mptcp: close fd_in before returning in main_loop
Jake Hillion <[email protected]>
sched_ext: create_dsq: Return -EEXIST on duplicate request
Sumanth Korikkar <[email protected]>
s390: Fix linker error when -no-pie option is unavailable
David Hildenbrand <[email protected]>
s390/virtio_ccw: Don't allocate/assign airqs for non-existing queues
Niklas Schnelle <[email protected]>
s390/pci: Fix zpci_bus_is_isolated_vf() for non-VFs
Steven Rostedt <[email protected]>
ring-buffer: Use flush_kernel_vmap_range() over flush_dcache_folio()
Peter Griffin <[email protected]>
pinctrl: samsung: add support for eint_fltcon_offset
Stephan Gerhold <[email protected]>
pinctrl: qcom: Clear latched interrupt status when changing IRQ type
Stefan Eichenberger <[email protected]>
phy: freescale: imx8m-pcie: assert phy reset and perst in power off
Philipp Stanner <[email protected]>
PCI: Fix wrong length of devres array
Ma Ke <[email protected]>
PCI: Fix reference leak in pci_register_host_bridge()
Ma Ke <[email protected]>
PCI: Fix reference leak in pci_alloc_child_bus()
Lukas Wunner <[email protected]>
PCI: pciehp: Avoid unnecessary device replacement check
Siddharth Vadapalli <[email protected]>
PCI: j721e: Fix the value of .linkdown_irq_regfield for J784S4
Stanimir Varbanov <[email protected]>
PCI: brcmstb: Fix missing of_node_put() in brcm_pcie_probe()
Zijun Hu <[email protected]>
of/irq: Fix device node refcount leakages in of_irq_init()
Zijun Hu <[email protected]>
of/irq: Fix device node refcount leakage in API irq_of_parse_and_map()
Zijun Hu <[email protected]>
of/irq: Fix device node refcount leakages in of_irq_count()
Zijun Hu <[email protected]>
of/irq: Fix device node refcount leakage in API of_irq_parse_raw()
Zijun Hu <[email protected]>
of/irq: Fix device node refcount leakage in API of_irq_parse_one()
Fedor Pchelkin <[email protected]>
ntb: use 64-bit arithmetic for the MSI doorbell mask
Haiyang Zhang <[email protected]>
net: mana: Switch to page pool for jumbo frames
Kunihiko Hayashi <[email protected]>
misc: pci_endpoint_test: Fix displaying 'irq_type' after 'request_irq' error
Mickaël Salaün <[email protected]>
selftests/landlock: Add a new test for setuid()
Mickaël Salaün <[email protected]>
selftests/landlock: Split signal_scoping_threads tests
Mickaël Salaün <[email protected]>
landlock: Prepare to add second errata
Mickaël Salaün <[email protected]>
landlock: Always allow signals between threads of the same process
Mickaël Salaün <[email protected]>
landlock: Add erratum for TCP fix
Mickaël Salaün <[email protected]>
landlock: Add the errata interface
Mickaël Salaün <[email protected]>
landlock: Move code to ease future backports
Tudor Ambarus <[email protected]>
scsi: ufs: qcom: fix dev reference leaked through of_qcom_ice_get
Sean Christopherson <[email protected]>
KVM: x86: Acquire SRCU in KVM_GET_MP_STATE to protect guest memory accesses
Sean Christopherson <[email protected]>
KVM: x86: Explicitly zero-initialize on-stack CPUID unions
Amit Machhiwal <[email protected]>
KVM: PPC: Enable CAP_SPAPR_TCE_VFIO on pSeries KVM guests
Sean Christopherson <[email protected]>
KVM: Allow building irqbypass.ko as as module when kvm.ko is a module
Joshua Washington <[email protected]>
gve: handle overflow when reporting TX consumed descriptors
Krzysztof Kozlowski <[email protected]>
gpio: zynq: Fix wakeup source leaks on device unbind
Guixin Liu <[email protected]>
gpio: tegra186: fix resource handling in ACPI probe path
Andy Chiu <[email protected]>
ftrace: Properly merge notrace hashes
zhoumin <[email protected]>
ftrace: Add cond_resched() to ftrace_graph_set_hash()
Krzysztof Kozlowski <[email protected]>
dt-bindings: coresight: qcom,coresight-tpdm: Fix too many 'reg'
Krzysztof Kozlowski <[email protected]>
dt-bindings: coresight: qcom,coresight-tpda: Fix too many 'reg'
Mikulas Patocka <[email protected]>
dm-verity: fix prefetch-vs-suspend race
Jo Van Bulck <[email protected]>
dm-integrity: fix non-constant-time tag verification
Mikulas Patocka <[email protected]>
dm-integrity: set ti->error on memory allocation failure
Mikulas Patocka <[email protected]>
dm-ebs: fix prefetch-vs-suspend race
Alexander Aring <[email protected]>
dlm: fix error if active rsb is not hashed
Alexander Aring <[email protected]>
dlm: fix error if inactive rsb is not hashed
Dionna Glaze <[email protected]>
crypto: ccp - Fix uAPI definitions of PSP errors
Tom Lendacky <[email protected]>
crypto: ccp - Fix check for the primary ASP device
Taniya Das <[email protected]>
clk: qcom: gdsc: Set retain_ff before moving to HW CTRL
Bryan O'Donoghue <[email protected]>
clk: qcom: gdsc: Capture pm_genpd_add_subdomain result code
Bryan O'Donoghue <[email protected]>
clk: qcom: gdsc: Release pm subdomains in reverse add order
Ajit Pandey <[email protected]>
clk: qcom: clk-branch: Fix invert halt status bit check for votable clocks
Lad Prabhakar <[email protected]>
clk: renesas: r9a07g043: Fix HP clock source for RZ/Five
Pali Rohár <[email protected]>
cifs: Ensure that all non-client-specific reparse points are processed by the server
Roman Smirnov <[email protected]>
cifs: fix integer overflow in match_server()
Alexandra Diupina <[email protected]>
cifs: avoid NULL pointer dereference in dbg call
Aman <[email protected]>
CIFS: Propagate min offload along with other parameters from primary to secondary channels.
Trevor Woerner <[email protected]>
thermal/drivers/rockchip: Add missing rk3328 mapping entry
Steven Rostedt <[email protected]>
tracing: Do not add length to print format in synthetic events
Masami Hiramatsu (Google) <[email protected]>
tracing: fprobe events: Fix possible UAF on modules
Roger Pau Monne <[email protected]>
x86/xen: fix balloon target initialization for PVH dom0
Ricardo Cañuelo Navarro <[email protected]>
sctp: detect and prevent references to a freed transport in sendmsg
Jinjiang Tu <[email protected]>
mm/hwpoison: introduce folio_contain_hwpoisoned_page() helper
Marc Herbert <[email protected]>
mm/hugetlb: move hugetlb_sysctl_init() to the __init section
Shuai Xue <[email protected]>
mm/hwpoison: do not send SIGBUS to processes with recovered clean pages
Peter Xu <[email protected]>
mm/userfaultfd: fix release hang over concurrent GUP
Mathieu Desnoyers <[email protected]>
mm: add missing release barrier on PGDAT_RECLAIM_LOCKED unlock
Lorenzo Stoakes <[email protected]>
mm/mremap: correctly handle partial mremap() of VMA starting at 0
Ryan Roberts <[email protected]>
mm: fix lazy mmu docs and usage
Jane Chu <[email protected]>
mm: make page_mapped_in_vma() hugetlb walk aware
David Hildenbrand <[email protected]>
mm/rmap: reject hugetlb folios in folio_make_device_exclusive()
Usama Arif <[email protected]>
mm/damon/ops: have damon_get_folio return folio even for tail pages
Kuniyuki Iwashima <[email protected]>
net: Fix null-ptr-deref by sock_lock_init_class_and_name() and rmmod.
Ryan Roberts <[email protected]>
sparc/mm: avoid calling arch_enter/leave_lazy_mmu() in set_ptes
Ryan Roberts <[email protected]>
sparc/mm: disable preemption in lazy mmu mode
Sean Christopherson <[email protected]>
iommu/vt-d: Wire up irq_ack() to irq_move_irq() for posted MSIs
Lu Baolu <[email protected]>
iommu/vt-d: Fix possible circular locking dependency
Sean Christopherson <[email protected]>
iommu/vt-d: Don't clobber posted vCPU IRTE when host IRQ affinity changes
Sean Christopherson <[email protected]>
iommu/vt-d: Put IRTE back into posted MSI mode if vCPU posting is disabled
Nicolin Chen <[email protected]>
iommu/tegra241-cmdqv: Fix warnings due to dmam_free_coherent()
Nicolin Chen <[email protected]>
iommufd: Fix uninitialized rc in iommufd_access_rw()
Johannes Thumshirn <[email protected]>
btrfs: zoned: fix zone finishing with missing devices
Johannes Thumshirn <[email protected]>
btrfs: zoned: fix zone activation with missing devices
Filipe Manana <[email protected]>
btrfs: tests: fix chunk map leak after failure to add it to the tree
Filipe Manana <[email protected]>
btrfs: fix non-empty delayed iputs list on unmount due to compressed write workers
Herve Codina <[email protected]>
backlight: led_bl: Hold led_access lock when calling led_sysfs_disable()
Peter Griffin <[email protected]>
arm64: dts: exynos: gs101: disable pinctrl_gsacore node
Chen-Yu Tsai <[email protected]>
arm64: dts: mediatek: mt8173: Fix disp-pwm compatible string
Nícolas F. R. A. Prado <[email protected]>
arm64: dts: mediatek: mt8188: Assign apll1 clock as parent to avoid hang
Siddharth Vadapalli <[email protected]>
arm64: dts: ti: k3-j784s4-j742s2-main-common: Fix serdes_ln_ctrl reg-masks
Keerthy <[email protected]>
arm64: dts: ti: k3-j784s4-j742s2-main-common: Correct the GICD size
Zhenhua Huang <[email protected]>
arm64: mm: Correct the update of max_pfn
Ninad Malwade <[email protected]>
arm64: tegra: Remove the Orin NX/Nano suspend key
Keir Fraser <[email protected]>
arm64: mops: Do not dereference src reg for a set operation
Wentao Liang <[email protected]>
mtd: rawnand: Add status chack in r852_ready()
Wentao Liang <[email protected]>
mtd: inftlcore: Add error check for inftl_read_oob()
Matthieu Baerts (NGI0) <[email protected]>
mptcp: only inc MPJoinAckHMacFailure for HMAC failures
Gang Yan <[email protected]>
mptcp: fix NULL pointer in can_accept_new_subflow
T Pratham <[email protected]>
lib: scatterlist: fix sg_split_phys to preserve original scatterlist offsets
Boqun Feng <[email protected]>
locking/lockdep: Decrease nr_unused_locks if lock unused in zap_class()
Kartik Rajput <[email protected]>
mailbox: tegra-hsp: Define dimensioning masks in SoC data
Chenyuan Yang <[email protected]>
mfd: ene-kb3930: Fix a potential NULL pointer dereference
Abel Vesa <[email protected]>
leds: rgb: leds-qcom-lpg: Fix calculation of best period Hi-Res PWMs
Abel Vesa <[email protected]>
leds: rgb: leds-qcom-lpg: Fix pwm resolution max for Hi-Res PWMs
Nathan Chancellor <[email protected]>
kbuild: Add '-fno-builtin-wcslen'
Kris Van Hees <[email protected]>
kbuild: exclude .rodata.(cst|str)* when building ranges
Jan Kara <[email protected]>
jbd2: remove wrong sb->s_sequence check
Manjunatha Venkatesh <[email protected]>
i3c: Add NULL pointer check in i3c_master_queue_ibi()
Stanley Chu <[email protected]>
i3c: master: svc: Use readsb helper for reading MDB
Mimi Zohar <[email protected]>
ima: limit the number of ToMToU integrity violations
Mimi Zohar <[email protected]>
ima: limit the number of open-writers integrity violations
Steve French <[email protected]>
smb311 client: fix missing tcon check when mounting with linux/posix extensions
Chenyuan Yang <[email protected]>
soc: samsung: exynos-chipid: Add NULL pointer check in exynos_chipid_probe()
Olga Kornievskaia <[email protected]>
svcrdma: do not unregister device for listeners
Thadeu Lima de Souza Cascardo <[email protected]>
tpm: do not start chip while suspended
Jan Kara <[email protected]>
udf: Fix inode_getblk() return value
Si-Wei Liu <[email protected]>
vdpa/mlx5: Fix oversized null mkey longer than 32bit
Yeongjin Gil <[email protected]>
f2fs: fix to avoid atomicity corruption of atomic file
Jaegeuk Kim <[email protected]>
f2fs: fix the missing write pointer correction
Artem Sadovnikov <[email protected]>
ext4: fix off-by-one error in do_split
Jeff Hugo <[email protected]>
bus: mhi: host: Fix race between unprepare and queue_buf
Jacek Lawrynowicz <[email protected]>
accel/ivpu: Fix deadlock in ivpu_ms_cleanup()
Jacek Lawrynowicz <[email protected]>
accel/ivpu: Fix warning in ivpu_ipc_send_receive_internal()
Sharan Kumar M <[email protected]>
ALSA: hda/realtek: Enable Mute LED on HP OMEN 16 Laptop xd000xx
Alexey Klimov <[email protected]>
ASoC: qdsp6: q6asm-dai: fix q6asm_dai_compr_set_params error path
Srinivas Kandagatla <[email protected]>
ASoC: qdsp6: q6apm-dai: fix capture pipeline overruns.
Srinivas Kandagatla <[email protected]>
ASoC: qdsp6: q6apm-dai: set 10 ms period and buffer alignment.
Srinivas Kandagatla <[email protected]>
ASoC: q6apm-dai: make use of q6apm_get_hw_pointer
Srinivas Kandagatla <[email protected]>
ASoC: q6apm-dai: schedule all available frames to avoid dsp under-runs
Srinivas Kandagatla <[email protected]>
ASoC: q6apm: add q6apm_get_hw_pointer helper
Haoxiang Li <[email protected]>
ASoC: codecs: wcd937x: fix a potential memory leak in wcd937x_soc_codec_probe()
Jens Axboe <[email protected]>
io_uring/kbuf: reject zero sized provided buffers
Pavel Begunkov <[email protected]>
io_uring/net: fix io_req_post_cqe abuse by send bundle
Pavel Begunkov <[email protected]>
io_uring/net: fix accept multishot handling
Qingfang Deng <[email protected]>
net: stmmac: Fix accessing freed irq affinity_hint
Ewan D. Milne <[email protected]>
scsi: lpfc: Restore clearing of NLP_UNREG_INP in ndlp->nlp_flag
Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: fix the wrong simultaneous cap for MLO
Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: fix the wrong link_idx when a p2p_device is present
Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: fix country count limitation for CLC
Ming Yen Hsieh <[email protected]>
wifi: mt76: mt7925: ensure wow pattern command align fw format
Gavrilov Ilia <[email protected]>
wifi: mac80211: fix integer overflow in hwmp_route_info_get()
Haoxiang Li <[email protected]>
wifi: mt76: Add check for devm_kstrdup()
Alexandre Torgue <[email protected]>
clocksource/drivers/stm32-lptimer: Use wakeup capable instead of init wakeup
Jiasheng Jiang <[email protected]>
mtd: Replace kcalloc() with devm_kcalloc()
Marek Behún <[email protected]>
net: dsa: mv88e6xxx: fix internal PHYs for 6320 family
Marek Behún <[email protected]>
net: dsa: mv88e6xxx: workaround RGMII transmit delay erratum for 6320 family
Jiasheng Jiang <[email protected]>
mtd: Add check for devm_kcalloc()
Ming Lei <[email protected]>
block: make sure ->nr_integrity_segments is cloned in blk_rq_prep_clone
Matthieu Baerts (NGI0) <[email protected]>
mptcp: sockopt: fix getting freebind & transparent
Matthieu Baerts (NGI0) <[email protected]>
mptcp: sockopt: fix getting IPV6_V6ONLY
Harshitha Ramamurthy <[email protected]>
gve: unlink old napi only if page pool exists
Biju Das <[email protected]>
irqchip/renesas-rzv2h: Fix wrong variable usage in rzv2h_tint_set_type()
Jackson.lee <[email protected]>
media: chips-media: wave5: Fix timeout while testing 10bit hevc fluster
Jackson.lee <[email protected]>
media: chips-media: wave5: Fix a hang after seeking
Jackson.lee <[email protected]>
media: chips-media: wave5: Avoid race condition in the interrupt handler
Jackson.lee <[email protected]>
media: chips-media: wave5: Fix gray color on screen
Sakari Ailus <[email protected]>
media: i2c: imx214: Rectify probe error handling related to runtime PM
Sakari Ailus <[email protected]>
media: i2c: imx219: Rectify runtime PM handling in probe and remove
Sakari Ailus <[email protected]>
media: i2c: imx319: Rectify runtime PM handling probe and remove
Vikash Garodia <[email protected]>
media: venus: hfi_parser: refactor hfi packet parsing logic
Vikash Garodia <[email protected]>
media: venus: hfi_parser: add check to avoid out of bound access
Ricardo Ribalda <[email protected]>
media: nuvoton: Fix reference handling of ece_pdev
Ricardo Ribalda <[email protected]>
media: nuvoton: Fix reference handling of ece_node
Sakari Ailus <[email protected]>
media: i2c: ov7251: Introduce 1 ms delay between regulators and en GPIO
Sakari Ailus <[email protected]>
media: i2c: ov7251: Set enable GPIO low in probe
Sakari Ailus <[email protected]>
media: i2c: ccs: Set the device's runtime PM status correctly in probe
Sakari Ailus <[email protected]>
media: i2c: ccs: Set the device's runtime PM status correctly in remove
Sakari Ailus <[email protected]>
Revert "media: imx214: Fix the error handling in imx214_probe()"
Karina Yankevich <[email protected]>
media: v4l2-dv-timings: prevent possible overflow in v4l2_detect_gtf()
Dave Stevenson <[email protected]>
media: imx219: Adjust PLL settings based on the number of MIPI lanes
Dan Carpenter <[email protected]>
media: xilinx-tpg: fix double put in xtpg_parse_of()
Jiasheng Jiang <[email protected]>
media: platform: stm32: Add check for clk_enable()
Nicolas Dufresne <[email protected]>
media: visl: Fix ERANGE error when setting enum controls
Hans de Goede <[email protected]>
media: hi556: Fix memory leak (on error) in hi556_check_hwcfg()
Murad Masimov <[email protected]>
media: streamzap: prevent processing IR data on URB failure
Hans de Goede <[email protected]>
media: ov08x40: Properly turn sensor on/off when runtime-suspended
Jacek Lawrynowicz <[email protected]>
accel/ivpu: Fix PM related deadlocks in MS IOCTLs
Jonathan McDowell <[email protected]>
tpm, tpm_tis: Fix timeout handling when waiting for TPM status
Kamal Dasu <[email protected]>
mtd: rawnand: brcmnand: fix PM resume warning
Miquel Raynal <[email protected]>
spi: cadence-qspi: Fix probe on AM62A LP SK
Oliver Upton <[email protected]>
KVM: arm64: Set HCR_EL2.TID1 unconditionally
Will Deacon <[email protected]>
KVM: arm64: Tear down vGIC on failed vCPU creation
Douglas Anderson <[email protected]>
arm64: errata: Add KRYO 2XX/3XX/4XX silver cores to Spectre BHB safe list
Douglas Anderson <[email protected]>
arm64: errata: Assume that unknown CPUs _are_ vulnerable to Spectre BHB
Douglas Anderson <[email protected]>
arm64: errata: Add QCOM_KRYO_4XX_GOLD to the spectre_bhb_k24_list
Douglas Anderson <[email protected]>
arm64: cputype: Add MIDR_CORTEX_A76AE
Akihiko Odaki <[email protected]>
KVM: arm64: PMU: Set raw values from user to PM{C,I}NTEN{SET,CLR}, PMOVS{SET,CLR}Jan Beulich <[email protected]>
xenfs/xensyms: respect hypervisor's "next" indication
John Keeping <[email protected]>
media: rockchip: rga: fix rga offset lookup
Yuan Can <[email protected]>
media: siano: Fix error handling in smsdvb_module_init()
Matthew Majewski <[email protected]>
media: vim2m: print device name after registering device
Vikash Garodia <[email protected]>
media: venus: hfi: add check to handle incorrect queue size
Vikash Garodia <[email protected]>
media: venus: hfi: add a check to handle OOB in sfr region
Bingbu Cao <[email protected]>
media: intel/ipu6: set the dev_parent of video device to pdev
Martin Tůma <[email protected]>
media: mgb4: Fix switched CMT frequency range "magic values" sets
Niklas Söderlund <[email protected]>
media: i2c: adv748x: Fix test pattern selection mask
Martin Tůma <[email protected]>
media: mgb4: Fix CMT registers update logic
Niklas Söderlund <[email protected]>
media: uapi: rkisp1-config: Fix typo in extensible params example
Arnd Bergmann <[email protected]>
media: mtk-vcodec: venc: avoid -Wenum-compare-conditional warning
Jiasheng Jiang <[email protected]>
media: mediatek: vcodec: Fix a resource leak related to the scp device in FW initialization
Alain Volmat <[email protected]>
dt-bindings: media: st,stmipid02: correct lane-polarities maxItems
Haoxiang Li <[email protected]>
auxdisplay: hd44780: Fix an API misuse in hd44780.c
Tomasz Pakuła <[email protected]>
HID: pidff: Fix set_device_control()
Tomasz Pakuła <[email protected]>
HID: pidff: Fix 90 degrees direction name North -> East
Tomasz Pakuła <[email protected]>
HID: pidff: Compute INFINITE value instead of using hardcoded 0xffff
Tomasz Pakuła <[email protected]>
HID: pidff: Clamp effect playback LOOP_COUNT value
Tomasz Pakuła <[email protected]>
HID: pidff: Rename two functions to align them with naming convention
Tomasz Pakuła <[email protected]>
HID: pidff: Remove redundant call to pidff_find_special_keys
Tomasz Pakuła <[email protected]>
HID: pidff: Support device error response from PID_BLOCK_LOAD
Tomasz Pakuła <[email protected]>
HID: pidff: Comment and code style update
Tomasz Pakuła <[email protected]>
HID: hid-universal-pidff: Add Asetek wheelbases support
Tomasz Pakuła <[email protected]>
HID: pidff: Make sure to fetch pool before checking SIMULTANEOUS_MAX
Tomasz Pakuła <[email protected]>
HID: pidff: Factor out pool report fetch and remove excess declaration
Tomasz Pakuła <[email protected]>
HID: pidff: Use macros instead of hardcoded min/max values for shorts
Tomasz Pakuła <[email protected]>
HID: pidff: Simplify pidff_rescale_signed
Tomasz Pakuła <[email protected]>
HID: pidff: Move all hid-pidff definitions to a dedicated header
Tomasz Pakuła <[email protected]>
HID: pidff: Factor out code for setting gain
Tomasz Pakuła <[email protected]>
HID: pidff: Rescale time values to match field units
Tomasz Pakuła <[email protected]>
HID: pidff: Define values used in pidff_find_special_fields
Tomasz Pakuła <[email protected]>
HID: pidff: Simplify pidff_upload_effect function
Tomasz Pakuła <[email protected]>
HID: pidff: Completely rework and fix pidff_reset function
Tomasz Pakuła <[email protected]>
HID: pidff: Stop all effects before enabling actuators
Tomasz Pakuła <[email protected]>
HID: pidff: Clamp PERIODIC effect period to device's logical range
Niklas Schnelle <[email protected]>
s390/pci: Fix s390_mmio_read/write syscall page fault handling
Jann Horn <[email protected]>
ext4: don't treat fhandle lookup of ea_inode as FS corruption
Willem de Bruijn <[email protected]>
bpf: support SKF_NET_OFF and SKF_LL_OFF on skb frags
Sheng Yong <[email protected]>
erofs: set error to bio if file-backed IO fails
Uwe Kleine-König <[email protected]>
pwm: stm32: Search an appropriate duty_cycle if period cannot be modified
Uwe Kleine-König <[email protected]>
pwm: fsl-ftm: Handle clk_get_rate() returning 0
Uwe Kleine-König <[email protected]>
pwm: rcar: Improve register calculation
Josh Poimboeuf <[email protected]>
pwm: mediatek: Prevent divide-by-zero in pwm_mediatek_config()
Jonathan McDowell <[email protected]>
tpm: End any active auth session before shutdown
Jonathan McDowell <[email protected]>
tpm, tpm_tis: Workaround failed command reception on Infineon devices
Ayush Jain <[email protected]>
ktest: Fix Test Failures Due to Missing LOG_FILE Directories
Masami Hiramatsu (Google) <[email protected]>
tracing: probe-events: Add comments about entry data storing code
Leonid Arapov <[email protected]>
fbdev: omapfb: Add 'plane' value check
Christian König <[email protected]>
drm/amdgpu: grab an additional reference on the gang fence v2
Ryo Takakura <[email protected]>
PCI: vmd: Make vmd_dev::cfg_lock a raw_spinlock_t type
Philipp Stanner <[email protected]>
PCI: Check BAR index for validity
Emily Deng <[email protected]>
drm/amdgpu: Fix the race condition for draining retry fault
Bjorn Helgaas <[email protected]>
PCI: Enable Configuration RRS SV early
Ryan Seto <[email protected]>
drm/amd/display: Prevent VStartup Overflow
Wentao Liang <[email protected]>
drm/amdgpu: handle amdgpu_cgs_create_device() errors in amd_powerplay_create()
Shawn Lin <[email protected]>
PCI: Add Rockchip Vendor ID
AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: mtk_dpi: Explicitly manage TVD clock in power on/off
AngeloGioacchino Del Regno <[email protected]>
drm/mediatek: mtk_dpi: Move the input_2p_en bit to platform data
Tvrtko Ursulin <[email protected]>
drm/xe/xelp: Move Wa_16011163337 from tunings to workarounds
Philip Yang <[email protected]>
drm/amdkfd: debugfs hang_hws skip GPU with MES
Philip Yang <[email protected]>
drm/amdkfd: Fix pqm_destroy_queue race with GPU reset
Philip Yang <[email protected]>
drm/amdkfd: Fix mode1 reset crash issue
David Yat Sin <[email protected]>
drm/amdkfd: clamp queue size to minimum
Lucas De Marchi <[email protected]>
drivers: base: devres: Allow to release group on device release
Mike Katsnelson <[email protected]>
drm/amd/display: stop DML2 from removing pipes based on planes
Michael Strauss <[email protected]>
drm/amd/display: Update FIXED_VS Link Rate Toggle Workaround Usage
Luca Ceresoli <[email protected]>
drm/bridge: panel: forbid initializing a panel with unknown connector type
Luca Ceresoli <[email protected]>
drm/debugfs: fix printk format for bridge index
Andrew Wyatt <[email protected]>
drm: panel-orientation-quirks: Add quirk for OneXPlayer Mini (Intel)
Andrew Wyatt <[email protected]>
drm: panel-orientation-quirks: Add new quirk for GPD Win 2
Andrew Wyatt <[email protected]>
drm: panel-orientation-quirks: Add quirk for AYA NEO Slide
Andrew Wyatt <[email protected]>
drm: panel-orientation-quirks: Add quirks for AYA NEO Flip DS and KB
Andrew Wyatt <[email protected]>
drm: panel-orientation-quirks: Add support for AYANEO 2S
Philip Yang <[email protected]>
drm/amdgpu: Unlocked unmap only clear page table leaves
Brendan Tam <[email protected]>
drm/amd/display: add workaround flag to link to force FFE preset
Zhikai Zhai <[email protected]>
drm/amd/display: Update Cursor request mode to the beginning prefetch always
Michal Wajdeczko <[email protected]>
drm/xe/vf: Don't try to trigger a full GT reset if VF
Michal Wajdeczko <[email protected]>
drm/xe/pf: Don't send BEGIN_ID if VF has no context/doorbells
Shekhar Chauhan <[email protected]>
drm/xe/bmg: Add new PCI IDs
Abhinav Kumar <[email protected]>
drm: allow encoder mode_set even when connectors change for crtc
Pedro Nishiyama <[email protected]>
Bluetooth: Add quirk for broken READ_PAGE_SCAN_TYPE
Pedro Nishiyama <[email protected]>
Bluetooth: Add quirk for broken READ_VOICE_SETTING
Dmitry Baryshkov <[email protected]>
Bluetooth: qca: simplify WCN399x NVM loading
Janaki Ramaiah Thota <[email protected]>
Bluetooth: hci_qca: use the power sequencer for wcn6750
Jiande Lu <[email protected]>
Bluetooth: btusb: Add 2 HWIDs for MT7922
Arseniy Krasnov <[email protected]>
Bluetooth: hci_uart: fix race during initialization
Zijun Hu <[email protected]>
Bluetooth: btusb: Add 13 USB device IDs for Qualcomm WCN785x
Kiran K <[email protected]>
Bluetooth: btintel_pcie: Add device id of Whale Peak
Dorian Cruveiller <[email protected]>
Bluetooth: btusb: Add new VID/PID for WCN785x
Gabriele Paoloni <[email protected]>
tracing: fix return value in __ftrace_event_enable_disable for TRACE_REG_UNREGISTER
Stanislav Fomichev <[email protected]>
net: vlan: don't propagate flags on open
Icenowy Zheng <[email protected]>
wifi: mt76: mt76x2u: add TP-Link TL-WDN6200 ID to device table
Boris Burkov <[email protected]>
btrfs: harden block_group::bg_list against list_del() races
Huacai Chen <[email protected]>
ahci: Marvell 88SE9215 controllers prefer DMA for ATAPI
Kai Mäkisara <[email protected]>
scsi: st: Fix array overflow in st_setup()
Philipp Hahn <[email protected]>
cdc_ether|r8152: ThinkPad Hybrid USB-C/A Dock quirk
Bhupesh <[email protected]>
ext4: ignore xattrs past end
Chao Yu <[email protected]>
Revert "f2fs: rebuild nat_bits during umount"
Ojaswin Mujoo <[email protected]>
ext4: protect ext4_release_dquot against freezing
Daniel Kral <[email protected]>
ahci: add PCI ID for Marvell 88SE9215 SATA Controller
Martin Schiller <[email protected]>
net: sfp: add quirk for FS SFP-10GM-T copper SFP+ module
Chao Yu <[email protected]>
f2fs: fix to avoid out-of-bounds access in f2fs_truncate_inode_blocks()
Manish Dharanenthiran <[email protected]>
wifi: ath12k: Fix invalid data access in ath12k_dp_rx_h_undecap_nwifi
Birger Koblitz <[email protected]>
net: sfp: add quirk for 2.5G OEM BX SFP
Niklas Cassel <[email protected]>
ata: libata-eh: Do not use ATAPI DMA for a device limited to PIO mode
Edward Adam Davis <[email protected]>
jfs: add sanity check for agwidth in dbMount
Edward Adam Davis <[email protected]>
jfs: Prevent copying of nlink with value 0 from disk inode
Rand Deeb <[email protected]>
fs/jfs: Prevent integer overflow in AG size calculation
Rand Deeb <[email protected]>
fs/jfs: cast inactags to s64 to prevent potential overflow
Zhongqiu Han <[email protected]>
jfs: Fix uninit-value access of imap allocated in the diMount() function
Ciprian Marian Costea <[email protected]>
can: flexcan: add NXP S32G2/S32G3 SoC support
Ciprian Marian Costea <[email protected]>
can: flexcan: Add quirk to handle separate interrupt lines for mailboxes
Jason Xing <[email protected]>
page_pool: avoid infinite loop to schedule delayed worker
Max Schulze <[email protected]>
net: usb: asix_devices: add FiberGecko DeviceID
Chaohai Chen <[email protected]>
scsi: target: spc: Fix RSOC parameter data header size
Miri Korenblit <[email protected]>
wifi: mac80211: ensure sdata->work is canceled before initialized.
Johannes Berg <[email protected]>
wifi: mac80211: add strict mode disabling workarounds
Chao Yu <[email protected]>
f2fs: don't retry IO for corrupted data scenario
Pavel Begunkov <[email protected]>
net: page_pool: don't cast mp param to devmem
Ranjan Kumar <[email protected]>
scsi: mpi3mr: Synchronous access b/w reset and tm thread for reply queue
Ranjan Kumar <[email protected]>
scsi: mpi3mr: Avoid reply queue full condition
Niklas Cassel <[email protected]>
ata: libata-core: Add 'external' to the libata.force kernel parameter
P Praneesh <[email protected]>
wifi: ath12k: Fix invalid entry fetch in ath12k_dp_mon_srng_process
Miaoqing Pan <[email protected]>
wifi: ath12k: fix memory leak in ath12k_pci_remove()
Miaoqing Pan <[email protected]>
wifi: ath11k: fix memory leak in ath11k_xxx_remove()
P Praneesh <[email protected]>
wifi: ath11k: Fix DMA buffer allocation to resolve SWIOTLB issues
Hans de Goede <[email protected]>
platform/x86: x86-android-tablets: Add select POWER_SUPPLY to Kconfig
Syed Saba kareem <[email protected]>
ASoC: amd: yc: update quirk data for new Lenovo model
keenplify <[email protected]>
ASoC: amd: Add DMI quirk for ACP6X mic support
Ricard Wanderlof <[email protected]>
ALSA: usb-audio: Fix CME quirk for UF series keyboards
Kaustabh Chakraborty <[email protected]>
mmc: dw_mmc: add a quirk for accessing 64-bit FIFOs in two halves
Aakarsh Jain <[email protected]>
media: s5p-mfc: Corrected NV12M/NV21M plane-sizes
Ricardo Ribalda <[email protected]>
media: uvcvideo: Add quirk for Actions UVC05
Shengjiu Wang <[email protected]>
ASoC: fsl_audmix: register card device depends on 'dais' property
Maxim Mikityanskiy <[email protected]>
ALSA: hda: intel: Add Lenovo IdeaPad Z570 to probe denylist
Maxim Mikityanskiy <[email protected]>
ALSA: hda: intel: Fix Optimus when GPU has no sound
Vijendar Mukunda <[email protected]>
ASoC: amd: amd_sdw: Add quirks for Dell SKU's
Vijendar Mukunda <[email protected]>
ASoC: amd: ps: use macro for ACP6.3 pci revision id
Tomasz Pakuła <[email protected]>
HID: pidff: Fix null pointer dereference in pidff_find_fields
Tomasz Pakuła <[email protected]>
HID: pidff: Add PERIODIC_SINE_ONLY quirk
Tomasz Pakuła <[email protected]>
HID: Add hid-universal-pidff driver and supported device ids
Tomasz Pakuła <[email protected]>
HID: pidff: Add FIX_WHEEL_DIRECTION quirk
Tomasz Pakuła <[email protected]>
HID: pidff: Add hid_pidff_init_with_quirks and export as GPL symbol
Tomasz Pakuła <[email protected]>
HID: pidff: Add PERMISSIVE_CONTROL quirk
Tomasz Pakuła <[email protected]>
HID: pidff: Add MISSING_PBO quirk and its detection
Tomasz Pakuła <[email protected]>
HID: pidff: Add MISSING_DELAY quirk and its detection
Tomasz Pakuła <[email protected]>
HID: pidff: Do not send effect envelope if it's empty
Tomasz Pakuła <[email protected]>
HID: pidff: Convert infinite length from Linux API to PID standard
Zhang Heng <[email protected]>
ASoC: SOF: topology: Use krealloc_array() to replace krealloc()
Daniel Schaefer <[email protected]>
platform/chrome: cros_ec_lpc: Match on Framework ACPI device
Josh Poimboeuf <[email protected]>
tracing: Disable branch profiling in noinstr code
Ingo Molnar <[email protected]>
zstd: Increase DYNAMIC_BMI2 GCC version cutoff from 4.8 to 11.0 to work around compiler segfault
Kees Cook <[email protected]>
xen/mcelog: Add __nonstring annotations for unterminated strings
Douglas Anderson <[email protected]>
arm64: cputype: Add QCOM_CPU_PART_KRYO_3XX_GOLD
Paul E. McKenney <[email protected]>
Flush console log from kernel_power_off()
Lizhi Xu <[email protected]>
PM: hibernate: Avoid deadlock in hibernate_compressor_param_set()
Yunhui Cui <[email protected]>
perf/dwc_pcie: fix some unreleased resources
Mark Rutland <[email protected]>
perf: arm_pmu: Don't disable counter in armpmu_add()
Max Grobecker <[email protected]>
x86/cpu: Don't clear X86_FEATURE_LAHF_LM flag in init_amd_k8() on AMD when running in a virtual machine
Xin Li (Intel) <[email protected]>
x86/ia32: Leave NULL selector values 0~3 unchanged
Uros Bizjak <[email protected]>
x86/percpu: Disable named address spaces for UBSAN_BOOL with KASAN for GCC < 14.2
Matthew Wilcox (Oracle) <[email protected]>
x86/mm: Clear _PAGE_DIRTY for kernel mappings when we clear _PAGE_RW
Dmitry Osipenko <[email protected]>
irqchip/gic-v3: Add Rockchip 3568002 erratum workaround
Zhongqiu Han <[email protected]>
pm: cpupower: bench: Prevent NULL dereference on malloc failure
Paul E. McKenney <[email protected]>
srcu: Force synchronization for srcu_get_delay()
Trond Myklebust <[email protected]>
umount: Allow superblock owners to force umount
Mateusz Guzik <[email protected]>
fs: consistently deref the files table with rcu_dereference_raw()
Frederic Weisbecker <[email protected]>
perf: Fix hang while freeing sigtrap event
Peter Zijlstra <[email protected]>
perf/core: Simplify the perf_event_alloc() error path
Louis-Alexis Eyraud <[email protected]>
iommu/mediatek: Fix NULL pointer deference in mtk_iommu_device_group
Marek Szyprowski <[email protected]>
iommu/exynos: Fix suspend/resume with IDENTITY domain
Ido Schimmel <[email protected]>
ethtool: cmis_cdb: Fix incorrect read / write length extension
Florian Westphal <[email protected]>
nft_set_pipapo: fix incorrect avx2 match of 5th field octet
Arnaud Lecomte <[email protected]>
net: ppp: Add bound checking for skb data on ppp_sync_txmung
Ido Schimmel <[email protected]>
ipv6: Align behavior across nexthops during path selection
Vladimir Oltean <[email protected]>
net: phy: allow MDIO bus PM ops to start/stop state machine for phylink-controlled PHY
Vladimir Oltean <[email protected]>
net: phy: move phy_link_change() prior to mdio_bus_phy_may_suspend()
Paulo Alcantara <[email protected]>
smb: client: fix UAF in decryption with multichannel
Octavian Purdila <[email protected]>
net_sched: sch_sfq: move the limit validation
Octavian Purdila <[email protected]>
net_sched: sch_sfq: use a temporary work area for validating configuration
Daniel Wagner <[email protected]>
nvmet-fcloop: swap list_add_tail arguments
Janusz Krzysztofik <[email protected]>
drm/i915/huc: Fix fence not released on early probe errors
Wentao Liang <[email protected]>
ata: sata_sx4: Add error handling in pdc20621_i2c_read()
Chenyuan Yang <[email protected]>
net: libwx: handle page_pool_dev_alloc_pages error
Maxime Ripard <[email protected]>
drm/tests: probe-helper: Fix drm_display_mode memory leak
Maxime Ripard <[email protected]>
drm/tests: modes: Fix drm_display_mode memory leak
Maxime Ripard <[email protected]>
drm/tests: cmdline: Fix drm_display_mode memory leak
Maxime Ripard <[email protected]>
drm/tests: helpers: Create kunit helper to destroy a drm_display_mode
Maxime Ripard <[email protected]>
drm/tests: modeset: Fix drm_display_mode memory leak
Maxime Chevallier <[email protected]>
net: ethtool: Don't call .cleanup_data when prepare_data fails
Toke Høiland-Jørgensen <[email protected]>
tc: Ensure we have enough buffer space when sending filter netlink notifications
Hariprasad Kelam <[email protected]>
octeontx2-pf: qos: fix VF root node parent queue index
Jakub Kicinski <[email protected]>
net: tls: explicitly disallow disconnect
Cong Wang <[email protected]>
codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog()
Tung Nguyen <[email protected]>
tipc: fix memory leak in tipc_link_xmit
Josh Poimboeuf <[email protected]>
objtool: Fix INSN_CONTEXT_SWITCH handling in validate_unret()
Henry Martin <[email protected]>
ata: pata_pxa: Fix potential NULL pointer dereference in pxa_ata_probe()
Rodrigo Vivi <[email protected]>
drm/xe: Restore EIO errno return when GuC PC start fails
Tejas Upadhyay <[email protected]>
drm/xe/hw_engine: define sysfs_ops on all directories
Petr Vaněk <[email protected]>
x86/acpi: Don't limit CPUs to 1 for Xen PV guests due to disabled ACPI
Badal Nilawar <[email protected]>
drm/i915: Disable RPG during live selftest
Ming Lei <[email protected]>
ublk: fix handling recovery & reissue in ublk_abort_queue()
Edward Liaw <[email protected]>
selftests/futex: futex_waitv wouldblock test should fail
Andy Shevchenko <[email protected]>
gpiolib: of: Fix the choice for Ingenic NAND quirk
Waiman Long <[email protected]>
cgroup/cpuset: Fix race between newly created partition and dying one
Waiman Long <[email protected]>
cgroup/cpuset: Fix error handling in remote_partition_disable()
Waiman Long <[email protected]>
cgroup/cpuset: Fix incorrect isolated_cpus update in update_parent_effective_cpumask()
Bard Liao <[email protected]>
ASoC: Intel: adl: add 2xrt1316 audio configuration
-------------
Diffstat:
Documentation/admin-guide/kernel-parameters.txt | 2 + Documentation/arch/arm64/silicon-errata.rst | 2 + .../bindings/arm/qcom,coresight-tpda.yaml | 3 +- .../bindings/arm/qcom,coresight-tpdm.yaml | 3 +- .../bindings/media/i2c/st,st-mipid02.yaml | 2 +- Makefile | 7 +- arch/arm64/Kconfig | 9 + arch/arm64/boot/dts/exynos/google/gs101.dtsi | 1 + arch/arm64/boot/dts/mediatek/mt8173.dtsi | 6 +- arch/arm64/boot/dts/mediatek/mt8188.dtsi | 2 +- .../boot/dts/nvidia/tegra234-p3768-0000+p3767.dtsi | 7 - .../boot/dts/ti/k3-j784s4-j742s2-main-common.dtsi | 6 +- arch/arm64/include/asm/cputype.h | 4 + arch/arm64/include/asm/kvm_arm.h | 4 +- arch/arm64/include/asm/spectre.h | 1 - arch/arm64/include/asm/traps.h | 4 +- arch/arm64/kernel/proton-pack.c | 208 ++++---- arch/arm64/kvm/arm.c | 6 +- arch/arm64/kvm/sys_regs.c | 204 ++++---- arch/arm64/mm/mmu.c | 3 +- arch/powerpc/kvm/powerpc.c | 5 +- arch/s390/Makefile | 2 +- arch/s390/kernel/perf_cpum_cf.c | 9 +- arch/s390/kernel/perf_cpum_sf.c | 3 - arch/s390/pci/pci_bus.c | 3 + arch/s390/pci/pci_mmio.c | 18 +- arch/sparc/include/asm/pgtable_64.h | 2 - arch/sparc/mm/tlb.c | 5 +- arch/x86/Kbuild | 4 + arch/x86/Kconfig | 20 +- arch/x86/include/asm/irqflags.h | 40 +- arch/x86/include/asm/paravirt.h | 20 +- arch/x86/include/asm/paravirt_types.h | 3 +- arch/x86/kernel/acpi/boot.c | 11 + arch/x86/kernel/cpu/amd.c | 2 +- arch/x86/kernel/e820.c | 17 +- arch/x86/kernel/head64.c | 2 - arch/x86/kernel/paravirt.c | 14 +- arch/x86/kernel/signal_32.c | 62 ++- arch/x86/kvm/cpuid.c | 8 +- arch/x86/kvm/x86.c | 4 + arch/x86/mm/kasan_init_64.c | 1 - arch/x86/mm/mem_encrypt_amd.c | 2 - arch/x86/mm/mem_encrypt_identity.c | 2 - arch/x86/mm/pat/set_memory.c | 6 +- arch/x86/xen/enlighten.c | 10 + arch/x86/xen/setup.c | 3 - block/blk-mq.c | 1 + drivers/accel/ivpu/ivpu_debugfs.c | 4 +- drivers/accel/ivpu/ivpu_ipc.c | 3 +- drivers/accel/ivpu/ivpu_ms.c | 24 + drivers/acpi/Makefile | 4 + drivers/acpi/platform_profile.c | 20 +- drivers/ata/ahci.c | 11 + drivers/ata/ahci.h | 1 + drivers/ata/libahci.c | 4 + drivers/ata/libata-core.c | 38 ++ drivers/ata/libata-eh.c | 11 +- drivers/ata/pata_pxa.c | 6 + drivers/ata/sata_sx4.c | 13 +- drivers/auxdisplay/hd44780.c | 4 +- drivers/base/devres.c | 7 + drivers/block/ublk_drv.c | 30 +- drivers/bluetooth/btintel_pcie.c | 1 + drivers/bluetooth/btqca.c | 13 +- drivers/bluetooth/btusb.c | 32 ++ drivers/bluetooth/hci_ldisc.c | 19 +- drivers/bluetooth/hci_qca.c | 2 +- drivers/bluetooth/hci_uart.h | 1 + drivers/bus/mhi/host/main.c | 16 +- drivers/char/tpm/tpm-chip.c | 6 + drivers/char/tpm/tpm-interface.c | 7 - drivers/char/tpm/tpm_tis_core.c | 20 +- drivers/char/tpm/tpm_tis_core.h | 1 + drivers/clk/qcom/clk-branch.c | 4 +- drivers/clk/qcom/gdsc.c | 61 ++- drivers/clk/renesas/r9a07g043-cpg.c | 7 + drivers/clocksource/timer-stm32-lp.c | 4 +- drivers/cpuidle/Makefile | 3 + drivers/crypto/ccp/sp-pci.c | 15 +- drivers/gpio/gpio-tegra186.c | 25 +- drivers/gpio/gpio-zynq.c | 1 + drivers/gpio/gpiolib-of.c | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 - drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 4 - drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 43 +- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 10 + drivers/gpu/drm/amd/amdkfd/kfd_device.c | 5 + drivers/gpu/drm/amd/amdkfd/kfd_process.c | 17 + .../gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 31 +- drivers/gpu/drm/amd/display/dc/dc.h | 2 + drivers/gpu/drm/amd/display/dc/dc_dp_types.h | 8 + .../dml21/src/dml2_core/dml2_core_dcn4_calcs.c | 2 + .../amd/display/dc/dml2/dml2_dc_resource_mgmt.c | 26 - .../gpu/drm/amd/display/dc/hubp/dcn31/dcn31_hubp.c | 2 +- .../drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 22 +- .../display/dc/link/protocols/link_dp_capability.c | 12 +- .../display/dc/link/protocols/link_dp_training.c | 2 + .../link_dp_training_fixed_vs_pe_retimer.c | 3 +- drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c | 5 + drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_debugfs.c | 2 +- drivers/gpu/drm/drm_panel.c | 5 +- drivers/gpu/drm/drm_panel_orientation_quirks.c | 46 +- drivers/gpu/drm/i915/gt/intel_rc6.c | 19 +- drivers/gpu/drm/i915/gt/uc/intel_huc.c | 11 +- drivers/gpu/drm/i915/gt/uc/intel_huc.h | 1 + drivers/gpu/drm/i915/gt/uc/intel_uc.c | 1 + drivers/gpu/drm/i915/selftests/i915_selftest.c | 18 + drivers/gpu/drm/mediatek/mtk_dpi.c | 23 +- drivers/gpu/drm/tests/drm_client_modeset_test.c | 3 + drivers/gpu/drm/tests/drm_cmdline_parser_test.c | 10 +- drivers/gpu/drm/tests/drm_kunit_helpers.c | 22 + drivers/gpu/drm/tests/drm_modes_test.c | 22 + drivers/gpu/drm/tests/drm_probe_helper_test.c | 8 +- drivers/gpu/drm/xe/xe_gt.c | 4 + drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 4 +- drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 16 + drivers/gpu/drm/xe/xe_gt_sriov_vf.h | 1 + drivers/gpu/drm/xe/xe_guc_pc.c | 1 + drivers/gpu/drm/xe/xe_hw_engine_class_sysfs.c | 108 ++-- drivers/gpu/drm/xe/xe_tuning.c | 8 - drivers/gpu/drm/xe/xe_wa.c | 7 + drivers/hid/Kconfig | 14 + drivers/hid/Makefile | 1 + drivers/hid/hid-ids.h | 37 ++ drivers/hid/hid-universal-pidff.c | 202 ++++++++ drivers/hid/usbhid/hid-core.c | 1 + drivers/hid/usbhid/hid-pidff.c | 571 ++++++++++++++------- drivers/hid/usbhid/hid-pidff.h | 33 ++ drivers/i3c/master.c | 3 + drivers/i3c/master/svc-i3c-master.c | 2 +- drivers/idle/Makefile | 5 +- drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 32 +- drivers/iommu/exynos-iommu.c | 4 +- drivers/iommu/intel/iommu.c | 2 + drivers/iommu/intel/irq_remapping.c | 71 +-- drivers/iommu/iommufd/device.c | 123 ++++- drivers/iommu/iommufd/fault.c | 8 +- drivers/iommu/iommufd/iommufd_private.h | 33 +- drivers/iommu/mtk_iommu.c | 26 +- drivers/irqchip/irq-gic-v3-its.c | 23 +- drivers/irqchip/irq-renesas-rzv2h.c | 2 +- drivers/leds/rgb/leds-qcom-lpg.c | 8 +- drivers/mailbox/tegra-hsp.c | 72 ++- drivers/md/dm-ebs-target.c | 7 + drivers/md/dm-integrity.c | 48 +- drivers/md/dm-verity-target.c | 8 + drivers/media/common/siano/smsdvb-main.c | 2 + drivers/media/i2c/adv748x/adv748x.h | 2 +- drivers/media/i2c/ccs/ccs-core.c | 6 +- drivers/media/i2c/hi556.c | 5 +- drivers/media/i2c/imx214.c | 25 +- drivers/media/i2c/imx219.c | 106 ++-- drivers/media/i2c/imx319.c | 9 +- drivers/media/i2c/ov08x40.c | 8 +- drivers/media/i2c/ov7251.c | 4 +- drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 1 + drivers/media/pci/mgb4/mgb4_cmt.c | 8 +- .../media/platform/chips-media/wave5/wave5-hw.c | 2 +- .../platform/chips-media/wave5/wave5-vpu-dec.c | 31 +- .../media/platform/chips-media/wave5/wave5-vpu.c | 4 +- .../platform/chips-media/wave5/wave5-vpuapi.c | 10 + .../mediatek/vcodec/common/mtk_vcodec_fw_scp.c | 5 +- .../mediatek/vcodec/encoder/venc/venc_h264_if.c | 6 +- drivers/media/platform/nuvoton/npcm-video.c | 6 +- drivers/media/platform/qcom/venus/hfi_parser.c | 100 +++- drivers/media/platform/qcom/venus/hfi_venus.c | 18 +- drivers/media/platform/rockchip/rga/rga-hw.c | 2 +- .../platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 5 +- drivers/media/platform/st/stm32/dma2d/dma2d.c | 3 +- drivers/media/platform/xilinx/xilinx-tpg.c | 2 - drivers/media/rc/streamzap.c | 68 +-- drivers/media/test-drivers/vim2m.c | 6 +- drivers/media/test-drivers/visl/visl-core.c | 12 + drivers/media/usb/uvc/uvc_driver.c | 9 + drivers/media/v4l2-core/v4l2-dv-timings.c | 4 +- drivers/mfd/ene-kb3930.c | 2 +- drivers/misc/pci_endpoint_test.c | 3 +- drivers/mmc/host/dw_mmc.c | 94 +++- drivers/mmc/host/dw_mmc.h | 27 + drivers/mtd/inftlcore.c | 9 +- drivers/mtd/mtdpstore.c | 12 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 2 +- drivers/mtd/nand/raw/r852.c | 3 + drivers/net/can/flexcan/flexcan-core.c | 35 +- drivers/net/can/flexcan/flexcan.h | 5 + drivers/net/dsa/mv88e6xxx/chip.c | 23 +- drivers/net/ethernet/google/gve/gve_ethtool.c | 4 +- drivers/net/ethernet/google/gve/gve_rx_dqo.c | 3 +- drivers/net/ethernet/marvell/octeontx2/nic/qos.c | 5 + drivers/net/ethernet/microsoft/mana/mana_en.c | 46 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 +- drivers/net/ethernet/wangxun/libwx/wx_lib.c | 3 +- drivers/net/phy/phy_device.c | 57 +- drivers/net/phy/sfp.c | 13 +- drivers/net/ppp/ppp_synctty.c | 5 + drivers/net/usb/asix_devices.c | 17 + drivers/net/usb/cdc_ether.c | 7 + drivers/net/usb/r8152.c | 6 + drivers/net/usb/r8153_ecm.c | 6 + drivers/net/wireless/ath/ath11k/ahb.c | 4 +- drivers/net/wireless/ath/ath11k/core.c | 3 +- drivers/net/wireless/ath/ath11k/dp.c | 35 +- drivers/net/wireless/ath/ath11k/fw.c | 3 +- drivers/net/wireless/ath/ath11k/pci.c | 3 +- drivers/net/wireless/ath/ath12k/dp_mon.c | 2 +- drivers/net/wireless/ath/ath12k/dp_rx.c | 42 +- drivers/net/wireless/ath/ath12k/pci.c | 1 + drivers/net/wireless/mediatek/mt76/eeprom.c | 4 + drivers/net/wireless/mediatek/mt76/mt76.h | 1 + .../net/wireless/mediatek/mt76/mt76_connac_mcu.c | 4 +- drivers/net/wireless/mediatek/mt76/mt76x2/usb.c | 1 + drivers/net/wireless/mediatek/mt76/mt7925/main.c | 16 +- drivers/net/wireless/mediatek/mt76/mt7925/mcu.c | 5 +- drivers/net/wireless/mediatek/mt76/mt7925/mcu.h | 4 +- drivers/ntb/ntb_transport.c | 2 +- drivers/nvme/target/fcloop.c | 2 +- drivers/of/irq.c | 78 +-- drivers/pci/controller/cadence/pci-j721e.c | 5 +- drivers/pci/controller/pcie-brcmstb.c | 13 +- drivers/pci/controller/pcie-rockchip-host.c | 2 +- drivers/pci/controller/pcie-rockchip.h | 1 - drivers/pci/controller/vmd.c | 12 +- drivers/pci/devres.c | 18 +- drivers/pci/hotplug/pciehp_core.c | 5 +- drivers/pci/iomap.c | 29 +- drivers/pci/pci.c | 6 + drivers/pci/pci.h | 16 + drivers/pci/probe.c | 22 +- drivers/perf/arm_pmu.c | 8 +- drivers/perf/dwc_pcie_pmu.c | 33 +- drivers/phy/freescale/phy-fsl-imx8m-pcie.c | 11 + drivers/pinctrl/qcom/pinctrl-msm.c | 12 +- drivers/pinctrl/samsung/pinctrl-exynos-arm64.c | 98 ++-- drivers/pinctrl/samsung/pinctrl-exynos.h | 22 + drivers/pinctrl/samsung/pinctrl-samsung.c | 1 + drivers/pinctrl/samsung/pinctrl-samsung.h | 4 + drivers/platform/chrome/cros_ec_lpc.c | 22 +- drivers/platform/x86/x86-android-tablets/Kconfig | 1 + drivers/pwm/pwm-fsl-ftm.c | 6 + drivers/pwm/pwm-mediatek.c | 8 +- drivers/pwm/pwm-rcar.c | 24 +- drivers/pwm/pwm-stm32.c | 12 +- drivers/s390/virtio/virtio_ccw.c | 16 +- drivers/scsi/lpfc/lpfc_sli.c | 2 + drivers/scsi/mpi3mr/mpi3mr.h | 14 +- drivers/scsi/mpi3mr/mpi3mr_app.c | 24 + drivers/scsi/mpi3mr/mpi3mr_fw.c | 99 +++- drivers/scsi/st.c | 2 +- drivers/soc/samsung/exynos-chipid.c | 2 + drivers/spi/spi-cadence-quadspi.c | 6 + drivers/spi/spi-fsl-qspi.c | 36 +- drivers/target/target_core_spc.c | 2 +- drivers/thermal/mediatek/lvts_thermal.c | 52 +- drivers/thermal/rockchip_thermal.c | 1 + drivers/ufs/host/ufs-qcom.c | 2 +- drivers/vdpa/mlx5/core/mr.c | 7 +- drivers/video/backlight/led_bl.c | 5 +- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 6 +- drivers/xen/balloon.c | 34 +- drivers/xen/xenfs/xensyms.c | 4 +- fs/btrfs/disk-io.c | 12 + fs/btrfs/extent-tree.c | 8 + fs/btrfs/tests/extent-map-tests.c | 1 + fs/btrfs/transaction.c | 12 + fs/btrfs/zoned.c | 6 + fs/dlm/lock.c | 2 + fs/erofs/fileio.c | 2 + fs/ext4/inode.c | 68 ++- fs/ext4/namei.c | 2 +- fs/ext4/super.c | 17 + fs/ext4/xattr.c | 11 +- fs/f2fs/checkpoint.c | 21 +- fs/f2fs/f2fs.h | 32 +- fs/f2fs/inode.c | 8 +- fs/f2fs/node.c | 110 ++-- fs/f2fs/super.c | 8 +- fs/file.c | 26 +- fs/jbd2/journal.c | 1 - fs/jfs/jfs_dmap.c | 10 +- fs/jfs/jfs_imap.c | 4 +- fs/namespace.c | 3 +- fs/nfsd/nfs4callback.c | 2 +- fs/nfsd/nfsctl.c | 9 +- fs/nfsd/stats.c | 4 +- fs/nfsd/stats.h | 2 +- fs/smb/client/cifsencrypt.c | 16 +- fs/smb/client/connect.c | 3 + fs/smb/client/fs_context.c | 5 + fs/smb/client/inode.c | 10 + fs/smb/client/reparse.c | 4 - fs/smb/client/sess.c | 7 + fs/smb/client/smb2misc.c | 9 +- fs/smb/client/smb2ops.c | 6 +- fs/smb/client/smb2pdu.c | 11 +- fs/udf/inode.c | 1 + fs/userfaultfd.c | 51 +- include/drm/drm_kunit_helpers.h | 3 + include/drm/intel/pciids.h | 5 +- include/linux/cgroup-defs.h | 1 + include/linux/cgroup.h | 2 +- include/linux/hid.h | 6 - include/linux/io_uring_types.h | 3 + include/linux/kvm_host.h | 2 +- include/linux/page-flags.h | 6 + include/linux/pci_ids.h | 2 + include/linux/perf_event.h | 17 +- include/linux/pgtable.h | 14 +- include/linux/printk.h | 6 + include/linux/tpm.h | 1 + include/net/bluetooth/hci.h | 16 + include/net/bluetooth/hci_core.h | 4 + include/net/mac80211.h | 6 + include/net/sctp/structs.h | 3 +- include/net/sock.h | 40 +- include/uapi/linux/kfd_ioctl.h | 2 + include/uapi/linux/landlock.h | 2 + include/uapi/linux/psp-sev.h | 21 +- include/uapi/linux/rkisp1-config.h | 2 +- include/xen/interface/xen-mca.h | 2 +- io_uring/io_uring.c | 4 +- io_uring/kbuf.c | 2 + io_uring/net.c | 3 + kernel/Makefile | 5 + kernel/cgroup/cgroup.c | 6 + kernel/cgroup/cpuset.c | 55 +- kernel/entry/Makefile | 3 + kernel/events/core.c | 184 +++---- kernel/locking/lockdep.c | 3 + kernel/power/hibernate.c | 6 +- kernel/printk/printk.c | 4 +- kernel/rcu/srcutree.c | 11 +- kernel/reboot.c | 1 + kernel/sched/Makefile | 5 + kernel/sched/ext.c | 4 +- kernel/time/Makefile | 6 + kernel/trace/ftrace.c | 9 +- kernel/trace/ring_buffer.c | 5 +- kernel/trace/trace_events.c | 4 +- kernel/trace/trace_events_synth.c | 1 - kernel/trace/trace_fprobe.c | 26 +- kernel/trace/trace_probe.c | 28 + lib/Makefile | 5 + lib/sg_split.c | 2 - lib/zstd/common/portability_macros.h | 2 +- mm/damon/ops-common.c | 2 +- mm/damon/paddr.c | 24 +- mm/hugetlb.c | 2 +- mm/memory-failure.c | 11 +- mm/memory_hotplug.c | 3 +- mm/mremap.c | 10 +- mm/page_vma_mapped.c | 13 +- mm/rmap.c | 2 +- mm/shmem.c | 3 +- mm/vmscan.c | 2 +- net/8021q/vlan_dev.c | 31 +- net/bluetooth/hci_sync.c | 6 +- net/core/filter.c | 80 +-- net/core/page_pool.c | 8 +- net/core/page_pool_user.c | 2 +- net/core/sock.c | 5 + net/ethtool/cmis.h | 1 - net/ethtool/cmis_cdb.c | 18 +- net/ethtool/netlink.c | 8 +- net/ipv6/route.c | 8 +- net/mac80211/debugfs.c | 44 +- net/mac80211/iface.c | 5 +- net/mac80211/mesh_hwmp.c | 14 +- net/mac80211/mlme.c | 45 +- net/mptcp/sockopt.c | 28 + net/mptcp/subflow.c | 19 +- net/netfilter/nft_set_pipapo_avx2.c | 3 +- net/sched/cls_api.c | 66 ++- net/sched/sch_codel.c | 5 +- net/sched/sch_fq_codel.c | 6 +- net/sched/sch_sfq.c | 66 ++- net/sctp/socket.c | 22 +- net/sctp/transport.c | 2 + net/sunrpc/xprtrdma/svc_rdma_transport.c | 3 +- net/tipc/link.c | 1 + net/tls/tls_main.c | 6 + scripts/generate_builtin_ranges.awk | 5 + security/integrity/ima/ima.h | 3 +- security/integrity/ima/ima_main.c | 18 +- security/landlock/errata.h | 99 ++++ security/landlock/errata/abi-4.h | 15 + security/landlock/errata/abi-6.h | 19 + security/landlock/fs.c | 39 +- security/landlock/setup.c | 38 +- security/landlock/setup.h | 3 + security/landlock/syscalls.c | 22 +- security/landlock/task.c | 12 + sound/pci/hda/hda_intel.c | 44 +- sound/pci/hda/patch_realtek.c | 22 + sound/soc/amd/acp/acp-sdw-legacy-mach.c | 34 ++ sound/soc/amd/acp/soc_amd_sdw_common.h | 1 + sound/soc/amd/ps/acp63.h | 1 + sound/soc/amd/ps/pci-ps.c | 2 +- sound/soc/amd/yc/acp6x-mach.c | 14 + sound/soc/codecs/wcd937x.c | 2 + sound/soc/fsl/fsl_audmix.c | 16 +- sound/soc/intel/common/soc-acpi-intel-adl-match.c | 29 ++ sound/soc/qcom/qdsp6/q6apm-dai.c | 60 ++- sound/soc/qcom/qdsp6/q6apm.c | 18 +- sound/soc/qcom/qdsp6/q6apm.h | 3 + sound/soc/qcom/qdsp6/q6asm-dai.c | 19 +- sound/soc/sof/topology.c | 4 +- sound/usb/midi.c | 80 ++- tools/objtool/check.c | 5 + tools/power/cpupower/bench/parse.c | 4 + tools/testing/ktest/ktest.pl | 8 + .../futex/functional/futex_wait_wouldblock.c | 2 +- tools/testing/selftests/landlock/base_test.c | 46 +- tools/testing/selftests/landlock/common.h | 1 + .../selftests/landlock/scoped_signal_test.c | 108 +++- tools/testing/selftests/net/mptcp/mptcp_connect.c | 11 +- virt/kvm/Kconfig | 2 +- virt/kvm/eventfd.c | 10 +- 421 files changed, 5137 insertions(+), 2163 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 14/414 tipc: fix memory leak in tipc_link_xmit
6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tung Nguyen <[email protected]>
[ Upstream commit 69ae94725f4fc9e75219d2d69022029c5b24bc9a ]
In case the backlog transmit queue for system-importance messages is overloaded, tipc_link_xmit() returns -ENOBUFS but the skb list is not purged. This leads to memory leak and failure when a skb is allocated.
This commit fixes this issue by purging the skb list before tipc_link_xmit() returns.
--- net/tipc/link.c | 1 + 1 file changed, 1 insertion(+)
net/tipc/link.c +1 -0
@@ -1046,6 +1046,7 @@ int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list,if (unlikely (l->backlog[imp].len >= l->backlog[imp].limit)) {if (imp ==TIPC_SYSTEM_IMPORTANCE ) {pr_warn ("%s<%s>, link overflow" , link_rst_msg, l->name); +__skb_queue_purge (list);return -ENOBUFS ; } rc =link_schedule_user (l, hdr);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 23/414 drm/tests: modes: Fix drm_display_mode memory leak
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
[ Upstream commit d34146340f95cd9bf06d4ce71cca72127dc0b7cd ]
drm_analog_tv_mode() and its variants return a drm_display_mode that needs to be destroyed later one. The drm_modes_analog_tv tests never do however, which leads to a memory leak.
Let's make sure it's freed.
--- drivers/gpu/drm/tests/drm_modes_test.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
drivers/gpu/drm/tests/drm_modes_test.c +22 -0
@@ -40,6 +40,7 @@ static void drm_test_modes_analog_tv_ntsc_480i(struct kunit *test) {struct drm_test_modes_priv *priv = test->priv;struct drm_display_mode *mode; +int ret; mode = drm_analog_tv_mode(priv->drm, DRM_MODE_TV_MODE_NTSC,
@@ -47,6 +48,9 @@ static void drm_test_modes_analog_tv_ntsc_480i(struct kunit *test) true);KUNIT_ASSERT_NOT_NULL (test, mode); + ret =drm_kunit_add_mode_destroy_action (test, mode); +KUNIT_ASSERT_EQ (test, ret,0 ); +KUNIT_EXPECT_EQ (test,drm_mode_vrefresh (mode),60 );KUNIT_EXPECT_EQ (test, mode->hdisplay,720 );
@@ -70,6 +74,7 @@ static void drm_test_modes_analog_tv_ntsc_480i_inlined(struct kunit *test) {struct drm_test_modes_priv *priv = test->priv;struct drm_display_mode *expected, *mode; +int ret; expected = drm_analog_tv_mode(priv->drm, DRM_MODE_TV_MODE_NTSC,
@@ -77,9 +82,15 @@ static void drm_test_modes_analog_tv_ntsc_480i_inlined(struct kunit *test) true);KUNIT_ASSERT_NOT_NULL (test, expected); + ret =drm_kunit_add_mode_destroy_action (test, expected); +KUNIT_ASSERT_EQ (test, ret,0 ); + mode =drm_mode_analog_ntsc_480i (priv->drm);KUNIT_ASSERT_NOT_NULL (test, mode); + ret =drm_kunit_add_mode_destroy_action (test, mode); +KUNIT_ASSERT_EQ (test, ret,0 ); +KUNIT_EXPECT_TRUE (test,drm_mode_equal (expected, mode)); }
@@ -87,6 +98,7 @@ static void drm_test_modes_analog_tv_pal_576i(struct kunit *test) {struct drm_test_modes_priv *priv = test->priv;struct drm_display_mode *mode; +int ret; mode = drm_analog_tv_mode(priv->drm, DRM_MODE_TV_MODE_PAL,
@@ -94,6 +106,9 @@ static void drm_test_modes_analog_tv_pal_576i(struct kunit *test) true);KUNIT_ASSERT_NOT_NULL (test, mode); + ret =drm_kunit_add_mode_destroy_action (test, mode); +KUNIT_ASSERT_EQ (test, ret,0 ); +KUNIT_EXPECT_EQ (test,drm_mode_vrefresh (mode),50 );KUNIT_EXPECT_EQ (test, mode->hdisplay,720 );
@@ -117,6 +132,7 @@ static void drm_test_modes_analog_tv_pal_576i_inlined(struct kunit *test) {struct drm_test_modes_priv *priv = test->priv;struct drm_display_mode *expected, *mode; +int ret; expected = drm_analog_tv_mode(priv->drm, DRM_MODE_TV_MODE_PAL,
@@ -124,9 +140,15 @@ static void drm_test_modes_analog_tv_pal_576i_inlined(struct kunit *test) true);KUNIT_ASSERT_NOT_NULL (test, expected); + ret =drm_kunit_add_mode_destroy_action (test, expected); +KUNIT_ASSERT_EQ (test, ret,0 ); + mode =drm_mode_analog_pal_576i (priv->drm);KUNIT_ASSERT_NOT_NULL (test, mode); + ret =drm_kunit_add_mode_destroy_action (test, mode); +KUNIT_ASSERT_EQ (test, ret,0 ); +KUNIT_EXPECT_TRUE (test,drm_mode_equal (expected, mode)); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 24/414 drm/tests: probe-helper: Fix drm_display_mode memory leak
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
[ Upstream commit 8b6f2e28431b2f9f84073bff50353aeaf25559d0 ]
drm_analog_tv_mode() and its variants return a drm_display_mode that needs to be destroyed later one. The drm_test_connector_helper_tv_get_modes_check() test never does however, which leads to a memory leak.
Let's make sure it's freed.
--- drivers/gpu/drm/tests/drm_probe_helper_test.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/tests/drm_probe_helper_test.c +7 -1
@@ -98,7 +98,7 @@ drm_test_connector_helper_tv_get_modes_check(struct kunit *test)struct drm_connector *connector = &priv->connector;struct drm_cmdline_mode *cmdline = &connector->cmdline_mode;struct drm_display_mode *mode; -const struct drm_display_mode *expected; +struct drm_display_mode *expected;size_t len;int ret;
@@ -134,6 +134,9 @@ drm_test_connector_helper_tv_get_modes_check(struct kunit *test)KUNIT_EXPECT_TRUE (test,drm_mode_equal (mode, expected));KUNIT_EXPECT_TRUE (test, mode->type &DRM_MODE_TYPE_PREFERRED ); + + ret =drm_kunit_add_mode_destroy_action (test, expected); +KUNIT_ASSERT_EQ (test, ret,0 ); }if (params->num_expected_modes >=2 ) {
@@ -145,6 +148,9 @@ drm_test_connector_helper_tv_get_modes_check(struct kunit *test)KUNIT_EXPECT_TRUE (test,drm_mode_equal (mode, expected));KUNIT_EXPECT_FALSE (test, mode->type &DRM_MODE_TYPE_PREFERRED ); + + ret =drm_kunit_add_mode_destroy_action (test, expected); +KUNIT_ASSERT_EQ (test, ret,0 ); }mutex_unlock (&priv->drm->mode_config.mutex);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 25/414 net: libwx: handle page_pool_dev_alloc_pages error
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chenyuan Yang <[email protected]>
[ Upstream commit 7f1ff1b38a7c8b872382b796023419d87d78c47e ]
page_pool_dev_alloc_pages could return NULL. There was a WARN_ON(!page) but it would still proceed to use the NULL pointer and then crash.
This is similar to commit 001ba0902046
("net: fec: handle page_pool_dev_alloc_pages error").
This is found by our static analysis tool KNighter.
--- drivers/net/ethernet/wangxun/libwx/wx_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/wangxun/libwx/wx_lib.c +2 -1
@@ -309,7 +309,8 @@ static bool wx_alloc_mapped_page(struct wx_ring *rx_ring,return true; page =page_pool_dev_alloc_pages (rx_ring->page_pool); -WARN_ON (!page); +if (unlikely (!page)) +return false; dma =page_pool_get_dma_addr (page); bi->page_dma = dma;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 26/414 ata: sata_sx4: Add error handling in pdc20621_i2c_read()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wentao Liang <[email protected]>
[ Upstream commit 8d46a27085039158eb5e253ab8a35a0e33b5e864 ]
The function pdc20621_prog_dimm0() calls the function pdc20621_i2c_read() but does not handle the error if the read fails. This could lead to process with invalid data. A proper implementation can be found in /source/drivers/ata/sata_sx4.c, pdc20621_prog_dimm_global(). As mentioned in its commit: bb44e154e25125bef31fa956785e90fccd24610b, the variable spd0 might be used uninitialized when pdc20621_i2c_read() fails.
Add error handling to pdc20621_i2c_read(). If a read operation fails, an error message is logged via dev_err(), and return a negative error code.
Add error handling to pdc20621_prog_dimm0() in pdc20621_dimm_init(), and return a negative error code if pdc20621_prog_dimm0() fails.
--- drivers/ata/sata_sx4.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/ata/sata_sx4.c +10 -3
@@ -1117,9 +1117,14 @@ static int pdc20621_prog_dimm0(struct ata_host *host) mmio +=PDC_CHIP0_OFS ;for (i =0 ; i <ARRAY_SIZE (pdc_i2c_read_data); i++) -pdc20621_i2c_read (host,PDC_DIMM0_SPD_DEV_ADDRESS , - pdc_i2c_read_data[i].reg, - &spd0[pdc_i2c_read_data[i].ofs]); +if (!pdc20621_i2c_read (host,PDC_DIMM0_SPD_DEV_ADDRESS , + pdc_i2c_read_data[i].reg, + &spd0[pdc_i2c_read_data[i].ofs])) { +dev_err (host->dev, +"Failed in i2c read at index %d: device=%#x, reg=%#x\n" , + i,PDC_DIMM0_SPD_DEV_ADDRESS , pdc_i2c_read_data[i].reg); +return -EIO ; + } data |= (spd0[4 ] -8 ) | ((spd0[21 ] !=0 ) <<3 ) | ((spd0[3 ]-11 ) <<4 ); data |= ((spd0[17] / 4) << 6) | ((spd0[5] / 2) << 7) |
@@ -1284,6 +1289,8 @@ static unsigned int pdc20621_dimm_init(struct ata_host *host)/* Programming DIMM0 Module Control Register (index_CID0:80h) */ size =pdc20621_prog_dimm0 (host); +if (size <0 ) +return size;dev_dbg (host->dev,"Local DIMM Size = %dMB\n" , size);/* Programming DIMM Module Global Control Register (index_CID0:88h) */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 27/414 drm/i915/huc: Fix fence not released on early probe errors
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Janusz Krzysztofik <[email protected]>
[ Upstream commit e3ea2eae70692a455e256787e4f54153fb739b90 ]
HuC delayed loading fence, introduced with commit 27536e03271da ("drm/i915/huc: track delayed HuC load with a fence"), is registered with object tracker early on driver probe but unregistered only from driver remove, which is not called on early probe errors. Since its memory is allocated under devres, then released anyway, it may happen to be allocated again to the fence and reused on future driver probes, resulting in kernel warnings that taint the kernel:
<4> [309.731371] ------------[ cut here ]------------
<3> [309.731373] ODEBUG: init destroyed (active state 0) object: ffff88813d7dd2e0 object type: i915_sw_fence hint: sw_fence_dummy_notify+0x0/0x20 [i915] <4> [309.731575] WARNING: CPU: 2 PID: 3161 at lib/debugobjects.c:612 debug_print_object+0x93/0xf0
...
<4> [309.731693] CPU: 2 UID: 0 PID: 3161 Comm: i915_module_loa Tainted: G U 6.14.0-CI_DRM_16362-gf0fd77956987+ #1
...
<4> [309.731700] RIP: 0010:debug_print_object+0x93/0xf0
...
<4> [309.731728] Call Trace:
<4> [309.731730] <TASK>
...
<4> [309.731949] __debug_object_init+0x17b/0x1c0 <4> [309.731957] debug_object_init+0x34/0x50 <4> [309.732126] __i915_sw_fence_init+0x34/0x60 [i915] <4> [309.732256] intel_huc_init_early+0x4b/0x1d0 [i915] <4> [309.732468] intel_uc_init_early+0x61/0x680 [i915] <4> [309.732667] intel_gt_common_init_early+0x105/0x130 [i915] <4> [309.732804] intel_root_gt_init_early+0x63/0x80 [i915] <4> [309.732938] i915_driver_probe+0x1fa/0xeb0 [i915] <4> [309.733075] i915_pci_probe+0xe6/0x220 [i915] <4> [309.733198] local_pci_probe+0x44/0xb0 <4> [309.733203] pci_device_probe+0xf4/0x270 <4> [309.733209] really_probe+0xee/0x3c0 <4> [309.733215] __driver_probe_device+0x8c/0x180 <4> [309.733219] driver_probe_device+0x24/0xd0 <4> [309.733223] __driver_attach+0x10f/0x220 <4> [309.733230] bus_for_each_dev+0x7d/0xe0 <4> [309.733236] driver_attach+0x1e/0x30 <4> [309.733239] bus_add_driver+0x151/0x290 <4> [309.733244] driver_register+0x5e/0x130 <4> [309.733247] __pci_register_driver+0x7d/0x90 <4> [309.733251] i915_pci_register_driver+0x23/0x30 [i915] <4> [309.733413] i915_init+0x34/0x120 [i915] <4> [309.733655] do_one_initcall+0x62/0x3f0 <4> [309.733667] do_init_module+0x97/0x2a0 <4> [309.733671] load_module+0x25ff/0x2890 <4> [309.733688] init_module_from_file+0x97/0xe0 <4> [309.733701] idempotent_init_module+0x118/0x330 <4> [309.733711] __x64_sys_finit_module+0x77/0x100 <4> [309.733715] x64_sys_call+0x1f37/0x2650 <4> [309.733719] do_syscall_64+0x91/0x180 <4> [309.733763] entry_SYSCALL_64_after_hwframe+0x76/0x7e <4> [309.733792] </TASK>
...
<4> [309.733806] ---[ end trace 0000000000000000 ]---
That scenario is most easily reproducible with
igt@i915_module_load@reload-with-fault-injection.
Fix the issue by moving the cleanup step to driver release path.
--- drivers/gpu/drm/i915/gt/uc/intel_huc.c | 11 +++++------ drivers/gpu/drm/i915/gt/uc/intel_huc.h | 1 + drivers/gpu/drm/i915/gt/uc/intel_uc.c | 1 + 3 files changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/gt/uc/intel_huc.c +5 -6
@@ -317,6 +317,11 @@ void intel_huc_init_early(struct intel_huc *huc) } } +void intel_huc_fini_late (struct intel_huc *huc) +{ +delayed_huc_load_fini (huc); +} +#define HUC_LOAD_MODE_STRING (x) (x ? "GSC" : "legacy")static int check_huc_loading_mode (struct intel_huc *huc) {
@@ -414,12 +419,6 @@ int intel_huc_init(struct intel_huc *huc)void intel_huc_fini (struct intel_huc *huc) { -/* -* the fence is initialized in init_early, so we need to clean it up -* even if HuC loading is off. -*/ -delayed_huc_load_fini (huc); -if (huc->heci_pkt)i915_vma_unpin_and_release (&huc->heci_pkt,0 );
drivers/gpu/drm/i915/gt/uc/intel_huc.h +1 -0
@@ -55,6 +55,7 @@ struct intel_huc {int intel_huc_sanitize (struct intel_huc *huc);void intel_huc_init_early (struct intel_huc *huc); +void intel_huc_fini_late (struct intel_huc *huc);int intel_huc_init (struct intel_huc *huc);void intel_huc_fini (struct intel_huc *huc);void intel_huc_suspend (struct intel_huc *huc);
drivers/gpu/drm/i915/gt/uc/intel_uc.c +1 -0
@@ -136,6 +136,7 @@ void intel_uc_init_late(struct intel_uc *uc)void intel_uc_driver_late_release (struct intel_uc *uc) { +intel_huc_fini_late (&uc->huc); }/**
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 28/414 nvmet-fcloop: swap list_add_tail arguments
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Wagner <[email protected]>
[ Upstream commit 2b5f0c5bc819af2b0759a8fcddc1b39102735c0f ]
The newly element to be added to the list is the first argument of list_add_tail. This fix is missing dcfad4ab4d67 ("nvmet-fcloop: swap the list_add_tail arguments").
--- drivers/nvme/target/fcloop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/target/fcloop.c +1 -1
@@ -478,7 +478,7 @@ fcloop_t2h_xmt_ls_rsp(struct nvme_fc_local_port *localport,if (targetport) { tport = targetport->private;spin_lock (&tport->lock); -list_add_tail (&tport->ls_list, &tls_req->ls_list); +list_add_tail (&tls_req->ls_list, &tport->ls_list);spin_unlock (&tport->lock);queue_work (nvmet_wq, &tport->ls_work); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 29/414 net_sched: sch_sfq: use a temporary work area for validating configuration
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Octavian Purdila <[email protected]>
[ Upstream commit 8c0cea59d40cf6dd13c2950437631dd614fbade6 ]
Many configuration parameters have influence on others (e.g. divisor -> flows -> limit, depth -> limit) and so it is difficult to correctly do all of the validation before applying the configuration. And if a validation error is detected late it is difficult to roll back a partially applied configuration.
To avoid these issues use a temporary work area to update and validate the configuration and only then apply the configuration to the internal state.
Stable-dep-of: b3bf8f63e617 ("net_sched: sch_sfq: move the limit validation")
--- net/sched/sch_sfq.c | 56 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 12 deletions(-)
net/sched/sch_sfq.c +44 -12
@@ -631,6 +631,15 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt,struct red_parms *p =NULL ;struct sk_buff *to_free =NULL ;struct sk_buff *tail =NULL ; +unsigned int maxflows; +unsigned int quantum; +unsigned int divisor; +int perturb_period; +u8 headdrop; +u8 maxdepth; +int limit; +u8 flags; +if (opt->nla_len <nla_attr_size (sizeof (*ctl)))return -EINVAL ;
@@ -656,36 +665,59 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt,NL_SET_ERR_MSG_MOD (extack,"invalid limit" );return -EINVAL ; } +sch_tree_lock (sch); + + limit = q->limit; + divisor = q->divisor; + headdrop = q->headdrop; + maxdepth = q->maxdepth; + maxflows = q->maxflows; + perturb_period = q->perturb_period; + quantum = q->quantum; + flags = q->flags; + +/* update and validate configuration */ if (ctl->quantum) - q->quantum = ctl->quantum; -WRITE_ONCE (q->perturb_period, ctl->perturb_period *HZ ); + quantum = ctl->quantum; + perturb_period = ctl->perturb_period *HZ ;if (ctl->flows) - q->maxflows =min_t (u32, ctl->flows,SFQ_MAX_FLOWS ); + maxflows =min_t (u32, ctl->flows,SFQ_MAX_FLOWS );if (ctl->divisor) { - q->divisor = ctl->divisor; - q->maxflows =min_t (u32, q->maxflows, q->divisor); + divisor = ctl->divisor; + maxflows =min_t (u32, maxflows, divisor); }if (ctl_v1) {if (ctl_v1->depth) - q->maxdepth =min_t (u32, ctl_v1->depth,SFQ_MAX_DEPTH ); + maxdepth =min_t (u32, ctl_v1->depth,SFQ_MAX_DEPTH );if (p) { -swap (q->red_parms, p); -red_set_parms (q->red_parms, +red_set_parms (p, ctl_v1->qth_min, ctl_v1->qth_max, ctl_v1->Wlog, ctl_v1->Plog, ctl_v1->Scell_log,NULL , ctl_v1->max_P); } - q->flags = ctl_v1->flags; - q->headdrop = ctl_v1->headdrop; + flags = ctl_v1->flags; + headdrop = ctl_v1->headdrop; }if (ctl->limit) { - q->limit =min_t (u32, ctl->limit, q->maxdepth * q->maxflows); - q->maxflows =min_t (u32, q->maxflows, q->limit); + limit =min_t (u32, ctl->limit, maxdepth * maxflows); + maxflows =min_t (u32, maxflows, limit); } +/* commit configuration */ + q->limit = limit; + q->divisor = divisor; + q->headdrop = headdrop; + q->maxdepth = maxdepth; + q->maxflows = maxflows; +WRITE_ONCE (q->perturb_period, perturb_period); + q->quantum = quantum; + q->flags = flags; +if (p) +swap (q->red_parms, p); + qlen = sch->q.qlen;while (sch->q.qlen > q->limit) { dropped +=sfq_drop (sch, &to_free);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 30/414 net_sched: sch_sfq: move the limit validation
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Octavian Purdila <[email protected]>
[ Upstream commit b3bf8f63e6179076b57c9de660c9f80b5abefe70 ]
It is not sufficient to directly validate the limit on the data that the user passes as it can be updated based on how the other parameters are changed.
Move the check at the end of the configuration update process to also catch scenarios where the limit is indirectly updated, for example with the following configurations:
tc qdisc add dev dummy0 handle 1: root sfq limit 2 flows 1 depth 1 tc qdisc add dev dummy0 handle 1: root sfq limit 2 flows 1 divisor 1
This fixes the following syzkaller reported crash:
------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in net/sched/sch_sfq.c:203:6 index 65535 is out of range for type 'struct sfq_head[128]' CPU: 1 UID: 0 PID: 3037 Comm: syz.2.16 Not tainted 6.14.0-rc2-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x201/0x300 lib/dump_stack.c:120 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0xf5/0x120 lib/ubsan.c:429 sfq_link net/sched/sch_sfq.c:203 [inline] sfq_dec+0x53c/0x610 net/sched/sch_sfq.c:231 sfq_dequeue+0x34e/0x8c0 net/sched/sch_sfq.c:493 sfq_reset+0x17/0x60 net/sched/sch_sfq.c:518 qdisc_reset+0x12e/0x600 net/sched/sch_generic.c:1035 tbf_reset+0x41/0x110 net/sched/sch_tbf.c:339 qdisc_reset+0x12e/0x600 net/sched/sch_generic.c:1035 dev_reset_queue+0x100/0x1b0 net/sched/sch_generic.c:1311 netdev_for_each_tx_queue include/linux/netdevice.h:2590 [inline] dev_deactivate_many+0x7e5/0xe70 net/sched/sch_generic.c:1375
--- net/sched/sch_sfq.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
net/sched/sch_sfq.c +6 -4
@@ -661,10 +661,6 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt,if (!p)return -ENOMEM ; } -if (ctl->limit ==1 ) { -NL_SET_ERR_MSG_MOD (extack,"invalid limit" ); -return -EINVAL ; - }sch_tree_lock (sch);
@@ -705,6 +701,12 @@ static int sfq_change(struct Qdisc *sch, struct nlattr *opt, limit =min_t (u32, ctl->limit, maxdepth * maxflows); maxflows =min_t (u32, maxflows, limit); } +if (limit ==1 ) { +sch_tree_unlock (sch); +kfree (p); +NL_SET_ERR_MSG_MOD (extack,"invalid limit" ); +return -EINVAL ; + }/* commit configuration */ q->limit = limit;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 31/414 smb: client: fix UAF in decryption with multichannel
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paulo Alcantara <[email protected]>
[ Upstream commit 9502dd5c7029902f4a425bf959917a5a9e7c0e50 ]
After commit f7025d861694 ("smb: client: allocate crypto only for primary server") and commit b0abcd65ec54 ("smb: client: fix UAF in async decryption"), the channels started reusing AEAD TFM from primary channel to perform synchronous decryption, but that can't done as there could be multiple cifsd threads (one per channel) simultaneously accessing it to perform decryption.
This fixes the following KASAN splat when running fstest generic/249 with 'vers=3.1.1,multichannel,max_channels=4,seal' against Windows Server 2022:
BUG: KASAN: slab-use-after-free in gf128mul_4k_lle+0xba/0x110 Read of size 8 at addr ffff8881046c18a0 by task cifsd/986 CPU: 3 UID: 0 PID: 986 Comm: cifsd Not tainted 6.15.0-rc1 #1 PREEMPT(voluntary) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-3.fc41 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x5d/0x80 print_report+0x156/0x528 ? gf128mul_4k_lle+0xba/0x110 ? __virt_addr_valid+0x145/0x300 ? __phys_addr+0x46/0x90 ? gf128mul_4k_lle+0xba/0x110 kasan_report+0xdf/0x1a0 ? gf128mul_4k_lle+0xba/0x110 gf128mul_4k_lle+0xba/0x110 ghash_update+0x189/0x210 shash_ahash_update+0x295/0x370 ? __pfx_shash_ahash_update+0x10/0x10 ? __pfx_shash_ahash_update+0x10/0x10 ? __pfx_extract_iter_to_sg+0x10/0x10 ? ___kmalloc_large_node+0x10e/0x180 ? __asan_memset+0x23/0x50 crypto_ahash_update+0x3c/0xc0 gcm_hash_assoc_remain_continue+0x93/0xc0 crypt_message+0xe09/0xec0 [cifs] ? __pfx_crypt_message+0x10/0x10 [cifs] ? _raw_spin_unlock+0x23/0x40 ? __pfx_cifs_readv_from_socket+0x10/0x10 [cifs] decrypt_raw_data+0x229/0x380 [cifs] ? __pfx_decrypt_raw_data+0x10/0x10 [cifs] ? __pfx_cifs_read_iter_from_socket+0x10/0x10 [cifs] smb3_receive_transform+0x837/0xc80 [cifs] ? __pfx_smb3_receive_transform+0x10/0x10 [cifs] ? __pfx___might_resched+0x10/0x10 ? __pfx_smb3_is_transform_hdr+0x10/0x10 [cifs] cifs_demultiplex_thread+0x692/0x1570 [cifs] ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] ? rcu_is_watching+0x20/0x50 ? rcu_lockdep_current_cpu_online+0x62/0xb0 ? find_held_lock+0x32/0x90 ? kvm_sched_clock_read+0x11/0x20 ? local_clock_noinstr+0xd/0xd0 ? trace_irq_enable.constprop.0+0xa8/0xe0 ? __pfx_cifs_demultiplex_thread+0x10/0x10 [cifs] kthread+0x1fe/0x380 ? kthread+0x10f/0x380 ? __pfx_kthread+0x10/0x10 ? local_clock_noinstr+0xd/0xd0 ? ret_from_fork+0x1b/0x60 ? local_clock+0x15/0x30 ? lock_release+0x29b/0x390 ? rcu_is_watching+0x20/0x50 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x31/0x60 ? __pfx_kthread+0x10/0x10 ret_from_fork_asm+0x1a/0x30 </TASK>
--- fs/smb/client/cifsencrypt.c | 16 +++++----------- fs/smb/client/smb2ops.c | 6 +++--- fs/smb/client/smb2pdu.c | 11 ++--------- 3 files changed, 10 insertions(+), 23 deletions(-)
fs/smb/client/cifsencrypt.c +5 -11
@@ -702,18 +702,12 @@ cifs_crypto_secmech_release(struct TCP_Server_Info *server)cifs_free_hash (&server->secmech.md5);cifs_free_hash (&server->secmech.sha512); -if (!SERVER_IS_CHAN (server)) { -if (server->secmech.enc) { -crypto_free_aead (server->secmech.enc); - server->secmech.enc =NULL ; - } - -if (server->secmech.dec) { -crypto_free_aead (server->secmech.dec); - server->secmech.dec =NULL ; - } - }else { +if (server->secmech.enc) { +crypto_free_aead (server->secmech.enc); server->secmech.enc =NULL ; + } +if (server->secmech.dec) { +crypto_free_aead (server->secmech.dec); server->secmech.dec =NULL ; } }
fs/smb/client/smb2ops.c +3 -3
@@ -4549,9 +4549,9 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf,return rc; } }else { -if (unlikely (!server->secmech.dec)) -return -EIO ; - + rc =smb3_crypto_aead_allocate (server); +if (unlikely (rc)) +return rc; tfm = server->secmech.dec; }
fs/smb/client/smb2pdu.c +2 -9
@@ -1251,15 +1251,8 @@ SMB2_negotiate(const unsigned int xid,cifs_server_dbg (VFS ,"Missing expected negotiate contexts\n" ); } -if (server->cipher_type && !rc) { -if (!SERVER_IS_CHAN (server)) { - rc =smb3_crypto_aead_allocate (server); - }else { -/* For channels, just reuse the primary server crypto secmech. */ - server->secmech.enc = server->primary_server->secmech.enc; - server->secmech.dec = server->primary_server->secmech.dec; - } - } +if (server->cipher_type && !rc) + rc =smb3_crypto_aead_allocate (server); neg_exit:free_rsp_buf (resp_buftype, rsp);return rc;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 32/414 net: phy: move phy_link_change() prior to mdio_bus_phy_may_suspend()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Oltean <[email protected]>
[ Upstream commit f40a673d6b4a128fe95dd9b8c3ed02da50a6a862 ]
In an upcoming change, mdio_bus_phy_may_suspend() will need to distinguish a phylib-based PHY client from a phylink PHY client. For that, it will need to compare the phydev->phy_link_change() function pointer with the eponymous phy_link_change() provided by phylib.
To avoid forward function declarations, the default PHY link state change method should be moved upwards. There is no functional change associated with this patch, it is only to reduce the noise from a real bug fix.
Stable-dep-of: fc75ea20ffb4 ("net: phy: allow MDIO bus PM ops to start/stop state machine for phylink-controlled PHY")
--- drivers/net/phy/phy_device.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/net/phy/phy_device.c +13 -13
@@ -289,6 +289,19 @@ static bool phy_drv_wol_enabled(struct phy_device *phydev)return wol.wolopts !=0 ; } +static void phy_link_change (struct phy_device *phydev,bool up) +{ +struct net_device *netdev = phydev->attached_dev; + +if (up) +netif_carrier_on (netdev); +else +netif_carrier_off (netdev); + phydev->adjust_link (netdev); +if (phydev->mii_ts && phydev->mii_ts->link_state) + phydev->mii_ts->link_state (phydev->mii_ts, phydev); +} +static bool mdio_bus_phy_may_suspend (struct phy_device *phydev) {struct device_driver *drv = phydev->mdio.dev.driver;
@@ -1101,19 +1114,6 @@ struct phy_device *phy_find_first(struct mii_bus *bus) }EXPORT_SYMBOL (phy_find_first); -static void phy_link_change (struct phy_device *phydev,bool up) -{ -struct net_device *netdev = phydev->attached_dev; - -if (up) -netif_carrier_on (netdev); -else -netif_carrier_off (netdev); - phydev->adjust_link (netdev); -if (phydev->mii_ts && phydev->mii_ts->link_state) - phydev->mii_ts->link_state (phydev->mii_ts, phydev); -} -/** * phy_prepare_link - prepares the PHY layer to monitor link status * @phydev: target phy_device struct
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 15/414 codel: remove sch->q.qlen check before qdisc_tree_reduce_backlog()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cong Wang <[email protected]>
[ Upstream commit 342debc12183b51773b3345ba267e9263bdfaaef ]
After making all ->qlen_notify() callbacks idempotent, now it is safe to remove the check of qlen!=0 from both fq_codel_dequeue() and codel_qdisc_dequeue().
--- net/sched/sch_codel.c | 5 +---- net/sched/sch_fq_codel.c | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-)
net/sched/sch_codel.c +1 -4
@@ -65,10 +65,7 @@ static struct sk_buff *codel_qdisc_dequeue(struct Qdisc *sch) &q->stats, qdisc_pkt_len, codel_get_enqueue_time, drop_func, dequeue_func); -/* We cant call qdisc_tree_reduce_backlog() if our qlen is 0, -* or HTB crashes. Defer it for next round. -*/ -if (q->stats.drop_count && sch->q.qlen) { +if (q->stats.drop_count) {qdisc_tree_reduce_backlog (sch, q->stats.drop_count, q->stats.drop_len); q->stats.drop_count =0 ; q->stats.drop_len =0 ;
net/sched/sch_fq_codel.c +2 -4
@@ -314,10 +314,8 @@ static struct sk_buff *fq_codel_dequeue(struct Qdisc *sch) }qdisc_bstats_update (sch, skb); flow->deficit -=qdisc_pkt_len (skb); -/* We cant call qdisc_tree_reduce_backlog() if our qlen is 0, -* or HTB crashes. Defer it for next round. -*/ -if (q->cstats.drop_count && sch->q.qlen) { + +if (q->cstats.drop_count) {qdisc_tree_reduce_backlog (sch, q->cstats.drop_count, q->cstats.drop_len); q->cstats.drop_count =0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 33/414 net: phy: allow MDIO bus PM ops to start/stop state machine for phylink-controlled PHY
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vladimir Oltean <[email protected]>
[ Upstream commit fc75ea20ffb452652f0d4033f38fe88d7cfdae35 ]
DSA has 2 kinds of drivers:
1. Those who call dsa_switch_suspend() and dsa_switch_resume() from their device PM ops: qca8k-8xxx, bcm_sf2, microchip ksz
2. Those who don't: all others. The above methods should be optional.
For type 1, dsa_switch_suspend() calls dsa_user_suspend() -> phylink_stop(), and dsa_switch_resume() calls dsa_user_resume() -> phylink_start(). These seem good candidates for setting mac_managed_pm = true because that is essentially its definition [1], but that does not seem to be the biggest problem for now, and is not what this change focuses on.
Talking strictly about the 2nd category of DSA drivers here (which do not have MAC managed PM, meaning that for their attached PHYs, mdio_bus_phy_suspend() and mdio_bus_phy_resume() should run in full), I have noticed that the following warning from mdio_bus_phy_resume() is triggered:
WARN_ON(phydev->state != PHY_HALTED && phydev->state != PHY_READY && phydev->state != PHY_UP);
because the PHY state machine is running.
It's running as a result of a previous dsa_user_open() -> ... -> phylink_start() -> phy_start() having been initiated by the user.
The previous mdio_bus_phy_suspend() was supposed to have called phy_stop_machine(), but it didn't. So this is why the PHY is in state PHY_NOLINK by the time mdio_bus_phy_resume() runs.
mdio_bus_phy_suspend() did not call phy_stop_machine() because for phylink, the phydev->adjust_link function pointer is NULL. This seems a technicality introduced by commit fddd91016d16 ("phylib: fix PAL state machine restart on resume"). That commit was written before phylink existed, and was intended to avoid crashing with consumer drivers which don't use the PHY state machine - phylink always does, when using a PHY. But phylink itself has historically not been developed with suspend/resume in mind, and apparently not tested too much in that scenario, allowing this bug to exist unnoticed for so long. Plus, prior to the WARN_ON(), it would have likely been invisible.
This issue is not in fact restricted to type 2 DSA drivers (according to the above ad-hoc classification), but can be extrapolated to any MAC driver with phylink and MDIO-bus-managed PHY PM ops. DSA is just where the issue was reported. Assuming mac_managed_pm is set correctly, a quick search indicates the following other drivers might be affected:
$ grep -Zlr PHYLINK_NETDEV drivers/ | xargs -0 grep -L mac_managed_pm drivers/net/ethernet/atheros/ag71xx.c drivers/net/ethernet/microchip/sparx5/sparx5_main.c drivers/net/ethernet/microchip/lan966x/lan966x_main.c drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c drivers/net/ethernet/freescale/dpaa/dpaa_eth.c drivers/net/ethernet/freescale/ucc_geth.c drivers/net/ethernet/freescale/enetc/enetc_pf_common.c drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c drivers/net/ethernet/marvell/mvneta.c drivers/net/ethernet/marvell/prestera/prestera_main.c drivers/net/ethernet/mediatek/mtk_eth_soc.c drivers/net/ethernet/altera/altera_tse_main.c drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c drivers/net/ethernet/meta/fbnic/fbnic_phylink.c drivers/net/ethernet/tehuti/tn40_phy.c drivers/net/ethernet/mscc/ocelot_net.c
Make the existing conditions dependent on the PHY device having a phydev->phy_link_change() implementation equal to the default phy_link_change() provided by phylib. Otherwise, we implicitly know that the phydev has the phylink-provided phylink_phy_change() callback, and when phylink is used, the PHY state machine always needs to be stopped/ started on the suspend/resume path. The code is structured as such that if phydev->phy_link_change() is absent, it is a matter of time until the kernel will crash - no need to further complicate the test.
Thus, for the situation where the PM is not managed by the MAC, we will make the MDIO bus PM ops treat identically the phylink-controlled PHYs with the phylib-controlled PHYs where an adjust_link() callback is supplied. In both cases, the MDIO bus PM ops should stop and restart the PHY state machine.
[1] https://lore.kernel.org/netdev/[email protected]/
--- drivers/net/phy/phy_device.c | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
drivers/net/phy/phy_device.c +29 -2
@@ -302,6 +302,33 @@ static void phy_link_change(struct phy_device *phydev, bool up) phydev->mii_ts->link_state (phydev->mii_ts, phydev); } +/** +* phy_uses_state_machine - test whether consumer driver uses PAL state machine +* @phydev: the target PHY device structure +* +* Ultimately, this aims to indirectly determine whether the PHY is attached +* to a consumer which uses the state machine by calling phy_start() and +* phy_stop(). +* +* When the PHY driver consumer uses phylib, it must have previously called +* phy_connect_direct() or one of its derivatives, so that phy_prepare_link() +* has set up a hook for monitoring state changes. +* +* When the PHY driver is used by the MAC driver consumer through phylink (the +* only other provider of a phy_link_change() method), using the PHY state +* machine is not optional. +* +* Return: true if consumer calls phy_start() and phy_stop(), false otherwise. +*/ +static bool phy_uses_state_machine (struct phy_device *phydev) +{ +if (phydev->phy_link_change == phy_link_change) +return phydev->attached_dev && phydev->adjust_link; + +/* phydev->phy_link_change is implicitly phylink_phy_change() */ +return true; +} +static bool mdio_bus_phy_may_suspend (struct phy_device *phydev) {struct device_driver *drv = phydev->mdio.dev.driver;
@@ -368,7 +395,7 @@ static __maybe_unused int mdio_bus_phy_suspend(struct device *dev)* may call phy routines that try to grab the same lock, and that may * lead to a deadlock. */ -if (phydev->attached_dev && phydev->adjust_link) +if (phy_uses_state_machine (phydev))phy_stop_machine (phydev);if (!mdio_bus_phy_may_suspend (phydev))
@@ -422,7 +449,7 @@ static __maybe_unused int mdio_bus_phy_resume(struct device *dev) } } -if (phydev->attached_dev && phydev->adjust_link) +if (phy_uses_state_machine (phydev))phy_start_machine (phydev);return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 34/414 ipv6: Align behavior across nexthops during path selection
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit 6933cd4714861eea6848f18396a119d741f25fc3 ]
A nexthop is only chosen when the calculated multipath hash falls in the nexthop's hash region (i.e., the hash is smaller than the nexthop's hash threshold) and when the nexthop is assigned a non-negative score by rt6_score_route().
Commit 4d0ab3a6885e ("ipv6: Start path selection from the first nexthop") introduced an unintentional difference between the first nexthop and the rest when the score is negative.
When the first nexthop matches, but has a negative score, the code will currently evaluate subsequent nexthops until one is found with a non-negative score. On the other hand, when a different nexthop matches, but has a negative score, the code will fallback to the nexthop with which the selection started ('match').
Align the behavior across all nexthops and fallback to 'match' when the first nexthop matches, but has a negative score.
--- net/ipv6/route.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/ipv6/route.c +4 -4
@@ -470,10 +470,10 @@ void fib6_select_path(const struct net *net, struct fib6_result *res, goto out; hash = fl6->mp_hash; -if (hash <=atomic_read (&first->fib6_nh->fib_nh_upper_bound) && -rt6_score_route (first->fib6_nh, first->fib6_flags, oif, - strict) >=0 ) { - match = first; +if (hash <=atomic_read (&first->fib6_nh->fib_nh_upper_bound)) { +if (rt6_score_route (first->fib6_nh, first->fib6_flags, oif, + strict) >=0 ) + match = first; goto out; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 35/414 net: ppp: Add bound checking for skb data on ppp_sync_txmung
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnaud Lecomte <[email protected]>
[ Upstream commit aabc6596ffb377c4c9c8f335124b92ea282c9821 ]
Ensure we have enough data in linear buffer from skb before accessing initial bytes. This prevents potential out-of-bounds accesses when processing short packets.
When ppp_sync_txmung receives an incoming package with an empty payload:
(remote) gef➤ p *(struct pppoe_hdr *) (skb->head + skb->network_header)
$18 = {
type = 0x1,
ver = 0x1,
code = 0x0,
sid = 0x2,
length = 0x0,
tag = 0xffff8880371cdb96
}from the skb struct (trimmed)
tail = 0x16,
end = 0x140,
head = 0xffff88803346f400 "4",
data = 0xffff88803346f416 ":\377",
truesize = 0x380,
len = 0x0,
data_len = 0x0,
mac_len = 0xe,
hdr_len = 0x0,it is not safe to access data[2].
--- drivers/net/ppp/ppp_synctty.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ppp/ppp_synctty.c +5 -0
@@ -506,6 +506,11 @@ ppp_sync_txmunge(struct syncppp *ap, struct sk_buff *skb)unsigned char *data;int islcp; +/* Ensure we can safely access protocol field and LCP code */ +if (!pskb_may_pull (skb,3 )) { +kfree_skb (skb); +return NULL ; + } data = skb->data; proto =get_unaligned_be16 (data);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 36/414 nft_set_pipapo: fix incorrect avx2 match of 5th field octet
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Florian Westphal <[email protected]>
[ Upstream commit e042ed950d4e176379ba4c0722146cd96fb38aa2 ]
Given a set element like:
icmpv6 . dead:beef:00ff::1
The value of 'ff' is irrelevant, any address will be matched as long as the other octets are the same.
This is because of too-early register clobbering:
ymm7 is reloaded with new packet data (pkt[9]) but it still holds data of an earlier load that wasn't processed yet.
The existing tests in nft_concat_range.sh selftests do exercise this code path, but do not trigger incorrect matching due to the network prefix limitation.
--- net/netfilter/nft_set_pipapo_avx2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nft_set_pipapo_avx2.c +2 -1
@@ -994,8 +994,9 @@ static int nft_pipapo_avx2_lookup_8b_16(unsigned long *map, unsigned long *fill,NFT_PIPAPO_AVX2_BUCKET_LOAD8 (5 , lt,8 , pkt[8 ], bsize);NFT_PIPAPO_AVX2_AND (6 ,2 ,3 ); +NFT_PIPAPO_AVX2_AND (3 ,4 ,7 );NFT_PIPAPO_AVX2_BUCKET_LOAD8 (7 , lt,9 , pkt[9 ], bsize); -NFT_PIPAPO_AVX2_AND (0 ,4 ,5 ); +NFT_PIPAPO_AVX2_AND (0 ,3 ,5 );NFT_PIPAPO_AVX2_BUCKET_LOAD8 (1 , lt,10 , pkt[10 ], bsize);NFT_PIPAPO_AVX2_AND (2 ,6 ,7 );NFT_PIPAPO_AVX2_BUCKET_LOAD8 (3 , lt,11 , pkt[11 ], bsize);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 37/414 ethtool: cmis_cdb: Fix incorrect read / write length extension
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ido Schimmel <[email protected]>
[ Upstream commit eaa517b77e63442260640d875f824d1111ca6569 ]
The 'read_write_len_ext' field in 'struct ethtool_cmis_cdb_cmd_args' stores the maximum number of bytes that can be read from or written to the Local Payload (LPL) page in a single multi-byte access.
Cited commit started overwriting this field with the maximum number of bytes that can be read from or written to the Extended Payload (LPL) pages in a single multi-byte access. Transceiver modules that support auto paging can advertise a number larger than 255 which is problematic as 'read_write_len_ext' is a 'u8', resulting in the number getting truncated and firmware flashing failing [1].
Fix by ignoring the maximum EPL access size as the kernel does not currently support auto paging (even if the transceiver module does) and will not try to read / write more than 128 bytes at once.
[1]
Transceiver module firmware flashing started for device enp177s0np0 Transceiver module firmware flashing in progress for device enp177s0np0
Progress: 0%
Transceiver module firmware flashing encountered an error for device enp177s0np0 Status message: Write FW block EPL command failed, LPL length is longer
than CDB read write length extension allows.
--- net/ethtool/cmis.h | 1 - net/ethtool/cmis_cdb.c | 18 +++--------------- 2 files changed, 3 insertions(+), 16 deletions(-)
net/ethtool/cmis.h +0 -1
@@ -101,7 +101,6 @@ struct ethtool_cmis_cdb_rpl { };u32 ethtool_cmis_get_max_lpl_size (u8 num_of_byte_octs); -u32 ethtool_cmis_get_max_epl_size (u8 num_of_byte_octs); void ethtool_cmis_cdb_compose_args(struct ethtool_cmis_cdb_cmd_args *args, enum ethtool_cmis_cdb_cmd_id cmd, u8 *lpl,
net/ethtool/cmis_cdb.c +3 -15
@@ -16,15 +16,6 @@ u32 ethtool_cmis_get_max_lpl_size(u8 num_of_byte_octs)return 8 * (1 +min_t (u8, num_of_byte_octs,15 )); } -/* For accessing the EPL field on page 9Fh, the allowable length extension is -* min(i, 255) byte octets where i specifies the allowable additional number of -* byte octets in a READ or a WRITE. -*/ -u32 ethtool_cmis_get_max_epl_size (u8 num_of_byte_octs) -{ -return 8 * (1 +min_t (u8, num_of_byte_octs,255 )); -} - void ethtool_cmis_cdb_compose_args(struct ethtool_cmis_cdb_cmd_args *args, enum ethtool_cmis_cdb_cmd_id cmd, u8 *lpl, u8 lpl_len, u8 *epl, u16 epl_len,
@@ -33,19 +24,16 @@ void ethtool_cmis_cdb_compose_args(struct ethtool_cmis_cdb_cmd_args *args, { args->req.id =cpu_to_be16 (cmd); args->req.lpl_len = lpl_len; -if (lpl) { +if (lpl)memcpy (args->req.payload, lpl, args->req.lpl_len); - args->read_write_len_ext = -ethtool_cmis_get_max_lpl_size (read_write_len_ext); - }if (epl) { args->req.epl_len =cpu_to_be16 (epl_len); args->req.epl = epl; - args->read_write_len_ext = -ethtool_cmis_get_max_epl_size (read_write_len_ext); } args->max_duration = max_duration; + args->read_write_len_ext = +ethtool_cmis_get_max_lpl_size (read_write_len_ext); args->msleep_pre_rpl = msleep_pre_rpl; args->rpl_exp_len = rpl_exp_len; args->flags = flags;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 38/414 iommu/exynos: Fix suspend/resume with IDENTITY domain
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Szyprowski <[email protected]>
[ Upstream commit 99deffc409b69000ac4877486e69ec6516becd53 ]
Commit bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path") changed the sequence of probing the SYSMMU controller devices and calls to arm_iommu_attach_device(), what results in resuming SYSMMU controller earlier, when it is still set to IDENTITY mapping. Such change revealed the bug in IDENTITY handling in the exynos-iommu driver. When SYSMMU controller is set to IDENTITY mapping, data->domain is NULL, so adjust checks in suspend & resume callbacks to handle this case correctly.
--- drivers/iommu/exynos-iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/iommu/exynos-iommu.c +2 -2
@@ -832,7 +832,7 @@ static int __maybe_unused exynos_sysmmu_suspend(struct device *dev)struct exynos_iommu_owner *owner =dev_iommu_priv_get (master);mutex_lock (&owner->rpm_lock); -if (&data->domain->domain != &exynos_identity_domain) { +if (data->domain) {dev_dbg (data->sysmmu,"saving state\n" );__sysmmu_disable (data); }
@@ -850,7 +850,7 @@ static int __maybe_unused exynos_sysmmu_resume(struct device *dev)struct exynos_iommu_owner *owner =dev_iommu_priv_get (master);mutex_lock (&owner->rpm_lock); -if (&data->domain->domain != &exynos_identity_domain) { +if (data->domain) {dev_dbg (data->sysmmu,"restoring state\n" );__sysmmu_enable (data); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 39/414 iommu/mediatek: Fix NULL pointer deference in mtk_iommu_device_group
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Louis-Alexis Eyraud <[email protected]>
[ Upstream commit 38e8844005e6068f336a3ad45451a562a0040ca1 ]
Currently, mtk_iommu calls during probe iommu_device_register before the hw_list from driver data is initialized. Since iommu probing issue fix, it leads to NULL pointer dereference in mtk_iommu_device_group when hw_list is accessed with list_first_entry (not null safe).
So, change the call order to ensure iommu_device_register is called after the driver data are initialized.
--- drivers/iommu/mtk_iommu.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
drivers/iommu/mtk_iommu.c +13 -13
@@ -1371,15 +1371,6 @@ static int mtk_iommu_probe(struct platform_device *pdev)platform_set_drvdata (pdev, data);mutex_init (&data->mutex); - ret =iommu_device_sysfs_add (&data->iommu, dev,NULL , -"mtk-iommu.%pa" , &ioaddr); -if (ret) - goto out_link_remove; - - ret =iommu_device_register (&data->iommu, &mtk_iommu_ops, dev); -if (ret) - goto out_sysfs_remove; -if (MTK_IOMMU_HAS_FLAG (data->plat_data,SHARE_PGTABLE )) {list_add_tail (&data->list, data->plat_data->hw_list); data->hw_list = data->plat_data->hw_list;
@@ -1389,19 +1380,28 @@ static int mtk_iommu_probe(struct platform_device *pdev) data->hw_list = &data->hw_list_head; } + ret =iommu_device_sysfs_add (&data->iommu, dev,NULL , +"mtk-iommu.%pa" , &ioaddr); +if (ret) + goto out_list_del; + + ret =iommu_device_register (&data->iommu, &mtk_iommu_ops, dev); +if (ret) + goto out_sysfs_remove; +if (MTK_IOMMU_IS_TYPE (data->plat_data,MTK_IOMMU_TYPE_MM )) { ret =component_master_add_with_match (dev, &mtk_iommu_com_ops, match);if (ret) - goto out_list_del; + goto out_device_unregister; }return ret; -out_list_del: -list_del (&data->list); +out_device_unregister:iommu_device_unregister (&data->iommu); out_sysfs_remove:iommu_device_sysfs_remove (&data->iommu); -out_link_remove: +out_list_del: +list_del (&data->list);if (MTK_IOMMU_IS_TYPE (data->plat_data,MTK_IOMMU_TYPE_MM ))device_link_remove (data->smicomm_dev, dev); out_runtime_disable:
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 40/414 perf/core: Simplify the perf_event_alloc() error path
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit c70ca298036c58a88686ff388d3d367e9d21acf0 ]
The error cleanup sequence in perf_event_alloc() is a subset of the existing _free_event() function (it must of course be).
Split this out into __free_event() and simplify the error path.
Stable-dep-of: 56799bc03565 ("perf: Fix hang while freeing sigtrap event")
--- include/linux/perf_event.h | 16 +++-- kernel/events/core.c | 138 ++++++++++++++++++------------------- 2 files changed, 78 insertions(+), 76 deletions(-)
include/linux/perf_event.h +9 -7
@@ -673,13 +673,15 @@ struct swevent_hlist {struct rcu_head rcu_head; }; -#define PERF_ATTACH_CONTEXT 0x01 -#define PERF_ATTACH_GROUP 0x02 -#define PERF_ATTACH_TASK 0x04 -#define PERF_ATTACH_TASK_DATA 0x08 -#define PERF_ATTACH_ITRACE 0x10 -#define PERF_ATTACH_SCHED_CB 0x20 -#define PERF_ATTACH_CHILD 0x40 +#define PERF_ATTACH_CONTEXT 0x0001 +#define PERF_ATTACH_GROUP 0x0002 +#define PERF_ATTACH_TASK 0x0004 +#define PERF_ATTACH_TASK_DATA 0x0008 +#define PERF_ATTACH_ITRACE 0x0010 +#define PERF_ATTACH_SCHED_CB 0x0020 +#define PERF_ATTACH_CHILD 0x0040 +#define PERF_ATTACH_EXCLUSIVE 0x0080 +#define PERF_ATTACH_CALLCHAIN 0x0100struct bpf_prog ;struct perf_cgroup ;
kernel/events/core.c +69 -69
258 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 41/414 perf: Fix hang while freeing sigtrap event
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Frederic Weisbecker <[email protected]>
[ Upstream commit 56799bc035658738f362acec3e7647bb84e68933 ]
Perf can hang while freeing a sigtrap event if a related deferred signal hadn't managed to be sent before the file got closed:
perf_event_overflow()
task_work_add(perf_pending_task)
fput()
task_work_add(____fput())
task_work_run()
____fput()
perf_release()
perf_event_release_kernel()
_free_event()
perf_pending_task_sync()
task_work_cancel() -> FAILED
rcuwait_wait_event()Once task_work_run() is running, the list of pending callbacks is removed from the task_struct and from this point on task_work_cancel() can't remove any pending and not yet started work items, hence the task_work_cancel() failure and the hang on rcuwait_wait_event().
Task work could be changed to remove one work at a time, so a work running on the current task can always cancel a pending one, however the wait / wake design is still subject to inverted dependencies when remote targets are involved, as pictured by Oleg:
T1 T2
fd = perf_event_open(pid => T2->pid); fd = perf_event_open(pid => T1->pid);
close(fd) close(fd)
<IRQ> <IRQ>
perf_event_overflow() perf_event_overflow()
task_work_add(perf_pending_task) task_work_add(perf_pending_task)
</IRQ> </IRQ>
fput() fput()
task_work_add(____fput()) task_work_add(____fput()) task_work_run() task_work_run()
____fput() ____fput()
perf_release() perf_release()
perf_event_release_kernel() perf_event_release_kernel()
_free_event() _free_event()
perf_pending_task_sync() perf_pending_task_sync()
rcuwait_wait_event() rcuwait_wait_event()
Therefore the only option left is to acquire the event reference count upon queueing the perf task work and release it from the task work, just like it was done before 3a5465418f5f ("perf: Fix event leak upon exec and file release") but without the leaks it fixed.
Some adjustments are necessary to make it work:
* A child event might dereference its parent upon freeing. Care must be taken to release the parent last.
* Some places assuming the event doesn't have any reference held and therefore can be freed right away must instead put the reference and let the reference counting to its job.
--- include/linux/perf_event.h | 1 - kernel/events/core.c | 64 +++++++++++--------------------------- 2 files changed, 18 insertions(+), 47 deletions(-)
include/linux/perf_event.h +0 -1
@@ -833,7 +833,6 @@ struct perf_event {struct irq_work pending_disable_irq;struct callback_head pending_task;unsigned int pending_work; -struct rcuwait pending_work_wait;atomic_t event_limit;
kernel/events/core.c +18 -46
145 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 42/414 fs: consistently deref the files table with rcu_dereference_raw()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mateusz Guzik <[email protected]>
[ Upstream commit f381640e1bd4f2de7ccafbfe8703d33c3718aad9 ]
... except when the table is known to be only used by one thread.
A file pointer can get installed at any moment despite the ->file_lock being held since the following:8a81252b774b53e6 ("fs/file.c: don't acquire files->file_lock in fd_install()")
Accesses subject to such a race can in principle suffer load tearing.
While here redo the comment in dup_fd -- it only covered a race against files showing up, still assuming fd_install() takes the lock.
--- fs/file.c | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-)
fs/file.c +17 -9
@@ -418,17 +418,25 @@ struct files_struct *dup_fd(struct files_struct *oldf, struct fd_range *punch_ho old_fds = old_fdt->fd; new_fds = new_fdt->fd; +/* +* We may be racing against fd allocation from other threads using this +* files_struct, despite holding ->file_lock. +* +* alloc_fd() might have already claimed a slot, while fd_install() +* did not populate it yet. Note the latter operates locklessly, so +* the file can show up as we are walking the array below. +* +* At the same time we know no files will disappear as all other +* operations take the lock. +* +* Instead of trying to placate userspace racing with itself, we +* ref the file if we see it and mark the fd slot as unused otherwise. +*/ for (i = open_files; i !=0 ; i--) { -struct file *f = *old_fds++; +struct file *f =rcu_dereference_raw (*old_fds++);if (f) {get_file (f); }else { -/* -* The fd may be claimed in the fd bitmap but not yet -* instantiated in the files array if a sibling thread -* is partway through open(). So make sure that this -* fd is available to the new process. -*/ __clear_open_fd (open_files - i, new_fdt); }rcu_assign_pointer (*new_fds++, f);
@@ -679,7 +687,7 @@ struct file *file_close_fd_locked(struct files_struct *files, unsigned fd)return NULL ; fd =array_index_nospec (fd, fdt->max_fds); - file = fdt->fd[fd]; + file =rcu_dereference_raw (fdt->fd[fd]);if (file) {rcu_assign_pointer (fdt->fd[fd],NULL );__put_unused_fd (files, fd);
@@ -1245,7 +1253,7 @@ __releases(&files->file_lock)*/ fdt =files_fdtable (files); fd =array_index_nospec (fd, fdt->max_fds); - tofree = fdt->fd[fd]; + tofree =rcu_dereference_raw (fdt->fd[fd]);if (!tofree &&fd_is_open (fd, fdt)) goto Ebusy;get_file (file);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 16/414 net: tls: explicitly disallow disconnect
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jakub Kicinski <[email protected]>
[ Upstream commit 5071a1e606b30c0c11278d3c6620cd6a24724cf6 ]
syzbot discovered that it can disconnect a TLS socket and then run into all sort of unexpected corner cases. I have a vague recollection of Eric pointing this out to us a long time ago. Supporting disconnect is really hard, for one thing if offload is enabled we'd need to wait for all packets to be _acked_. Disconnect is not commonly used, disallow it.
The immediate problem syzbot run into is the warning in the strp, but that's just the easiest bug to trigger:
WARNING: CPU: 0 PID: 5834 at net/tls/tls_strp.c:486 tls_strp_msg_load+0x72e/0xa80 net/tls/tls_strp.c:486 RIP: 0010:tls_strp_msg_load+0x72e/0xa80 net/tls/tls_strp.c:486 Call Trace: <TASK> tls_rx_rec_wait+0x280/0xa60 net/tls/tls_sw.c:1363 tls_sw_recvmsg+0x85c/0x1c30 net/tls/tls_sw.c:2043 inet6_recvmsg+0x2c9/0x730 net/ipv6/af_inet6.c:678 sock_recvmsg_nosec net/socket.c:1023 [inline] sock_recvmsg+0x109/0x280 net/socket.c:1045 __sys_recvfrom+0x202/0x380 net/socket.c:2237
--- net/tls/tls_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/tls/tls_main.c +6 -0
@@ -809,6 +809,11 @@ static int tls_setsockopt(struct sock *sk, int level, int optname,return do_tls_setsockopt (sk, optname, optval, optlen); } +static int tls_disconnect (struct sock *sk,int flags) +{ +return -EOPNOTSUPP ; +} +struct tls_context *tls_ctx_create (struct sock *sk) {struct inet_connection_sock *icsk =inet_csk (sk);
@@ -904,6 +909,7 @@ static void build_protos(struct proto prot[TLS_NUM_CONFIG][TLS_NUM_CONFIG], prot[TLS_BASE ][TLS_BASE ] = *base; prot[TLS_BASE ][TLS_BASE ].setsockopt = tls_setsockopt; prot[TLS_BASE ][TLS_BASE ].getsockopt = tls_getsockopt; + prot[TLS_BASE ][TLS_BASE ].disconnect = tls_disconnect; prot[TLS_BASE ][TLS_BASE ].close = tls_sk_proto_close; prot[TLS_SW ][TLS_BASE ] = prot[TLS_BASE ][TLS_BASE ];
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 43/414 umount: Allow superblock owners to force umount
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Trond Myklebust <[email protected]>
[ Upstream commit e1ff7aa34dec7e650159fd7ca8ec6af7cc428d9f ]
Loosen the permission check on forced umount to allow users holding CAP_SYS_ADMIN privileges in namespaces that are privileged with respect to the userns that originally mounted the filesystem.
--- fs/namespace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/namespace.c +2 -1
@@ -1986,6 +1986,7 @@ static void warn_mandlock(void)static int can_umount (const struct path *path,int flags) {struct mount *mnt =real_mount (path->mnt); +struct super_block *sb = path->dentry->d_sb;if (!may_mount ())return -EPERM ;
@@ -1995,7 +1996,7 @@ static int can_umount(const struct path *path, int flags)return -EINVAL ;if (mnt->mnt.mnt_flags &MNT_LOCKED )/* Check optimistically */ return -EINVAL ; -if (flags &MNT_FORCE && !capable (CAP_SYS_ADMIN )) +if (flags &MNT_FORCE && !ns_capable (sb->s_user_ns,CAP_SYS_ADMIN ))return -EPERM ;return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 44/414 srcu: Force synchronization for srcu_get_delay()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul E. McKenney <[email protected]>
[ Upstream commit d31e31365b5b6c0cdfc74d71be87234ced564395 ]
Currently, srcu_get_delay() can be called concurrently, for example, by a CPU that is the first to request a new grace period and the CPU processing the current grace period. Although concurrent access is harmless, it unnecessarily expands the state space. Additionally, all calls to srcu_get_delay() are from slow paths.
This commit therefore protects all calls to srcu_get_delay() with ssp->srcu_sup->lock, which is already held on the invocation from the srcu_funnel_gp_start() function. While in the area, this commit also adds a lockdep_assert_held() to srcu_get_delay() itself.
--- kernel/rcu/srcutree.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
kernel/rcu/srcutree.c +10 -1
@@ -647,6 +647,7 @@ static unsigned long srcu_get_delay(struct srcu_struct *ssp)unsigned long jbase =SRCU_INTERVAL ;struct srcu_usage *sup = ssp->srcu_sup; +lockdep_assert_held (&ACCESS_PRIVATE (ssp->srcu_sup, lock));if (srcu_gp_is_expedited (ssp)) jbase =0 ;if (rcu_seq_state (READ_ONCE (sup->srcu_gp_seq))) {
@@ -674,9 +675,13 @@ static unsigned long srcu_get_delay(struct srcu_struct *ssp)void cleanup_srcu_struct (struct srcu_struct *ssp) {int cpu; +unsigned long delay;struct srcu_usage *sup = ssp->srcu_sup; -if (WARN_ON (!srcu_get_delay (ssp))) +spin_lock_irq_rcu_node (ssp->srcu_sup); + delay =srcu_get_delay (ssp); +spin_unlock_irq_rcu_node (ssp->srcu_sup); +if (WARN_ON (!delay))return ;/* Just leak it! */ if (WARN_ON (srcu_readers_active (ssp)))return ;/* Just leak it! */
@@ -1102,7 +1107,9 @@ static bool try_check_zero(struct srcu_struct *ssp, int idx, int trycount) {unsigned long curdelay; +spin_lock_irq_rcu_node (ssp->srcu_sup); curdelay = !srcu_get_delay (ssp); +spin_unlock_irq_rcu_node (ssp->srcu_sup);for (;;) {if (srcu_readers_active_idx_check (ssp, idx))
@@ -1849,7 +1856,9 @@ static void process_srcu(struct work_struct *work) ssp = sup->srcu_ssp;srcu_advance_state (ssp); +spin_lock_irq_rcu_node (ssp->srcu_sup); curdelay =srcu_get_delay (ssp); +spin_unlock_irq_rcu_node (ssp->srcu_sup);if (curdelay) {WRITE_ONCE (sup->reschedule_count,0 ); }else {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 45/414 pm: cpupower: bench: Prevent NULL dereference on malloc failure
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhongqiu Han <[email protected]>
[ Upstream commit 208baa3ec9043a664d9acfb8174b332e6b17fb69 ]
If malloc returns NULL due to low memory, 'config' pointer can be NULL. Add a check to prevent NULL dereference.
--- tools/power/cpupower/bench/parse.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/power/cpupower/bench/parse.c +4 -0
@@ -121,6 +121,10 @@ FILE *prepare_output(const char *dirname)struct config *prepare_default_config () {struct config *config =malloc (sizeof (struct config )); +if (!config) { +perror ("malloc" ); +return NULL ; + }dprintf ("loading defaults\n" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 17/414 octeontx2-pf: qos: fix VF root node parent queue index
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hariprasad Kelam <[email protected]>
[ Upstream commit b7db94734e785e380b0db0f9295e07024f4d42a0 ]
The current code configures the Physical Function (PF) root node at TL1 and the Virtual Function (VF) root node at TL2.
This ensure at any given point of time PF traffic gets more priority.
PF root node
TL1
/ \
TL2 TL2 VF root node
/ \
TL3 TL3
/ \
TL4 TL4
/ \
SMQ SMQDue to a bug in the current code, the TL2 parent queue index on the VF interface is not being configured, leading to 'SMQ Flush' errors
--- drivers/net/ethernet/marvell/octeontx2/nic/qos.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/qos.c +5 -0
@@ -165,6 +165,11 @@ static void __otx2_qos_txschq_cfg(struct otx2_nic *pfvf,otx2_config_sched_shaping (pfvf, node, cfg, &num_regs); }else if (level ==NIX_TXSCH_LVL_TL2 ) { +/* configure parent txschq */ + cfg->reg[num_regs] =NIX_AF_TL2X_PARENT (node->schq); + cfg->regval[num_regs] = (u64 )hw->tx_link <<16 ; + num_regs++; +/* configure link cfg */ if (level == pfvf->qos.link_cfg_lvl) { cfg->reg[num_regs] =NIX_AF_TL3_TL2X_LINKX_CFG (node->schq, hw->tx_link);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 18/414 tc: Ensure we have enough buffer space when sending filter netlink notifications
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 369609fc6272c2f6ad666ba4fd913f3baf32908f ]
The tfilter_notify() and tfilter_del_notify() functions assume that NLMSG_GOODSIZE is always enough to dump the filter chain. This is not always the case, which can lead to silent notify failures (because the return code of tfilter_notify() is not always checked). In particular, this can lead to NLM_F_ECHO not being honoured even though an action succeeds, which forces userspace to create workarounds[0].
Fix this by increasing the message size if dumping the filter chain into the allocated skb fails. Use the size of the incoming skb as a size hint if set, so we can start at a larger value when appropriate.
To trigger this, run the following commands:
# ip link add type veth # tc qdisc replace dev veth0 root handle 1: fq_codel # tc -echo filter add dev veth0 parent 1: u32 match u32 0 0 $(for i in $(seq 32); do echo action pedit munge ip dport set 22; done)
Before this fix, tc just returns:
Not a filter(cmd 2)
After the fix, we get the correct echo:
added filter dev veth0 parent 1: protocol all pref 49152 u32 chain 0 fh 800::800 order 2048 key ht 800 bkt 0 terminal flowid not_in_hw
match 00000000/00000000 at 0
action order 1: pedit action pass keys 1
index 1 ref 1 bind 1
key #0 at 20: val 00000016 mask ffff0000
[repeated 32 times]
[0] https://github.com/openvswitch/ovs/commit/106ef21860c935e5e0017a88bf42b94025c4e511
--- net/sched/cls_api.c | 66 ++++++++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 21 deletions(-)
net/sched/cls_api.c +45 -21
@@ -2057,6 +2057,7 @@ static int tcf_fill_node(struct net *net, struct sk_buff *skb,struct tcmsg *tcm;struct nlmsghdr *nlh;unsigned char *b =skb_tail_pointer (skb); +int ret = -EMSGSIZE ; nlh =nlmsg_put (skb, portid, seq, event,sizeof (*tcm), flags);if (!nlh)
@@ -2101,11 +2102,45 @@ static int tcf_fill_node(struct net *net, struct sk_buff *skb,return skb->len; +cls_op_not_supp: + ret = -EOPNOTSUPP ; out_nlmsg_trim: nla_put_failure: -cls_op_not_supp:nlmsg_trim (skb, b); -return -1 ; +return ret; +} + +static struct sk_buff *tfilter_notify_prep (struct net *net, +struct sk_buff *oskb, +struct nlmsghdr *n, +struct tcf_proto *tp, +struct tcf_block *block, +struct Qdisc *q,u32 parent, +void *fh,int event, +u32 portid,bool rtnl_held, +struct netlink_ext_ack *extack) +{ +unsigned int size = oskb ?max (NLMSG_GOODSIZE , oskb->len) :NLMSG_GOODSIZE ; +struct sk_buff *skb; +int ret; + +retry: + skb =alloc_skb (size,GFP_KERNEL ); +if (!skb) +return ERR_PTR (-ENOBUFS ); + + ret =tcf_fill_node (net, skb, tp, block, q, parent, fh, portid, + n->nlmsg_seq, n->nlmsg_flags, event, false, + rtnl_held, extack); +if (ret <=0 ) { +kfree_skb (skb); +if (ret == -EMSGSIZE ) { + size +=NLMSG_GOODSIZE ; + goto retry; + } +return ERR_PTR (-EINVAL ); + } +return skb; } static int tfilter_notify(struct net *net, struct sk_buff *oskb,
@@ -2121,16 +2156,10 @@ static int tfilter_notify(struct net *net, struct sk_buff *oskb,if (!unicast && !rtnl_notify_needed (net, n->nlmsg_flags,RTNLGRP_TC ))return 0 ; - skb =alloc_skb (NLMSG_GOODSIZE ,GFP_KERNEL ); -if (!skb) -return -ENOBUFS ; - -if (tcf_fill_node (net, skb, tp, block, q, parent, fh, portid, - n->nlmsg_seq, n->nlmsg_flags, event, - false, rtnl_held, extack) <=0 ) { -kfree_skb (skb); -return -EINVAL ; - } + skb =tfilter_notify_prep (net, oskb, n, tp, block, q, parent, fh, event, + portid, rtnl_held, extack); +if (IS_ERR (skb)) +return PTR_ERR (skb);if (unicast) err =rtnl_unicast (skb, net, portid);
@@ -2153,16 +2182,11 @@ static int tfilter_del_notify(struct net *net, struct sk_buff *oskb,if (!rtnl_notify_needed (net, n->nlmsg_flags,RTNLGRP_TC ))return tp->ops->delete (tp, fh, last, rtnl_held, extack); - skb =alloc_skb (NLMSG_GOODSIZE ,GFP_KERNEL ); -if (!skb) -return -ENOBUFS ; - -if (tcf_fill_node (net, skb, tp, block, q, parent, fh, portid, - n->nlmsg_seq, n->nlmsg_flags,RTM_DELTFILTER , - false, rtnl_held, extack) <=0 ) { + skb =tfilter_notify_prep (net, oskb, n, tp, block, q, parent, fh, +RTM_DELTFILTER , portid, rtnl_held, extack); +if (IS_ERR (skb)) {NL_SET_ERR_MSG (extack,"Failed to build del event notification" ); -kfree_skb (skb); -return -EINVAL ; +return PTR_ERR (skb); } err = tp->ops->delete (tp, fh, last, rtnl_held, extack);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 19/414 net: ethtool: Dont call .cleanup_data when prepare_data fails
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Chevallier <[email protected]>
[ Upstream commit 4f038a6a02d20859a3479293cbf172b0f14cbdd6 ]
There's a consistent pattern where the .cleanup_data() callback is called when .prepare_data() fails, when it should really be called to clean after a successful .prepare_data() as per the documentation.
Rewrite the error-handling paths to make sure we don't cleanup un-prepared data.
--- net/ethtool/netlink.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/ethtool/netlink.c +5 -3
@@ -490,7 +490,7 @@ static int ethnl_default_doit(struct sk_buff *skb, struct genl_info *info) ret = ops->prepare_data (req_info, reply_data, info);rtnl_unlock ();if (ret <0 ) - goto err_cleanup; + goto err_dev; ret = ops->reply_size (req_info, reply_data);if (ret <0 ) goto err_cleanup;
@@ -548,7 +548,7 @@ static int ethnl_default_dump_one(struct sk_buff *skb, struct net_device *dev, ret = ctx->ops->prepare_data (ctx->req_info, ctx->reply_data, info);rtnl_unlock ();if (ret <0 ) - goto out; + goto out_cancel; ret =ethnl_fill_reply_header (skb, dev, ctx->ops->hdr_attr);if (ret <0 ) goto out;
@@ -557,6 +557,7 @@ static int ethnl_default_dump_one(struct sk_buff *skb, struct net_device *dev, out:if (ctx->ops->cleanup_data) ctx->ops->cleanup_data (ctx->reply_data); +out_cancel: ctx->reply_data->dev =NULL ;if (ret <0 )genlmsg_cancel (skb, ehdr);
@@ -760,7 +761,7 @@ static void ethnl_default_notify(struct net_device *dev, unsigned int cmd,ethnl_init_reply_data (reply_data, ops, dev); ret = ops->prepare_data (req_info, reply_data, &info);if (ret <0 ) - goto err_cleanup; + goto err_rep; ret = ops->reply_size (req_info, reply_data);if (ret <0 ) goto err_cleanup;
@@ -795,6 +796,7 @@ static void ethnl_default_notify(struct net_device *dev, unsigned int cmd, err_cleanup:if (ops->cleanup_data) ops->cleanup_data (reply_data); +err_rep:kfree (reply_data);kfree (req_info);return ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 20/414 drm/tests: modeset: Fix drm_display_mode memory leak
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
[ Upstream commit dacafdcc7789cfeb0f0552716db56f210238225d ]
drm_mode_find_dmt() returns a drm_display_mode that needs to be destroyed later one. The drm_test_pick_cmdline_res_1920_1080_60() test never does however, which leads to a memory leak.
Let's make sure it's freed.
--- drivers/gpu/drm/tests/drm_client_modeset_test.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/tests/drm_client_modeset_test.c +3 -0
@@ -95,6 +95,9 @@ static void drm_test_pick_cmdline_res_1920_1080_60(struct kunit *test) expected_mode =drm_mode_find_dmt (priv->drm,1920 ,1080 ,60 , false);KUNIT_ASSERT_NOT_NULL (test, expected_mode); + ret =drm_kunit_add_mode_destroy_action (test, expected_mode); +KUNIT_ASSERT_EQ (test, ret,0 ); + KUNIT_ASSERT_TRUE(test, drm_mode_parse_command_line_for_connector(cmdline, connector,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 21/414 drm/tests: helpers: Create kunit helper to destroy a drm_display_mode
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
[ Upstream commit 13c1d5f3a7fa7b55a26e73bb9e95342374a489b2 ]
A number of test suites call functions that expect the returned drm_display_mode to be destroyed eventually.
However, none of the tests called drm_mode_destroy, which results in a memory leak.
Since drm_mode_destroy takes two pointers as argument, we can't use a kunit wrapper. Let's just create a helper every test suite can use.
Stable-dep-of: 70f29ca3117a ("drm/tests: cmdline: Fix drm_display_mode memory leak")
--- drivers/gpu/drm/tests/drm_kunit_helpers.c | 22 ++++++++++++++++++++++ include/drm/drm_kunit_helpers.h | 3 +++ 2 files changed, 25 insertions(+)
drivers/gpu/drm/tests/drm_kunit_helpers.c +22 -0
@@ -319,6 +319,28 @@ static void kunit_action_drm_mode_destroy(void *ptr)drm_mode_destroy (NULL , mode); } +/** +* drm_kunit_add_mode_destroy_action() - Add a drm_destroy_mode kunit action +* @test: The test context object +* @mode: The drm_display_mode to destroy eventually +* +* Registers a kunit action that will destroy the drm_display_mode at +* the end of the test. +* +* If an error occurs, the drm_display_mode will be destroyed. +* +* Returns: +* 0 on success, an error code otherwise. +*/ +int drm_kunit_add_mode_destroy_action (struct kunit *test, +struct drm_display_mode *mode) +{ +return kunit_add_action_or_reset (test, + kunit_action_drm_mode_destroy, + mode); +} +EXPORT_SYMBOL_GPL (drm_kunit_add_mode_destroy_action); +/** * drm_kunit_display_mode_from_cea_vic() - return a mode for CEA VIC for a KUnit test * @test: The test context object
include/drm/drm_kunit_helpers.h +3 -0
@@ -120,6 +120,9 @@ drm_kunit_helper_create_crtc(struct kunit *test,const struct drm_crtc_funcs *funcs, const struct drm_crtc_helper_funcs *helper_funcs); +int drm_kunit_add_mode_destroy_action (struct kunit *test, +struct drm_display_mode *mode); +struct drm_display_mode *drm_kunit_display_mode_from_cea_vic (struct kunit *test,struct drm_device *dev,u8 video_code);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 22/414 drm/tests: cmdline: Fix drm_display_mode memory leak
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxime Ripard <[email protected]>
[ Upstream commit 70f29ca3117a8796cd6bde7612a3ded96d0f2dde ]
drm_analog_tv_mode() and its variants return a drm_display_mode that needs to be destroyed later one. The drm_test_cmdline_tv_options() test never does however, which leads to a memory leak.
Let's make sure it's freed.
--- drivers/gpu/drm/tests/drm_cmdline_parser_test.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/gpu/drm/tests/drm_cmdline_parser_test.c +9 -1
@@ -7,6 +7,7 @@#include <kunit/test.h> #include <drm/drm_connector.h> +#include <drm/drm_kunit_helpers.h> #include <drm/drm_modes.h> static const struct drm_connector no_connector = {};
@@ -955,8 +956,15 @@ struct drm_cmdline_tv_option_test {static void drm_test_cmdline_tv_options (struct kunit *test) {const struct drm_cmdline_tv_option_test *params = test->param_value; -const struct drm_display_mode *expected_mode = params->mode_fn (NULL ); +struct drm_display_mode *expected_mode;struct drm_cmdline_mode mode = { }; +int ret; + + expected_mode = params->mode_fn (NULL ); +KUNIT_ASSERT_NOT_NULL (test, expected_mode); + + ret =drm_kunit_add_mode_destroy_action (test, expected_mode); +KUNIT_ASSERT_EQ (test, ret,0 );KUNIT_EXPECT_TRUE (test,drm_mode_parse_command_line_for_connector (params->cmdline, &no_connector, &mode));
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 13/414 objtool: Fix INSN_CONTEXT_SWITCH handling in validate_unret()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Poimboeuf <[email protected]>
[ Upstream commit a8df7d0ef92eca28c610206c6748daf537ac0586 ]
The !CONFIG_IA32_EMULATION version of xen_entry_SYSCALL_compat() ends with a SYSCALL instruction which is classified by objtool as INSN_CONTEXT_SWITCH.
Unlike validate_branch(), validate_unret() doesn't consider INSN_CONTEXT_SWITCH in a non-function to be a dead end, so it keeps going past the end of xen_entry_SYSCALL_compat(), resulting in the following warning:
vmlinux.o: warning: objtool: xen_reschedule_interrupt+0x2a: RET before UNTRAIN
Fix that by adding INSN_CONTEXT_SWITCH handling to validate_unret() to match what validate_branch() is already doing.
--- tools/objtool/check.c | 5 +++++ 1 file changed, 5 insertions(+)
tools/objtool/check.c +5 -0
@@ -3990,6 +3990,11 @@ static int validate_unret(struct objtool_file *file, struct instruction *insn)WARN_INSN (insn,"RET before UNTRAIN" );return 1 ; +case INSN_CONTEXT_SWITCH : +if (insn_func (insn)) +break ; +return 0 ; +case INSN_NOP :if (insn->retpoline_safe)return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 47/414 x86/mm: Clear _PAGE_DIRTY for kernel mappings when we clear _PAGE_RW
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthew Wilcox (Oracle) <[email protected]>
[ Upstream commit c1fcf41cf37f7a3fd3bbf6f0c04aba3ea4258888 ]
The bit pattern of _PAGE_DIRTY set and _PAGE_RW clear is used to mark shadow stacks. This is currently checked for in mk_pte() but not pfn_pte(). If we add the check to pfn_pte(), it catches vfree() calling set_direct_map_invalid_noflush() which calls __change_page_attr() which loads the old protection bits from the PTE, clears the specified bits and uses pfn_pte() to construct the new PTE.
We should, therefore, for kernel mappings, clear the _PAGE_DIRTY bit consistently whenever we clear _PAGE_RW. I opted to do it in the callers in case we want to use __change_page_attr() to create shadow stacks inside the kernel at some point in the future. Arguably, we might also want to clear _PAGE_ACCESSED here.
Note that the 3 functions involved:
__set_pages_np()
kernel_map_pages_in_pgd()
kernel_unmap_pages_in_pgd()
Only ever manipulate non-swappable kernel mappings, so maintaining the DIRTY:1|RW:0 special pattern for shadow stacks and DIRTY:0 pattern for non-shadow-stack entries can be maintained consistently and doesn't result in the unintended clearing of a live dirty bit that could corrupt (destroy) dirty bit information for user mappings.
--- arch/x86/mm/pat/set_memory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/mm/pat/set_memory.c +3 -3
@@ -2422,7 +2422,7 @@ static int __set_pages_np(struct page *page, int numpages) .pgd = NULL, .numpages = numpages, .mask_set = __pgprot(0), - .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW), + .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY), .flags = CPA_NO_CHECK_ALIAS };/*
@@ -2509,7 +2509,7 @@ int __init kernel_map_pages_in_pgd(pgd_t *pgd, u64 pfn, unsigned long address, .pgd = pgd, .numpages = numpages, .mask_set = __pgprot(0), - .mask_clr = __pgprot(~page_flags & (_PAGE_NX|_PAGE_RW)), + .mask_clr = __pgprot(~page_flags & (_PAGE_NX|_PAGE_RW|_PAGE_DIRTY)), .flags = CPA_NO_CHECK_ALIAS, };
@@ -2552,7 +2552,7 @@ int __init kernel_unmap_pages_in_pgd(pgd_t *pgd, unsigned long address, .pgd = pgd, .numpages = numpages, .mask_set = __pgprot(0), - .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW), + .mask_clr = __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY), .flags = CPA_NO_CHECK_ALIAS, };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 56/414 xen/mcelog: Add __nonstring annotations for unterminated strings
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kees Cook <[email protected]>
[ Upstream commit 1c3dfc7c6b0f551fdca3f7c1f1e4c73be8adb17d ]
When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initialization will only warn if the array lacks the "nonstring" attribute[1]. Mark the arrays with __nonstring to and correctly identify the char array as "not a C string" and thereby eliminate the warning.
Message-ID: <[email protected]>
--- include/xen/interface/xen-mca.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/xen/interface/xen-mca.h +1 -1
@@ -372,7 +372,7 @@ struct xen_mce {#define XEN_MCE_LOG_LEN 32struct xen_mce_log { -char signature[12 ];/* "MACHINECHECK" */ + char signature[12] __nonstring; /* "MACHINECHECK" */unsigned len;/* = XEN_MCE_LOG_LEN */ unsigned next; unsigned flags;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 57/414 zstd: Increase DYNAMIC_BMI2 GCC version cutoff from 4.8 to 11.0 to work around compiler segfault
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ingo Molnar <[email protected]>
[ Upstream commit 1400c87e6cac47eb243f260352c854474d9a9073 ]
Due to pending percpu improvements in -next, GCC9 and GCC10 are crashing during the build with:
lib/zstd/compress/huf_compress.c:1033:1: internal compiler error: Segmentation fault
1033 | {
| ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-9/README.Bugs> for instructions.
The DYNAMIC_BMI2 feature is a known-challenging feature of the ZSTD library, with an existing GCC quirk turning it off for GCC versions below 4.8.
Increase the DYNAMIC_BMI2 version cutoff to GCC 11.0 - GCC 10.5 is the last version known to crash.
--- lib/zstd/common/portability_macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/zstd/common/portability_macros.h +1 -1
@@ -55,7 +55,7 @@#ifndef DYNAMIC_BMI2 #if ((defined(__clang__) &&__has_attribute (__target__)) \ || (defined(__GNUC__) \ - && (__GNUC__ >=5 || (__GNUC__ ==4 && __GNUC_MINOR__ >=8 )))) \ + && (__GNUC__ >=11 ))) \ && (defined(__x86_64__) || defined(_M_X64)) \ && !defined(__BMI2__)# define DYNAMIC_BMI2 1
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 58/414 tracing: Disable branch profiling in noinstr code
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Josh Poimboeuf <[email protected]>
[ Upstream commit 2cbb20b008dba39893f0e296dc8ca312f40a9a0e ]
CONFIG_TRACE_BRANCH_PROFILING inserts a call to ftrace_likely_update() for each use of likely() or unlikely(). That breaks noinstr rules if the affected function is annotated as noinstr.
Disable branch profiling for files with noinstr functions. In addition to some individual files, this also includes the entire arch/x86 subtree, as well as the kernel/entry, drivers/cpuidle, and drivers/idle directories, all of which are noinstr-heavy.
Due to the nature of how sched binaries are built by combining multiple .c files into one, branch profiling is disabled more broadly across the sched code than would otherwise be needed.
This fixes many warnings like the following:
vmlinux.o: warning: objtool: do_syscall_64+0x40: call to ftrace_likely_update() leaves .noinstr.text section vmlinux.o: warning: objtool: __rdgsbase_inactive+0x33: call to ftrace_likely_update() leaves .noinstr.text section vmlinux.o: warning: objtool: handle_bug.isra.0+0x198: call to ftrace_likely_update() leaves .noinstr.text section
...
--- arch/x86/Kbuild | 4 ++++ arch/x86/kernel/head64.c | 2 -- arch/x86/mm/kasan_init_64.c | 1 - arch/x86/mm/mem_encrypt_amd.c | 2 -- arch/x86/mm/mem_encrypt_identity.c | 2 -- drivers/acpi/Makefile | 4 ++++ drivers/cpuidle/Makefile | 3 +++ drivers/idle/Makefile | 5 ++++- kernel/Makefile | 5 +++++ kernel/entry/Makefile | 3 +++ kernel/sched/Makefile | 5 +++++ kernel/time/Makefile | 6 ++++++ lib/Makefile | 5 +++++ 13 files changed, 39 insertions(+), 8 deletions(-)
arch/x86/Kbuild +4 -0
@@ -1,4 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 + +# Branch profiling isn't noinstr-safe. Disable it for arch/x86/* +subdir-ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING + obj-$(CONFIG_ARCH_HAS_CC_PLATFORM) += coco/ obj-y += entry/
arch/x86/kernel/head64.c +0 -2
@@ -5,8 +5,6 @@* Copyright (C) 2000 Andrea Arcangeli <[email protected]> SuSE */ -#define DISABLE_BRANCH_PROFILING -/* cpu_feature_enabled() cannot be used this early */ #define USE_EARLY_PGTABLE_L5
arch/x86/mm/kasan_init_64.c +0 -1
@@ -1,5 +1,4 @@// SPDX-License-Identifier: GPL-2.0 -#define DISABLE_BRANCH_PROFILING #define pr_fmt (fmt) "kasan: " fmt/* cpu_feature_enabled() cannot be used this early */
arch/x86/mm/mem_encrypt_amd.c +0 -2
@@ -7,8 +7,6 @@* Author: Tom Lendacky <[email protected]> */ -#define DISABLE_BRANCH_PROFILING -#include <linux/linkage.h> #include <linux/init.h> #include <linux/mm.h>
arch/x86/mm/mem_encrypt_identity.c +0 -2
@@ -7,8 +7,6 @@* Author: Tom Lendacky <[email protected]> */ -#define DISABLE_BRANCH_PROFILING -/* * Since we're dealing with identity mappings, physical and virtual * addresses are the same, so override these defines which are ultimately
drivers/acpi/Makefile +4 -0
@@ -5,6 +5,10 @@ ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT +ifdef CONFIG_TRACE_BRANCH_PROFILING +CFLAGS_processor_idle.o += -DDISABLE_BRANCH_PROFILING +endif + # # ACPI Boot-Time Table Parsing #
drivers/cpuidle/Makefile +3 -0
@@ -3,6 +3,9 @@ # Makefile for cpuidle. # +# Branch profiling isn't noinstr-safe +ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING + obj-y += cpuidle.o driver.o governor.o sysfs.o governors/ obj-$(CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED) += coupled.o obj-$(CONFIG_DT_IDLE_STATES) += dt_idle_states.o
drivers/idle/Makefile +4 -1
@@ -1,3 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only -obj-$(CONFIG_INTEL_IDLE) += intel_idle.o +# Branch profiling isn't noinstr-safe +ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING + +obj-$(CONFIG_INTEL_IDLE) += intel_idle.o
kernel/Makefile +5 -0
@@ -21,6 +21,11 @@ ifdef CONFIG_FUNCTION_TRACER CFLAGS_REMOVE_irq_work.o = $(CC_FLAGS_FTRACE) endif +# Branch profiling isn't noinstr-safe +ifdef CONFIG_TRACE_BRANCH_PROFILING +CFLAGS_context_tracking.o += -DDISABLE_BRANCH_PROFILING +endif + # Prevents flicker of uninteresting __do_softirq()/__local_bh_disable_ip() # in coverage traces. KCOV_INSTRUMENT_softirq.o := n
kernel/entry/Makefile +3 -0
@@ -6,6 +6,9 @@ KASAN_SANITIZE := n UBSAN_SANITIZE := n KCOV_INSTRUMENT := n +# Branch profiling isn't noinstr-safe +ccflags-$(CONFIG_TRACE_BRANCH_PROFILING) += -DDISABLE_BRANCH_PROFILING + CFLAGS_REMOVE_common.o = -fstack-protector -fstack-protector-strong CFLAGS_common.o += -fno-stack-protector
kernel/sched/Makefile +5 -0
@@ -22,6 +22,11 @@ ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y) CFLAGS_core.o := $(PROFILING) -fno-omit-frame-pointer endif +# Branch profiling isn't noinstr-safe +ifdef CONFIG_TRACE_BRANCH_PROFILING +CFLAGS_build_policy.o += -DDISABLE_BRANCH_PROFILING +CFLAGS_build_utility.o += -DDISABLE_BRANCH_PROFILING +endif # # Build efficiency: #
kernel/time/Makefile +6 -0
@@ -1,4 +1,10 @@ # SPDX-License-Identifier: GPL-2.0 + +# Branch profiling isn't noinstr-safe +ifdef CONFIG_TRACE_BRANCH_PROFILING +CFLAGS_sched_clock.o += -DDISABLE_BRANCH_PROFILING +endif + obj-y += time.o timer.o hrtimer.o sleep_timeout.o obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o obj-y += timeconv.o timecounter.o alarmtimer.o
lib/Makefile +5 -0
@@ -5,6 +5,11 @@ ccflags-remove-$(CONFIG_FUNCTION_TRACER) += $(CC_FLAGS_FTRACE) +# Branch profiling isn't noinstr-safe +ifdef CONFIG_TRACE_BRANCH_PROFILING +CFLAGS_smp_processor_id.o += -DDISABLE_BRANCH_PROFILING +endif + # These files are disabled because they produce lots of non-interesting and/or # flaky coverage that is not a function of syscall inputs. For example, # rbtree can be global and individual rotations don't correlate with inputs.
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 59/414 platform/chrome: cros_ec_lpc: Match on Framework ACPI device
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Schaefer <[email protected]>
[ Upstream commit d83c45aeec9b223fe6db4175e9d1c4f5699cc37a ]
Load the cros_ec_lpc driver based on a Framework FRMWC004 ACPI device, which mirrors GOOG0004, but also applies npcx quirks for Framework systems.
Matching on ACPI will let us avoid having to change the SMBIOS match rules again and again.
--- drivers/platform/chrome/cros_ec_lpc.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/platform/chrome/cros_ec_lpc.c +14 -8
@@ -30,6 +30,7 @@#define DRV_NAME "cros_ec_lpcs"#define ACPI_DRV_NAME "GOOG0004" +#define FRMW_ACPI_DRV_NAME "FRMWC004"/* True if ACPI device is present */ static bool cros_ec_lpc_acpi_device_found;
@@ -460,7 +461,7 @@ static int cros_ec_lpc_probe(struct platform_device *pdev)acpi_status status;struct cros_ec_device *ec_dev;struct cros_ec_lpc *ec_lpc; -struct lpc_driver_data *driver_data; +const struct lpc_driver_data *driver_data;u8 buf[2 ] = {};int irq, ret;u32 quirks;
@@ -472,6 +473,9 @@ static int cros_ec_lpc_probe(struct platform_device *pdev) ec_lpc->mmio_memory_base =EC_LPC_ADDR_MEMMAP ; driver_data =platform_get_drvdata (pdev); +if (!driver_data) + driver_data =acpi_device_get_match_data (dev); +if (driver_data) { quirks = driver_data->quirks;
@@ -625,12 +629,6 @@ static void cros_ec_lpc_remove(struct platform_device *pdev)cros_ec_unregister (ec_dev); } -static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = { - {ACPI_DRV_NAME ,0 }, - { } -}; -MODULE_DEVICE_TABLE (acpi, cros_ec_lpc_acpi_device_ids); -static const struct lpc_driver_data framework_laptop_npcx_lpc_driver_data__initconst = { .quirks =CROS_EC_LPC_QUIRK_REMAP_MEMORY , .quirk_mmio_memory_base =0xE00 ,
@@ -642,6 +640,13 @@ static const struct lpc_driver_data framework_laptop_mec_lpc_driver_data __initc .quirk_aml_mutex_name = "ECMT", }; +static const struct acpi_device_id cros_ec_lpc_acpi_device_ids[] = { + {ACPI_DRV_NAME ,0 }, + {FRMW_ACPI_DRV_NAME , (kernel_ulong_t)&framework_laptop_npcx_lpc_driver_data }, + { } +}; +MODULE_DEVICE_TABLE (acpi, cros_ec_lpc_acpi_device_ids); +static const struct dmi_system_id cros_ec_lpc_dmi_table[]__initconst = { {/*
@@ -795,7 +800,8 @@ static int __init cros_ec_lpc_init(void)int ret;const struct dmi_system_id *dmi_match; - cros_ec_lpc_acpi_device_found = !!cros_ec_lpc_get_device (ACPI_DRV_NAME ); + cros_ec_lpc_acpi_device_found = !!cros_ec_lpc_get_device (ACPI_DRV_NAME ) || + !!cros_ec_lpc_get_device (FRMW_ACPI_DRV_NAME ); dmi_match =dmi_first_match (cros_ec_lpc_dmi_table);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 60/414 ASoC: SOF: topology: Use krealloc_array() to replace krealloc()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Heng <[email protected]>
[ Upstream commit a05143a8f713d9ae6abc41141dac52c66fca8b06 ]
Use krealloc_array() to replace krealloc() with multiplication. krealloc_array() has multiply overflow check, which will be safer.
--- sound/soc/sof/topology.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/soc/sof/topology.c +2 -2
@@ -1269,8 +1269,8 @@ static int sof_widget_parse_tokens(struct snd_soc_component *scomp, struct snd_sstruct snd_sof_tuple *new_tuples; num_tuples += token_list[object_token_list[i]].count * (num_sets -1 ); - new_tuples =krealloc (swidget->tuples, -sizeof (*new_tuples) * num_tuples,GFP_KERNEL ); + new_tuples =krealloc_array (swidget->tuples, + num_tuples,sizeof (*new_tuples),GFP_KERNEL );if (!new_tuples) { ret = -ENOMEM ; goto err;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 61/414 HID: pidff: Convert infinite length from Linux API to PID standard
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit 37e0591fe44dce39d1ebc7a82d5b6e4dba1582eb ]
Software uses 0 as de-facto infinite lenght on Linux FF apis (SDL), Linux doesn't actually define anythi as of now, while USB PID defines NULL (0xffff). Most PID devices do not expect a 0-length effect and can't interpret it as infinite. This change fixes Force Feedback for most PID compliant devices.
As most games depend on updating the values of already playing infinite effects, this is crucial to ensure they will actually work.
Previously, users had to rely on third-party software to do this conversion and make their PID devices usable.
--- drivers/hid/usbhid/hid-pidff.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/hid/usbhid/hid-pidff.c +7 -1
@@ -21,6 +21,7 @@#include "usbhid.h" #define PID_EFFECTS_MAX 64 +#define PID_INFINITE 0xffff/* Report usage table used to put reports into an array */
@@ -301,7 +302,12 @@ static void pidff_set_effect_report(struct pidff_device *pidff, pidff->block_load[PID_EFFECT_BLOCK_INDEX ].value[0 ]; pidff->set_effect_type->value[0 ] = pidff->create_new_effect_type->value[0 ]; - pidff->set_effect[PID_DURATION ].value[0 ] = effect->replay.length; + +/* Convert infinite length from Linux API (0) +to PID standard (NULL) if needed */ + pidff->set_effect[PID_DURATION ].value[0 ] = + effect->replay.length ==0 ?PID_INFINITE : effect->replay.length; + pidff->set_effect[PID_TRIGGER_BUTTON ].value[0 ] = effect->trigger.button; pidff->set_effect[PID_TRIGGER_REPEAT_INT ].value[0 ] = effect->trigger.interval;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 62/414 HID: pidff: Do not send effect envelope if its empty
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit 8876fc1884f5b39550c8387ff3176396c988541d ]
Envelope struct is always initialized, but the envelope itself is optional as described in USB PID Device class definition 1.0.
5.1.1.1 Type Specific Block Offsets
...
4) Effects that do not use Condition Blocks use 1 Parameter Block and an *optional* Envelope Block.
Sending out "empty" envelope breaks force feedback on some devices with games that use SINE effect + offset to emulate constant force effect, as well as generally breaking Constant/Periodic effects. One of the affected brands is Moza Racing.
This change prevents the envelope from being sent if it contains all 0 values while keeping the old behavior of only sending it, if it differs from the old one.
Changes in v6:
- Simplify the checks to make them clearer
- Fix possible null pointer dereference while calling pidff_needs_set_envelope
--- drivers/hid/usbhid/hid-pidff.c | 42 +++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 18 deletions(-)
drivers/hid/usbhid/hid-pidff.c +24 -18
@@ -262,10 +262,22 @@ static void pidff_set_envelope_report(struct pidff_device *pidff,static int pidff_needs_set_envelope (struct ff_envelope *envelope,struct ff_envelope *old) { -return envelope->attack_level != old->attack_level || - envelope->fade_level != old->fade_level || +bool needs_new_envelope; + needs_new_envelope = envelope->attack_level !=0 || + envelope->fade_level !=0 || + envelope->attack_length !=0 || + envelope->fade_length !=0 ; + +if (!needs_new_envelope) +return false; + +if (!old) +return needs_new_envelope; + +return envelope->attack_level != old->attack_level || + envelope->fade_level != old->fade_level || envelope->attack_length != old->attack_length || - envelope->fade_length != old->fade_length; + envelope->fade_length != old->fade_length; }/*
@@ -580,11 +592,9 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect,pidff_set_effect_report (pidff, effect);if (!old ||pidff_needs_set_constant (effect, old))pidff_set_constant_force_report (pidff, effect); -if (!old || -pidff_needs_set_envelope (&effect->u.constant.envelope, - &old->u.constant.envelope)) -pidff_set_envelope_report (pidff, - &effect->u.constant.envelope); +if (pidff_needs_set_envelope (&effect->u.constant.envelope, + old ? &old->u.constant.envelope :NULL )) +pidff_set_envelope_report (pidff, &effect->u.constant.envelope);break ;case FF_PERIODIC :
@@ -619,11 +629,9 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect,pidff_set_effect_report (pidff, effect);if (!old ||pidff_needs_set_periodic (effect, old))pidff_set_periodic_report (pidff, effect); -if (!old || -pidff_needs_set_envelope (&effect->u.periodic.envelope, - &old->u.periodic.envelope)) -pidff_set_envelope_report (pidff, - &effect->u.periodic.envelope); +if (pidff_needs_set_envelope (&effect->u.periodic.envelope, + old ? &old->u.periodic.envelope :NULL )) +pidff_set_envelope_report (pidff, &effect->u.periodic.envelope);break ;case FF_RAMP :
@@ -637,11 +645,9 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect,pidff_set_effect_report (pidff, effect);if (!old ||pidff_needs_set_ramp (effect, old))pidff_set_ramp_force_report (pidff, effect); -if (!old || -pidff_needs_set_envelope (&effect->u.ramp.envelope, - &old->u.ramp.envelope)) -pidff_set_envelope_report (pidff, - &effect->u.ramp.envelope); +if (pidff_needs_set_envelope (&effect->u.ramp.envelope, + old ? &old->u.ramp.envelope :NULL )) +pidff_set_envelope_report (pidff, &effect->u.ramp.envelope);break ;case FF_SPRING :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 63/414 HID: pidff: Add MISSING_DELAY quirk and its detection
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit 2d5c7ce5bf4cc27db41632f357f682d0ee4518e7 ]
A lot of devices do not include this field, and it's seldom used in force feedback implementations. I tested about three dozen applications and none of them make use of the delay.
This fixes initialization of a lot of PID wheels like Cammus, VRS, FFBeast
This change has no effect on fully compliant devices
--- drivers/hid/usbhid/hid-pidff.c | 33 ++++++++++++++++++++++++++++----- include/linux/hid.h | 3 +++ 2 files changed, 31 insertions(+), 5 deletions(-)
drivers/hid/usbhid/hid-pidff.c +28 -5
@@ -185,6 +185,8 @@ struct pidff_device {int operation_id[sizeof (pidff_effect_operation_status)];int pid_id[PID_EFFECTS_MAX ]; + +u32 quirks; };/*
@@ -329,7 +331,10 @@ static void pidff_set_effect_report(struct pidff_device *pidff, pidff->effect_direction->value[0 ] =pidff_rescale (effect->direction,0xffff , pidff->effect_direction); - pidff->set_effect[PID_START_DELAY ].value[0 ] = effect->replay.delay; + +/* Omit setting delay field if it's missing */ +if (!(pidff->quirks &HID_PIDFF_QUIRK_MISSING_DELAY )) + pidff->set_effect[PID_START_DELAY ].value[0 ] = effect->replay.delay;hid_hw_request (pidff->hid, pidff->reports[PID_SET_EFFECT ],HID_REQ_SET_REPORT );
@@ -748,7 +753,10 @@ static void pidff_autocenter(struct pidff_device *pidff, u16 magnitude) pidff->set_effect[PID_TRIGGER_REPEAT_INT ].value[0 ] =0 ;pidff_set (&pidff->set_effect[PID_GAIN ], magnitude); pidff->set_effect[PID_DIRECTION_ENABLE ].value[0 ] =1 ; - pidff->set_effect[PID_START_DELAY ].value[0 ] =0 ; + +/* Omit setting delay field if it's missing */ +if (!(pidff->quirks &HID_PIDFF_QUIRK_MISSING_DELAY )) + pidff->set_effect[PID_START_DELAY ].value[0 ] =0 ;hid_hw_request (pidff->hid, pidff->reports[PID_SET_EFFECT ],HID_REQ_SET_REPORT );
@@ -771,6 +779,7 @@ static int pidff_find_fields(struct pidff_usage *usage, const u8 *table, struct hid_report *report, int count, int strict) { int i, j, k, found; +int return_value =0 ;for (k =0 ; k < count; k++) { found =0 ;
@@ -795,12 +804,17 @@ static int pidff_find_fields(struct pidff_usage *usage, const u8 *table,if (found)break ; } -if (!found && strict) { +if (!found && table[k] == pidff_set_effect[PID_START_DELAY ]) { +pr_debug ("Delay field not found, but that's OK\n" ); +pr_debug ("Setting MISSING_DELAY quirk\n" ); + return_value |=HID_PIDFF_QUIRK_MISSING_DELAY ; + } +else if (!found && strict) {pr_debug ("failed to locate %d\n" , k);return -1 ; } } -return 0 ; +return return_value; }/*
@@ -1075,11 +1089,19 @@ static int pidff_find_effects(struct pidff_device *pidff,static int pidff_init_fields (struct pidff_device *pidff,struct input_dev *dev) {int envelope_ok =0 ; +int status =0 ; -if (PIDFF_FIND_FIELDS (set_effect,PID_SET_EFFECT ,1 )) { +/* Save info about the device not having the DELAY ffb field. */ + status =PIDFF_FIND_FIELDS (set_effect,PID_SET_EFFECT ,1 ); +if (status ==-1 ) {hid_err (pidff->hid,"unknown set_effect report layout\n" );return -ENODEV ; } + pidff->quirks |= status; + +if (status &HID_PIDFF_QUIRK_MISSING_DELAY ) +hid_dbg (pidff->hid,"Adding MISSING_DELAY quirk\n" ); +PIDFF_FIND_FIELDS (block_load,PID_BLOCK_LOAD ,0 );if (!pidff->block_load[PID_EFFECT_BLOCK_INDEX ].value) {
@@ -1323,6 +1345,7 @@ int hid_pidff_init(struct hid_device *hid) ff->playback = pidff_playback;hid_info (dev,"Force feedback for USB HID PID devices by Anssi Hannula <[email protected]>\n" ); +hid_dbg (dev,"Active quirks mask: 0x%x\n" , pidff->quirks);hid_device_io_stop (hid);
include/linux/hid.h +3 -0
@@ -1228,6 +1228,9 @@ int hid_pidff_init(struct hid_device *hid);#define hid_pidff_init NULL#endif +/* HID PIDFF quirks */ +#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0) +#define dbg_hid (fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)#define hid_err (hid, fmt, ...) \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 64/414 HID: pidff: Add MISSING_PBO quirk and its detection
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit fc7c154e9bb3c2b98875cfc565406f4787e3b7a4 ]
Some devices with only one axis are missing PARAMETER_BLOCK_OFFSET field for conditional effects. They can only have one axis, so we're limiting the max_axis when setting the report for those effects.
Automatic detection ensures compatibility even if such device won't be explicitly defined in the kernel.
Fixes initialization of VRS DirectForce PRO and possibly other devices.
Changes in v6:
- Fixed NULL pointer dereference. When PBO is missing, make sure not to set it anyway
--- drivers/hid/usbhid/hid-pidff.c | 47 +++++++++++++++++++++------------- include/linux/hid.h | 1 + 2 files changed, 30 insertions(+), 18 deletions(-)
drivers/hid/usbhid/hid-pidff.c +29 -18
@@ -391,13 +391,19 @@ static int pidff_needs_set_periodic(struct ff_effect *effect,static void pidff_set_condition_report (struct pidff_device *pidff,struct ff_effect *effect) { -int i; +int i, max_axis; + +/* Devices missing Parameter Block Offset can only have one axis */ + max_axis = pidff->quirks &HID_PIDFF_QUIRK_MISSING_PBO ?1 :2 ; pidff->set_condition[PID_EFFECT_BLOCK_INDEX ].value[0 ] = pidff->block_load[PID_EFFECT_BLOCK_INDEX ].value[0 ]; -for (i =0 ; i <2 ; i++) { - pidff->set_condition[PID_PARAM_BLOCK_OFFSET ].value[0 ] = i; +for (i =0 ; i < max_axis; i++) { +/* Omit Parameter Block Offset if missing */ +if (!(pidff->quirks &HID_PIDFF_QUIRK_MISSING_PBO )) + pidff->set_condition[PID_PARAM_BLOCK_OFFSET ].value[0 ] = i; +pidff_set_signed (&pidff->set_condition[PID_CP_OFFSET ], effect->u.condition[i].center); pidff_set_signed(&pidff->set_condition[PID_POS_COEFFICIENT],
@@ -809,6 +815,11 @@ static int pidff_find_fields(struct pidff_usage *usage, const u8 *table,pr_debug ("Setting MISSING_DELAY quirk\n" ); return_value |=HID_PIDFF_QUIRK_MISSING_DELAY ; } +else if (!found && table[k] == pidff_set_condition[PID_PARAM_BLOCK_OFFSET ]) { +pr_debug ("PBO field not found, but that's OK\n" ); +pr_debug ("Setting MISSING_PBO quirk\n" ); + return_value |=HID_PIDFF_QUIRK_MISSING_PBO ; + }else if (!found && strict) {pr_debug ("failed to locate %d\n" , k);return -1 ;
@@ -1088,7 +1099,6 @@ static int pidff_find_effects(struct pidff_device *pidff,*/ static int pidff_init_fields (struct pidff_device *pidff,struct input_dev *dev) { -int envelope_ok =0 ;int status =0 ;/* Save info about the device not having the DELAY ffb field. */
@@ -1119,13 +1129,10 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev)return -ENODEV ; } -if (!PIDFF_FIND_FIELDS (set_envelope,PID_SET_ENVELOPE ,1 )) - envelope_ok =1 ; -if (pidff_find_special_fields (pidff) ||pidff_find_effects (pidff, dev))return -ENODEV ; -if (!envelope_ok) { +if (PIDFF_FIND_FIELDS (set_envelope,PID_SET_ENVELOPE ,1 )) {if (test_and_clear_bit (FF_CONSTANT , dev->ffbit))hid_warn (pidff->hid,"has constant effect but no envelope\n" );
@@ -1150,16 +1157,20 @@ static int pidff_init_fields(struct pidff_device *pidff, struct input_dev *dev)clear_bit (FF_RAMP , dev->ffbit); } -if ((test_bit (FF_SPRING , dev->ffbit) || -test_bit (FF_DAMPER , dev->ffbit) || -test_bit (FF_FRICTION , dev->ffbit) || -test_bit (FF_INERTIA , dev->ffbit)) && -PIDFF_FIND_FIELDS (set_condition,PID_SET_CONDITION ,1 )) { -hid_warn (pidff->hid,"unknown condition effect layout\n" ); -clear_bit (FF_SPRING , dev->ffbit); -clear_bit (FF_DAMPER , dev->ffbit); -clear_bit (FF_FRICTION , dev->ffbit); -clear_bit (FF_INERTIA , dev->ffbit); +if (test_bit (FF_SPRING , dev->ffbit) || +test_bit (FF_DAMPER , dev->ffbit) || +test_bit (FF_FRICTION , dev->ffbit) || +test_bit (FF_INERTIA , dev->ffbit)) { + status =PIDFF_FIND_FIELDS (set_condition,PID_SET_CONDITION ,1 ); + +if (status <0 ) { +hid_warn (pidff->hid,"unknown condition effect layout\n" ); +clear_bit (FF_SPRING , dev->ffbit); +clear_bit (FF_DAMPER , dev->ffbit); +clear_bit (FF_FRICTION , dev->ffbit); +clear_bit (FF_INERTIA , dev->ffbit); + } + pidff->quirks |= status; } if (test_bit(FF_PERIODIC, dev->ffbit) &&
include/linux/hid.h +1 -0
@@ -1230,6 +1230,7 @@ int hid_pidff_init(struct hid_device *hid);/* HID PIDFF quirks */ #define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0) +#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1)#define dbg_hid (fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 65/414 HID: pidff: Add PERMISSIVE_CONTROL quirk
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit a4119108d2530747e61c7cbf52e2affd089cb1f6 ]
With this quirk, a PID device isn't required to have a strict logical_minimum of 1 for the the PID_DEVICE_CONTROL usage page.
Some devices come with weird values in their device descriptors and this quirk enables their initialization even if the logical minimum of the DEVICE_CONTROL page is not 1.
Fixes initialization of VRS Direct Force Pro
Changes in v6:
- Change quirk name to better reflect it's intention
--- drivers/hid/usbhid/hid-pidff.c | 3 ++- include/linux/hid.h | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/hid/usbhid/hid-pidff.c +2 -1
@@ -969,7 +969,8 @@ static int pidff_find_special_fields(struct pidff_device *pidff) 0x57, 0); pidff->device_control =pidff_find_special_field (pidff->reports[PID_DEVICE_CONTROL ], -0x96 ,1 ); +0x96 , !(pidff->quirks &HID_PIDFF_QUIRK_PERMISSIVE_CONTROL )); + pidff->block_load_status =pidff_find_special_field (pidff->reports[PID_BLOCK_LOAD ],0x8b ,1 );
include/linux/hid.h +3 -2
@@ -1229,8 +1229,9 @@ int hid_pidff_init(struct hid_device *hid);#endif /* HID PIDFF quirks */ -#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0) -#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1) +#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0) +#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1) +#define HID_PIDFF_QUIRK_PERMISSIVE_CONTROL BIT(2)#define dbg_hid (fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 48/414 x86/percpu: Disable named address spaces for UBSAN_BOOL with KASAN for GCC < 14.2
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uros Bizjak <[email protected]>
[ Upstream commit b6762467a09ba8838c499e4f36561e82fc608ed1 ]
GCC < 14.2 does not correctly propagate address space qualifiers with -fsanitize=bool,enum. Together with address sanitizer then causes that load to be sanitized.
Disable named address spaces for GCC < 14.2 when both, UBSAN_BOOL and KASAN are enabled.
--- arch/x86/Kconfig | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
arch/x86/Kconfig +11 -9
@@ -2446,18 +2446,20 @@ config CC_HAS_NAMED_AS def_bool $(success,echo 'int __seg_fs fs; int __seg_gs gs;' | $(CC) -x c - -S -o /dev/null) depends on CC_IS_GCC +# +# -fsanitize=kernel-address (KASAN) and -fsanitize=thread (KCSAN) +# are incompatible with named address spaces with GCC < 13.3 +# (see GCC PR sanitizer/111736 and also PR sanitizer/115172). +# + config CC_HAS_NAMED_AS_FIXED_SANITIZERS - def_bool CC_IS_GCC && GCC_VERSION >= 130300 + def_bool y + depends on !(KASAN || KCSAN) || GCC_VERSION >= 130300 + depends on !(UBSAN_BOOL && KASAN) || GCC_VERSION >= 140200 config USE_X86_SEG_SUPPORT - def_bool y - depends on CC_HAS_NAMED_AS - # - # -fsanitize=kernel-address (KASAN) and -fsanitize=thread - # (KCSAN) are incompatible with named address spaces with - # GCC < 13.3 - see GCC PR sanitizer/111736. - # - depends on !(KASAN || KCSAN) || CC_HAS_NAMED_AS_FIXED_SANITIZERS + def_bool CC_HAS_NAMED_AS + depends on CC_HAS_NAMED_AS_FIXED_SANITIZERS config CC_HAS_SLS def_bool $(cc-option,-mharden-sls=all)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 66/414 HID: pidff: Add hid_pidff_init_with_quirks and export as GPL symbol
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit 36de0164bbaff1484288e84ac5df5cff00580263 ]
This lays out a way to provide an initial set of quirks to enable before device initialization takes place. GPL symbol export needed for the possibility of building HID drivers which use this function as modules.
Adding a wrapper function to ensure compatibility with the old behavior of hid_pidff_init.
--- drivers/hid/usbhid/hid-pidff.c | 15 ++++++++++++++- include/linux/hid.h | 2 ++ 2 files changed, 16 insertions(+), 1 deletion(-)
drivers/hid/usbhid/hid-pidff.c +14 -1
@@ -1268,8 +1268,9 @@ static int pidff_check_autocenter(struct pidff_device *pidff,/* * Check if the device is PID and initialize it +* Set initial quirks */ -int hid_pidff_init (struct hid_device *hid) +int hid_pidff_init_with_quirks (struct hid_device *hid,__u32 initial_quirks) {struct pidff_device *pidff; struct hid_input *hidinput = list_entry(hid->inputs.next,
@@ -1291,6 +1292,7 @@ int hid_pidff_init(struct hid_device *hid)return -ENOMEM ; pidff->hid = hid; + pidff->quirks = initial_quirks;hid_device_io_start (hid);
@@ -1369,3 +1371,14 @@ int hid_pidff_init(struct hid_device *hid)kfree (pidff);return error; } +EXPORT_SYMBOL_GPL (hid_pidff_init_with_quirks); + +/* +* Check if the device is PID and initialize it +* Wrapper made to keep the compatibility with old +* init function +*/ +int hid_pidff_init (struct hid_device *hid) +{ +return hid_pidff_init_with_quirks (hid,0 ); +}
include/linux/hid.h +2 -0
@@ -1224,8 +1224,10 @@ void hid_quirks_exit(__u16 bus);#ifdef CONFIG_HID_PID int hid_pidff_init (struct hid_device *hid); +int hid_pidff_init_with_quirks (struct hid_device *hid,__u32 initial_quirks);#else #define hid_pidff_init NULL +#define hid_pidff_init_with_quirks NULL#endif /* HID PIDFF quirks */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 67/414 HID: pidff: Add FIX_WHEEL_DIRECTION quirk
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit 3051bf5ec773b803c474ea556b57d678a8885be3 ]
Most steering wheels simply ignore DIRECTION field, but some try to be compliant with the PID standard and use it in force calculations. Games often ignore setting this field properly and/or there can be issues with dinput8 -> wine -> SDL -> Linux API translation, and this value can be incorrect. This can lead to partial/complete loss of Force Feedback or even unexpected force reversal.
Sadly, this quirk can't be detected automatically without sending out effects that would move an axis.
This fixes FFB on Moza Racing devices and others where effect direction is not simply ignored.
--- drivers/hid/usbhid/hid-pidff.c | 12 +++++++++--- include/linux/hid.h | 1 + 2 files changed, 10 insertions(+), 3 deletions(-)
drivers/hid/usbhid/hid-pidff.c +9 -3
@@ -137,6 +137,9 @@ static const u8 pidff_block_load_status[] = { 0x8c, 0x8d };#define PID_EFFECT_STOP 1static const u8 pidff_effect_operation_status[] = {0x79 ,0x7b }; +/* Polar direction 90 degrees (North) */ +#define PIDFF_FIXED_WHEEL_DIRECTION 0x4000 +struct pidff_usage {struct hid_field *field;s32 *value;
@@ -328,9 +331,12 @@ static void pidff_set_effect_report(struct pidff_device *pidff, pidff->set_effect[PID_GAIN ].value[0 ] = pidff->set_effect[PID_GAIN ].field->logical_maximum; pidff->set_effect[PID_DIRECTION_ENABLE ].value[0 ] =1 ; - pidff->effect_direction->value[0 ] = -pidff_rescale (effect->direction,0xffff , - pidff->effect_direction); + +/* Use fixed direction if needed */ + pidff->effect_direction->value[0 ] =pidff_rescale ( + pidff->quirks &HID_PIDFF_QUIRK_FIX_WHEEL_DIRECTION ? +PIDFF_FIXED_WHEEL_DIRECTION : effect->direction, +0xffff , pidff->effect_direction);/* Omit setting delay field if it's missing */ if (!(pidff->quirks &HID_PIDFF_QUIRK_MISSING_DELAY ))
include/linux/hid.h +1 -0
@@ -1234,6 +1234,7 @@ int hid_pidff_init_with_quirks(struct hid_device *hid, __u32 initial_quirks);#define HID_PIDFF_QUIRK_MISSING_DELAY BIT(0)#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1)#define HID_PIDFF_QUIRK_PERMISSIVE_CONTROL BIT(2) +#define HID_PIDFF_QUIRK_FIX_WHEEL_DIRECTION BIT(3)#define dbg_hid (fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 68/414 HID: Add hid-universal-pidff driver and supported device ids
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit f06bf8d94fffbb544b1cb5402c92e0a075f0d420 ]
Extend pidff compatibility, usable button range, manage pidff quirks and set improved fuzz/flat default for high precision devices. Possibility of fixing device descriptors in the future if such needs arises.
As many of PID devices are quite similar and not dependent on custom drivers, this one can handle all of PID devices which need special care.
Numerous sim racing/sim flight bases report a lot of buttons in excess of 100. Moza Racing exposes 128 of them and thus the need to extend the available range.
All the included devices were tested and confirmed working with the help of the sim racing community.
Changes in v6:
- Support "split" devices with a separate "input device" for buttons
- Fixed comment styling
--- drivers/hid/Kconfig | 14 +++ drivers/hid/Makefile | 1 + drivers/hid/hid-ids.h | 31 +++++ drivers/hid/hid-universal-pidff.c | 192 ++++++++++++++++++++++++++++++ 4 files changed, 238 insertions(+) create mode 100644 drivers/hid/hid-universal-pidff.c
drivers/hid/Kconfig +14 -0
@@ -1218,6 +1218,20 @@ config HID_U2FZERO allow setting the brightness to anything but 1, which will trigger a single blink and immediately reset back to 0. +config HID_UNIVERSAL_PIDFF + tristate "universal-pidff: extended USB PID driver compatibility and usage" + depends on USB_HID + depends on HID_PID + help + Extended PID support for selected devices. + + Contains report fixups, extended usable button range and + pidff quirk management to extend compatibility with slightly + non-compliant USB PID devices and better fuzz/flat values for + high precision direct drive devices. + + Supports Moza Racing, Cammus, VRS, FFBeast and more. + config HID_WACOM tristate "Wacom Intuos/Graphire tablet support (USB)" depends on USB_HID
drivers/hid/Makefile +1 -0
@@ -140,6 +140,7 @@ hid-uclogic-objs := hid-uclogic-core.o \ hid-uclogic-params.o obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o obj-$(CONFIG_HID_UDRAW_PS3) += hid-udraw-ps3.o +obj-$(CONFIG_HID_UNIVERSAL_PIDFF) += hid-universal-pidff.o obj-$(CONFIG_HID_LED) += hid-led.o obj-$(CONFIG_HID_XIAOMI) += hid-xiaomi.o obj-$(CONFIG_HID_XINMO) += hid-xinmo.o
drivers/hid/hid-ids.h +31 -0
@@ -262,6 +262,10 @@#define USB_DEVICE_ID_BTC_EMPREX_REMOTE 0x5578#define USB_DEVICE_ID_BTC_EMPREX_REMOTE_2 0x5577 +#define USB_VENDOR_ID_CAMMUS 0x3416 +#define USB_DEVICE_ID_CAMMUS_C5 0x0301 +#define USB_DEVICE_ID_CAMMUS_C12 0x0302 +#define USB_VENDOR_ID_CANDO 0x2087#define USB_DEVICE_ID_CANDO_PIXCIR_MULTI_TOUCH 0x0703#define USB_DEVICE_ID_CANDO_MULTI_TOUCH 0x0a01
@@ -453,6 +457,11 @@#define USB_VENDOR_ID_EVISION 0x320f#define USB_DEVICE_ID_EVISION_ICL01 0x5041 +#define USB_VENDOR_ID_FFBEAST 0x045b +#define USB_DEVICE_ID_FFBEAST_JOYSTICK 0x58f9 +#define USB_DEVICE_ID_FFBEAST_RUDDER 0x5968 +#define USB_DEVICE_ID_FFBEAST_WHEEL 0x59d7 +#define USB_VENDOR_ID_FLATFROG 0x25b5#define USB_DEVICE_ID_MULTITOUCH_3200 0x0002
@@ -817,6 +826,13 @@#define I2C_DEVICE_ID_LG_8001 0x8001#define I2C_DEVICE_ID_LG_7010 0x7010 +#define USB_VENDOR_ID_LITE_STAR 0x11ff +#define USB_DEVICE_ID_PXN_V10 0x3245 +#define USB_DEVICE_ID_PXN_V12 0x1212 +#define USB_DEVICE_ID_PXN_V12_LITE 0x1112 +#define USB_DEVICE_ID_PXN_V12_LITE_2 0x1211 +#define USB_DEVICE_LITE_STAR_GT987_FF 0x2141 +#define USB_VENDOR_ID_LOGITECH 0x046d#define USB_DEVICE_ID_LOGITECH_Z_10_SPK 0x0a07#define USB_DEVICE_ID_LOGITECH_AUDIOHUB 0x0a0e
@@ -964,6 +980,18 @@#define USB_VENDOR_ID_MONTEREY 0x0566#define USB_DEVICE_ID_GENIUS_KB29E 0x3004 +#define USB_VENDOR_ID_MOZA 0x346e +#define USB_DEVICE_ID_MOZA_R3 0x0005 +#define USB_DEVICE_ID_MOZA_R3_2 0x0015 +#define USB_DEVICE_ID_MOZA_R5 0x0004 +#define USB_DEVICE_ID_MOZA_R5_2 0x0014 +#define USB_DEVICE_ID_MOZA_R9 0x0002 +#define USB_DEVICE_ID_MOZA_R9_2 0x0012 +#define USB_DEVICE_ID_MOZA_R12 0x0006 +#define USB_DEVICE_ID_MOZA_R12_2 0x0016 +#define USB_DEVICE_ID_MOZA_R16_R21 0x0000 +#define USB_DEVICE_ID_MOZA_R16_R21_2 0x0010 +#define USB_VENDOR_ID_MSI 0x1770#define USB_DEVICE_ID_MSI_GT683R_LED_PANEL 0xff00
@@ -1375,6 +1403,9 @@#define USB_DEVICE_ID_VELLEMAN_K8061_FIRST 0x8061#define USB_DEVICE_ID_VELLEMAN_K8061_LAST 0x8068 +#define USB_VENDOR_ID_VRS 0x0483 +#define USB_DEVICE_ID_VRS_DFP 0xa355 +#define USB_VENDOR_ID_VTL 0x0306#define USB_DEVICE_ID_VTL_MULTITOUCH_FF3F 0xff3f
drivers/hid/hid-universal-pidff.c new file +192 -0
192 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 69/414 HID: pidff: Add PERIODIC_SINE_ONLY quirk
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit abdbf8764f4962af2a910abb3a213ecf304a73d3 ]
Some devices only support SINE periodic effect although they advertise support for all PERIODIC effect in their HID descriptor. Some just do nothing when trying to play such an effect (upload goes fine), some express undefined behavior like turning to one side.
This quirk forces all the periodic effects to be uploaded as SINE. This is acceptable as all these effects are similar in nature and are mostly used as rumble. SINE is the most popular with others seldom used (especially SAW_UP and SAW_DOWN).
Fixes periodic effects for PXN and LITE STAR wheels
--- drivers/hid/hid-universal-pidff.c | 15 ++++++++++----- drivers/hid/usbhid/hid-pidff.c | 3 +++ include/linux/hid.h | 1 + 3 files changed, 14 insertions(+), 5 deletions(-)
drivers/hid/hid-universal-pidff.c +10 -5
@@ -168,11 +168,16 @@ static const struct hid_device_id universal_pidff_devices[] = { { HID_USB_DEVICE(USB_VENDOR_ID_FFBEAST, USB_DEVICE_ID_FFBEAST_JOYSTICK), }, { HID_USB_DEVICE(USB_VENDOR_ID_FFBEAST, USB_DEVICE_ID_FFBEAST_RUDDER), }, { HID_USB_DEVICE(USB_VENDOR_ID_FFBEAST, USB_DEVICE_ID_FFBEAST_WHEEL) }, - { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V10) }, - { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V12) }, - { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V12_LITE) }, - { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V12_LITE_2) }, - { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_LITE_STAR_GT987_FF) }, + { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V10), + .driver_data = HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY }, + { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V12), + .driver_data = HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY }, + { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V12_LITE), + .driver_data = HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY }, + { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_ID_PXN_V12_LITE_2), + .driver_data = HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY }, + { HID_USB_DEVICE(USB_VENDOR_ID_LITE_STAR, USB_DEVICE_LITE_STAR_GT987_FF), + .driver_data = HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY }, { } };MODULE_DEVICE_TABLE (hid, universal_pidff_devices);
drivers/hid/usbhid/hid-pidff.c +3 -0
@@ -637,6 +637,9 @@ static int pidff_upload_effect(struct input_dev *dev, struct ff_effect *effect,return -EINVAL ; } +if (pidff->quirks &HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY ) + type_id =PID_SINE ; + error =pidff_request_effect_upload (pidff, pidff->type_id[type_id]);if (error)
include/linux/hid.h +1 -0
@@ -1235,6 +1235,7 @@ int hid_pidff_init_with_quirks(struct hid_device *hid, __u32 initial_quirks);#define HID_PIDFF_QUIRK_MISSING_PBO BIT(1)#define HID_PIDFF_QUIRK_PERMISSIVE_CONTROL BIT(2)#define HID_PIDFF_QUIRK_FIX_WHEEL_DIRECTION BIT(3) +#define HID_PIDFF_QUIRK_PERIODIC_SINE_ONLY BIT(4)#define dbg_hid (fmt, ...) pr_debug("%s: " fmt, __FILE__, ##__VA_ARGS__)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 70/414 HID: pidff: Fix null pointer dereference in pidff_find_fields
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Pakuła <[email protected]>
[ Upstream commit 22a05462c3d0eee15154faf8d13c49e6295270a5 ]
This function triggered a null pointer dereference if used to search for a report that isn't implemented on the device. This happened both for optional and required reports alike.
The same logic was applied to pidff_find_special_field and although pidff_init_fields should return an error earlier if one of the required reports is missing, future modifications could change this logic and resurface this possible null pointer dereference again.
LKML bug report:
https://lore.kernel.org/all/CAL-gK7f5=R0nrrQdPtaZZr1fd-cdAMbDMuZ_NLA8vM0SX+nGSw@mail.gmail.com
--- drivers/hid/usbhid/hid-pidff.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/hid/usbhid/hid-pidff.c +10 -0
@@ -793,6 +793,11 @@ static void pidff_set_autocenter(struct input_dev *dev, u16 magnitude)static int pidff_find_fields (struct pidff_usage *usage,const u8 *table,struct hid_report *report,int count,int strict) { +if (!report) { +pr_debug ("pidff_find_fields, null report\n" ); +return -1 ; + } +int i, j, k, found;int return_value =0 ;
@@ -917,6 +922,11 @@ static int pidff_reports_ok(struct pidff_device *pidff)static struct hid_field *pidff_find_special_field (struct hid_report *report,int usage,int enforce_min) { +if (!report) { +pr_debug ("pidff_find_special_field, null report\n" ); +return NULL ; + } +int i;for (i =0 ; i < report->maxfield; i++) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 71/414 ASoC: amd: ps: use macro for ACP6.3 pci revision id
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <[email protected]>
[ Upstream commit 4b36a47e2d989b98953dbfb1e97da0f0169f5086 ]
Use macro for ACP6.3 PCI revision id instead of hard coded value.
--- sound/soc/amd/ps/acp63.h | 1 + sound/soc/amd/ps/pci-ps.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
sound/soc/amd/ps/acp63.h +1 -0
@@ -11,6 +11,7 @@#define ACP_DEVICE_ID 0x15E2#define ACP63_REG_START 0x1240000#define ACP63_REG_END 0x125C000 +#define ACP63_PCI_REV 0x63#define ACP_SOFT_RESET_SOFTRESET_AUDDONE_MASK 0x00010001#define ACP_PGFSM_CNTL_POWER_ON_MASK 1
sound/soc/amd/ps/pci-ps.c +1 -1
@@ -559,7 +559,7 @@ static int snd_acp63_probe(struct pci_dev *pci,/* Pink Sardine device check */ switch (pci->revision) { -case 0x63 : +case ACP63_PCI_REV :break ;default :dev_dbg (&pci->dev,"acp63 pci device not found\n" );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 72/414 ASoC: amd: amd_sdw: Add quirks for Dell SKUs
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vijendar Mukunda <[email protected]>
[ Upstream commit 4bb5b6f13fd83b32c8a93fbd399e7558415d1ce0 ]
This patch adds a quirk to include the codec amplifier function for Dell SKU's listed in quirk table.
Note: In these SKU's, the RT722 codec amplifier is excluded, and an external amplifier is used instead.
--- sound/soc/amd/acp/acp-sdw-legacy-mach.c | 34 +++++++++++++++++++++++++ sound/soc/amd/acp/soc_amd_sdw_common.h | 1 + 2 files changed, 35 insertions(+)
sound/soc/amd/acp/acp-sdw-legacy-mach.c +34 -0
@@ -28,6 +28,8 @@ static void log_quirks(struct device *dev) SOC_JACK_JDSRC(soc_sdw_quirk));if (soc_sdw_quirk &ASOC_SDW_ACP_DMIC )dev_dbg (dev,"quirk SOC_SDW_ACP_DMIC enabled\n" ); +if (soc_sdw_quirk &ASOC_SDW_CODEC_SPKR ) +dev_dbg (dev,"quirk ASOC_SDW_CODEC_SPKR enabled\n" ); }static int soc_sdw_quirk_cb (const struct dmi_system_id *id)
@@ -45,6 +47,38 @@ static const struct dmi_system_id soc_sdw_quirk_table[] = { }, .driver_data = (void *)RT711_JD2, }, + { + .callback = soc_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0D80"), + }, + .driver_data = (void *)(ASOC_SDW_CODEC_SPKR), + }, + { + .callback = soc_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0D81"), + }, + .driver_data = (void *)(ASOC_SDW_CODEC_SPKR), + }, + { + .callback = soc_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0D82"), + }, + .driver_data = (void *)(ASOC_SDW_CODEC_SPKR), + }, + { + .callback = soc_sdw_quirk_cb, + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc"), + DMI_EXACT_MATCH(DMI_PRODUCT_SKU, "0D83"), + }, + .driver_data = (void *)(ASOC_SDW_CODEC_SPKR), + }, {} };
sound/soc/amd/acp/soc_amd_sdw_common.h +1 -0
@@ -22,6 +22,7 @@#define SOC_JACK_JDSRC (quirk) ((quirk) & GENMASK(3, 0))#define ASOC_SDW_FOUR_SPK BIT(4)#define ASOC_SDW_ACP_DMIC BIT(5) +#define ASOC_SDW_CODEC_SPKR BIT(15)#define AMD_SDW0 0#define AMD_SDW1 1
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 73/414 ALSA: hda: intel: Fix Optimus when GPU has no sound
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxim Mikityanskiy <[email protected]>
[ Upstream commit 2b360ba9a4936486380bc30d1eabceb40a714d98 ]
quirk_nvidia_hda() forcefully enables HDA controller on all NVIDIA GPUs, because some buggy BIOSes leave it disabled. However, some dual-GPU laptops do not have a functional HDA controller in DGPU, and BIOS disables it on purpose. After quirk_nvidia_hda() reenables this dummy HDA controller, attempting to probe it fails at azx_first_init(), which is too late to cancel the probe, as it happens in azx_probe_continue().
The sna_hda_intel driver calls azx_free() and stops the chip, however, it stays probed, and from the runtime PM point of view, the device remains active (it was set as active by the PCI subsystem on probe). It prevents vga_switcheroo from turning off the DGPU, because pci_create_device_link() syncs power management for video and audio devices.
Affected devices should be added to driver_denylist to prevent them from probing early. This patch helps identify such devices by printing a warning, and also forces the device to the suspended state to allow vga_switcheroo turn off DGPU.
--- sound/pci/hda/hda_intel.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
sound/pci/hda/hda_intel.c +14 -1
@@ -1352,8 +1352,21 @@ static void azx_free(struct azx *chip)if (use_vga_switcheroo (hda)) {if (chip->disabled && hda->probe_continued)snd_hda_unlock_devices (&chip->bus); -if (hda->vga_switcheroo_registered) +if (hda->vga_switcheroo_registered) {vga_switcheroo_unregister_client (chip->pci); + +/* Some GPUs don't have sound, and azx_first_init fails, +* leaving the device probed but non-functional. As long +* as it's probed, the PCI subsystem keeps its runtime +* PM status as active. Force it to suspended (as we +* actually stop the chip) to allow GPU to suspend via +* vga_switcheroo, and print a warning. +*/ +dev_warn (&pci->dev,"GPU sound probed, but not operational: please add a quirk to driver_denylist\n" ); +pm_runtime_disable (&pci->dev); +pm_runtime_set_suspended (&pci->dev); +pm_runtime_enable (&pci->dev); + } }if (bus->chip_init) {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 74/414 ALSA: hda: intel: Add Lenovo IdeaPad Z570 to probe denylist
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxim Mikityanskiy <[email protected]>
[ Upstream commit becc794c5e46f4dfca59f2385f78d83fc9e84700 ]
Lenovo IdeaPad Z570 with NVIDIA GeForce Ge 540M doesn't have sound on the discrete GPU. The HDA controller in DGPU is disabled by BIOS, but then reenabled by quirk_nvidia_hda(). The probe fails and ends up with the "GPU sound probed, but not operational" error.
Add this laptop to DMI-based denylist to prevent probe early. DMI is used, because the audio device has zero subsystem IDs, and this entry would be too much, blocking all 540M chips:
PCI_DEVICE_SUB(0x10de, 0x0bea, 0x0000, 0x0000)
Also, this laptop comes in a variety of modifications with different NVIDIA GPUs, so the DMI check will cover them all.
--- sound/pci/hda/hda_intel.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
sound/pci/hda/hda_intel.c +29 -0
@@ -37,6 +37,7 @@#include <linux/completion.h> #include <linux/acpi.h> #include <linux/pgtable.h> +#include <linux/dmi.h> #ifdef CONFIG_X86 /* for snoop control */
@@ -2074,6 +2075,27 @@ static const struct pci_device_id driver_denylist[] = { {} }; +static struct pci_device_id driver_denylist_ideapad_z570[] = { + {PCI_DEVICE_SUB (0x10de ,0x0bea ,0x0000 ,0x0000 ) },/* NVIDIA GF108 HDA */ + {} +}; + +/* DMI-based denylist, to be used when: +* - PCI subsystem IDs are zero, impossible to distinguish from valid sound cards. +* - Different modifications of the same laptop use different GPU models. +*/ +static const struct dmi_system_id driver_denylist_dmi[] = { + { +/* No HDA in NVIDIA DGPU. BIOS disables it, but quirk_nvidia_hda() reenables. */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"LENOVO" ), +DMI_MATCH (DMI_PRODUCT_VERSION ,"Ideapad Z570" ), + }, + .driver_data = &driver_denylist_ideapad_z570, + }, + {} +}; +static const struct hda_controller_ops pci_hda_ops = { .disable_msi_reset_irq = disable_msi_reset_irq, .position_check = azx_position_check,
@@ -2084,6 +2106,7 @@ static DECLARE_BITMAP(probed_devs, SNDRV_CARDS);static int azx_probe (struct pci_dev *pci,const struct pci_device_id *pci_id) { +const struct dmi_system_id *dmi;struct snd_card *card;struct hda_intel *hda;struct azx *chip;
@@ -2096,6 +2119,12 @@ static int azx_probe(struct pci_dev *pci,return -ENODEV ; } + dmi =dmi_first_match (driver_denylist_dmi); +if (dmi &&pci_match_id (dmi->driver_data, pci)) { +dev_info (&pci->dev,"Skipping the device on the DMI denylist\n" ); +return -ENODEV ; + } + dev =find_first_zero_bit (probed_devs,SNDRV_CARDS );if (dev >=SNDRV_CARDS )return -ENODEV ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 75/414 ASoC: fsl_audmix: register card device depends on dais property
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shengjiu Wang <[email protected]>
[ Upstream commit 294a60e5e9830045c161181286d44ce669f88833 ]
In order to make the audmix device linked by audio graph card, make 'dais' property to be optional.
If 'dais' property exists, then register the imx-audmix card driver. otherwise, it should be linked by audio graph card.
--- sound/soc/fsl/fsl_audmix.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
sound/soc/fsl/fsl_audmix.c +11 -5
@@ -488,11 +488,17 @@ static int fsl_audmix_probe(struct platform_device *pdev) goto err_disable_pm; } - priv->pdev =platform_device_register_data (dev,"imx-audmix" ,0 ,NULL ,0 ); -if (IS_ERR (priv->pdev)) { - ret =PTR_ERR (priv->pdev); -dev_err (dev,"failed to register platform: %d\n" , ret); - goto err_disable_pm; +/* +* If dais property exist, then register the imx-audmix card driver. +* otherwise, it should be linked by audio graph card. +*/ +if (of_find_property (pdev->dev.of_node,"dais" ,NULL )) { + priv->pdev =platform_device_register_data (dev,"imx-audmix" ,0 ,NULL ,0 ); +if (IS_ERR (priv->pdev)) { + ret =PTR_ERR (priv->pdev); +dev_err (dev,"failed to register platform: %d\n" , ret); + goto err_disable_pm; + } }return 0 ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 49/414 x86/ia32: Leave NULL selector values 0~3 unchanged
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xin Li (Intel) <[email protected]>
[ Upstream commit ad546940b5991d3e141238cd80a6d1894b767184 ]
The first GDT descriptor is reserved as 'NULL descriptor'. As bits 0 and 1 of a segment selector, i.e., the RPL bits, are NOT used to index GDT, selector values 0~3 all point to the NULL descriptor, thus values 0, 1, 2 and 3 are all valid NULL selector values.
When a NULL selector value is to be loaded into a segment register, reload_segments() sets its RPL bits. Later IRET zeros ES, FS, GS, and DS segment registers if any of them is found to have any nonzero NULL selector value. The two operations offset each other to actually effect a nop.
Besides, zeroing of RPL in NULL selector values is an information leak in pre-FRED systems as userspace can spot any interrupt/exception by loading a nonzero NULL selector, and waiting for it to become zero. But there is nothing software can do to prevent it before FRED.
ERETU, the only legit instruction to return to userspace from kernel under FRED, by design does NOT zero any segment register to avoid this problem behavior.
As such, leave NULL selector values 0~3 unchanged and close the leak.
Do the same on 32-bit kernel as well.
--- arch/x86/kernel/signal_32.c | 62 +++++++++++++++++++++++++------------ 1 file changed, 43 insertions(+), 19 deletions(-)
arch/x86/kernel/signal_32.c +43 -19
@@ -33,25 +33,55 @@#include <asm/smap.h> #include <asm/gsseg.h> +/* +* The first GDT descriptor is reserved as 'NULL descriptor'. As bits 0 +* and 1 of a segment selector, i.e., the RPL bits, are NOT used to index +* GDT, selector values 0~3 all point to the NULL descriptor, thus values +* 0, 1, 2 and 3 are all valid NULL selector values. +* +* However IRET zeros ES, FS, GS, and DS segment registers if any of them +* is found to have any nonzero NULL selector value, which can be used by +* userspace in pre-FRED systems to spot any interrupt/exception by loading +* a nonzero NULL selector and waiting for it to become zero. Before FRED +* there was nothing software could do to prevent such an information leak. +* +* ERETU, the only legit instruction to return to userspace from kernel +* under FRED, by design does NOT zero any segment register to avoid this +* problem behavior. +* +* As such, leave NULL selector values 0~3 unchanged. +*/ +static inline u16 fixup_rpl (u16 sel) +{ +return sel <=3 ? sel : sel |3 ; +} +#ifdef CONFIG_IA32_EMULATION #include <asm/unistd_32_ia32.h> static inline void reload_segments (struct sigcontext_32 *sc) { -unsigned int cur; +u16 cur; +/* +* Reload fs and gs if they have changed in the signal +* handler. This does not handle long fs/gs base changes in +* the handler, but does not clobber them at least in the +* normal case. +*/ savesegment (gs, cur); -if ((sc->gs |0x03 ) != cur) -load_gs_index (sc->gs |0x03 ); +if (fixup_rpl (sc->gs) != cur) +load_gs_index (fixup_rpl (sc->gs));savesegment (fs, cur); -if ((sc->fs |0x03 ) != cur) -loadsegment (fs, sc->fs |0x03 ); +if (fixup_rpl (sc->fs) != cur) +loadsegment (fs,fixup_rpl (sc->fs)); +savesegment (ds, cur); -if ((sc->ds |0x03 ) != cur) -loadsegment (ds, sc->ds |0x03 ); +if (fixup_rpl (sc->ds) != cur) +loadsegment (ds,fixup_rpl (sc->ds));savesegment (es, cur); -if ((sc->es |0x03 ) != cur) -loadsegment (es, sc->es |0x03 ); +if (fixup_rpl (sc->es) != cur) +loadsegment (es,fixup_rpl (sc->es)); }#define sigset32_t compat_sigset_t
@@ -105,18 +135,12 @@ static bool ia32_restore_sigcontext(struct pt_regs *regs, regs->orig_ax =-1 ;#ifdef CONFIG_IA32_EMULATION -/* -* Reload fs and gs if they have changed in the signal -* handler. This does not handle long fs/gs base changes in -* the handler, but does not clobber them at least in the -* normal case. -*/ reload_segments (&sc);#else -loadsegment (gs, sc.gs); - regs->fs = sc.fs; - regs->es = sc.es; - regs->ds = sc.ds; +loadsegment (gs,fixup_rpl (sc.gs)); + regs->fs =fixup_rpl (sc.fs); + regs->es =fixup_rpl (sc.es); + regs->ds =fixup_rpl (sc.ds);#endif return fpu__restore_sig (compat_ptr (sc.fpstate),1 );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 76/414 media: uvcvideo: Add quirk for Actions UVC05
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit 8c54e58f94ed3ff28643aefd2c0c2c98313ee770 ]
Actions UVC05 is a HDMI to USB dongle that implements the UVC protocol.
When the device suspends, its firmware seems to enter a weird mode when it does not produce more frames.
Add the device to the quirk list to disable autosuspend.
Bus 001 Device 007: ID 1de1:f105 Actions Microelectronics Co. Display
capture-UVC05
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2 [unknown]
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 64
idVendor 0x1de1 Actions Microelectronics Co.
idProduct 0xf105 Display capture-UVC05
bcdDevice 4.09
iManufacturer 1 Actions Micro iProduct 2 Display capture-UVC05 iSerial 3 -1005308387 bNumConfigurations 1
--- drivers/media/usb/uvc/uvc_driver.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +9 -0
@@ -3030,6 +3030,15 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceProtocol = 0, .driver_info =UVC_INFO_QUIRK (UVC_QUIRK_PROBE_MINMAX | UVC_QUIRK_IGNORE_SELECTOR_UNIT) }, + /* Actions Microelectronics Co. Display capture-UVC05 */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x1de1, + .idProduct = 0xf105, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_DISABLE_AUTOSUSPEND) }, /* NXP Semiconductors IR VIDEO */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 77/414 media: s5p-mfc: Corrected NV12M/NV21M plane-sizes
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aakarsh Jain <[email protected]>
[ Upstream commit 7d0d0b2342bebc47a46499cdf21257ed1e58c4aa ]
There is a possibility of getting page fault if the overall buffer size is not aligned to 256bytes. Since MFC does read operation only and it won't corrupt the data values even if it reads the extra bytes.
Corrected luma and chroma plane sizes for V4L2_PIX_FMT_NV12M and V4L2_PIX_FMT_NV21M pixel format.
--- drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/platform/samsung/s5p-mfc/s5p_mfc_opr_v6.c +3 -2
@@ -549,8 +549,9 @@ static void s5p_mfc_enc_calc_src_size_v6(struct s5p_mfc_ctx *ctx)case V4L2_PIX_FMT_NV21M : ctx->stride[0 ] =ALIGN (ctx->img_width,S5P_FIMV_NV12M_HALIGN_V6 ); ctx->stride[1 ] =ALIGN (ctx->img_width,S5P_FIMV_NV12M_HALIGN_V6 ); - ctx->luma_size = ctx->stride[0 ] *ALIGN (ctx->img_height,16 ); - ctx->chroma_size = ctx->stride[0 ] *ALIGN (ctx->img_height /2 ,16 ); + ctx->luma_size =ALIGN (ctx->stride[0 ] *ALIGN (ctx->img_height,16 ),256 ); + ctx->chroma_size =ALIGN (ctx->stride[0 ] *ALIGN (ctx->img_height /2 ,16 ), +256 );break ;case V4L2_PIX_FMT_YUV420M :case V4L2_PIX_FMT_YVU420M :
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 50/414 x86/cpu: Dont clear X86_FEATURE_LAHF_LM flag in init_amd_k8() on AMD when running in a virtual machine
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Grobecker <[email protected]>
[ Upstream commit a4248ee16f411ac1ea7dfab228a6659b111e3d65 ]
When running in a virtual machine, we might see the original hardware CPU vendor string (i.e. "AuthenticAMD"), but a model and family ID set by the hypervisor. In case we run on AMD hardware and the hypervisor sets a model ID < 0x14, the LAHF cpu feature is eliminated from the the list of CPU capabilities present to circumvent a bug with some BIOSes in conjunction with AMD K8 processors.
Parsing the flags list from /proc/cpuinfo seems to be happening mostly in bash scripts and prebuilt Docker containers, as it does not need to have additionals tools present – even though more reliable ways like using "kcpuid", which calls the CPUID instruction instead of parsing a list, should be preferred. Scripts, that use /proc/cpuinfo to determine if the current CPU is "compliant" with defined microarchitecture levels like x86-64-v2 will falsely claim the CPU is incapable of modern CPU instructions when "lahf_lm" is missing in that flags list.
This can prevent some docker containers from starting or build scripts to create unoptimized binaries.
Admittably, this is more a small inconvenience than a severe bug in the kernel and the shoddy scripts that rely on parsing /proc/cpuinfo
should be fixed instead.
This patch adds an additional check to see if we're running inside a virtual machine (X86_FEATURE_HYPERVISOR is present), which, to my understanding, can't be present on a real K8 processor as it was introduced only with the later/other Athlon64 models.
Example output with the "lahf_lm" flag missing in the flags list (should be shown between "hypervisor" and "abm"):
$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 15
model : 6
model name : Common KVM processor
stepping : 1
microcode : 0x1000065
cpu MHz : 2599.998
cache size : 512 KB
physical id : 0
siblings : 1
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca
cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx rdtscp
lm rep_good nopl cpuid extd_apicid tsc_known_freq pni
pclmulqdq ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt
tsc_deadline_timer aes xsave avx f16c hypervisor abm
3dnowprefetch vmmcall bmi1 avx2 bmi2 xsaveopt... while kcpuid shows the feature to be present in the CPU:
# kcpuid -d | grep lahf
lahf_lm - LAHF/SAHF available in 64-bit mode[ mingo: Updated the comment a bit, incorporated Boris's review feedback. ]
--- arch/x86/kernel/cpu/amd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/amd.c +1 -1
@@ -627,7 +627,7 @@ static void init_amd_k8(struct cpuinfo_x86 *c)* (model = 0x14) and later actually support it. * (AMD Erratum #110, docId: 25759). */ -if (c->x86_model <0x14 &&cpu_has (c,X86_FEATURE_LAHF_LM )) { +if (c->x86_model <0x14 &&cpu_has (c,X86_FEATURE_LAHF_LM ) && !cpu_has (c,X86_FEATURE_HYPERVISOR )) {clear_cpu_cap (c,X86_FEATURE_LAHF_LM );if (!rdmsrl_amd_safe (0xc001100d , &value)) { value &= ~BIT_64 (32 );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 51/414 perf: arm_pmu: Dont disable counter in armpmu_add()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mark Rutland <[email protected]>
[ Upstream commit dcca27bc1eccb9abc2552aab950b18a9742fb8e7 ]
Currently armpmu_add() tries to handle a newly-allocated counter having a stale associated event, but this should not be possible, and if this were to happen the current mitigation is insufficient and potentially expensive. It would be better to warn if we encounter the impossible case.
Calls to pmu::add() and pmu::del() are serialized by the core perf code, and armpmu_del() clears the relevant slot in pmu_hw_events::events[] before clearing the bit in pmu_hw_events::used_mask such that the counter can be reallocated. Thus when armpmu_add() allocates a counter index from pmu_hw_events::used_mask, it should not be possible to observe a stale even in pmu_hw_events::events[] unless either pmu_hw_events::used_mask or pmu_hw_events::events[] have been corrupted.
If this were to happen, we'd end up with two events with the same event->hw.idx, which would clash with each other during reprogramming, deletion, etc, and produce bogus results. Add a WARN_ON_ONCE() for this case so that we can detect if this ever occurs in practice.
That possiblity aside, there's no need to call arm_pmu::disable(event) for the new event. The PMU reset code initialises the counter in a disabled state, and armpmu_del() will disable the counter before it can be reused. Remove the redundant disable.
--- drivers/perf/arm_pmu.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/perf/arm_pmu.c +3 -5
@@ -342,12 +342,10 @@ armpmu_add(struct perf_event *event, int flags)if (idx <0 )return idx; -/* -* If there is an event in the counter we are going to use then make -* sure it is disabled. -*/ +/* The newly-allocated counter should be empty */ +WARN_ON_ONCE (hw_events->events[idx]); + event->hw.idx = idx; - armpmu->disable (event); hw_events->events[idx] = event; hwc->state =PERF_HES_STOPPED |PERF_HES_UPTODATE ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 52/414 perf/dwc_pcie: fix some unreleased resources
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yunhui Cui <[email protected]>
[ Upstream commit 6eb1e8ef586ac4a3dcdc20248f9cb45e4ceb141f ]
Release leaked resources, such as plat_dev and dev_info.
--- drivers/perf/dwc_pcie_pmu.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-)
drivers/perf/dwc_pcie_pmu.c +22 -11
@@ -567,8 +567,10 @@ static int dwc_pcie_register_dev(struct pci_dev *pdev)return PTR_ERR (plat_dev); dev_info =kzalloc (sizeof (*dev_info),GFP_KERNEL ); -if (!dev_info) +if (!dev_info) { +platform_device_unregister (plat_dev);return -ENOMEM ; + }/* Cache platform device to handle pci device hotplug */ dev_info->plat_dev = plat_dev;
@@ -724,6 +726,15 @@ static struct platform_driver dwc_pcie_pmu_driver = { .driver = {.name = "dwc_pcie_pmu",}, }; +static void dwc_pcie_cleanup_devices (void ) +{ +struct dwc_pcie_dev_info *dev_info, *tmp; + +list_for_each_entry_safe (dev_info, tmp, &dwc_pcie_dev_info_head, dev_node) { +dwc_pcie_unregister_dev (dev_info); + } +} +static int __init dwc_pcie_pmu_init (void ) {struct pci_dev *pdev =NULL ;
@@ -736,7 +747,7 @@ static int __init dwc_pcie_pmu_init(void) ret =dwc_pcie_register_dev (pdev);if (ret) {pci_dev_put (pdev); -return ret; + goto err_cleanup; } }
@@ -745,35 +756,35 @@ static int __init dwc_pcie_pmu_init(void) dwc_pcie_pmu_online_cpu, dwc_pcie_pmu_offline_cpu);if (ret <0 ) -return ret; + goto err_cleanup; dwc_pcie_pmu_hp_state = ret; ret =platform_driver_register (&dwc_pcie_pmu_driver);if (ret) - goto platform_driver_register_err; + goto err_remove_cpuhp; ret =bus_register_notifier (&pci_bus_type, &dwc_pcie_pmu_nb);if (ret) - goto platform_driver_register_err; + goto err_unregister_driver; notify = true;return 0 ; -platform_driver_register_err: +err_unregister_driver: +platform_driver_unregister (&dwc_pcie_pmu_driver); +err_remove_cpuhp:cpuhp_remove_multi_state (dwc_pcie_pmu_hp_state); - +err_cleanup: +dwc_pcie_cleanup_devices ();return ret; } static void __exit dwc_pcie_pmu_exit(void) { -struct dwc_pcie_dev_info *dev_info, *tmp; -if (notify)bus_unregister_notifier (&pci_bus_type, &dwc_pcie_pmu_nb); -list_for_each_entry_safe (dev_info, tmp, &dwc_pcie_dev_info_head, dev_node) -dwc_pcie_unregister_dev (dev_info); +dwc_pcie_cleanup_devices ();platform_driver_unregister (&dwc_pcie_pmu_driver);cpuhp_remove_multi_state (dwc_pcie_pmu_hp_state); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 53/414 PM: hibernate: Avoid deadlock in hibernate_compressor_param_set()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lizhi Xu <[email protected]>
[ Upstream commit 52323ed1444ea5c2a5f1754ea0a2d9c8c216ccdf ]
syzbot reported a deadlock in lock_system_sleep() (see below).
The write operation to "/sys/module/hibernate/parameters/compressor" conflicts with the registration of ieee80211 device, resulting in a deadlock when attempting to acquire system_transition_mutex under param_lock.
To avoid this deadlock, change hibernate_compressor_param_set() to use mutex_trylock() for attempting to acquire system_transition_mutex and return -EBUSY when it fails.
Task flags need not be saved or adjusted before calling mutex_trylock(&system_transition_mutex) because the caller is not going to end up waiting for this mutex and if it runs concurrently with system suspend in progress, it will be frozen properly when it returns to user space.
syzbot report:
syz-executor895/5833 is trying to acquire lock:ffffffff8e0828c8 (system_transition_mutex){+.+.}-{4:4}, at: lock_system_sleep+0x87/0xa0 kernel/power/main.c:56
but task is already holding lock:ffffffff8e07dc68 (param_lock){+.+.}-{4:4}, at: kernel_param_lock kernel/params.c:607 [inline] ffffffff8e07dc68 (param_lock){+.+.}-{4:4}, at: param_attr_store+0xe6/0x300 kernel/params.c:586
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #3 (param_lock){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:585 [inline]
__mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
ieee80211_rate_control_ops_get net/mac80211/rate.c:220 [inline]
rate_control_alloc net/mac80211/rate.c:266 [inline]
ieee80211_init_rate_ctrl_alg+0x18d/0x6b0 net/mac80211/rate.c:1015
ieee80211_register_hw+0x20cd/0x4060 net/mac80211/main.c:1531
mac80211_hwsim_new_radio+0x304e/0x54e0 drivers/net/wireless/virtual/mac80211_hwsim.c:5558
init_mac80211_hwsim+0x432/0x8c0 drivers/net/wireless/virtual/mac80211_hwsim.c:6910
do_one_initcall+0x128/0x700 init/main.c:1257
do_initcall_level init/main.c:1319 [inline]
do_initcalls init/main.c:1335 [inline]
do_basic_setup init/main.c:1354 [inline]
kernel_init_freeable+0x5c7/0x900 init/main.c:1568
kernel_init+0x1c/0x2b0 init/main.c:1457
ret_from_fork+0x45/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244-> #2 (rtnl_mutex){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:585 [inline]
__mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
wg_pm_notification drivers/net/wireguard/device.c:80 [inline]
wg_pm_notification+0x49/0x180 drivers/net/wireguard/device.c:64
notifier_call_chain+0xb7/0x410 kernel/notifier.c:85
notifier_call_chain_robust kernel/notifier.c:120 [inline]
blocking_notifier_call_chain_robust kernel/notifier.c:345 [inline]
blocking_notifier_call_chain_robust+0xc9/0x170 kernel/notifier.c:333
pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102
snapshot_open+0x189/0x2b0 kernel/power/user.c:77
misc_open+0x35a/0x420 drivers/char/misc.c:179
chrdev_open+0x237/0x6a0 fs/char_dev.c:414
do_dentry_open+0x735/0x1c40 fs/open.c:956
vfs_open+0x82/0x3f0 fs/open.c:1086
do_open fs/namei.c:3830 [inline]
path_openat+0x1e88/0x2d80 fs/namei.c:3989
do_filp_open+0x20c/0x470 fs/namei.c:4016
do_sys_openat2+0x17a/0x1e0 fs/open.c:1428
do_sys_open fs/open.c:1443 [inline]
__do_sys_openat fs/open.c:1459 [inline]
__se_sys_openat fs/open.c:1454 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1454
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f-> #1 ((pm_chain_head).rwsem){++++}-{4:4}:
down_read+0x9a/0x330 kernel/locking/rwsem.c:1524
blocking_notifier_call_chain_robust kernel/notifier.c:344 [inline]
blocking_notifier_call_chain_robust+0xa9/0x170 kernel/notifier.c:333
pm_notifier_call_chain_robust+0x27/0x60 kernel/power/main.c:102
snapshot_open+0x189/0x2b0 kernel/power/user.c:77
misc_open+0x35a/0x420 drivers/char/misc.c:179
chrdev_open+0x237/0x6a0 fs/char_dev.c:414
do_dentry_open+0x735/0x1c40 fs/open.c:956
vfs_open+0x82/0x3f0 fs/open.c:1086
do_open fs/namei.c:3830 [inline]
path_openat+0x1e88/0x2d80 fs/namei.c:3989
do_filp_open+0x20c/0x470 fs/namei.c:4016
do_sys_openat2+0x17a/0x1e0 fs/open.c:1428
do_sys_open fs/open.c:1443 [inline]
__do_sys_openat fs/open.c:1459 [inline]
__se_sys_openat fs/open.c:1454 [inline]
__x64_sys_openat+0x175/0x210 fs/open.c:1454
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7f-> #0 (system_transition_mutex){+.+.}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3163 [inline]
check_prevs_add kernel/locking/lockdep.c:3282 [inline]
validate_chain kernel/locking/lockdep.c:3906 [inline]
__lock_acquire+0x249e/0x3c40 kernel/locking/lockdep.c:5228
lock_acquire.part.0+0x11b/0x380 kernel/locking/lockdep.c:5851
__mutex_lock_common kernel/locking/mutex.c:585 [inline]
__mutex_lock+0x19b/0xb10 kernel/locking/mutex.c:730
lock_system_sleep+0x87/0xa0 kernel/power/main.c:56
hibernate_compressor_param_set+0x1c/0x210 kernel/power/hibernate.c:1452
param_attr_store+0x18f/0x300 kernel/params.c:588
module_attr_store+0x55/0x80 kernel/params.c:924
sysfs_kf_write+0x117/0x170 fs/sysfs/file.c:139
kernfs_fop_write_iter+0x33d/0x500 fs/kernfs/file.c:334
new_sync_write fs/read_write.c:586 [inline]
vfs_write+0x5ae/0x1150 fs/read_write.c:679
ksys_write+0x12b/0x250 fs/read_write.c:731
do_syscall_x64 arch/x86/entry/common.c:52 [inline]
do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83
entry_SYSCALL_64_after_hwframe+0x77/0x7fother info that might help us debug this:
Chain exists of: system_transition_mutex --> rtnl_mutex --> param_lock Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(param_lock);
lock(rtnl_mutex);
lock(param_lock); lock(system_transition_mutex);
*** DEADLOCK ***
--- kernel/power/hibernate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
kernel/power/hibernate.c +3 -3
@@ -1446,10 +1446,10 @@ static const char * const comp_alg_enabled[] = {static int hibernate_compressor_param_set (const char *compressor,const struct kernel_param *kp) { -unsigned int sleep_flags;int index, ret; - sleep_flags =lock_system_sleep (); +if (!mutex_trylock (&system_transition_mutex)) +return -EBUSY ; index =sysfs_match_string (comp_alg_enabled, compressor);if (index >=0 ) {
@@ -1461,7 +1461,7 @@ static int hibernate_compressor_param_set(const char *compressor, ret = index; } -unlock_system_sleep (sleep_flags); +mutex_unlock (&system_transition_mutex);if (ret) pr_debug("Cannot set specified compressor %s\n",
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 54/414 Flush console log from kernel_power_off()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul E. McKenney <[email protected]>
[ Upstream commit 6ea9a1781c70a8be1fcdc49134fc1bf4baba8bca ]
Kernels built with CONFIG_PREEMPT_RT=y can lose significant console output and shutdown time, which hides shutdown-time RCU issues from rcutorture. Therefore, make pr_flush() public and invoke it after then last print in kernel_power_off().
[ paulmck: Apply John Ogness feedback. ]
[ paulmck: Appy Sebastian Andrzej Siewior feedback. ] [ paulmck: Apply kernel test robot feedback. ]
--- include/linux/printk.h | 6 ++++++ kernel/printk/printk.c | 4 +--- kernel/reboot.c | 1 + 3 files changed, 8 insertions(+), 3 deletions(-)
include/linux/printk.h +6 -0
@@ -207,6 +207,7 @@ void printk_legacy_allow_panic_sync(void);extern bool nbcon_device_try_acquire (struct console *con);extern void nbcon_device_release (struct console *con);void nbcon_atomic_flush_unsafe (void ); +bool pr_flush (int timeout_ms,bool reset_on_progress);#else static inline __printf(1, 0) int vprintk(const char *s, va_list args)
@@ -315,6 +316,11 @@ static inline void nbcon_atomic_flush_unsafe(void) { } +static inline bool pr_flush (int timeout_ms,bool reset_on_progress) +{ +return true; +} +#endif bool this_cpu_in_panic (void );
kernel/printk/printk.c +1 -3
@@ -2461,7 +2461,6 @@ asmlinkage __visible int _printk(const char *fmt, ...) }EXPORT_SYMBOL (_printk); -static bool pr_flush (int timeout_ms,bool reset_on_progress);static bool __pr_flush (struct console *con,int timeout_ms,bool reset_on_progress);#else /* CONFIG_PRINTK */
@@ -2474,7 +2473,6 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progrestatic u64 syslog_seq; -static bool pr_flush (int timeout_ms,bool reset_on_progress) {return true; }static bool __pr_flush (struct console *con,int timeout_ms,bool reset_on_progress) {return true; }#endif /* CONFIG_PRINTK */
@@ -4466,7 +4464,7 @@ static bool __pr_flush(struct console *con, int timeout_ms, bool reset_on_progre* Context: Process context. May sleep while acquiring console lock. * Return: true if all usable printers are caught up. */ -static bool pr_flush (int timeout_ms,bool reset_on_progress) +bool pr_flush (int timeout_ms,bool reset_on_progress) {return __pr_flush (NULL , timeout_ms, reset_on_progress); }
kernel/reboot.c +1 -0
@@ -704,6 +704,7 @@ void kernel_power_off(void)migrate_to_reboot_cpu ();syscore_shutdown ();pr_emerg ("Power down\n" ); +pr_flush (1000 , true);kmsg_dump (KMSG_DUMP_SHUTDOWN );machine_power_off (); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 55/414 arm64: cputype: Add QCOM_CPU_PART_KRYO_3XX_GOLD
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 401c3333bb2396aa52e4121887a6f6a6e2f040bc ]
Add a definition for the Qualcomm Kryo 300-series Gold cores.
--- arch/arm64/include/asm/cputype.h | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/include/asm/cputype.h +2 -0
@@ -119,6 +119,7 @@#define QCOM_CPU_PART_KRYO 0x200#define QCOM_CPU_PART_KRYO_2XX_GOLD 0x800#define QCOM_CPU_PART_KRYO_2XX_SILVER 0x801 +#define QCOM_CPU_PART_KRYO_3XX_GOLD 0x802#define QCOM_CPU_PART_KRYO_3XX_SILVER 0x803#define QCOM_CPU_PART_KRYO_4XX_GOLD 0x804#define QCOM_CPU_PART_KRYO_4XX_SILVER 0x805
@@ -195,6 +196,7 @@#define MIDR_QCOM_KRYO MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO)#define MIDR_QCOM_KRYO_2XX_GOLD MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_2XX_GOLD)#define MIDR_QCOM_KRYO_2XX_SILVER MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_2XX_SILVER) +#define MIDR_QCOM_KRYO_3XX_GOLD MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_3XX_GOLD)#define MIDR_QCOM_KRYO_3XX_SILVER MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_3XX_SILVER)#define MIDR_QCOM_KRYO_4XX_GOLD MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_4XX_GOLD)#define MIDR_QCOM_KRYO_4XX_SILVER MIDR_CPU_MODEL(ARM_CPU_IMP_QCOM, QCOM_CPU_PART_KRYO_4XX_SILVER)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 46/414 irqchip/gic-v3: Add Rockchip 3568002 erratum workaround
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Osipenko <[email protected]>
[ Upstream commit 2d81e1bb625238d40a686ed909ff3e1abab7556a ]
Rockchip RK3566/RK3568 GIC600 integration has DDR addressing limited to the first 32bit of physical address space. Rockchip assigned Erratum ID #3568002 for this issue. Add driver quirk for this Rockchip GIC Erratum.
Note, that the 0x0201743b GIC600 ID is not Rockchip-specific and is common for many ARM GICv3 implementations. Hence, there is an extra of_machine_is_compatible() check.
--- Documentation/arch/arm64/silicon-errata.rst | 2 ++ arch/arm64/Kconfig | 9 ++++++++ drivers/irqchip/irq-gic-v3-its.c | 23 ++++++++++++++++++++- 3 files changed, 33 insertions(+), 1 deletion(-)
Documentation/arch/arm64/silicon-errata.rst +2 -0
@@ -283,6 +283,8 @@ stable kernels. +----------------+-----------------+-----------------+-----------------------------+ | Rockchip | RK3588 | #3588001 | ROCKCHIP_ERRATUM_3588001 | +----------------+-----------------+-----------------+-----------------------------+ +| Rockchip | RK3568 | #3568002 | ROCKCHIP_ERRATUM_3568002 | ++----------------+-----------------+-----------------+-----------------------------+ +----------------+-----------------+-----------------+-----------------------------+ | Fujitsu | A64FX | E#010001 | FUJITSU_ERRATUM_010001 | +----------------+-----------------+-----------------+-----------------------------+
arch/arm64/Kconfig +9 -0
@@ -1298,6 +1298,15 @@ config NVIDIA_CARMEL_CNP_ERRATUM If unsure, say Y. +config ROCKCHIP_ERRATUM_3568002 + bool "Rockchip 3568002: GIC600 can not access physical addresses higher than 4GB" + default y + help + The Rockchip RK3566 and RK3568 GIC600 SoC integrations have AXI + addressing limited to the first 32bit of physical address space. + + If unsure, say Y. + config ROCKCHIP_ERRATUM_3588001 bool "Rockchip 3588001: GIC600 can not support shareability attributes" default y
drivers/irqchip/irq-gic-v3-its.c +22 -1
@@ -205,13 +205,15 @@ static DEFINE_IDA(its_vpeid_ida);#define gic_data_rdist_rd_base () (gic_data_rdist()->rd_base)#define gic_data_rdist_vlpi_base () (gic_data_rdist_rd_base() + SZ_128K) +static gfp_t gfp_flags_quirk; +static struct page *its_alloc_pages_node (int node,gfp_t gfp,unsigned int order) {struct page *page;int ret =0 ; - page =alloc_pages_node (node, gfp, order); + page =alloc_pages_node (node, gfp | gfp_flags_quirk, order);if (!page)return NULL ;
@@ -4887,6 +4889,17 @@ static bool __maybe_unused its_enable_quirk_hip09_162100801(void *data)return true; } +static bool __maybe_unused its_enable_rk3568002 (void *data) +{ +if (!of_machine_is_compatible ("rockchip,rk3566" ) && + !of_machine_is_compatible ("rockchip,rk3568" )) +return false; + + gfp_flags_quirk |=GFP_DMA32 ; + +return true; +} + static const struct gic_quirk its_quirks[] = { #ifdef CONFIG_CAVIUM_ERRATUM_22375 {
@@ -4954,6 +4967,14 @@ static const struct gic_quirk its_quirks[] = { .property = "dma-noncoherent", .init = its_set_non_coherent, }, +#ifdef CONFIG_ROCKCHIP_ERRATUM_3568002 + { + .desc = "ITS: Rockchip erratum RK3568002", + .iidr = 0x0201743b, + .mask = 0xffffffff, + .init = its_enable_rk3568002, + }, +#endif { } };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 79/414 ALSA: usb-audio: Fix CME quirk for UF series keyboards
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricard Wanderlof <[email protected]>
[ Upstream commit c2820405ba55a38932aa2177f026b70064296663 ]
Fix quirk for CME master keyboards so it not only handles sysex but also song position pointer, MIDI timing clock, start and stop messages, and active sensing. All of these can be output by the CME UF series master keyboards.
Tested with a CME UF6 in a desktop Linux environment as well as on the Zynthian Raspberry Pi based platform.
--- sound/usb/midi.c | 80 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 6 deletions(-)
sound/usb/midi.c +74 -6
@@ -489,16 +489,84 @@ static void ch345_broken_sysex_input(struct snd_usb_midi_in_endpoint *ep,/* * CME protocol: like the standard protocol, but SysEx commands are sent as a -* single USB packet preceded by a 0x0F byte. +* single USB packet preceded by a 0x0F byte, as are system realtime +* messages and MIDI Active Sensing. +* Also, multiple messages can be sent in the same packet. */ static void snd_usbmidi_cme_input (struct snd_usb_midi_in_endpoint *ep,uint8_t *buffer,int buffer_length) { -if (buffer_length <2 || (buffer[0 ] &0x0f ) !=0x0f ) -snd_usbmidi_standard_input (ep, buffer, buffer_length); -else -snd_usbmidi_input_data (ep, buffer[0 ] >>4 , - &buffer[1 ], buffer_length -1 ); +int remaining = buffer_length; + +/* +* CME send sysex, song position pointer, system realtime +* and active sensing using CIN 0x0f, which in the standard +* is only intended for single byte unparsed data. +* So we need to interpret these here before sending them on. +* By default, we assume single byte data, which is true +* for system realtime (midi clock, start, stop and continue) +* and active sensing, and handle the other (known) cases +* separately. +* In contrast to the standard, CME does not split sysex +* into multiple 4-byte packets, but lumps everything together +* into one. In addition, CME can string multiple messages +* together in the same packet; pressing the Record button +* on an UF6 sends a sysex message directly followed +* by a song position pointer in the same packet. +* For it to have any reasonable meaning, a sysex message +* needs to be at least 3 bytes in length (0xf0, id, 0xf7), +* corresponding to a packet size of 4 bytes, and the ones sent +* by CME devices are 6 or 7 bytes, making the packet fragments +* 7 or 8 bytes long (six or seven bytes plus preceding CN+CIN byte). +* For the other types, the packet size is always 4 bytes, +* as per the standard, with the data size being 3 for SPP +* and 1 for the others. +* Thus all packet fragments are at least 4 bytes long, so we can +* skip anything that is shorter; this also conveniantly skips +* packets with size 0, which CME devices continuously send when +* they have nothing better to do. +* Another quirk is that sometimes multiple messages are sent +* in the same packet. This has been observed for midi clock +* and active sensing i.e. 0x0f 0xf8 0x00 0x00 0x0f 0xfe 0x00 0x00, +* but also multiple note ons/offs, and control change together +* with MIDI clock. Similarly, some sysex messages are followed by +* the song position pointer in the same packet, and occasionally +* additionally by a midi clock or active sensing. +* We handle this by looping over all data and parsing it along the way. +*/ +while (remaining >=4 ) { +int source_length =4 ;/* default */ + +if ((buffer[0 ] &0x0f ) ==0x0f ) { +int data_length =1 ;/* default */ + +if (buffer[1 ] ==0xf0 ) { +/* Sysex: Find EOX and send on whole message. */ +/* To kick off the search, skip the first +* two bytes (CN+CIN and SYSEX (0xf0). +*/ +uint8_t *tmp_buf = buffer +2 ; +int tmp_length = remaining -2 ; + +while (tmp_length >1 && *tmp_buf !=0xf7 ) { + tmp_buf++; + tmp_length--; + } + data_length = tmp_buf - buffer; + source_length = data_length +1 ; + }else if (buffer[1 ] ==0xf2 ) { +/* Three byte song position pointer */ + data_length =3 ; + } +snd_usbmidi_input_data (ep, buffer[0 ] >>4 , + &buffer[1 ], data_length); + }else { +/* normal channel events */ +snd_usbmidi_standard_input (ep, buffer, source_length); + } + buffer += source_length; + remaining -= source_length; + } }/*
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 88/414 scsi: mpi3mr: Avoid reply queue full condition
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ranjan Kumar <[email protected]>
[ Upstream commit f08b24d82749117ce779cc66689e8594341130d3 ]
To avoid reply queue full condition, update the driver to check IOCFacts capabilities for qfull.
Update the operational reply queue's Consumer Index after processing 100 replies. If pending I/Os on a reply queue exceeds a threshold (reply_queue_depth - 200), then return I/O back to OS to retry.
Also increase default admin reply queue size to 2K.
--- drivers/scsi/mpi3mr/mpi3mr.h | 12 +++++++++++- drivers/scsi/mpi3mr/mpi3mr_app.c | 24 ++++++++++++++++++++++++ drivers/scsi/mpi3mr/mpi3mr_fw.c | 32 ++++++++++++++++++++++++++++---- 3 files changed, 63 insertions(+), 5 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +11 -1
@@ -81,13 +81,14 @@ extern atomic64_t event_counter;/* Admin queue management definitions */ #define MPI3MR_ADMIN_REQ_Q_SIZE (2 * MPI3MR_PAGE_SIZE_4K) -#define MPI3MR_ADMIN_REPLY_Q_SIZE (4 * MPI3MR_PAGE_SIZE_4K) +#define MPI3MR_ADMIN_REPLY_Q_SIZE (8 * MPI3MR_PAGE_SIZE_4K)#define MPI3MR_ADMIN_REQ_FRAME_SZ 128#define MPI3MR_ADMIN_REPLY_FRAME_SZ 16/* Operational queue management definitions */ #define MPI3MR_OP_REQ_Q_QD 512#define MPI3MR_OP_REP_Q_QD 1024 +#define MPI3MR_OP_REP_Q_QD2K 2048#define MPI3MR_OP_REP_Q_QD4K 4096#define MPI3MR_OP_REQ_Q_SEG_SIZE 4096#define MPI3MR_OP_REP_Q_SEG_SIZE 4096
@@ -329,6 +330,7 @@ enum mpi3mr_reset_reason {#define MPI3MR_RESET_REASON_OSTYPE_SHIFT 28#define MPI3MR_RESET_REASON_IOCNUM_SHIFT 20 +/* Queue type definitions */ enum queue_type {MPI3MR_DEFAULT_QUEUE =0 ,
@@ -388,6 +390,7 @@ struct mpi3mr_ioc_facts {u16 max_msix_vectors;u8 personality;u8 dma_mask; +bool max_req_limit;u8 protocol_flags;u8 sge_mod_mask;u8 sge_mod_value;
@@ -457,6 +460,8 @@ struct op_req_qinfo {* @enable_irq_poll: Flag to indicate polling is enabled * @in_use: Queue is handled by poll/ISR * @qtype: Type of queue (types defined in enum queue_type) +* @qfull_watermark: Watermark defined in reply queue to avoid +* reply queue full */ struct op_reply_qinfo {u16 ci;
@@ -472,6 +477,7 @@ struct op_reply_qinfo {bool enable_irq_poll;atomic_t in_use;enum queue_type qtype; +u16 qfull_watermark; };/**
@@ -1154,6 +1160,8 @@ struct scmd_priv {* @snapdump_trigger_active: Snapdump trigger active flag * @pci_err_recovery: PCI error recovery in progress * @block_on_pci_err: Block IO during PCI error recovery +* @reply_qfull_count: Occurences of reply queue full avoidance kicking-in +* @prevent_reply_qfull: Enable reply queue prevention */ struct mpi3mr_ioc {struct list_head list;
@@ -1352,6 +1360,8 @@ struct mpi3mr_ioc {bool fw_release_trigger_active;bool pci_err_recovery;bool block_on_pci_err; +atomic_t reply_qfull_count; +bool prevent_reply_qfull; };/**
drivers/scsi/mpi3mr/mpi3mr_app.c +24 -0
@@ -3060,6 +3060,29 @@ reply_queue_count_show(struct device *dev, struct device_attribute *attr,static DEVICE_ATTR_RO (reply_queue_count); +/** +* reply_qfull_count_show - Show reply qfull count +* @dev: class device +* @attr: Device attributes +* @buf: Buffer to copy +* +* Retrieves the current value of the reply_qfull_count from the mrioc structure and +* formats it as a string for display. +* +* Return: sysfs_emit() return +*/ +static ssize_t +reply_qfull_count_show (struct device *dev,struct device_attribute *attr, +char *buf) +{ +struct Scsi_Host *shost =class_to_shost (dev); +struct mpi3mr_ioc *mrioc =shost_priv (shost); + +return sysfs_emit (buf,"%u\n" ,atomic_read (&mrioc->reply_qfull_count)); +} + +static DEVICE_ATTR_RO (reply_qfull_count); +/** * logging_level_show - Show controller debug level * @dev: class device
@@ -3152,6 +3175,7 @@ static struct attribute *mpi3mr_host_attrs[] = { &dev_attr_fw_queue_depth.attr, &dev_attr_op_req_q_count.attr, &dev_attr_reply_queue_count.attr, + &dev_attr_reply_qfull_count.attr, &dev_attr_logging_level.attr, &dev_attr_adp_state.attr, NULL,
drivers/scsi/mpi3mr/mpi3mr_fw.c +28 -4
@@ -2104,15 +2104,22 @@ static int mpi3mr_create_op_reply_q(struct mpi3mr_ioc *mrioc, u16 qidx) } reply_qid = qidx +1 ; - op_reply_q->num_replies =MPI3MR_OP_REP_Q_QD ; -if ((mrioc->pdev->device ==MPI3_MFGPAGE_DEVID_SAS4116 ) && - !mrioc->pdev->revision) - op_reply_q->num_replies =MPI3MR_OP_REP_Q_QD4K ; + +if (mrioc->pdev->device ==MPI3_MFGPAGE_DEVID_SAS4116 ) { +if (mrioc->pdev->revision) + op_reply_q->num_replies =MPI3MR_OP_REP_Q_QD ; +else + op_reply_q->num_replies =MPI3MR_OP_REP_Q_QD4K ; + }else + op_reply_q->num_replies =MPI3MR_OP_REP_Q_QD2K ; + op_reply_q->ci =0 ; op_reply_q->ephase =1 ;atomic_set (&op_reply_q->pend_ios,0 );atomic_set (&op_reply_q->in_use,0 ); op_reply_q->enable_irq_poll = false; + op_reply_q->qfull_watermark = + op_reply_q->num_replies - (MPI3MR_THRESHOLD_REPLY_COUNT *2 );if (!op_reply_q->q_segments) { retval =mpi3mr_alloc_op_reply_q_segments (mrioc, qidx);
@@ -2416,8 +2423,10 @@ int mpi3mr_op_request_post(struct mpi3mr_ioc *mrioc,void *segment_base_addr;u16 req_sz = mrioc->facts.op_req_sz;struct segments *segments = op_req_q->q_segments; +struct op_reply_qinfo *op_reply_q =NULL ; reply_qidx = op_req_q->reply_qid -1 ; + op_reply_q = mrioc->op_reply_qinfo + reply_qidx;if (mrioc->unrecoverable)return -EFAULT ;
@@ -2448,6 +2457,15 @@ int mpi3mr_op_request_post(struct mpi3mr_ioc *mrioc, goto out; } +/* Reply queue is nearing to get full, push back IOs to SML */ +if ((mrioc->prevent_reply_qfull == true) && + (atomic_read (&op_reply_q->pend_ios) > + (op_reply_q->qfull_watermark))) { +atomic_inc (&mrioc->reply_qfull_count); + retval = -EAGAIN ; + goto out; + } + segment_base_addr = segments[pi / op_req_q->segment_qd].segment; req_entry = (u8 *)segment_base_addr + ((pi % op_req_q->segment_qd) * req_sz);
@@ -3091,6 +3109,9 @@ static void mpi3mr_process_factsdata(struct mpi3mr_ioc *mrioc, mrioc->facts.dma_mask = (facts_flags &MPI3_IOCFACTS_FLAGS_DMA_ADDRESS_WIDTH_MASK ) >>MPI3_IOCFACTS_FLAGS_DMA_ADDRESS_WIDTH_SHIFT ; + mrioc->facts.dma_mask = (facts_flags & +MPI3_IOCFACTS_FLAGS_DMA_ADDRESS_WIDTH_MASK ) >> +MPI3_IOCFACTS_FLAGS_DMA_ADDRESS_WIDTH_SHIFT ; mrioc->facts.protocol_flags = facts_data->protocol_flags; mrioc->facts.mpi_version =le32_to_cpu (facts_data->mpi_version.word); mrioc->facts.max_reqs =le16_to_cpu (facts_data->max_outstanding_requests);
@@ -4214,6 +4235,9 @@ int mpi3mr_init_ioc(struct mpi3mr_ioc *mrioc) mrioc->shost->transportt = mpi3mr_transport_template; } +if (mrioc->facts.max_req_limit) + mrioc->prevent_reply_qfull = true; + mrioc->reply_sz = mrioc->facts.reply_sz; retval =mpi3mr_check_reset_dma_mask (mrioc);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 89/414 scsi: mpi3mr: Synchronous access b/w reset and tm thread for reply queue
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ranjan Kumar <[email protected]>
[ Upstream commit f195fc060c738d303a21fae146dbf85e1595fb4c ]
When the task management thread processes reply queues while the reset thread resets them, the task management thread accesses an invalid queue ID (0xFFFF), set by the reset thread, which points to unallocated memory, causing a crash.
Add flag 'io_admin_reset_sync' to synchronize access between the reset, I/O, and admin threads. Before a reset, the reset handler sets this flag to block I/O and admin processing threads. If any thread bypasses the initial check, the reset thread waits up to 10 seconds for processing to finish. If the wait exceeds 10 seconds, the controller is marked as unrecoverable.
--- drivers/scsi/mpi3mr/mpi3mr.h | 2 + drivers/scsi/mpi3mr/mpi3mr_fw.c | 67 +++++++++++++++++++++++++++++++-- 2 files changed, 66 insertions(+), 3 deletions(-)
drivers/scsi/mpi3mr/mpi3mr.h +2 -0
@@ -1097,6 +1097,7 @@ struct scmd_priv {* @ts_update_interval: Timestamp update interval * @reset_in_progress: Reset in progress flag * @unrecoverable: Controller unrecoverable flag +* @io_admin_reset_sync: Manage state of I/O ops during an admin reset process * @prev_reset_result: Result of previous reset * @reset_mutex: Controller reset mutex * @reset_waitq: Controller reset wait queue
@@ -1285,6 +1286,7 @@ struct mpi3mr_ioc {u16 ts_update_interval;u8 reset_in_progress;u8 unrecoverable; +u8 io_admin_reset_sync;int prev_reset_result;struct mutex reset_mutex;wait_queue_head_t reset_waitq;
drivers/scsi/mpi3mr/mpi3mr_fw.c +64 -3
109 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 90/414 net: page_pool: dont cast mp param to devmem
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pavel Begunkov <[email protected]>
[ Upstream commit 8d522566ae9cb3f0609ddb2a6ce3f4f39988043c ]
page_pool_check_memory_provider() is a generic path and shouldn't assume anything about the actual type of the memory provider argument. It's fine while devmem is the only provider, but cast away the devmem specific binding types to avoid confusion.
--- net/core/page_pool_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/page_pool_user.c +1 -1
@@ -356,7 +356,7 @@ void page_pool_unlist(struct page_pool *pool)int page_pool_check_memory_provider (struct net_device *dev,struct netdev_rx_queue *rxq) { -struct net_devmem_dmabuf_binding *binding = rxq->mp_params.mp_priv; +void *binding = rxq->mp_params.mp_priv;struct page_pool *pool;struct hlist_node *n;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 91/414 f2fs: dont retry IO for corrupted data scenario
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit 1534747d3170646ddeb9ea5f7caaac90359707cf ]
F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942] F2FS-fs (dm-105): inconsistent node block, nid:430, node_footer[nid:2198964142,ino:598252782,ofs:118300154,cpver:5409237455940746069,blkaddr:2125070942]
If node block is loaded successfully, but its content is inconsistent, it doesn't need to retry IO.
--- fs/f2fs/inode.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/f2fs/inode.c +4 -0
@@ -764,8 +764,12 @@ void f2fs_update_inode_page(struct inode *inode)if (err == -ENOENT )return ; +if (err == -EFSCORRUPTED ) + goto stop_checkpoint; +if (err == -ENOMEM || ++count <=DEFAULT_RETRY_IO_COUNT ) goto retry; +stop_checkpoint:f2fs_stop_checkpoint (sbi, false,STOP_CP_REASON_UPDATE_INODE );return ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 92/414 wifi: mac80211: add strict mode disabling workarounds
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johannes Berg <[email protected]>
[ Upstream commit 3ad4fce66e4f9d82abfc366707757e29cc14a9d2 ]
Add a strict mode where we disable certain workarounds and have additional checks such as, for now, that VHT capabilities from association response match those from beacon/probe response. We can extend the checks in the future.
Make it an opt-in setting by the driver so it can be set there in some driver-specific way, for example. Also allow setting this one hw flag through the hwflags debugfs, by writing a new strict=0 or strict=1 value.
--- include/net/mac80211.h | 6 ++++++ net/mac80211/debugfs.c | 44 +++++++++++++++++++++++++++++++++++++++-- net/mac80211/mlme.c | 45 +++++++++++++++++++++++++++++------------- 3 files changed, 79 insertions(+), 16 deletions(-)
include/net/mac80211.h +6 -0
@@ -2845,6 +2845,11 @@ struct ieee80211_txq {* implements MLO, so operation can continue on other links when one * link is switching. * +* @IEEE80211_HW_STRICT: strictly enforce certain things mandated by the spec +* but otherwise ignored/worked around for interoperability. This is a +* HW flag so drivers can opt in according to their own control, e.g. in +* testing. +* * @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays */ enum ieee80211_hw_flags {
@@ -2905,6 +2910,7 @@ enum ieee80211_hw_flags {IEEE80211_HW_DISALLOW_PUNCTURING ,IEEE80211_HW_DISALLOW_PUNCTURING_5GHZ ,IEEE80211_HW_HANDLES_QUIET_CSA , +IEEE80211_HW_STRICT ,/* keep last, obviously */ NUM_IEEE80211_HW_FLAGS
net/mac80211/debugfs.c +42 -2
68 lines not on this page · raw message
net/mac80211/mlme.c +31 -14
105 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 93/414 wifi: mac80211: ensure sdata->work is canceled before initialized.
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miri Korenblit <[email protected]>
[ Upstream commit 6c93fd502023dd919b5987ccbe990735410edd49 ]
This wiphy work is canceled when the iface is stopped,
and shouldn't be queued for a non-running iface.
If it happens to be queued for a non-running iface (due to a bug) it can cause a corruption of wiphy_work_list when ieee80211_setup_sdata is called. Make sure to cancel it in this case and warn on.
--- net/mac80211/iface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
net/mac80211/iface.c +4 -1
@@ -8,7 +8,7 @@* Copyright 2008, Johannes Berg <[email protected]> * Copyright 2013-2014 Intel Mobile Communications GmbH * Copyright (c) 2016 Intel Deutschland GmbH -* Copyright (C) 2018-2024 Intel Corporation +* Copyright (C) 2018-2025 Intel Corporation */ #include <linux/slab.h> #include <linux/kernel.h>
@@ -813,6 +813,9 @@ static void ieee80211_set_multicast_list(struct net_device *dev)*/ static void ieee80211_teardown_sdata (struct ieee80211_sub_if_data *sdata) { +if (WARN_ON (!list_empty (&sdata->work.entry))) +wiphy_work_cancel (sdata->local->hw.wiphy, &sdata->work); +/* free extra data */ ieee80211_free_keys (sdata, false);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 94/414 scsi: target: spc: Fix RSOC parameter data header size
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chaohai Chen <[email protected]>
[ Upstream commit b50532318793d28a7628c1ffc129a2226e83e495 ]
The SPC document states that "The COMMAND DATA LENGTH field indicates the length in bytes of the command descriptor list".
The length should be subtracted by 4 to represent the length of the description list, not 3.
--- drivers/target/target_core_spc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/target/target_core_spc.c +1 -1
@@ -2243,7 +2243,7 @@ spc_emulate_report_supp_op_codes(struct se_cmd *cmd) response_length +=spc_rsoc_encode_command_descriptor ( &buf[response_length], rctd, descr); } -put_unaligned_be32 (response_length -3 , buf); +put_unaligned_be32 (response_length -4 , buf); }else { response_length = spc_rsoc_encode_one_command_descriptor( &buf[response_length], rctd, descr,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 95/414 net: usb: asix_devices: add FiberGecko DeviceID
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Schulze <[email protected]>
[ Upstream commit 4079918ae720e842ed7dff65fedeb9980b374995 ]
The FiberGecko is a small USB module that connects a 100 Mbit/s SFP
--- drivers/net/usb/asix_devices.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/net/usb/asix_devices.c +17 -0
@@ -1421,6 +1421,19 @@ static const struct driver_info hg20f9_info = { .data = FLAG_EEPROM_MAC, }; +static const struct driver_info lyconsys_fibergecko100_info = { + .description ="LyconSys FiberGecko 100 USB 2.0 to SFP Adapter" , + .bind = ax88178_bind, + .status = asix_status, + .link_reset = ax88178_link_reset, + .reset = ax88178_link_reset, + .flags =FLAG_ETHER |FLAG_FRAMING_AX |FLAG_LINK_INTR | +FLAG_MULTI_PACKET , + .rx_fixup = asix_rx_fixup_common, + .tx_fixup = asix_tx_fixup, + .data =0x20061201 , +}; +static const struct usb_device_id products [] = { {// Linksys USB200M
@@ -1578,6 +1591,10 @@ static const struct usb_device_id products [] = {// Linux Automation GmbH USB 10Base-T1L USB_DEVICE(0x33f7, 0x0004), .driver_info = (unsigned long) &lxausb_t1l_info, +}, { +/* LyconSys FiberGecko 100 */ + USB_DEVICE(0x1d2a, 0x0801), + .driver_info = (unsigned long) &lyconsys_fibergecko100_info, }, { }, // END };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 96/414 page_pool: avoid infinite loop to schedule delayed worker
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Xing <[email protected]>
[ Upstream commit 43130d02baa137033c25297aaae95fd0edc41654 ]
We noticed the kworker in page_pool_release_retry() was waken up repeatedly and infinitely in production because of the buggy driver causing the inflight less than 0 and warning us in page_pool_inflight()[1].
Since the inflight value goes negative, it means we should not expect the whole page_pool to get back to work normally.
This patch mitigates the adverse effect by not rescheduling the kworker when detecting the inflight negative in page_pool_release_retry().
[1]
[Mon Feb 10 20:36:11 2025] ------------[ cut here ]------------ [Mon Feb 10 20:36:11 2025] Negative(-51446) inflight packet-pages ... [Mon Feb 10 20:36:11 2025] Call Trace: [Mon Feb 10 20:36:11 2025] page_pool_release_retry+0x23/0x70 [Mon Feb 10 20:36:11 2025] process_one_work+0x1b1/0x370 [Mon Feb 10 20:36:11 2025] worker_thread+0x37/0x3a0 [Mon Feb 10 20:36:11 2025] kthread+0x11a/0x140 [Mon Feb 10 20:36:11 2025] ? process_one_work+0x370/0x370 [Mon Feb 10 20:36:11 2025] ? __kthread_cancel_work+0x40/0x40 [Mon Feb 10 20:36:11 2025] ret_from_fork+0x35/0x40 [Mon Feb 10 20:36:11 2025] ---[ end trace ebffe800f33e7e34 ]---
Note: before this patch, the above calltrace would flood the dmesg due to repeated reschedule of release_dw kworker.
--- net/core/page_pool.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
net/core/page_pool.c +7 -1
@@ -1066,7 +1066,13 @@ static void page_pool_release_retry(struct work_struct *wq)int inflight; inflight =page_pool_release (pool); -if (!inflight) +/* In rare cases, a driver bug may cause inflight to go negative. +* Don't reschedule release if inflight is 0 or negative. +* - If 0, the page_pool has been destroyed +* - if negative, we will never recover +* in both cases no reschedule is necessary. +*/ +if (inflight <=0 )return ;/* Periodic warning for page pools the user can't see */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 97/414 can: flexcan: Add quirk to handle separate interrupt lines for mailboxes
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ciprian Marian Costea <[email protected]>
[ Upstream commit 8c652cf030a769fbfc73cfc280ed3f1656343c35 ]
Introduce 'FLEXCAN_QUIRK_SECONDARY_MB_IRQ' quirk to handle a FlexCAN hardware module integration particularity where two ranges of mailboxes are controlled by separate hardware interrupt lines.
The same 'flexcan_irq' handler is used for both separate mailbox interrupt lines, with no other changes.
--- drivers/net/can/flexcan/flexcan-core.c | 24 +++++++++++++++++++++++- drivers/net/can/flexcan/flexcan.h | 5 +++++ 2 files changed, 28 insertions(+), 1 deletion(-)
drivers/net/can/flexcan/flexcan-core.c +23 -1
@@ -1762,14 +1762,25 @@ static int flexcan_open(struct net_device *dev) goto out_free_irq_boff; } +if (priv->devtype_data.quirks &FLEXCAN_QUIRK_SECONDARY_MB_IRQ ) { + err =request_irq (priv->irq_secondary_mb, + flexcan_irq,IRQF_SHARED , dev->name, dev); +if (err) + goto out_free_irq_err; + } +flexcan_chip_interrupts_enable (dev);netif_start_queue (dev);return 0 ; + out_free_irq_err: +if (priv->devtype_data.quirks &FLEXCAN_QUIRK_NR_IRQ_3 ) +free_irq (priv->irq_err, dev); out_free_irq_boff: -free_irq (priv->irq_boff, dev); +if (priv->devtype_data.quirks &FLEXCAN_QUIRK_NR_IRQ_3 ) +free_irq (priv->irq_boff, dev); out_free_irq:free_irq (dev->irq, dev); out_can_rx_offload_disable:
@@ -1794,6 +1805,9 @@ static int flexcan_close(struct net_device *dev)netif_stop_queue (dev);flexcan_chip_interrupts_disable (dev); +if (priv->devtype_data.quirks &FLEXCAN_QUIRK_SECONDARY_MB_IRQ ) +free_irq (priv->irq_secondary_mb, dev); +if (priv->devtype_data.quirks &FLEXCAN_QUIRK_NR_IRQ_3 ) {free_irq (priv->irq_err, dev);free_irq (priv->irq_boff, dev);
@@ -2187,6 +2201,14 @@ static int flexcan_probe(struct platform_device *pdev) } } +if (priv->devtype_data.quirks &FLEXCAN_QUIRK_SECONDARY_MB_IRQ ) { + priv->irq_secondary_mb =platform_get_irq_byname (pdev,"mb-1" ); +if (priv->irq_secondary_mb <0 ) { + err = priv->irq_secondary_mb; + goto failed_platform_get_irq; + } + } +if (priv->devtype_data.quirks &FLEXCAN_QUIRK_SUPPORT_FD ) { priv->can.ctrlmode_supported |=CAN_CTRLMODE_FD |CAN_CTRLMODE_FD_NON_ISO ;
drivers/net/can/flexcan/flexcan.h +5 -0
@@ -70,6 +70,10 @@#define FLEXCAN_QUIRK_SUPPORT_RX_FIFO BIT(16)/* Setup stop mode with ATF SCMI protocol to support wakeup */ #define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCMI BIT(17) +/* Device has two separate interrupt lines for two mailbox ranges, which +* both need to have an interrupt handler registered. +*/ +#define FLEXCAN_QUIRK_SECONDARY_MB_IRQ BIT(18)struct flexcan_devtype_data {u32 quirks;/* quirks needed for different IP cores */
@@ -107,6 +111,7 @@ struct flexcan_priv {int irq_boff;int irq_err; +int irq_secondary_mb;/* IPC handle when setup stop mode by System Controller firmware(scfw) */ struct imx_sc_ipc *sc_ipc_handle;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 80/414 ASoC: amd: Add DMI quirk for ACP6X mic support
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: keenplify <[email protected]>
[ Upstream commit 309b367eafc8e162603cd29189da6db770411fea ]
Some AMD laptops with ACP6X do not expose the DMIC properly on Linux. Adding a DMI quirk enables mic functionality.
Similar to Bugzilla #218402, this issue affects multiple users.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -584,6 +584,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_VERSION, "pang13"), } }, + { + .driver_data = &acp6x_card, + .matches = { + DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."), + DMI_MATCH(DMI_PRODUCT_NAME, "Bravo 15 C7UCX"), + } + }, {} };
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 98/414 can: flexcan: add NXP S32G2/S32G3 SoC support
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ciprian Marian Costea <[email protected]>
[ Upstream commit 8503a4b1a24d32e95f3a233062e8f1dc0b2052bd ]
Add device type data for S32G2/S32G3 SoC.
FlexCAN module from S32G2/S32G3 is similar with i.MX SoCs, but interrupt management is different.
On S32G2/S32G3 SoC, there are separate interrupts for state change, bus errors, Mailboxes 0-7 and Mailboxes 8-127 respectively.
In order to handle this FlexCAN hardware particularity, first reuse the 'FLEXCAN_QUIRK_NR_IRQ_3' quirk provided by mcf5441x's irq handling support. Secondly, use the newly introduced 'FLEXCAN_QUIRK_SECONDARY_MB_IRQ' quirk which handles the case where two separate mailbox ranges are controlled by independent hardware interrupt lines.
--- drivers/net/can/flexcan/flexcan-core.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/can/flexcan/flexcan-core.c +11 -0
@@ -386,6 +386,16 @@ static const struct flexcan_devtype_data fsl_lx2160a_r1_devtype_data = { FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR, }; +static const struct flexcan_devtype_data nxp_s32g2_devtype_data = { + .quirks =FLEXCAN_QUIRK_DISABLE_RXFG |FLEXCAN_QUIRK_ENABLE_EACEN_RRS | +FLEXCAN_QUIRK_DISABLE_MECR |FLEXCAN_QUIRK_BROKEN_PERR_STATE | +FLEXCAN_QUIRK_USE_RX_MAILBOX |FLEXCAN_QUIRK_SUPPORT_FD | +FLEXCAN_QUIRK_SUPPORT_ECC |FLEXCAN_QUIRK_NR_IRQ_3 | +FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX | +FLEXCAN_QUIRK_SUPPORT_RX_MAILBOX_RTR | +FLEXCAN_QUIRK_SECONDARY_MB_IRQ , +}; +static const struct can_bittiming_const flexcan_bittiming_const = { .name =DRV_NAME , .tseg1_min =4 ,
@@ -2055,6 +2065,7 @@ static const struct of_device_id flexcan_of_match[] = { { .compatible = "fsl,vf610-flexcan", .data = &fsl_vf610_devtype_data, }, { .compatible = "fsl,ls1021ar2-flexcan", .data = &fsl_ls1021a_r2_devtype_data, }, { .compatible = "fsl,lx2160ar1-flexcan", .data = &fsl_lx2160a_r1_devtype_data, }, + { .compatible = "nxp,s32g2-flexcan", .data = &nxp_s32g2_devtype_data, }, { /* sentinel */ }, }; MODULE_DEVICE_TABLE(of, flexcan_of_match);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 99/414 jfs: Fix uninit-value access of imap allocated in the diMount() function
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhongqiu Han <[email protected]>
[ Upstream commit 9629d7d66c621671d9a47afe27ca9336bfc8a9ea ]
syzbot reports that hex_dump_to_buffer is using uninit-value:
=====================================================
BUG: KMSAN: uninit-value in hex_dump_to_buffer+0x888/0x1100 lib/hexdump.c:171 hex_dump_to_buffer+0x888/0x1100 lib/hexdump.c:171 print_hex_dump+0x13d/0x3e0 lib/hexdump.c:276 diFree+0x5ba/0x4350 fs/jfs/jfs_imap.c:876 jfs_evict_inode+0x510/0x550 fs/jfs/inode.c:156 evict+0x723/0xd10 fs/inode.c:796 iput_final fs/inode.c:1946 [inline] iput+0x97b/0xdb0 fs/inode.c:1972 txUpdateMap+0xf3e/0x1150 fs/jfs/jfs_txnmgr.c:2367 txLazyCommit fs/jfs/jfs_txnmgr.c:2664 [inline] jfs_lazycommit+0x627/0x11d0 fs/jfs/jfs_txnmgr.c:2733 kthread+0x6b9/0xef0 kernel/kthread.c:464 ret_from_fork+0x6d/0x90 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
Uninit was created at:
slab_post_alloc_hook mm/slub.c:4121 [inline] slab_alloc_node mm/slub.c:4164 [inline] __kmalloc_cache_noprof+0x8e3/0xdf0 mm/slub.c:4320 kmalloc_noprof include/linux/slab.h:901 [inline] diMount+0x61/0x7f0 fs/jfs/jfs_imap.c:105 jfs_mount+0xa8e/0x11d0 fs/jfs/jfs_mount.c:176 jfs_fill_super+0xa47/0x17c0 fs/jfs/super.c:523 get_tree_bdev_flags+0x6ec/0x910 fs/super.c:1636 get_tree_bdev+0x37/0x50 fs/super.c:1659 jfs_get_tree+0x34/0x40 fs/jfs/super.c:635 vfs_get_tree+0xb1/0x5a0 fs/super.c:1814 do_new_mount+0x71f/0x15e0 fs/namespace.c:3560 path_mount+0x742/0x1f10 fs/namespace.c:3887 do_mount fs/namespace.c:3900 [inline] __do_sys_mount fs/namespace.c:4111 [inline] __se_sys_mount+0x71f/0x800 fs/namespace.c:4088 __x64_sys_mount+0xe4/0x150 fs/namespace.c:4088 x64_sys_call+0x39bf/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:166 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f =====================================================
The reason is that imap is not properly initialized after memory allocation. It will cause the snprintf() function to write uninitialized data into linebuf within hex_dump_to_buffer().
Fix this by using kzalloc instead of kmalloc to clear its content at the beginning in diMount().
--- fs/jfs/jfs_imap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/jfs_imap.c +1 -1
@@ -102,7 +102,7 @@ int diMount(struct inode *ipimap)* allocate/initialize the in-memory inode map control structure */ /* allocate the in-memory inode map control structure. */ - imap =kmalloc (sizeof (struct inomap ),GFP_KERNEL ); + imap =kzalloc (sizeof (struct inomap ),GFP_KERNEL );if (imap ==NULL )return -ENOMEM ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 100/414 fs/jfs: cast inactags to s64 to prevent potential overflow
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rand Deeb <[email protected]>
[ Upstream commit 70ca3246ad201b53a9f09380b3f29d8bac320383 ]
The expression "inactags << bmp->db_agl2size" in the function dbFinalizeBmap() is computed using int operands. Although the values (inactags and db_agl2size) are derived from filesystem parameters and are usually small, there is a theoretical risk that the shift could overflow a 32-bit int if extreme values occur.
According to the C standard, shifting a signed 32-bit int can lead to undefined behavior if the result exceeds its range. In our case, an overflow could miscalculate free blocks, potentially leading to erroneous filesystem accounting.
To ensure the arithmetic is performed in 64-bit space, we cast "inactags" to s64 before shifting. This defensive fix prevents any risk of overflow and complies with kernel coding best practices.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- fs/jfs/jfs_dmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/jfs/jfs_dmap.c +2 -2
@@ -3666,8 +3666,8 @@ void dbFinalizeBmap(struct inode *ipbmap)* system size is not a multiple of the group size). */ inactfree = (inactags && ag_rem) ? - ((inactags -1 ) << bmp->db_agl2size) + ag_rem - : inactags << bmp->db_agl2size; + (((s64 )inactags -1 ) << bmp->db_agl2size) + ag_rem + : ((s64 )inactags << bmp->db_agl2size);/* determine how many free blocks are in the active * allocation groups plus the average number of free blocks
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 101/414 fs/jfs: Prevent integer overflow in AG size calculation
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rand Deeb <[email protected]>
[ Upstream commit 7fcbf789629cdb9fbf4e2172ce31136cfed11e5e ]
The JFS filesystem calculates allocation group (AG) size using 1 << l2agsize in dbExtendFS(). When l2agsize exceeds 31 (possible with >2TB aggregates on 32-bit systems), this 32-bit shift operation causes undefined behavior and improper AG sizing.
On 32-bit architectures:
- Left-shifting 1 by 32+ bits results in 0 due to integer overflow
- This creates invalid AG sizes (0 or garbage values) in sbi->bmap->db_agsize
- Subsequent block allocations would reference invalid AG structures
- Could lead to:
- Filesystem corruption during extend operations
- Kernel crashes due to invalid memory accesses
- Security vulnerabilities via malformed on-disk structures
Fix by casting to s64 before shifting:bmp->db_agsize = (s64)1 << l2agsize;
This ensures 64-bit arithmetic even on 32-bit architectures. The cast matches the data type of db_agsize (s64) and follows similar patterns in JFS block calculation code.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- fs/jfs/jfs_dmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/jfs_dmap.c +1 -1
@@ -3403,7 +3403,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks) oldl2agsize = bmp->db_agl2size; bmp->db_agl2size = l2agsize; - bmp->db_agsize =1 << l2agsize; + bmp->db_agsize = (s64 )1 << l2agsize;/* compute new number of AG */ agno = bmp->db_numag;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 102/414 jfs: Prevent copying of nlink with value 0 from disk inode
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <[email protected]>
[ Upstream commit b61e69bb1c049cf507e3c654fa3dc1568231bd07 ]
syzbot report a deadlock in diFree. [1]
When calling "ioctl$LOOP_SET_STATUS64", the offset value passed in is 4, which does not match the mounted loop device, causing the mapping of the mounted loop device to be invalidated.
When creating the directory and creating the inode of iag in diReadSpecial(), read the page of fixed disk inode (AIT) in raw mode in read_metapage(), the metapage data it returns is corrupted, which causes the nlink value of 0 to be assigned to the iag inode when executing copy_from_dinode(), which ultimately causes a deadlock when entering diFree().
To avoid this, first check the nlink value of dinode before setting iag inode.
[1]
WARNING: possible recursive locking detected
6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Not tainted
--------------------------------------------
syz-executor301/5309 is trying to acquire lock:ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889
but task is already holding lock:ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
---- lock(&(imap->im_aglock[index]));
lock(&(imap->im_aglock[index]));
*** DEADLOCK ***
May be due to missing lock nesting notation
5 locks held by syz-executor301/5309:
#0: ffff8880422a4420 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515 #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline] #1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x260/0x540 fs/namei.c:4026 #2: ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630
#3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2460 [inline] #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline] #3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocAG+0x4b7/0x1e50 fs/jfs/jfs_imap.c:1669 #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2477 [inline] #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline] #4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocAG+0x869/0x1e50 fs/jfs/jfs_imap.c:1669
stack backtrace: CPU: 0 UID: 0 PID: 5309 Comm: syz-executor301 Not tainted 6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037 check_deadlock kernel/locking/lockdep.c:3089 [inline] validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 __lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 __mutex_lock_common kernel/locking/mutex.c:608 [inline] __mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752 diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889 jfs_evict_inode+0x32d/0x440 fs/jfs/inode.c:156 evict+0x4e8/0x9b0 fs/inode.c:725 diFreeSpecial fs/jfs/jfs_imap.c:552 [inline] duplicateIXtree+0x3c6/0x550 fs/jfs/jfs_imap.c:3022 diNewIAG fs/jfs/jfs_imap.c:2597 [inline] diAllocExt fs/jfs/jfs_imap.c:1905 [inline] diAllocAG+0x17dc/0x1e50 fs/jfs/jfs_imap.c:1669 diAlloc+0x1d2/0x1630 fs/jfs/jfs_imap.c:1590 ialloc+0x8f/0x900 fs/jfs/jfs_inode.c:56 jfs_mkdir+0x1c5/0xba0 fs/jfs/namei.c:225 vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4257 do_mkdirat+0x264/0x3a0 fs/namei.c:4280 __do_sys_mkdirat fs/namei.c:4295 [inline] __se_sys_mkdirat fs/namei.c:4293 [inline] __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4293 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
--- fs/jfs/jfs_imap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jfs/jfs_imap.c +1 -1
@@ -456,7 +456,7 @@ struct inode *diReadSpecial(struct super_block *sb, ino_t inum, int secondary) dp += inum %8 ;/* 8 inodes per 4K page */ /* copy on-disk inode to in-memory inode */ -if ((copy_from_dinode (dp, ip)) !=0 ) { +if ((copy_from_dinode (dp, ip) !=0 ) || (ip->i_nlink ==0 )) {/* handle bad return by returning NULL for ip */ set_nlink (ip,1 );/* Don't want iput() deleting it */ iput (ip);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 103/414 jfs: add sanity check for agwidth in dbMount
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Adam Davis <[email protected]>
[ Upstream commit ddf2846f22e8575d6b4b6a66f2100f168b8cd73d ]
The width in dmapctl of the AG is zero, it trigger a divide error when calculating the control page level in dbAllocAG.
To avoid this issue, add a check for agwidth in dbAllocAG.
--- fs/jfs/jfs_dmap.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/jfs/jfs_dmap.c +4 -0
@@ -204,6 +204,10 @@ int dbMount(struct inode *ipbmap) bmp->db_aglevel =le32_to_cpu (dbmp_le->dn_aglevel); bmp->db_agheight =le32_to_cpu (dbmp_le->dn_agheight); bmp->db_agwidth =le32_to_cpu (dbmp_le->dn_agwidth); +if (!bmp->db_agwidth) { + err = -EINVAL ; + goto err_release_metapage; + } bmp->db_agstart =le32_to_cpu (dbmp_le->dn_agstart); bmp->db_agl2size =le32_to_cpu (dbmp_le->dn_agl2size); if (bmp->db_agl2size > L2MAXL2SIZE - L2MAXAG ||
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 104/414 ata: libata-eh: Do not use ATAPI DMA for a device limited to PIO mode
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
[ Upstream commit 91ec84f8eaddbc93d7c62e363d68aeb7b89879c7 ]
atapi_eh_request_sense() currently uses ATAPI DMA if the SATA controller has ATA_FLAG_PIO_DMA (PIO cmds via DMA) set.
However, ATA_FLAG_PIO_DMA is a flag that can be set by a low-level driver on a port at initialization time, before any devices are scanned.
If a controller detects a connected device that only supports PIO, we set the flag ATA_DFLAG_PIO.
Modify atapi_eh_request_sense() to not use ATAPI DMA if the connected device only supports PIO.
--- drivers/ata/libata-eh.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/ata/libata-eh.c +9 -2
@@ -1542,8 +1542,15 @@ unsigned int atapi_eh_request_sense(struct ata_device *dev, tf.flags |=ATA_TFLAG_ISADDR |ATA_TFLAG_DEVICE ; tf.command =ATA_CMD_PACKET ; -/* is it pointless to prefer PIO for "safety reasons"? */ -if (ap->flags &ATA_FLAG_PIO_DMA ) { +/* +* Do not use DMA if the connected device only supports PIO, even if the +* port prefers PIO commands via DMA. +* +* Ideally, we should call atapi_check_dma() to check if it is safe for +* the LLD to use DMA for REQUEST_SENSE, but we don't have a qc. +* Since we can't check the command, perhaps we should only use pio? +*/ +if ((ap->flags &ATA_FLAG_PIO_DMA ) && !(dev->flags &ATA_DFLAG_PIO )) { tf.protocol =ATAPI_PROT_DMA ; tf.feature |=ATAPI_PKT_DMA ; }else {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 105/414 net: sfp: add quirk for 2.5G OEM BX SFP
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Birger Koblitz <[email protected]>
[ Upstream commit a85035561025063125f81090e4f2bd65da368c83 ]
The OEM SFP-2.5G-BX10-D/U SFP module pair is meant to operate with 2500Base-X. However, in their EEPROM they incorrectly specify:
Transceiver codes : 0x00 0x12 0x00 0x00 0x12 0x00 0x01 0x05 0x00
BR, Nominal : 2500MBd
Use sfp_quirk_2500basex for this module to allow 2500Base-X mode anyway. Tested on BananaPi R3.
--- drivers/net/phy/sfp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/phy/sfp.c +2 -0
@@ -515,6 +515,8 @@ static const struct sfp_quirk sfp_quirks[] = {SFP_QUIRK_F ("OEM" ,"SFP-10G-T" , sfp_fixup_rollball_cc),SFP_QUIRK_M ("OEM" ,"SFP-2.5G-T" , sfp_quirk_oem_2_5g), +SFP_QUIRK_M ("OEM" ,"SFP-2.5G-BX10-D" , sfp_quirk_2500basex), +SFP_QUIRK_M ("OEM" ,"SFP-2.5G-BX10-U" , sfp_quirk_2500basex),SFP_QUIRK_F ("OEM" ,"RTSFP-10" , sfp_fixup_rollball_cc),SFP_QUIRK_F ("OEM" ,"RTSFP-10G" , sfp_fixup_rollball_cc), SFP_QUIRK_F("Turris", "RTSFP-2.5G", sfp_fixup_rollball),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 106/414 wifi: ath12k: Fix invalid data access in ath12k_dp_rx_h_undecap_nwifi
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manish Dharanenthiran <[email protected]>
[ Upstream commit 9a0dddfb30f120db3851627935851d262e4e7acb ]
In certain cases, hardware might provide packets with a length greater than the maximum native Wi-Fi header length. This can lead to accessing and modifying fields in the header within the ath12k_dp_rx_h_undecap_nwifi function for DP_RX_DECAP_TYPE_NATIVE_WIFI decap type and
potentially resulting in invalid data access and memory corruption.
Add a sanity check before processing the SKB to prevent invalid data access in the undecap native Wi-Fi function for the DP_RX_DECAP_TYPE_NATIVE_WIFI decap type.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/dp_rx.c | 42 +++++++++++++++++++++++-- 1 file changed, 40 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath12k/dp_rx.c +40 -2
@@ -2474,6 +2474,29 @@ static void ath12k_dp_rx_deliver_msdu(struct ath12k *ar, struct napi_struct *napieee80211_rx_napi (ath12k_ar_to_hw (ar), pubsta, msdu, napi); } +static bool ath12k_dp_rx_check_nwifi_hdr_len_valid (struct ath12k_base *ab, +struct hal_rx_desc *rx_desc, +struct sk_buff *msdu) +{ +struct ieee80211_hdr *hdr; +u8 decap_type; +u32 hdr_len; + + decap_type =ath12k_dp_rx_h_decap_type (ab, rx_desc); +if (decap_type !=DP_RX_DECAP_TYPE_NATIVE_WIFI ) +return true; + + hdr = (struct ieee80211_hdr *)msdu->data; + hdr_len =ieee80211_hdrlen (hdr->frame_control); + +if ((likely (hdr_len <=DP_MAX_NWIFI_HDR_LEN ))) +return true; + + ab->soc_stats.invalid_rbm++; +WARN_ON_ONCE (1 ); +return false; +} + static int ath12k_dp_rx_process_msdu(struct ath12k *ar, struct sk_buff *msdu, struct sk_buff_head *msdu_list,
@@ -2532,6 +2555,11 @@ static int ath12k_dp_rx_process_msdu(struct ath12k *ar, } } +if (unlikely (!ath12k_dp_rx_check_nwifi_hdr_len_valid (ab, rx_desc, msdu))) { + ret = -EINVAL ; + goto free_out; + } +ath12k_dp_rx_h_ppdu (ar, rx_desc, rx_status);ath12k_dp_rx_h_mpdu (ar, msdu, rx_desc, rx_status);
@@ -2884,6 +2912,9 @@ static int ath12k_dp_rx_h_verify_tkip_mic(struct ath12k *ar, struct ath12k_peerRX_FLAG_IV_STRIPPED |RX_FLAG_DECRYPTED ;skb_pull (msdu, hal_rx_desc_sz); +if (unlikely (!ath12k_dp_rx_check_nwifi_hdr_len_valid (ab, rx_desc, msdu))) +return -EINVAL ; +ath12k_dp_rx_h_ppdu (ar, rx_desc, rxs);ath12k_dp_rx_h_undecap (ar, msdu, rx_desc,HAL_ENCRYPT_TYPE_TKIP_MIC , rxs, true);
@@ -3604,6 +3635,9 @@ static int ath12k_dp_rx_h_null_q_desc(struct ath12k *ar, struct sk_buff *msdu,skb_put (msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len);skb_pull (msdu, hal_rx_desc_sz + l3pad_bytes); } +if (unlikely (!ath12k_dp_rx_check_nwifi_hdr_len_valid (ab, desc, msdu))) +return -EINVAL ; +ath12k_dp_rx_h_ppdu (ar, desc, status);ath12k_dp_rx_h_mpdu (ar, msdu, desc, status);
@@ -3648,7 +3682,7 @@ static bool ath12k_dp_rx_h_reo_err(struct ath12k *ar, struct sk_buff *msdu,return drop; } -static void ath12k_dp_rx_h_tkip_mic_err (struct ath12k *ar,struct sk_buff *msdu, +static bool ath12k_dp_rx_h_tkip_mic_err (struct ath12k *ar,struct sk_buff *msdu,struct ieee80211_rx_status *status) {struct ath12k_base *ab = ar->ab;
@@ -3666,6 +3700,9 @@ static void ath12k_dp_rx_h_tkip_mic_err(struct ath12k *ar, struct sk_buff *msdu,skb_put (msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len);skb_pull (msdu, hal_rx_desc_sz + l3pad_bytes); +if (unlikely (!ath12k_dp_rx_check_nwifi_hdr_len_valid (ab, desc, msdu))) +return true; +ath12k_dp_rx_h_ppdu (ar, desc, status); status->flag |= (RX_FLAG_MMIC_STRIPPED | RX_FLAG_MMIC_ERROR |
@@ -3673,6 +3710,7 @@ static void ath12k_dp_rx_h_tkip_mic_err(struct ath12k *ar, struct sk_buff *msdu,ath12k_dp_rx_h_undecap (ar, msdu, desc,HAL_ENCRYPT_TYPE_TKIP_MIC , status, false); +return false; } static bool ath12k_dp_rx_h_rxdma_err(struct ath12k *ar, struct sk_buff *msdu,
@@ -3691,7 +3729,7 @@ static bool ath12k_dp_rx_h_rxdma_err(struct ath12k *ar, struct sk_buff *msdu,case HAL_REO_ENTR_RING_RXDMA_ECODE_TKIP_MIC_ERR : err_bitmap =ath12k_dp_rx_h_mpdu_err (ab, rx_desc);if (err_bitmap &HAL_RX_MPDU_ERR_TKIP_MIC ) { -ath12k_dp_rx_h_tkip_mic_err (ar, msdu, status); + drop =ath12k_dp_rx_h_tkip_mic_err (ar, msdu, status);break ; } fallthrough;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 107/414 f2fs: fix to avoid out-of-bounds access in f2fs_truncate_inode_blocks()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit e6494977bd4a83862118a05f57a8df40256951c0 ]
syzbot reports an UBSAN issue as below:
------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in fs/f2fs/node.h:381:10 index 18446744073709550692 is out of range for type '__le32[5]' (aka 'unsigned int[5]') CPU: 0 UID: 0 PID: 5318 Comm: syz.0.0 Not tainted 6.14.0-rc3-syzkaller-00060-g6537cfb395f3 #0 Call Trace: <TASK> __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 ubsan_epilogue lib/ubsan.c:231 [inline] __ubsan_handle_out_of_bounds+0x121/0x150 lib/ubsan.c:429 get_nid fs/f2fs/node.h:381 [inline] f2fs_truncate_inode_blocks+0xa5e/0xf60 fs/f2fs/node.c:1181 f2fs_do_truncate_blocks+0x782/0x1030 fs/f2fs/file.c:808 f2fs_truncate_blocks+0x10d/0x300 fs/f2fs/file.c:836 f2fs_truncate+0x417/0x720 fs/f2fs/file.c:886 f2fs_file_write_iter+0x1bdb/0x2550 fs/f2fs/file.c:5093 aio_write+0x56b/0x7c0 fs/aio.c:1633 io_submit_one+0x8a7/0x18a0 fs/aio.c:2052 __do_sys_io_submit fs/aio.c:2111 [inline] __se_sys_io_submit+0x171/0x2e0 fs/aio.c:2081 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7f238798cde9
index 18446744073709550692 (decimal, unsigned long long) = 0xfffffffffffffc64 (hexadecimal, unsigned long long) = -924 (decimal, long long)
In f2fs_truncate_inode_blocks(), UBSAN detects that get_nid() tries to access .i_nid[-924], it means both offset[0] and level should zero.
The possible case should be in f2fs_do_truncate_blocks(), we try to truncate inode size to zero, however, dn.ofs_in_node is zero and dn.node_page is not an inode page, so it fails to truncate inode page, and then pass zeroed free_from to f2fs_truncate_inode_blocks(), result in this issue.
if (dn.ofs_in_node || IS_INODE(dn.node_page)) {
f2fs_truncate_data_blocks_range(&dn, count);
free_from += count;
}I guess the reason why dn.node_page is not an inode page could be: there are multiple nat entries share the same node block address, once the node block address was reused, f2fs_get_node_page() may load a non-inode block.
Let's add a sanity check for such condition to avoid out-of-bounds access issue.
--- fs/f2fs/node.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/f2fs/node.c +8 -1
@@ -1134,7 +1134,14 @@ int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from)trace_f2fs_truncate_inode_blocks_enter (inode, from); level =get_node_path (inode, from, offset, noffset); -if (level <0 ) { +if (level <=0 ) { +if (!level) { + level = -EFSCORRUPTED ; +f2fs_err (sbi,"%s: inode ino=%lx has corrupted node block, from:%lu addrs:%u" , + __func__, inode->i_ino, + from,ADDRS_PER_INODE (inode)); +set_sbi_flag (sbi,SBI_NEED_FSCK ); + }trace_f2fs_truncate_inode_blocks_exit (inode, level);return level; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 81/414 ASoC: amd: yc: update quirk data for new Lenovo model
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Syed Saba kareem <[email protected]>
[ Upstream commit 5a4dd520ef8a94ecf81ac77b90d6a03e91c100a9 ]
Update Quirk data for new Lenovo model 83J2 for YC platform.
--- sound/soc/amd/yc/acp6x-mach.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/soc/amd/yc/acp6x-mach.c +7 -0
@@ -339,6 +339,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "83Q3"), } }, + { + .driver_data = &acp6x_card, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"LENOVO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "83J2"), + } + }, { .driver_data = &acp6x_card, .matches = {
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 108/414 net: sfp: add quirk for FS SFP-10GM-T copper SFP+ module
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Martin Schiller <[email protected]>
[ Upstream commit 05ec5c085eb7ae044d49e04a3cff194a0b2a3251 ]
Add quirk for a copper SFP that identifies itself as "FS" "SFP-10GM-T". It uses RollBall protocol to talk to the PHY and needs 4 sec wait before probing the PHY.
--- drivers/net/phy/sfp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/phy/sfp.c +6 -5
@@ -385,7 +385,7 @@ static void sfp_fixup_rollball(struct sfp *sfp) sfp->phy_t_retry =msecs_to_jiffies (1000 ); } -static void sfp_fixup_fs_2_5gt (struct sfp *sfp) +static void sfp_fixup_rollball_wait4s (struct sfp *sfp) {sfp_fixup_rollball (sfp);
@@ -399,7 +399,7 @@ static void sfp_fixup_fs_2_5gt(struct sfp *sfp)static void sfp_fixup_fs_10gt (struct sfp *sfp) {sfp_fixup_10gbaset_30m (sfp); -sfp_fixup_fs_2_5gt (sfp); +sfp_fixup_rollball_wait4s (sfp); }static void sfp_fixup_halny_gsfp (struct sfp *sfp)
@@ -479,9 +479,10 @@ static const struct sfp_quirk sfp_quirks[] = {// PHY. SFP_QUIRK_F ("FS" ,"SFP-10G-T" , sfp_fixup_fs_10gt), -// Fiberstore SFP-2.5G-T uses Rollball protocol to talk to the PHY and -// needs 4 sec wait before probing the PHY. - SFP_QUIRK_F("FS", "SFP-2.5G-T", sfp_fixup_fs_2_5gt), +// Fiberstore SFP-2.5G-T and SFP-10GM-T uses Rollball protocol to talk +// to the PHY and needs 4 sec wait before probing the PHY. +SFP_QUIRK_F ("FS" ,"SFP-2.5G-T" , sfp_fixup_rollball_wait4s), + SFP_QUIRK_F("FS", "SFP-10GM-T", sfp_fixup_rollball_wait4s),// Fiberstore GPON-ONU-34-20BI can operate at 2500base-X, but report 1.2GBd // NRZ in their EEPROM
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 109/414 ahci: add PCI ID for Marvell 88SE9215 SATA Controller
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Daniel Kral <[email protected]>
[ Upstream commit 885251dc35767b1c992f6909532ca366c830814a ]
Add support for Marvell Technology Group Ltd. 88SE9215 SATA 6 Gb/s controller, which is e.g. used in the DAWICONTROL DC-614e RAID bus controller and was not automatically recognized before.
Tested with a DAWICONTROL DC-614e RAID bus controller.
--- drivers/ata/ahci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/ata/ahci.c +2 -0
@@ -589,6 +589,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { .driver_data = board_ahci_yes_fbs }, { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x91a3), .driver_data = board_ahci_yes_fbs }, + { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9215), + .driver_data = board_ahci_yes_fbs }, { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9230), .driver_data = board_ahci_yes_fbs }, { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9235),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 82/414 platform/x86: x86-android-tablets: Add select POWER_SUPPLY to Kconfig
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
[ Upstream commit 2c30357e755b087217c7643fda2b8aea6d6deda4 ]
Commit c78dd25138d1 ("platform/x86: x86-android-tablets: Add Vexia EDU ATLA 10 EC battery driver"), adds power_supply class registering to the x86-android-tablets code.
Add "select POWER_SUPPLY" to the Kconfig entry to avoid these errors:
ERROR: modpost: "power_supply_get_drvdata" [drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.ko] undefined!
ERROR: modpost: "power_supply_changed" [drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.ko] undefined!
ERROR: modpost: "devm_power_supply_register" [drivers/platform/x86/x86-android-tablets/vexia_atla10_ec.ko] undefined!
When POWER_SUPPLY support is not enabled.
--- drivers/platform/x86/x86-android-tablets/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/x86-android-tablets/Kconfig +1 -0
@@ -10,6 +10,7 @@ config X86_ANDROID_TABLETS depends on ACPI && EFI && PCI select NEW_LEDS select LEDS_CLASS + select POWER_SUPPLY help X86 tablets which ship with Android as (part of) the factory image typically have various problems with their DSDTs. The factory kernels
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 83/414 wifi: ath11k: Fix DMA buffer allocation to resolve SWIOTLB issues
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: P Praneesh <[email protected]>
[ Upstream commit 1bcd20981834928ccc5d981aacb806bb523d8b29 ]
Currently, the driver allocates cacheable DMA buffers for rings like HAL_REO_DST and HAL_WBM2SW_RELEASE. The buffers for HAL_WBM2SW_RELEASE are large (1024 KiB), exceeding the SWIOTLB slot size of 256 KiB. This leads to "swiotlb buffer is full" error messages on systems without an IOMMU that use SWIOTLB, causing driver initialization failures. The driver calls dma_map_single() with these large buffers obtained from kzalloc(), resulting in ring initialization errors on systems without an IOMMU that use SWIOTLB.
To address these issues, replace the flawed buffer allocation mechanism with the appropriate DMA API. Specifically, use dma_alloc_noncoherent() for cacheable DMA buffers, ensuring proper freeing of buffers with dma_free_noncoherent().
Error log:
[ 10.194343] ath11k_pci 0000:04:00.0: swiotlb buffer is full (sz:1048583 bytes), total 32768 (slots), used 2529 (slots) [ 10.194406] ath11k_pci 0000:04:00.0: failed to set up tcl_comp ring (0) :-12 [ 10.194781] ath11k_pci 0000:04:00.0: failed to init DP: -12
Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
--- drivers/net/wireless/ath/ath11k/dp.c | 35 +++++++++------------------- 1 file changed, 11 insertions(+), 24 deletions(-)
drivers/net/wireless/ath/ath11k/dp.c +11 -24
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <crypto/hash.h>
@@ -104,14 +104,12 @@ void ath11k_dp_srng_cleanup(struct ath11k_base *ab, struct dp_srng *ring)if (!ring->vaddr_unaligned)return ; -if (ring->cached) { -dma_unmap_single (ab->dev, ring->paddr_unaligned, ring->size, -DMA_FROM_DEVICE ); -kfree (ring->vaddr_unaligned); - }else { +if (ring->cached) +dma_free_noncoherent (ab->dev, ring->size, ring->vaddr_unaligned, + ring->paddr_unaligned,DMA_FROM_DEVICE ); +else dma_free_coherent (ab->dev, ring->size, ring->vaddr_unaligned, ring->paddr_unaligned); - } ring->vaddr_unaligned =NULL ; }
@@ -249,25 +247,14 @@ int ath11k_dp_srng_setup(struct ath11k_base *ab, struct dp_srng *ring,default : cached = false; } - -if (cached) { - ring->vaddr_unaligned =kzalloc (ring->size,GFP_KERNEL ); -if (!ring->vaddr_unaligned) -return -ENOMEM ; - - ring->paddr_unaligned =dma_map_single (ab->dev, - ring->vaddr_unaligned, - ring->size, -DMA_FROM_DEVICE ); -if (dma_mapping_error (ab->dev, ring->paddr_unaligned)) { -kfree (ring->vaddr_unaligned); - ring->vaddr_unaligned =NULL ; -return -ENOMEM ; - } - } } -if (!cached) +if (cached) + ring->vaddr_unaligned =dma_alloc_noncoherent (ab->dev, ring->size, + &ring->paddr_unaligned, +DMA_FROM_DEVICE , +GFP_KERNEL ); +else ring->vaddr_unaligned =dma_alloc_coherent (ab->dev, ring->size, &ring->paddr_unaligned,GFP_KERNEL );
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 84/414 wifi: ath11k: fix memory leak in ath11k_xxx_remove()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqing Pan <[email protected]>
[ Upstream commit efb24b1f0d29537714dd3cc46fb335ac27855251 ]
The firmware memory was allocated in ath11k_pci_probe() or ath11k_ahb_probe(), but not freed in ath11k_xxx_remove() in case ATH11K_FLAG_QMI_FAIL bit is set. So call ath11k_fw_destroy() to free the memory.
Found while fixing the same problem in ath12k:
https://lore.kernel.org/linux-wireless/[email protected]
Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04546-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1
--- drivers/net/wireless/ath/ath11k/ahb.c | 4 +++- drivers/net/wireless/ath/ath11k/core.c | 3 +-- drivers/net/wireless/ath/ath11k/fw.c | 3 ++- drivers/net/wireless/ath/ath11k/pci.c | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-)
drivers/net/wireless/ath/ath11k/ahb.c +3 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. -* Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2022-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h>
@@ -1290,6 +1290,7 @@ static void ath11k_ahb_remove(struct platform_device *pdev)ath11k_core_deinit (ab); qmi_fail: +ath11k_fw_destroy (ab);ath11k_ahb_free_resources (ab); }
@@ -1309,6 +1310,7 @@ static void ath11k_ahb_shutdown(struct platform_device *pdev)ath11k_core_deinit (ab); free_resources: +ath11k_fw_destroy (ab);ath11k_ahb_free_resources (ab); }
drivers/net/wireless/ath/ath11k/core.c +1 -2
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h>
@@ -2214,7 +2214,6 @@ void ath11k_core_deinit(struct ath11k_base *ab)ath11k_hif_power_down (ab);ath11k_mac_destroy (ab);ath11k_core_soc_destroy (ab); -ath11k_fw_destroy (ab); }EXPORT_SYMBOL (ath11k_core_deinit);
drivers/net/wireless/ath/ath11k/fw.c +2 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* -* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2022-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include "core.h"
@@ -166,3 +166,4 @@ void ath11k_fw_destroy(struct ath11k_base *ab) {release_firmware (ab->fw.fw); } +EXPORT_SYMBOL (ath11k_fw_destroy);
drivers/net/wireless/ath/ath11k/pci.c +2 -1
@@ -1,7 +1,7 @@// SPDX-License-Identifier: BSD-3-Clause-Clear /* * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. -* Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved. +* Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ #include <linux/module.h>
@@ -981,6 +981,7 @@ static void ath11k_pci_remove(struct pci_dev *pdev)ath11k_core_deinit (ab); qmi_fail: +ath11k_fw_destroy (ab);ath11k_mhi_unregister (ab_pci);ath11k_pcic_free_irq (ab);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 85/414 wifi: ath12k: fix memory leak in ath12k_pci_remove()
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Miaoqing Pan <[email protected]>
[ Upstream commit 1b24394ed5c8a8d8f7b9e3aa9044c31495d46f2e ]
Kmemleak reported this error:
unreferenced object 0xffff1c165cec3060 (size 32):
comm "insmod", pid 560, jiffies 4296964570 (age 235.596s)
backtrace:
[<000000005434db68>] __kmem_cache_alloc_node+0x1f4/0x2c0
[<000000001203b155>] kmalloc_trace+0x40/0x88
[<0000000028adc9c8>] _request_firmware+0xb8/0x608
[<00000000cad1aef7>] firmware_request_nowarn+0x50/0x80
[<000000005011a682>] local_pci_probe+0x48/0xd0
[<00000000077cd295>] pci_device_probe+0xb4/0x200
[<0000000087184c94>] really_probe+0x150/0x2c0The firmware memory was allocated in ath12k_pci_probe(), but not freed in ath12k_pci_remove() in case ATH12K_FLAG_QMI_FAIL bit is set. So call ath12k_fw_unmap() to free the memory.
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.2.0-02280-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1
--- drivers/net/wireless/ath/ath12k/pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wireless/ath/ath12k/pci.c +1 -0
@@ -1727,6 +1727,7 @@ static void ath12k_pci_remove(struct pci_dev *pdev)ath12k_core_deinit (ab); qmi_fail: +ath12k_fw_unmap (ab);ath12k_mhi_unregister (ab_pci);ath12k_pci_free_irq (ab);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 86/414 wifi: ath12k: Fix invalid entry fetch in ath12k_dp_mon_srng_process
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: P Praneesh <[email protected]>
[ Upstream commit 63fdc4509bcf483e79548de6bc08bf3c8e504bb3 ]
Currently, ath12k_dp_mon_srng_process uses ath12k_hal_srng_src_get_next_entry to fetch the next entry from the destination ring. This is incorrect because ath12k_hal_srng_src_get_next_entry is intended for source rings, not destination rings. This leads to invalid entry fetches, causing potential data corruption or crashes due to accessing incorrect memory locations. This happens because the source ring and destination ring have different handling mechanisms and using the wrong function results in incorrect pointer arithmetic and ring management.
To fix this issue, replace the call to ath12k_hal_srng_src_get_next_entry with ath12k_hal_srng_dst_get_next_entry in ath12k_dp_mon_srng_process. This ensures that the correct function is used for fetching entries from the destination ring, preventing invalid memory accesses.
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3
--- drivers/net/wireless/ath/ath12k/dp_mon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath12k/dp_mon.c +1 -1
@@ -2545,7 +2545,7 @@ int ath12k_dp_mon_rx_process_stats(struct ath12k *ar, int mac_id, dest_idx =0 ; move_next:ath12k_dp_mon_buf_replenish (ab, buf_ring,1 ); -ath12k_hal_srng_src_get_next_entry (ab, srng); +ath12k_hal_srng_dst_get_next_entry (ab, srng); num_buffs_reaped++; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 87/414 ata: libata-core: Add external to the libata.force kernel parameter
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Niklas Cassel <[email protected]>
[ Upstream commit deca423213cb33feda15e261e7b5b992077a6a08 ]
Commit ae1f3db006b7 ("ata: ahci: do not enable LPM on external ports") changed so that LPM is not enabled on external ports (hotplug-capable or eSATA ports).
This is because hotplug and LPM are mutually exclusive, see 7.3.1 Hot Plug Removal Detection and Power Management Interaction in AHCI 1.3.1.
This does require that firmware has set the appropate bits (HPCP or ESP) in PxCMD (which is a per port register in the AHCI controller).
If the firmware has failed to mark a port as hotplug-capable or eSATA in PxCMD, then there is currently not much a user can do.
If LPM is enabled on the port, hotplug insertions and removals will not be detected on that port.
In order to allow a user to fix up broken firmware, add 'external' to the libata.force kernel parameter.
libata.force can be specified either on the kernel command line, or as a kernel module parameter.
For more information, see Documentation/admin-guide/kernel-parameters.txt.
--- .../admin-guide/kernel-parameters.txt | 2 + drivers/ata/libata-core.c | 38 +++++++++++++++++++ 2 files changed, 40 insertions(+)
Documentation/admin-guide/kernel-parameters.txt +2 -0
@@ -3036,6 +3036,8 @@ * max_sec_lba48: Set or clear transfer size limit to 65535 sectors. + * external: Mark port as external (hotplug-capable). + * [no]lpm: Enable or disable link power management. * [no]setxfer: Indicate if transfer speed mode setting
drivers/ata/libata-core.c +38 -0
@@ -88,6 +88,7 @@ struct ata_force_param {unsigned int xfer_mask;unsigned int quirk_on;unsigned int quirk_off; +unsigned int pflags_on;u16 lflags_on;u16 lflags_off; };
@@ -331,6 +332,35 @@ void ata_force_cbl(struct ata_port *ap) } } +/** +* ata_force_pflags - force port flags according to libata.force +* @ap: ATA port of interest +* +* Force port flags according to libata.force and whine about it. +* +* LOCKING: +* EH context. +*/ +static void ata_force_pflags (struct ata_port *ap) +{ +int i; + +for (i = ata_force_tbl_size -1 ; i >=0 ; i--) { +const struct ata_force_ent *fe = &ata_force_tbl[i]; + +if (fe->port !=-1 && fe->port != ap->print_id) +continue ; + +/* let pflags stack */ +if (fe->param.pflags_on) { + ap->pflags |= fe->param.pflags_on; +ata_port_notice (ap, +"FORCE: port flag 0x%x forced -> 0x%x\n" , + fe->param.pflags_on, ap->pflags); + } + } +} +/** * ata_force_link_limits - force link limits according to libata.force * @link: ATA link of interest
@@ -486,6 +516,7 @@ static void ata_force_quirks(struct ata_device *dev) } }#else +static inline void ata_force_pflags (struct ata_port *ap) { }static inline void ata_force_link_limits (struct ata_link *link) { }static inline void ata_force_xfermask (struct ata_device *dev) { }static inline void ata_force_quirks (struct ata_device *dev) { }
@@ -5460,6 +5491,8 @@ struct ata_port *ata_port_alloc(struct ata_host *host)#endif ata_sff_port_init (ap); +ata_force_pflags (ap); +return ap; }EXPORT_SYMBOL_GPL (ata_port_alloc);
@@ -6272,6 +6305,9 @@ EXPORT_SYMBOL_GPL(ata_platform_remove_one); { "no" #name, .lflags_on = (flags) }, \ { #name, .lflags_off = (flags) } +#define force_pflag_on (name, flags) \ + { #name, .pflags_on = (flags) } +#define force_quirk_on (name, flag) \ { #name, .quirk_on = (flag) }
@@ -6331,6 +6367,8 @@ static const struct ata_force_param force_tbl[] __initconst = {force_lflag_on (rstonce,ATA_LFLAG_RST_ONCE ),force_lflag_onoff (dbdelay,ATA_LFLAG_NO_DEBOUNCE_DELAY ), +force_pflag_on (external,ATA_PFLAG_EXTERNAL ), +force_quirk_onoff (ncq,ATA_QUIRK_NONCQ ),force_quirk_onoff (ncqtrim,ATA_QUIRK_NO_NCQ_TRIM ), force_quirk_onoff(ncqati, ATA_QUIRK_NO_NCQ_ON_ATI),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 78/414 mmc: dw_mmc: add a quirk for accessing 64-bit FIFOs in two halves
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kaustabh Chakraborty <[email protected]>
[ Upstream commit 57c0902f8bec51add5a1eb908d8b876592725d81 ]
In certain DW MMC implementations (such as in some Exynos7870 controllers), 64-bit read/write is not allowed from a 64-bit FIFO. Add a quirk which facilitates accessing the 64-bit FIFO registers in two 32-bit halves.
--- drivers/mmc/host/dw_mmc.c | 94 ++++++++++++++++++++++++++++++++++++++- drivers/mmc/host/dw_mmc.h | 27 +++++++++++ 2 files changed, 119 insertions(+), 2 deletions(-)
drivers/mmc/host/dw_mmc.c +92 -2
@@ -2579,6 +2579,91 @@ static void dw_mci_pull_data64(struct dw_mci *host, void *buf, int cnt) } } +static void dw_mci_push_data64_32 (struct dw_mci *host,void *buf,int cnt) +{ +struct mmc_data *data = host->data; +int init_cnt = cnt; + +/* try and push anything in the part_buf */ +if (unlikely (host->part_buf_count)) { +int len =dw_mci_push_part_bytes (host, buf, cnt); + + buf += len; + cnt -= len; + +if (host->part_buf_count ==8 ) { +mci_fifo_l_writeq (host->fifo_reg, host->part_buf); + host->part_buf_count =0 ; + } + } +#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +if (unlikely ((unsigned long )buf &0x7 )) { +while (cnt >=8 ) { +u64 aligned_buf[16 ]; +int len =min (cnt &-8 , (int )sizeof (aligned_buf)); +int items = len >>3 ; +int i; +/* memcpy from input buffer into aligned buffer */ +memcpy (aligned_buf, buf, len); + buf += len; + cnt -= len; +/* push data from aligned buffer into fifo */ +for (i =0 ; i < items; ++i) +mci_fifo_l_writeq (host->fifo_reg, aligned_buf[i]); + } + } else +#endif + { +u64 *pdata = buf; + +for (; cnt >=8 ; cnt -=8 ) +mci_fifo_l_writeq (host->fifo_reg, *pdata++); + buf = pdata; + } +/* put anything remaining in the part_buf */ +if (cnt) { +dw_mci_set_part_bytes (host, buf, cnt); +/* Push data if we have reached the expected data length */ +if ((data->bytes_xfered + init_cnt) == + (data->blksz * data->blocks)) +mci_fifo_l_writeq (host->fifo_reg, host->part_buf); + } +} + +static void dw_mci_pull_data64_32 (struct dw_mci *host,void *buf,int cnt) +{ +#ifndef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS +if (unlikely ((unsigned long )buf &0x7 )) { +while (cnt >=8 ) { +/* pull data from fifo into aligned buffer */ +u64 aligned_buf[16 ]; +int len =min (cnt &-8 , (int )sizeof (aligned_buf)); +int items = len >>3 ; +int i; + +for (i =0 ; i < items; ++i) + aligned_buf[i] =mci_fifo_l_readq (host->fifo_reg); + +/* memcpy from aligned buffer into output buffer */ +memcpy (buf, aligned_buf, len); + buf += len; + cnt -= len; + } + } else +#endif + { +u64 *pdata = buf; + +for (; cnt >=8 ; cnt -=8 ) + *pdata++ =mci_fifo_l_readq (host->fifo_reg); + buf = pdata; + } +if (cnt) { + host->part_buf =mci_fifo_l_readq (host->fifo_reg); +dw_mci_pull_final_bytes (host, buf, cnt); + } +} +static void dw_mci_pull_data (struct dw_mci *host,void *buf,int cnt) {int len;
@@ -3379,8 +3464,13 @@ int dw_mci_probe(struct dw_mci *host) width =16 ; host->data_shift =1 ; }else if (i ==2 ) { - host->push_data = dw_mci_push_data64; - host->pull_data = dw_mci_pull_data64; +if ((host->quirks &DW_MMC_QUIRK_FIFO64_32 )) { + host->push_data = dw_mci_push_data64_32; + host->pull_data = dw_mci_pull_data64_32; + }else { + host->push_data = dw_mci_push_data64; + host->pull_data = dw_mci_pull_data64; + } width =64 ; host->data_shift =3 ; }else {
drivers/mmc/host/dw_mmc.h +27 -0
@@ -281,6 +281,8 @@ struct dw_mci_board {/* Support for longer data read timeout */ #define DW_MMC_QUIRK_EXTENDED_TMOUT BIT(0) +/* Force 32-bit access to the FIFO */ +#define DW_MMC_QUIRK_FIFO64_32 BIT(1)#define DW_MMC_240A 0x240a#define DW_MMC_280A 0x280a
@@ -472,6 +474,31 @@ struct dw_mci_board {#define mci_fifo_writel (__value, __reg) __raw_writel(__reg, __value)#define mci_fifo_writeq (__value, __reg) __raw_writeq(__reg, __value) +/* +* Some dw_mmc devices have 64-bit FIFOs, but expect them to be +* accessed using two 32-bit accesses. If such controller is used +* with a 64-bit kernel, this has to be done explicitly. +*/ +static inline u64 mci_fifo_l_readq (void __iomem *addr) +{ +u64 ans; +u32 proxy[2 ]; + + proxy[0 ] =mci_fifo_readl (addr); + proxy[1 ] =mci_fifo_readl (addr +4 ); +memcpy (&ans, proxy,8 ); +return ans; +} + +static inline void mci_fifo_l_writeq (void __iomem *addr,u64 value) +{ +u32 proxy[2 ]; + +memcpy (proxy, &value,8 ); +mci_fifo_writel (addr, proxy[0 ]); +mci_fifo_writel (addr +4 , proxy[1 ]); +} +/* Register access macros */ #define mci_readl (dev, reg) \ readl_relaxed((dev)->regs + SDMMC_##reg)
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 111/414 Revert "f2fs: rebuild nat_bits during umount"
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chao Yu <[email protected]>
[ Upstream commit 19426c4988aa85298c1b4caf2889d37ec5c80fea ]
This reverts commit 94c821fb286b545d37549ff30a0c341e066f0d6c.
It reports that there is potential corruption in node footer, the most suspious feature is nat_bits, let's revert recovery related code.
--- fs/f2fs/checkpoint.c | 21 +++------ fs/f2fs/f2fs.h | 32 +++++++++++++- fs/f2fs/node.c | 101 ++++++++++--------------------------------- 3 files changed, 59 insertions(+), 95 deletions(-)
fs/f2fs/checkpoint.c +6 -15
@@ -1344,21 +1344,13 @@ static void update_ckpt_flags(struct f2fs_sb_info *sbi, struct cp_control *cpc)struct f2fs_checkpoint *ckpt =F2FS_CKPT (sbi);unsigned long flags; -if (cpc->reason &CP_UMOUNT ) { -if (le32_to_cpu (ckpt->cp_pack_total_block_count) + -NM_I (sbi)->nat_bits_blocks >BLKS_PER_SEG (sbi)) { -clear_ckpt_flags (sbi,CP_NAT_BITS_FLAG ); -f2fs_notice (sbi,"Disable nat_bits due to no space" ); - }else if (!is_set_ckpt_flags (sbi,CP_NAT_BITS_FLAG ) && -f2fs_nat_bitmap_enabled (sbi)) { -f2fs_enable_nat_bits (sbi); -set_ckpt_flags (sbi,CP_NAT_BITS_FLAG ); -f2fs_notice (sbi,"Rebuild and enable nat_bits" ); - } - } -spin_lock_irqsave (&sbi->cp_lock, flags); +if ((cpc->reason &CP_UMOUNT ) && +le32_to_cpu (ckpt->cp_pack_total_block_count) > + sbi->blocks_per_seg -NM_I (sbi)->nat_bits_blocks) +disable_nat_bits (sbi, false); +if (cpc->reason &CP_TRIMMED )__set_ckpt_flags (ckpt,CP_TRIMMED_FLAG );else
@@ -1541,8 +1533,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc) start_blk =__start_cp_next_addr (sbi);/* write nat bits */ -if ((cpc->reason &CP_UMOUNT ) && -is_set_ckpt_flags (sbi,CP_NAT_BITS_FLAG )) { +if (enabled_nat_bits (sbi, cpc)) {__u64 cp_ver =cur_cp_version (ckpt);block_t blk;
fs/f2fs/f2fs.h +30 -2
@@ -2232,6 +2232,36 @@ static inline void f2fs_up_write(struct f2fs_rwsem *sem)#endif } +static inline void disable_nat_bits (struct f2fs_sb_info *sbi,bool lock) +{ +unsigned long flags; +unsigned char *nat_bits; + +/* +* In order to re-enable nat_bits we need to call fsck.f2fs by +* set_sbi_flag(sbi, SBI_NEED_FSCK). But it may give huge cost, +* so let's rely on regular fsck or unclean shutdown. +*/ + +if (lock) +spin_lock_irqsave (&sbi->cp_lock, flags); +__clear_ckpt_flags (F2FS_CKPT (sbi),CP_NAT_BITS_FLAG ); + nat_bits =NM_I (sbi)->nat_bits; +NM_I (sbi)->nat_bits =NULL ; +if (lock) +spin_unlock_irqrestore (&sbi->cp_lock, flags); + +kvfree (nat_bits); +} + +static inline bool enabled_nat_bits (struct f2fs_sb_info *sbi, +struct cp_control *cpc) +{ +bool set =is_set_ckpt_flags (sbi,CP_NAT_BITS_FLAG ); + +return (cpc) ? (cpc->reason &CP_UMOUNT ) && set : set; +} +static inline void f2fs_lock_op (struct f2fs_sb_info *sbi) {f2fs_down_read (&sbi->cp_rwsem);
@@ -3675,7 +3705,6 @@ int f2fs_truncate_inode_blocks(struct inode *inode, pgoff_t from);int f2fs_truncate_xattr_node (struct inode *inode);int f2fs_wait_on_node_pages_writeback (struct f2fs_sb_info *sbi,unsigned int seq_id); -bool f2fs_nat_bitmap_enabled (struct f2fs_sb_info *sbi);int f2fs_remove_inode_page (struct inode *inode);struct page *f2fs_new_inode_page (struct inode *inode);struct page *f2fs_new_node_page (struct dnode_of_data *dn,unsigned int ofs);
@@ -3700,7 +3729,6 @@ int f2fs_recover_xattr_data(struct inode *inode, struct page *page);int f2fs_recover_inode_page (struct f2fs_sb_info *sbi,struct page *page);int f2fs_restore_node_summary (struct f2fs_sb_info *sbi,unsigned int segno,struct f2fs_summary_block *sum); -void f2fs_enable_nat_bits (struct f2fs_sb_info *sbi);int f2fs_flush_nat_entries (struct f2fs_sb_info *sbi,struct cp_control *cpc);int f2fs_build_node_manager (struct f2fs_sb_info *sbi);void f2fs_destroy_node_manager (struct f2fs_sb_info *sbi);
fs/f2fs/node.c +23 -78
178 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 120/414 Bluetooth: btusb: Add new VID/PID for WCN785x
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dorian Cruveiller <[email protected]>
[ Upstream commit c7629ccfa175e16bb44a60c469214e1a6051f63d ]
Add VID 0489 & PID e10d for Qualcomm WCN785x USB Bluetooth chip.
The information in /sys/kernel/debug/usb/devices about the Bluetooth device is listed as the below.
T: Bus=01 Lev=01 Prnt=01 Port=03 Cnt=03 Dev#= 4 Spd=12 MxCh= 0 D: Ver= 1.10 Cls=e0(wlcon) Sub=01 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=0489 ProdID=e10d Rev= 0.01 C:* #Ifs= 2 Cfg#= 1 Atr=e0 MxPwr=100mA I:* If#= 0 Alt= 0 #EPs= 3 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=81(I) Atr=03(Int.) MxPS= 16 Ivl=1ms E: Ad=82(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 0 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 0 Ivl=1ms I: If#= 1 Alt= 1 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 9 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 9 Ivl=1ms I: If#= 1 Alt= 2 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 17 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 17 Ivl=1ms I: If#= 1 Alt= 3 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 25 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 25 Ivl=1ms I: If#= 1 Alt= 4 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 33 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 33 Ivl=1ms I: If#= 1 Alt= 5 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 49 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 49 Ivl=1ms I: If#= 1 Alt= 6 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 63 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 63 Ivl=1ms I: If#= 1 Alt= 7 #EPs= 2 Cls=e0(wlcon) Sub=01 Prot=01 Driver=btusb E: Ad=83(I) Atr=01(Isoc) MxPS= 65 Ivl=1ms E: Ad=03(O) Atr=01(Isoc) MxPS= 65 Ivl=1ms
--- drivers/bluetooth/btusb.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bluetooth/btusb.c +2 -0
@@ -375,6 +375,8 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe0f3), .driver_info = BTUSB_QCA_WCN6855 | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe10d), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x13d3, 0x3623), .driver_info = BTUSB_QCA_WCN6855 | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x2c7c, 0x0130), .driver_info = BTUSB_QCA_WCN6855 |
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 121/414 Bluetooth: btintel_pcie: Add device id of Whale Peak
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kiran K <[email protected]>
[ Upstream commit 6b8c05e52d66e4fe4ab1df4c6e15f339ecd9aa51 ]
Add device of Whale Peak.
Output of sudo lspci -v -s 00:14.7:
00:14.7 Bluetooth: Intel Corporation Device e476
Subsystem: Intel Corporation Device 0011
Flags: bus master, fast devsel, latency 0, IRQ 16, IOMMU group 11 Memory at 11011c30000 (64-bit, non-prefetchable) [size=16K]
Capabilities: [c8] Power Management version 3
Capabilities: [d0] MSI: Enable- Count=1/1 Maskable- 64bit+
Capabilities: [40] Express Root Complex Integrated Endpoint, MSI 00
Capabilities: [80] MSI-X: Enable+ Count=32 Masked-
Capabilities: [100] Latency Tolerance Reporting
Kernel driver in use: btintel_pcie
Kernel modules: btintel_pcie
--- drivers/bluetooth/btintel_pcie.c | 1 + 1 file changed, 1 insertion(+)
drivers/bluetooth/btintel_pcie.c +1 -0
@@ -36,6 +36,7 @@/* Intel Bluetooth PCIe device id table */ static const struct pci_device_id btintel_pcie_table[] = { {BTINTEL_PCI_DEVICE (0xA876 ,PCI_ANY_ID ) }, + {BTINTEL_PCI_DEVICE (0xE476 ,PCI_ANY_ID ) }, {0 } };MODULE_DEVICE_TABLE (pci, btintel_pcie_table);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 122/414 Bluetooth: btusb: Add 13 USB device IDs for Qualcomm WCN785x
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zijun Hu <[email protected]>
[ Upstream commit 2dd1c1eee3e496fcc16971be4db5bb792a36025c ]
Add 13 USB device IDs for Qualcomm WCN785x, and these IDs are extracted from Windows driver inf file for various types of WoS (Windows on Snapdragon) laptop.
--- drivers/bluetooth/btusb.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/bluetooth/btusb.c +26 -0
@@ -375,12 +375,38 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe0f3), .driver_info = BTUSB_QCA_WCN6855 | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe100), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe103), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe10a), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe10d), .driver_info = BTUSB_QCA_WCN6855 | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe11b), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe11c), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe11f), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe141), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe14a), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe14b), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe14d), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x13d3, 0x3623), .driver_info = BTUSB_QCA_WCN6855 | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x13d3, 0x3624), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x2c7c, 0x0130), .driver_info = BTUSB_QCA_WCN6855 | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x2c7c, 0x0131), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x2c7c, 0x0132), .driver_info = BTUSB_QCA_WCN6855 | + BTUSB_WIDEBAND_SPEECH }, /* Broadcom BCM2035 */ { USB_DEVICE(0x0a5c, 0x2009), .driver_info = BTUSB_BCM92035 },
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 123/414 Bluetooth: hci_uart: fix race during initialization
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arseniy Krasnov <[email protected]>
[ Upstream commit 366ceff495f902182d42b6f41525c2474caf3f9a ]
'hci_register_dev()' calls power up function, which is executed by kworker - 'hci_power_on()'. This function does access to bluetooth chip using callbacks from 'hci_ldisc.c', for example 'hci_uart_send_frame()'. Now 'hci_uart_send_frame()' checks 'HCI_UART_PROTO_READY' bit set, and if not - it fails. Problem is that 'HCI_UART_PROTO_READY' is set after 'hci_register_dev()', and there is tiny chance that 'hci_power_on()' will be executed before setting this bit. In that case HCI init logic fails.
Patch moves setting of 'HCI_UART_PROTO_READY' before calling function 'hci_uart_register_dev()'.
--- drivers/bluetooth/hci_ldisc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/bluetooth/hci_ldisc.c +2 -1
@@ -707,12 +707,13 @@ static int hci_uart_set_proto(struct hci_uart *hu, int id) hu->proto = p; +set_bit (HCI_UART_PROTO_READY , &hu->flags); + err =hci_uart_register_dev (hu);if (err) {return err; } -set_bit (HCI_UART_PROTO_READY , &hu->flags);return 0 ; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 124/414 Bluetooth: btusb: Add 2 HWIDs for MT7922
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiande Lu <[email protected]>
[ Upstream commit a88643b7e48506777e175e80c902c727ddd90851 ]
Add below HWIDs for MediaTek MT7922 USB Bluetooth chip. VID 0x0489, PID 0xe152
VID 0x0489, PID 0xe153
Patch has been tested successfully and controller is recognized device pair successfully.
MT7922 module bring up message as below.
Bluetooth: Core ver 2.22
Bluetooth: HCI device and connection manager initialized
Bluetooth: HCI socket layer initialized
Bluetooth: L2CAP socket layer initialized
Bluetooth: SCO socket layer initialized
Bluetooth: hci0: HW/SW Version: 0x008a008a, Build Time: 20241106163512
Bluetooth: hci0: Device setup in 2284925 usecs
Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
Bluetooth: hci0: AOSP extensions version v1.00
Bluetooth: BNEP (Ethernet Emulation) ver 1.3
Bluetooth: BNEP filters: protocol multicast
Bluetooth: BNEP socket layer initialized
Bluetooth: MGMT ver 1.22
Bluetooth: RFCOMM TTY layer initialized
Bluetooth: RFCOMM socket layer initialized
Bluetooth: RFCOMM ver 1.11
--- drivers/bluetooth/btusb.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/bluetooth/btusb.c +4 -0
@@ -662,6 +662,10 @@ static const struct usb_device_id quirks_table[] = { BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x0489, 0xe102), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe152), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, + { USB_DEVICE(0x0489, 0xe153), .driver_info = BTUSB_MEDIATEK | + BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x04ca, 0x3804), .driver_info = BTUSB_MEDIATEK | BTUSB_WIDEBAND_SPEECH }, { USB_DEVICE(0x04ca, 0x38e4), .driver_info = BTUSB_MEDIATEK |
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 125/414 Bluetooth: hci_qca: use the power sequencer for wcn6750
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Janaki Ramaiah Thota <[email protected]>
[ Upstream commit 852cfdc7a5a5af54358325c1e0f490cc178d9664 ]
Older boards are having entry "enable-gpios" in dts, we can safely assume latest boards which are supporting PMU node enrty will support power sequencer.
--- drivers/bluetooth/hci_qca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bluetooth/hci_qca.c +1 -1
@@ -2346,6 +2346,7 @@ static int qca_serdev_probe(struct serdev_device *serdev)switch (qcadev->btsoc_type) {case QCA_WCN6855 :case QCA_WCN7850 : +case QCA_WCN6750 :if (!device_property_present (&serdev->dev,"enable-gpios" )) {/* * Backward compatibility with old DT sources. If the
@@ -2365,7 +2366,6 @@ static int qca_serdev_probe(struct serdev_device *serdev)case QCA_WCN3990 :case QCA_WCN3991 :case QCA_WCN3998 : -case QCA_WCN6750 : qcadev->bt_power->dev = &serdev->dev; err =qca_init_regulators (qcadev->bt_power, data->vregs, data->num_vregs);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 126/414 Bluetooth: qca: simplify WCN399x NVM loading
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 1cc41b5092e3aa511454ec882c525af311bee631 ]
The WCN399x code has two separate cases for loading the NVM data. In preparation to adding support for WCN3950, which also requires similar quirk, split the "variant" to be specified explicitly and merge two snprintfs into a single one.
--- drivers/bluetooth/btqca.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/bluetooth/btqca.c +6 -7
@@ -785,6 +785,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, const char *firmware_name) {struct qca_fw_config config = {}; +const char *variant ="" ;int err;u8 rom_ver =0 ;u32 soc_ver;
@@ -879,13 +880,11 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,case QCA_WCN3990 :case QCA_WCN3991 :case QCA_WCN3998 : -if (le32_to_cpu (ver.soc_id) ==QCA_WCN3991_SOC_ID ) { -snprintf (config.fwname,sizeof (config.fwname), -"qca/crnv%02xu.bin" , rom_ver); - }else { -snprintf (config.fwname,sizeof (config.fwname), -"qca/crnv%02x.bin" , rom_ver); - } +if (le32_to_cpu (ver.soc_id) ==QCA_WCN3991_SOC_ID ) + variant ="u" ; + +snprintf (config.fwname,sizeof (config.fwname), +"qca/crnv%02x%s.bin" , rom_ver, variant);break ;case QCA_WCN3988 : snprintf(config.fwname, sizeof(config.fwname),
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 127/414 Bluetooth: Add quirk for broken READ_VOICE_SETTING
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pedro Nishiyama <[email protected]>
[ Upstream commit ff26b2dd6568392f60fa67a4e58279938025c3af ]
Some fake controllers cannot be initialized because they return a smaller report than expected for READ_VOICE_SETTING.
--- include/net/bluetooth/hci.h | 8 ++++++++ include/net/bluetooth/hci_core.h | 4 ++++ net/bluetooth/hci_sync.c | 3 +++ 3 files changed, 15 insertions(+)
include/net/bluetooth/hci.h +8 -0
@@ -354,6 +354,14 @@ enum {* during the hdev->setup vendor callback. */ HCI_QUIRK_FIXUP_LE_EXT_ADV_REPORT_PHY , + +/* When this quirk is set, the HCI_OP_READ_VOICE_SETTING command is +* skipped. This is required for a subset of the CSR controller clones +* which erroneously claim to support it. +* +* This quirk must be set before hci_register_dev is called. +*/ + HCI_QUIRK_BROKEN_READ_VOICE_SETTING, };/* HCI device flags */
include/net/bluetooth/hci_core.h +4 -0
@@ -1931,6 +1931,10 @@ void hci_conn_del_sysfs(struct hci_conn *conn); ((dev)->commands[20 ] &0x10 && \ !test_bit(HCI_QUIRK_BROKEN_READ_ENC_KEY_SIZE, &hdev->quirks)) +#define read_voice_setting_capable (dev) \ + ((dev)->commands[9] & 0x04 && \ + !test_bit(HCI_QUIRK_BROKEN_READ_VOICE_SETTING, &(dev)->quirks)) +/* Use enhanced synchronous connection if command is supported and its quirk * has not been set. */
net/bluetooth/hci_sync.c +3 -0
@@ -3720,6 +3720,9 @@ static int hci_read_local_name_sync(struct hci_dev *hdev)/* Read Voice Setting */ static int hci_read_voice_setting_sync (struct hci_dev *hdev) { +if (!read_voice_setting_capable (hdev)) +return 0 ; +return __hci_cmd_sync_status (hdev,HCI_OP_READ_VOICE_SETTING ,0 ,NULL ,HCI_CMD_TIMEOUT ); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 128/414 Bluetooth: Add quirk for broken READ_PAGE_SCAN_TYPE
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pedro Nishiyama <[email protected]>
[ Upstream commit 127881334eaad639e0a19a399ee8c91d6c9dc982 ]
Some fake controllers cannot be initialized because they return a smaller report than expected for READ_PAGE_SCAN_TYPE.
--- include/net/bluetooth/hci.h | 8 ++++++++ net/bluetooth/hci_sync.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)
include/net/bluetooth/hci.h +8 -0
@@ -362,6 +362,14 @@ enum {* This quirk must be set before hci_register_dev is called. */ HCI_QUIRK_BROKEN_READ_VOICE_SETTING , + +/* When this quirk is set, the HCI_OP_READ_PAGE_SCAN_TYPE command is +* skipped. This is required for a subset of the CSR controller clones +* which erroneously claim to support it. +* +* This quirk must be set before hci_register_dev is called. +*/ + HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, };/* HCI device flags */
net/bluetooth/hci_sync.c +2 -1
@@ -4156,7 +4156,8 @@ static int hci_read_page_scan_type_sync(struct hci_dev *hdev)* support the Read Page Scan Type command. Check support for * this command in the bit mask of supported commands. */ -if (!(hdev->commands[13 ] &0x01 )) +if (!(hdev->commands[13 ] &0x01 ) || +test_bit (HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE , &hdev->quirks))return 0 ; return __hci_cmd_sync_status(hdev, HCI_OP_READ_PAGE_SCAN_TYPE,
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 129/414 drm: allow encoder mode_set even when connectors change for crtc
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Abhinav Kumar <[email protected]>
[ Upstream commit 7e182cb4f5567f53417b762ec0d679f0b6f0039d ]
In certain use-cases, a CRTC could switch between two encoders and because the mode being programmed on the CRTC remains the same during this switch, the CRTC's mode_changed remains false. In such cases, the encoder's mode_set also gets skipped.
Skipping mode_set on the encoder for such cases could cause an issue because even though the same CRTC mode was being used, the encoder type could have changed like the CRTC could have switched from a real time encoder to a writeback encoder OR vice-versa.
Allow encoder's mode_set to happen even when connectors changed on a CRTC and not just when the mode changed.
--- drivers/gpu/drm/drm_atomic_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_atomic_helper.c +1 -1
@@ -1376,7 +1376,7 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state) mode = &new_crtc_state->mode; adjusted_mode = &new_crtc_state->adjusted_mode; -if (!new_crtc_state->mode_changed) +if (!new_crtc_state->mode_changed && !new_crtc_state->connectors_changed)continue ; drm_dbg_atomic(dev, "modeset on [ENCODER:%d:%s]\n",
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 112/414 ext4: ignore xattrs past end
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bhupesh <[email protected]>
[ Upstream commit c8e008b60492cf6fd31ef127aea6d02fd3d314cd ]
Once inside 'ext4_xattr_inode_dec_ref_all' we should ignore xattrs entries past the 'end' entry.
This fixes the following KASAN reported issue:
==================================================================
BUG: KASAN: slab-use-after-free in ext4_xattr_inode_dec_ref_all+0xb8c/0xe90 Read of size 4 at addr ffff888012c120c4 by task repro/2065 CPU: 1 UID: 0 PID: 2065 Comm: repro Not tainted 6.13.0-rc2+ #11 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x1fd/0x300 ? tcp_gro_dev_warn+0x260/0x260 ? _printk+0xc0/0x100 ? read_lock_is_recursive+0x10/0x10 ? irq_work_queue+0x72/0xf0 ? __virt_addr_valid+0x17b/0x4b0 print_address_description+0x78/0x390 print_report+0x107/0x1f0 ? __virt_addr_valid+0x17b/0x4b0 ? __virt_addr_valid+0x3ff/0x4b0 ? __phys_addr+0xb5/0x160 ? ext4_xattr_inode_dec_ref_all+0xb8c/0xe90 kasan_report+0xcc/0x100 ? ext4_xattr_inode_dec_ref_all+0xb8c/0xe90 ext4_xattr_inode_dec_ref_all+0xb8c/0xe90 ? ext4_xattr_delete_inode+0xd30/0xd30 ? __ext4_journal_ensure_credits+0x5f0/0x5f0 ? __ext4_journal_ensure_credits+0x2b/0x5f0 ? inode_update_timestamps+0x410/0x410 ext4_xattr_delete_inode+0xb64/0xd30 ? ext4_truncate+0xb70/0xdc0 ? ext4_expand_extra_isize_ea+0x1d20/0x1d20 ? __ext4_mark_inode_dirty+0x670/0x670 ? ext4_journal_check_start+0x16f/0x240 ? ext4_inode_is_fast_symlink+0x2f2/0x3a0 ext4_evict_inode+0xc8c/0xff0 ? ext4_inode_is_fast_symlink+0x3a0/0x3a0 ? do_raw_spin_unlock+0x53/0x8a0 ? ext4_inode_is_fast_symlink+0x3a0/0x3a0 evict+0x4ac/0x950 ? proc_nr_inodes+0x310/0x310 ? trace_ext4_drop_inode+0xa2/0x220 ? _raw_spin_unlock+0x1a/0x30 ? iput+0x4cb/0x7e0 do_unlinkat+0x495/0x7c0 ? try_break_deleg+0x120/0x120 ? 0xffffffff81000000 ? __check_object_size+0x15a/0x210 ? strncpy_from_user+0x13e/0x250 ? getname_flags+0x1dc/0x530 __x64_sys_unlinkat+0xc8/0xf0 do_syscall_64+0x65/0x110 entry_SYSCALL_64_after_hwframe+0x67/0x6f RIP: 0033:0x434ffd Code: 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 8 RSP: 002b:00007ffc50fa7b28 EFLAGS: 00000246 ORIG_RAX: 0000000000000107 RAX: ffffffffffffffda RBX: 00007ffc50fa7e18 RCX: 0000000000434ffd RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000005 RBP: 00007ffc50fa7be0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffc50fa7e08 R14: 00000000004bbf30 R15: 0000000000000001 </TASK> The buggy address belongs to the object at ffff888012c12000 which belongs to the cache filp of size 360
The buggy address is located 196 bytes inside of
freed 360-byte region [ffff888012c12000, ffff888012c12168)
The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x12c12 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x40(head|node=0|zone=0) page_type: f5(slab) raw: 0000000000000040 ffff888000ad7640 ffffea0000497a00 dead000000000004 raw: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000
head: 0000000000000040 ffff888000ad7640 ffffea0000497a00 dead000000000004
head: 0000000000000000 0000000000100010 00000001f5000000 0000000000000000
head: 0000000000000001 ffffea00004b0481 ffffffffffffffff 0000000000000000
head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888012c11f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888012c12000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
Quoted 1 line
ffff888012c12080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888012c12100: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc
ffff888012c12180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
--- fs/ext4/xattr.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
fs/ext4/xattr.c +10 -1
@@ -1176,15 +1176,24 @@ ext4_xattr_inode_dec_ref_all(handle_t *handle, struct inode *parent, {struct inode *ea_inode;struct ext4_xattr_entry *entry; +struct ext4_iloc iloc;bool dirty = false;unsigned int ea_ino;int err;int credits; +void *end; + +if (block_csum) + end = (void *)bh->b_data + bh->b_size; +else { +ext4_get_inode_loc (parent, &iloc); + end = (void *)ext4_raw_inode (&iloc) +EXT4_SB (parent->i_sb)->s_inode_size; + }/* One credit for dec ref on ea_inode, one for orphan list addition, */ credits =2 + extra_credits; -for (entry = first; !IS_LAST_ENTRY (entry); +for (entry = first; (void *)entry < end && !IS_LAST_ENTRY (entry); entry =EXT4_XATTR_NEXT (entry)) {if (!entry->e_value_inum)continue ;
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 130/414 drm/xe/bmg: Add new PCI IDs
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shekhar Chauhan <[email protected]>
[ Upstream commit fa8ffaae1b15236b8afb0fbbc04117ff7c900a83 ]
Add 3 new PCI IDs for BMG.
v2: Fix typo -> Replace '.' with ','
--- include/drm/intel/pciids.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/drm/intel/pciids.h +4 -1
@@ -817,7 +817,10 @@ MACRO__(0xE20B, ## __VA_ARGS__), \ MACRO__(0xE20C, ## __VA_ARGS__), \ MACRO__(0xE20D, ## __VA_ARGS__), \ - MACRO__(0xE212, ## __VA_ARGS__) + MACRO__(0xE210, ## __VA_ARGS__), \ + MACRO__(0xE212, ## __VA_ARGS__), \ + MACRO__(0xE215, ## __VA_ARGS__), \ + MACRO__(0xE216, ## __VA_ARGS__)/* PTL */ #define INTEL_PTL_IDS (MACRO__ , ...) \
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 131/414 drm/xe/pf: Dont send BEGIN_ID if VF has no context/doorbells
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit 21ccac0e22aaf27b767f9de4bf573e7c47f619c8 ]
It turned out that GuC validates VF configuration immediately after receiving "some" set of configuration KLVs and complains if one of the critical, from GuC understanding, resource is left unprovisioned, even if PF should be still allowed to make late VF config adjustments, since VF was not yet started.
This issue was discovered after we decided to asynchronously re-send configuration KLVs after GT reset/resume, as then fair VF auto-provisioning could already allocate some of the resources, which was a prerequiste for sending those config KLVs:
# fair GGTT provisioning
[] xe 0000:00:02.0: [drm] GT0: PF: pushed VF1 config with 2 KLVs:
[] xe 0000:00:02.0: [drm] GT0: { key 0x0001 : 64b value 0x176a000 } # ggtt_start
[] xe 0000:00:02.0: [drm] GT0: { key 0x0002 : 64b value 0xfd696000 } # ggtt_size
[] xe 0000:00:02.0: [drm] GT0: PF: VF1 provisioned with 4251541504 (3.96 GiB) GGTT
# re-provisioning worker
[] xe 0000:00:02.0: [drm] *ERROR* GT0: H2G request 0x5503 failed: error 0x60 hint 0x0
[] xe 0000:00:02.0: [drm] GT0: PF: Failed to push VF1 14 config KLVs (-EIO)
[] xe 0000:00:02.0: [drm] GT0: { key 0x0001 : 64b value 0x176a000 } # ggtt_start
[] xe 0000:00:02.0: [drm] GT0: { key 0x0002 : 64b value 0xfd696000 } # ggtt_size
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a0b : 32b value 0 } # begin_ctx_id
[] xe 0000:00:02.0: [drm] GT0: { key 0x0004 : 32b value 0 } # num_contexts
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a0a : 32b value 0 } # begin_db_id
[] xe 0000:00:02.0: [drm] GT0: { key 0x0006 : 32b value 0 } # num_doorbells
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a01 : 32b value 0 } # exec_quantum
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a02 : 32b value 0 } # preempt_timeout
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a03 : 32b value 0 } # cat_error_count
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a04 : 32b value 0 } # engine_reset_count
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a05 : 32b value 0 } # page_fault_count
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a06 : 32b value 0 } # guc_time_us
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a07 : 32b value 0 } # irq_time_us
[] xe 0000:00:02.0: [drm] GT0: { key 0x8a08 : 32b value 0 } # doorbell_time_us
[] xe 0000:00:02.0: [drm] GT0: PF: Failed to push VF1 configuration (-EIO)To avoid such errors stop sending BEGIN_CONTEXT/DOORBELL_ID KLVs if no GuC context/doorbell IDs were provisioned to VF.
--- drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c +2 -2
@@ -257,7 +257,7 @@ static u32 encode_config(u32 *cfg, const struct xe_gt_sriov_config *config, bool n +=encode_config_ggtt (cfg, config, details); -if (details) { +if (details && config->num_ctxs) { cfg[n++] =PREP_GUC_KLV_TAG (VF_CFG_BEGIN_CONTEXT_ID ); cfg[n++] = config->begin_ctx; }
@@ -265,7 +265,7 @@ static u32 encode_config(u32 *cfg, const struct xe_gt_sriov_config *config, bool cfg[n++] =PREP_GUC_KLV_TAG (VF_CFG_NUM_CONTEXTS ); cfg[n++] = config->num_ctxs; -if (details) { +if (details && config->num_dbs) { cfg[n++] =PREP_GUC_KLV_TAG (VF_CFG_BEGIN_DOORBELL_ID ); cfg[n++] = config->begin_db; }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 132/414 drm/xe/vf: Dont try to trigger a full GT reset if VF
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Wajdeczko <[email protected]>
[ Upstream commit 459777724d306315070d24608fcd89aea85516d6 ]
VFs don't have access to the GDRST(0x941c) register that driver uses to reset a GT. Attempt to trigger a reset using debugfs:
$ cat /sys/kernel/debug/dri/0000:00:02.1/gt0/force_reset
or due to a hang condition detected by the driver leads to:
[ ] xe 0000:00:02.1: [drm] GT0: trying reset from force_reset [xe]
[ ] xe 0000:00:02.1: [drm] GT0: reset queued
[ ] xe 0000:00:02.1: [drm] GT0: reset started
[ ] ------------[ cut here ]------------
[ ] xe 0000:00:02.1: [drm] GT0: VF is trying to write 0x1 to an inaccessible register 0x941c+0x0 [ ] WARNING: CPU: 3 PID: 3069 at drivers/gpu/drm/xe/xe_gt_sriov_vf.c:996 xe_gt_sriov_vf_write32+0xc6/0x580 [xe] [ ] RIP: 0010:xe_gt_sriov_vf_write32+0xc6/0x580 [xe]
[ ] Call Trace:
[ ] <TASK> [ ] ? show_regs+0x6c/0x80 [ ] ? __warn+0x93/0x1c0 [ ] ? xe_gt_sriov_vf_write32+0xc6/0x580 [xe] [ ] ? report_bug+0x182/0x1b0 [ ] ? handle_bug+0x6e/0xb0 [ ] ? exc_invalid_op+0x18/0x80 [ ] ? asm_exc_invalid_op+0x1b/0x20 [ ] ? xe_gt_sriov_vf_write32+0xc6/0x580 [xe] [ ] ? xe_gt_sriov_vf_write32+0xc6/0x580 [xe] [ ] ? xe_gt_tlb_invalidation_reset+0xef/0x110 [xe] [ ] ? __mutex_unlock_slowpath+0x41/0x2e0 [ ] xe_mmio_write32+0x64/0x150 [xe] [ ] do_gt_reset+0x2f/0xa0 [xe] [ ] gt_reset_worker+0x14e/0x1e0 [xe] [ ] process_one_work+0x21c/0x740 [ ] worker_thread+0x1db/0x3c0
Fix that by sending H2G VF_RESET(0x5507) action instead.
--- drivers/gpu/drm/xe/xe_gt.c | 4 ++++ drivers/gpu/drm/xe/xe_gt_sriov_vf.c | 16 ++++++++++++++++ drivers/gpu/drm/xe/xe_gt_sriov_vf.h | 1 + 3 files changed, 21 insertions(+)
drivers/gpu/drm/xe/xe_gt.c +4 -0
@@ -32,6 +32,7 @@#include "xe_gt_pagefault.h" #include "xe_gt_printk.h" #include "xe_gt_sriov_pf.h" +#include "xe_gt_sriov_vf.h" #include "xe_gt_sysfs.h" #include "xe_gt_tlb_invalidation.h" #include "xe_gt_topology.h"
@@ -676,6 +677,9 @@ static int do_gt_reset(struct xe_gt *gt) {int err; +if (IS_SRIOV_VF (gt_to_xe (gt))) +return xe_gt_sriov_vf_reset (gt); +xe_gsc_wa_14015076503 (gt, true);xe_mmio_write32 (>->mmio,GDRST ,GRDOM_FULL );
drivers/gpu/drm/xe/xe_gt_sriov_vf.c +16 -0
@@ -57,6 +57,22 @@ static int vf_reset_guc_state(struct xe_gt *gt)return err; } +/** +* xe_gt_sriov_vf_reset - Reset GuC VF internal state. +* @gt: the &xe_gt +* +* It requires functional `GuC MMIO based communication`_. +* +* Return: 0 on success or a negative error code on failure. +*/ +int xe_gt_sriov_vf_reset (struct xe_gt *gt) +{ +if (!xe_device_uc_enabled (gt_to_xe (gt))) +return -ENODEV ; + +return vf_reset_guc_state (gt); +} +static int guc_action_match_version (struct xe_guc *guc,u32 wanted_branch,u32 wanted_major,u32 wanted_minor,u32 *branch,u32 *major,u32 *minor,u32 *patch)
drivers/gpu/drm/xe/xe_gt_sriov_vf.h +1 -0
@@ -12,6 +12,7 @@ struct drm_printer;struct xe_gt ;struct xe_reg ; +int xe_gt_sriov_vf_reset (struct xe_gt *gt);int xe_gt_sriov_vf_bootstrap (struct xe_gt *gt);int xe_gt_sriov_vf_query_config (struct xe_gt *gt);int xe_gt_sriov_vf_connect (struct xe_gt *gt);
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 133/414 drm/amd/display: Update Cursor request mode to the beginning prefetch always
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhikai Zhai <[email protected]>
[ Upstream commit 4a4077b4b63a8404efd6d37fc2926f03fb25bace ]
[Why]
The double buffer cursor registers is updated by the cursor vupdate event. There is a gap between vupdate and cursor data fetch if cursor fetch data reletive to cursor position. Cursor corruption will happen if we update the cursor surface in this gap.
[How]
Modify the cursor request mode to the beginning prefetch always and avoid wraparound calculation issues.
--- .../amd/display/dc/hubp/dcn31/dcn31_hubp.c | 2 +- .../amd/display/dc/hwss/dcn10/dcn10_hwseq.c | 22 ++++++++----------- 2 files changed, 10 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/hubp/dcn31/dcn31_hubp.c +1 -1
@@ -44,7 +44,7 @@ void hubp31_set_unbounded_requesting(struct hubp *hubp, bool enable)struct dcn20_hubp *hubp2 =TO_DCN20_HUBP (hubp);REG_UPDATE (DCHUBP_CNTL ,HUBP_UNBOUNDED_REQ_MODE , enable); -REG_UPDATE (CURSOR_CONTROL ,CURSOR_REQ_MODE , enable); +REG_UPDATE (CURSOR_CONTROL ,CURSOR_REQ_MODE ,1 ); }void hubp31_soft_reset (struct hubp *hubp,bool reset)
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +9 -13
@@ -1992,20 +1992,11 @@ static void delay_cursor_until_vupdate(struct dc *dc, struct pipe_ctx *pipe_ctx) dc->hwss.get_position (&pipe_ctx,1 , &position); vpos = position.vertical_count; -/* Avoid wraparound calculation issues */ - vupdate_start += stream->timing.v_total; - vupdate_end += stream->timing.v_total; - vpos += stream->timing.v_total; -if (vpos <= vupdate_start) {/* VPOS is in VACTIVE or back porch. */ lines_to_vupdate = vupdate_start - vpos; - }else if (vpos > vupdate_end) { -/* VPOS is in the front porch. */ -return ; }else { -/* VPOS is in VUPDATE. */ - lines_to_vupdate =0 ; + lines_to_vupdate = stream->timing.v_total - vpos + vupdate_start; }/* Calculate time until VUPDATE in microseconds. */
@@ -2013,13 +2004,18 @@ static void delay_cursor_until_vupdate(struct dc *dc, struct pipe_ctx *pipe_ctx) stream->timing.h_total *10000u / stream->timing.pix_clk_100hz; us_to_vupdate = lines_to_vupdate * us_per_line; +/* Stall out until the cursor update completes. */ +if (vupdate_end < vupdate_start) + vupdate_end += stream->timing.v_total; + +/* Position is in the range of vupdate start and end*/ +if (lines_to_vupdate > stream->timing.v_total - vupdate_end + vupdate_start) + us_to_vupdate =0 ; +/* 70 us is a conservative estimate of cursor update time*/ if (us_to_vupdate >70 )return ; -/* Stall out until the cursor update completes. */ -if (vupdate_end < vupdate_start) - vupdate_end += stream->timing.v_total; us_vupdate = (vupdate_end - vupdate_start +1 ) * us_per_line;udelay (us_to_vupdate + us_vupdate); }
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 134/414 drm/amd/display: add workaround flag to link to force FFE preset
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Brendan Tam <[email protected]>
[ Upstream commit 51d1b338541dea83fec8e6f95d3e46fa469a73a8 ]
[Why]
There have been instances of some monitors being unable to link train on their reported link speed using their selected FFE preset. If a different FFE preset is found that has a higher rate of success during link training this workaround can be used to force its FFE preset.
[How]
A new link workaround flag is made called force_dp_ffe_preset. The flag is checked in override_training_settings and will set lt_settings->ffe_preset which is null if the flag is not set. The flag is then set in override_lane_settings.
--- drivers/gpu/drm/amd/display/dc/dc.h | 2 ++ .../gpu/drm/amd/display/dc/link/protocols/link_dp_training.c | 2 ++ 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/display/dc/dc.h +2 -0
@@ -1780,7 +1780,9 @@ struct dc_link {bool dongle_mode_timing_override;bool blank_stream_on_ocs_change;bool read_dpcd204h_on_irq_hpd; +bool force_dp_ffe_preset; } wa_flags; +union dc_dp_ffe_preset forced_dp_ffe_preset;struct link_mst_stream_allocation_table mst_stream_alloc_table;struct dc_link_status link_status;
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_training.c +2 -0
@@ -736,6 +736,8 @@ void override_training_settings( lt_settings->pre_emphasis = overrides->pre_emphasis;if (overrides->post_cursor2 !=NULL ) lt_settings->post_cursor2 = overrides->post_cursor2; +if (link->wa_flags.force_dp_ffe_preset && !dp_is_lttpr_present (link)) + lt_settings->ffe_preset = &link->forced_dp_ffe_preset;if (overrides->ffe_preset !=NULL ) lt_settings->ffe_preset = overrides->ffe_preset;/* Override HW lane settings with BIOS forced values if present */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 135/414 drm/amdgpu: Unlocked unmap only clear page table leaves
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Philip Yang <[email protected]>
[ Upstream commit 23b645231eeffdaf44021debac881d2f26824150 ]
SVM migration unmap pages from GPU and then update mapping to GPU to recover page fault. Currently unmap clears the PDE entry for range length >= huge page and free PTB bo, update mapping to alloc new PT bo. There is race bug that the freed entry bo maybe still on the pt_free list, reused when updating mapping and then freed, leave invalid PDE entry and cause GPU page fault.
By setting the update to clear only one PDE entry or clear PTB, to avoid unmap to free PTE bo. This fixes the race bug and improve the unmap and map to GPU performance. Update mapping to huge page will still free the PTB bo.
With this change, the vm->pt_freed list and work is not needed. Add WARN_ON(unlocked) in amdgpu_vm_pt_free_dfs to catch if unmap to free the PTB.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 4 --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 43 +++++++---------------- 3 files changed, 13 insertions(+), 38 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0 -4
@@ -2440,8 +2440,6 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,spin_lock_init (&vm->status_lock);INIT_LIST_HEAD (&vm->freed);INIT_LIST_HEAD (&vm->done); -INIT_LIST_HEAD (&vm->pt_freed); -INIT_WORK (&vm->pt_free_work, amdgpu_vm_pt_free_work);INIT_KFIFO (vm->faults); r =amdgpu_vm_init_entities (adev, vm);
@@ -2613,8 +2611,6 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm)amdgpu_amdkfd_gpuvm_destroy_cb (adev, vm); -flush_work (&vm->pt_free_work); - root =amdgpu_bo_ref (vm->root.bo);amdgpu_bo_reserve (root, true);amdgpu_vm_put_task_info (vm->task_info);
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +0 -4
@@ -369,10 +369,6 @@ struct amdgpu_vm {/* BOs which are invalidated, has been updated in the PTs */ struct list_head done; -/* PT BOs scheduled to free and fill with zero if vm_resv is not hold */ -struct list_head pt_freed; -struct work_struct pt_free_work; -/* contains the page directory */ struct amdgpu_vm_bo_base root;struct dma_fence *last_update;
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c +13 -30
66 lines not on this page · raw message
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 136/414 drm: panel-orientation-quirks: Add support for AYANEO 2S
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Wyatt <[email protected]>
[ Upstream commit eb8f1e3e8ee10cff591d4a47437dfd34d850d454 ]
AYANEO 2S uses the same panel and orientation as the AYANEO 2.
Update the AYANEO 2 DMI match to also match AYANEO 2S.
--- drivers/gpu/drm/drm_panel_orientation_quirks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_panel_orientation_quirks.c +2 -2
@@ -184,10 +184,10 @@ static const struct dmi_system_id orientation_data[] = { DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "T103HAF"), }, .driver_data = (void *)&lcd800x1280_rightside_up, - }, { /* AYA NEO AYANEO 2 */ + }, { /* AYA NEO AYANEO 2/2S */ .matches = {DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"AYANEO" ), - DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "AYANEO 2"), + DMI_MATCH(DMI_PRODUCT_NAME, "AYANEO 2"), }, .driver_data = (void *)&lcd1200x1920_rightside_up, }, { /* AYA NEO 2021 */
Signature · 1 line
2.39.5
Greg Kroah-Hartman
maintainerPATCH 137/414 drm: panel-orientation-quirks: Add quirks for AYA NEO Flip DS and KB
In reply to Greg Kroah-Hartman6.13-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrew Wyatt <[email protected]>
[ Upstream commit 529741c331da1fbf54f86c6ec3a4558b9b0b16dc ]
The AYA NEO Flip DS and KB both use a 1080x1920 portrait LCD panel. The Flip DS additionally uses a 640x960 portrait LCD panel as a second display.
Add DMI matches to correctly rotate these panels.
--- drivers/gpu/drm/drm_panel_orientation_quirks.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/drm_panel_orientation_quirks.c +18 -0
@@ -93,6 +93,12 @@ static const struct drm_dmi_panel_orientation_data onegx1_pro = { .orientation = DRM_MODE_PANEL_ORIENTATION_RIGHT_UP, }; +static const struct drm_dmi_panel_orientation_data lcd640x960_leftside_up = { + .width =640 , + .height =960 , + .orientation =DRM_MODE_PANEL_ORIENTATION_LEFT_UP , +}; +static const struct drm_dmi_panel_orientation_data lcd720x1280_rightside_up = { .width =720 , .height =1280 ,
@@ -202,6 +208,18 @@ static const struct dmi_system_id orientation_data[] = { DMI_MATCH(DMI_PRODUCT_NAME, "AIR"), }, .driver_data = (void *)&lcd1080x1920_leftside_up, + }, { /* AYA NEO Flip DS Bottom Screen */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"AYANEO" ), + DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "FLIP DS"), + }, + .driver_data = (void *)&lcd640x960_leftside_up, + }, { /* AYA NEO Flip KB/DS Top Screen */ + .matches = { +DMI_EXACT_MATCH (DMI_SYS_VENDOR ,"AYANEO" ), + DMI_MATCH(DMI_PRODUCT_NAME, "FLIP"), + }, + .driver_data = (void *)&lcd1080x1920_leftside_up, }, { /* AYA NEO Founder */ .matches = { DMI_EXACT_MATCH(DMI_SYS_VENDOR, "AYA NEO"),
Signature · 1 line
2.39.5