5.4.244-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 151/161 power: supply: bq27xxx: Fix I2C IRQ race on remove
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 444ff00734f3878cd54ddd1ed5e2e6dbea9326d5 upstream.
devm_request_threaded_irq() requested IRQs are only free-ed after the driver's remove function has ran. So the IRQ could trigger and call bq27xxx_battery_update() after bq27xxx_battery_teardown() has already run.
Switch to explicitly free-ing the IRQ in bq27xxx_battery_i2c_remove() to fix this.
--- drivers/power/supply/bq27xxx_battery_i2c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/supply/bq27xxx_battery_i2c.c +2 -1
@@ -187,7 +187,7 @@ static int bq27xxx_battery_i2c_probe(stri2c_set_clientdata (client, di);if (client->irq) { - ret =devm_request_threaded_irq (&client->dev, client->irq, + ret =request_threaded_irq (client->irq,NULL , bq27xxx_battery_irq_handler_thread,IRQF_ONESHOT , di->name, di);
@@ -217,6 +217,7 @@ static int bq27xxx_battery_i2c_remove(st {struct bq27xxx_device_info *di =i2c_get_clientdata (client); +free_irq (client->irq, di);bq27xxx_battery_teardown (di);mutex_lock (&battery_mutex);
Greg Kroah-Hartman
maintainerPATCH 152/161 power: supply: bq27xxx: Fix poll_interval handling and races on remove
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit c00bc80462afc7963f449d7f21d896d2f629cacc upstream.
Before this patch bq27xxx_battery_teardown() was setting poll_interval = 0 to avoid bq27xxx_battery_update() requeuing the delayed_work item.
There are 2 problems with this:
1. If the driver is unbound through sysfs, rather then the module being rmmod-ed, this changes poll_interval unexpectedly
2. This is racy, after it being set poll_interval could be changed before bq27xxx_battery_update() checks it through /sys/module/bq27xxx_battery/parameters/poll_interval
Fix this by added a removed attribute to struct bq27xxx_device_info and using that instead of setting poll_interval to 0.
There also is another poll_interval related race on remove(), writing /sys/module/bq27xxx_battery/parameters/poll_interval will requeue the delayed_work item for all devices on the bq27xxx_battery_devices list and the device being removed was only removed from that list after cancelling the delayed_work item.
Fix this by moving the removal from the bq27xxx_battery_devices list to before cancelling the delayed_work item.
--- drivers/power/supply/bq27xxx_battery.c | 22 +++++++++------------- include/linux/power/bq27xxx_battery.h | 1 + 2 files changed, 10 insertions(+), 13 deletions(-)
drivers/power/supply/bq27xxx_battery.c +9 -13
@@ -1598,7 +1598,7 @@ static void bq27xxx_battery_update_unloc di->last_update = jiffies; -if (poll_interval >0 ) +if (!di->removed && poll_interval >0 )mod_delayed_work (system_wq, &di->work, poll_interval *HZ ); }
@@ -1915,22 +1915,18 @@ EXPORT_SYMBOL_GPL(bq27xxx_battery_setup)void bq27xxx_battery_teardown (struct bq27xxx_device_info *di) { -/* -* power_supply_unregister call bq27xxx_battery_get_property which -* call bq27xxx_battery_poll. -* Make sure that bq27xxx_battery_poll will not call -* schedule_delayed_work again after unregister (which cause OOPS). -*/ - poll_interval =0 ; - -cancel_delayed_work_sync (&di->work); - -power_supply_unregister (di->bat); -mutex_lock (&bq27xxx_list_lock);list_del (&di->list);mutex_unlock (&bq27xxx_list_lock); +/* Set removed to avoid bq27xxx_battery_update() re-queuing the work */ +mutex_lock (&di->lock); + di->removed = true; +mutex_unlock (&di->lock); + +cancel_delayed_work_sync (&di->work); + +power_supply_unregister (di->bat);mutex_destroy (&di->lock); }EXPORT_SYMBOL_GPL (bq27xxx_battery_teardown);
include/linux/power/bq27xxx_battery.h +1 -0
@@ -64,6 +64,7 @@ struct bq27xxx_device_info {struct bq27xxx_access_methods bus;struct bq27xxx_reg_cache cache;int charge_design_full; +bool removed;unsigned long last_update;struct delayed_work work;struct power_supply *bat;
Greg Kroah-Hartman
maintainerPATCH 153/161 power: supply: sbs-charger: Fix INHIBITED bit for Status reg
In reply to Greg Kroah-HartmanFrom: Daisuke Nojiri <[email protected]>
commit b2f2a3c9800208b0db2c2e34b05323757117faa2 upstream.
CHARGE_INHIBITED bit position of the ChargerStatus register is actually 0 not 1. This patch corrects it.
--- drivers/power/supply/sbs-charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/sbs-charger.c +1 -1
@@ -25,7 +25,7 @@#define SBS_CHARGER_REG_STATUS 0x13#define SBS_CHARGER_REG_ALARM_WARNING 0x16 -#define SBS_CHARGER_STATUS_CHARGE_INHIBITED BIT(1) +#define SBS_CHARGER_STATUS_CHARGE_INHIBITED BIT(0)#define SBS_CHARGER_STATUS_RES_COLD BIT(9)#define SBS_CHARGER_STATUS_RES_HOT BIT(10)#define SBS_CHARGER_STATUS_BATTERY_PRESENT BIT(14)
Greg Kroah-Hartman
maintainerPATCH 154/161 coresight: Fix signedness bug in tmc_etr_buf_insert_barrier_packet()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit f67bc15e526bb9920683ad6c1891ff9e08981335 upstream.
This code generates a Smatch warning:
drivers/hwtracing/coresight/coresight-tmc-etr.c:947 tmc_etr_buf_insert_barrier_packet()
error: uninitialized symbol 'bufp'.
The problem is that if tmc_sg_table_get_data() returns -EINVAL, then when we test if "len < CORESIGHT_BARRIER_PKT_SIZE", the negative "len" value is type promoted to a high unsigned long value which is greater than CORESIGHT_BARRIER_PKT_SIZE. Fix this bug by adding an explicit check for error codes.
--- drivers/hwtracing/coresight/coresight-tmc-etr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-tmc-etr.c +1 -1
@@ -909,7 +909,7 @@ tmc_etr_buf_insert_barrier_packet(struct len =tmc_etr_buf_get_data (etr_buf, offset,CORESIGHT_BARRIER_PKT_SIZE , &bufp); -if (WARN_ON (len <CORESIGHT_BARRIER_PKT_SIZE )) +if (WARN_ON (len <0 || len <CORESIGHT_BARRIER_PKT_SIZE ))return -EINVAL ;coresight_insert_barrier_packet (bufp);return offset +CORESIGHT_BARRIER_PKT_SIZE ;
Greg Kroah-Hartman
maintainerPATCH 128/161 ALSA: hda/realtek: Enable headset onLenovo M70/M90
In reply to Greg Kroah-HartmanFrom: Bin Li <[email protected]>
commit 4ca110cab46561cd74a2acd9b447435acb4bec5f upstream.
Lenovo M70/M90 Gen4 are equipped with ALC897, and they need ALC897_FIXUP_HEADSET_MIC_PIN quirk to make its headset mic work. The previous quirk for M70/M90 is for Gen3.
--- sound/pci/hda/patch_realtek.c | 2 ++ 1 file changed, 2 insertions(+)
sound/pci/hda/patch_realtek.c +2 -0
@@ -10370,6 +10370,8 @@ static const struct snd_pci_quirk alc662SND_PCI_QUIRK (0x17aa ,0x32cb ,"Lenovo ThinkCentre M70" ,ALC897_FIXUP_HEADSET_MIC_PIN ),SND_PCI_QUIRK (0x17aa ,0x32cf ,"Lenovo ThinkCentre M950" ,ALC897_FIXUP_HEADSET_MIC_PIN ),SND_PCI_QUIRK (0x17aa ,0x32f7 ,"Lenovo ThinkCentre M90" ,ALC897_FIXUP_HEADSET_MIC_PIN ), +SND_PCI_QUIRK (0x17aa ,0x3321 ,"Lenovo ThinkCentre M70 Gen4" ,ALC897_FIXUP_HEADSET_MIC_PIN ), +SND_PCI_QUIRK (0x17aa ,0x331b ,"Lenovo ThinkCentre M90 Gen4" ,ALC897_FIXUP_HEADSET_MIC_PIN ),SND_PCI_QUIRK (0x17aa ,0x3742 ,"Lenovo TianYi510Pro-14IOB" ,ALC897_FIXUP_HEADSET_MIC_PIN2 ),SND_PCI_QUIRK (0x17aa ,0x38af ,"Lenovo Ideapad Y550P" ,ALC662_FIXUP_IDEAPAD ), SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Ideapad Y550", ALC662_FIXUP_IDEAPAD),
Greg Kroah-Hartman
maintainerPATCH 129/161 m68k: Move signal frame following exception on 68020/030
In reply to Greg Kroah-HartmanFrom: Finn Thain <[email protected]>
commit b845b574f86dcb6a70dfa698aa87a237b0878d2a upstream.
On 68030/020, an instruction such as, moveml %a2-%a3/%a5,%sp@- may cause a stack page fault during instruction execution (i.e. not at an instruction boundary) and produce a format 0xB exception frame.
In this situation, the value of USP will be unreliable. If a signal is to be delivered following the exception, this USP value is used to calculate the location for a signal frame. This can result in a corrupted user stack.
The corruption was detected in dash (actually in glibc) where it showed up as an intermittent "stack smashing detected" message and crash following signal delivery for SIGCHLD.
It was hard to reproduce that failure because delivery of the signal raced with the page fault and because the kernel places an unpredictable gap of up to 7 bytes between the USP and the signal frame.
A format 0xB exception frame can be produced by a bus error or an address error. The 68030 Users Manual says that address errors occur immediately upon detection during instruction prefetch. The instruction pipeline allows prefetch to overlap with other instructions, which means an address error can arise during the execution of a different instruction. So it seems likely that this patch may help in the address error case also.
--- arch/m68k/kernel/signal.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
arch/m68k/kernel/signal.c +10 -4
@@ -883,11 +883,17 @@ static inline int rt_setup_ucontext(stru }static inline void __user * -get_sigframe (struct ksignal *ksig,size_t frame_size) +get_sigframe (struct ksignal *ksig,struct pt_regs *tregs,size_t frame_size) {unsigned long usp =sigsp (rdusp (), ksig); +unsigned long gap =0 ; -return (void __user *)((usp - frame_size) &-8UL ); +if (CPU_IS_020_OR_030 && tregs->format ==0xb ) { +/* USP is unreliable so use worst-case value */ + gap =256 ; + } + +return (void __user *)((usp - gap - frame_size) &-8UL ); } static int setup_frame(struct ksignal *ksig, sigset_t *set,
@@ -905,7 +911,7 @@ static int setup_frame(struct ksignal *kreturn -EFAULT ; } - frame =get_sigframe (ksig,sizeof (*frame) + fsize); + frame =get_sigframe (ksig, tregs,sizeof (*frame) + fsize);if (fsize) err |=copy_to_user (frame +1 , regs +1 , fsize);
@@ -976,7 +982,7 @@ static int setup_rt_frame(struct ksignalreturn -EFAULT ; } - frame =get_sigframe (ksig,sizeof (*frame)); + frame =get_sigframe (ksig, tregs,sizeof (*frame));if (fsize) err |=copy_to_user (&frame->uc.uc_extra, regs +1 , fsize);
Greg Kroah-Hartman
maintainerPATCH 130/161 parisc: Handle kgdb breakpoints only in kernel context
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit 6888ff04e37d01295620a73f3f7efbc79f6ef152 upstream.
The kernel kgdb break instructions should only be handled when running in kernel context.
--- arch/parisc/kernel/traps.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/parisc/kernel/traps.c +2 -2
@@ -305,8 +305,8 @@ static void handle_break(struct pt_regs#endif #ifdef CONFIG_KGDB -if (unlikely (iir ==PARISC_KGDB_COMPILED_BREAK_INSN || - iir ==PARISC_KGDB_BREAK_INSN )) { +if (unlikely ((iir ==PARISC_KGDB_COMPILED_BREAK_INSN || + iir ==PARISC_KGDB_BREAK_INSN )) && !user_mode (regs)) {kgdb_handle_exception (9 ,SIGTRAP ,0 , regs);return ; }
Greg Kroah-Hartman
maintainerPATCH 131/161 parisc: Allow to reboot machine after system halt
In reply to Greg Kroah-HartmanFrom: Helge Deller <[email protected]>
commit 2028315cf59bb899a5ac7e87dc48ecb8fac7ac24 upstream.
In case a machine can't power-off itself on system shutdown, allow the user to reboot it by pressing the RETURN key.
--- arch/parisc/kernel/process.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
arch/parisc/kernel/process.c +8 -3
@@ -124,13 +124,18 @@ void machine_power_off(void)/* It seems we have no way to power the system off via * software. The user has to press the button himself. */ -printk (KERN_EMERG "System shut down completed.\n" -"Please power this system off now." ); +printk ("Power off or press RETURN to reboot.\n" );/* prevent soft lockup/stalled CPU messages for endless loop. */ rcu_sysrq_start ();lockup_detector_soft_poweroff (); -for (;;); +while (1 ) { +/* reboot if user presses RETURN key */ +if (pdc_iodc_getc () ==13 ) { +printk ("Rebooting...\n" ); +machine_restart (NULL ); + } + } }void (*pm_power_off)(void );
Greg Kroah-Hartman
maintainerPATCH 132/161 gpio: mockup: Fix mode of debugfs files
In reply to Greg Kroah-HartmanFrom: Zev Weiss <[email protected]>
commit 0a1bb16e0fe6650c3841e611de374bfd5578ad70 upstream.
This driver's debugfs files have had a read operation since commit 2a9e27408e12 ("gpio: mockup: rework debugfs interface"), but were still being created with write-only mode bits. Update them to indicate that the files can also be read.
--- drivers/gpio/gpio-mockup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-mockup.c +1 -1
@@ -339,7 +339,7 @@ static void gpio_mockup_debugfs_setup(st priv->offset = i; priv->desc = &gc->gpiodev->descs[i]; -debugfs_create_file (name,0200 , chip->dbg_dir, priv, +debugfs_create_file (name,0600 , chip->dbg_dir, priv, &gpio_mockup_debugfs_ops); }
Greg Kroah-Hartman
maintainerPATCH 133/161 btrfs: use nofs when cleaning up aborted transactions
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
commit 597441b3436a43011f31ce71dc0a6c0bf5ce958a upstream.
Our CI system caught a lockdep splat:
======================================================
WARNING: possible circular locking dependency detected
6.3.0-rc7+ #1167 Not tainted
------------------------------------------------------
kswapd0/46 is trying to acquire lock:
ffff8c6543abd650 (sb_internal#2){++++}-{0:0}, at: btrfs_commit_inode_delayed_inode+0x5f/0x120
but task is already holding lock:
ffffffffabe61b40 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x4aa/0x7a0
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (fs_reclaim){+.+.}-{0:0}:
fs_reclaim_acquire+0xa5/0xe0 kmem_cache_alloc+0x31/0x2c0 alloc_extent_state+0x1d/0xd0 __clear_extent_bit+0x2e0/0x4f0 try_release_extent_mapping+0x216/0x280 btrfs_release_folio+0x2e/0x90 invalidate_inode_pages2_range+0x397/0x470 btrfs_cleanup_dirty_bgs+0x9e/0x210 btrfs_cleanup_one_transaction+0x22/0x760 btrfs_commit_transaction+0x3b7/0x13a0 create_subvol+0x59b/0x970 btrfs_mksubvol+0x435/0x4f0 __btrfs_ioctl_snap_create+0x11e/0x1b0 btrfs_ioctl_snap_create_v2+0xbf/0x140 btrfs_ioctl+0xa45/0x28f0 __x64_sys_ioctl+0x88/0xc0 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc
-> #0 (sb_internal#2){++++}-{0:0}:
__lock_acquire+0x1435/0x21a0 lock_acquire+0xc2/0x2b0 start_transaction+0x401/0x730 btrfs_commit_inode_delayed_inode+0x5f/0x120 btrfs_evict_inode+0x292/0x3d0 evict+0xcc/0x1d0 inode_lru_isolate+0x14d/0x1e0 __list_lru_walk_one+0xbe/0x1c0 list_lru_walk_one+0x58/0x80 prune_icache_sb+0x39/0x60 super_cache_scan+0x161/0x1f0 do_shrink_slab+0x163/0x340 shrink_slab+0x1d3/0x290 shrink_node+0x300/0x720 balance_pgdat+0x35c/0x7a0 kswapd+0x205/0x410 kthread+0xf0/0x120 ret_from_fork+0x29/0x50
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(fs_reclaim);
lock(sb_internal#2);
lock(fs_reclaim);
lock(sb_internal#2);*** DEADLOCK ***
3 locks held by kswapd0/46:
#0: ffffffffabe61b40 (fs_reclaim){+.+.}-{0:0}, at: balance_pgdat+0x4aa/0x7a0 #1: ffffffffabe50270 (shrinker_rwsem){++++}-{3:3}, at: shrink_slab+0x113/0x290 #2: ffff8c6543abd0e0 (&type->s_umount_key#44){++++}-{3:3}, at: super_cache_scan+0x38/0x1f0
stack backtrace: CPU: 0 PID: 46 Comm: kswapd0 Not tainted 6.3.0-rc7+ #1167 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 Call Trace: <TASK> dump_stack_lvl+0x58/0x90 check_noncircular+0xd6/0x100 ? save_trace+0x3f/0x310 ? add_lock_to_list+0x97/0x120 __lock_acquire+0x1435/0x21a0 lock_acquire+0xc2/0x2b0 ? btrfs_commit_inode_delayed_inode+0x5f/0x120 start_transaction+0x401/0x730 ? btrfs_commit_inode_delayed_inode+0x5f/0x120 btrfs_commit_inode_delayed_inode+0x5f/0x120 btrfs_evict_inode+0x292/0x3d0 ? lock_release+0x134/0x270 ? __pfx_wake_bit_function+0x10/0x10 evict+0xcc/0x1d0 inode_lru_isolate+0x14d/0x1e0 __list_lru_walk_one+0xbe/0x1c0 ? __pfx_inode_lru_isolate+0x10/0x10 ? __pfx_inode_lru_isolate+0x10/0x10 list_lru_walk_one+0x58/0x80 prune_icache_sb+0x39/0x60 super_cache_scan+0x161/0x1f0 do_shrink_slab+0x163/0x340 shrink_slab+0x1d3/0x290 shrink_node+0x300/0x720 balance_pgdat+0x35c/0x7a0 kswapd+0x205/0x410 ? __pfx_autoremove_wake_function+0x10/0x10 ? __pfx_kswapd+0x10/0x10 kthread+0xf0/0x120 ? __pfx_kthread+0x10/0x10 ret_from_fork+0x29/0x50 </TASK>
This happens because when we abort the transaction in the transaction commit path we call invalidate_inode_pages2_range on our block group cache inodes (if we have space cache v1) and any delalloc inodes we may have. The plain invalidate_inode_pages2_range() call passes through GFP_KERNEL, which makes sense in most cases, but not here. Wrap these two invalidate callees with memalloc_nofs_save/memalloc_nofs_restore to make sure we don't end up with the fs reclaim dependency under the transaction dependency.
--- fs/btrfs/disk-io.c | 9 +++++++++ 1 file changed, 9 insertions(+)
fs/btrfs/disk-io.c +9 -0
@@ -4408,7 +4408,11 @@ static void btrfs_destroy_delalloc_inode*/ inode =igrab (&btrfs_inode->vfs_inode);if (inode) { +unsigned int nofs_flag; + + nofs_flag =memalloc_nofs_save ();invalidate_inode_pages2 (inode->i_mapping); +memalloc_nofs_restore (nofs_flag);iput (inode); }spin_lock (&root->delalloc_lock);
@@ -4526,7 +4530,12 @@ static void btrfs_cleanup_bg_io(struct b inode = cache->io_ctl.inode;if (inode) { +unsigned int nofs_flag; + + nofs_flag =memalloc_nofs_save ();invalidate_inode_pages2 (inode->i_mapping); +memalloc_nofs_restore (nofs_flag); +BTRFS_I (inode)->generation =0 ; cache->io_ctl.inode =NULL ;iput (inode);
Greg Kroah-Hartman
maintainerPATCH 134/161 x86/mm: Avoid incomplete Global INVLPG flushes
In reply to Greg Kroah-HartmanFrom: Dave Hansen <[email protected]>
commit ce0b15d11ad837fbacc5356941712218e38a0a83 upstream.
The INVLPG instruction is used to invalidate TLB entries for a specified virtual address. When PCIDs are enabled, INVLPG is supposed to invalidate TLB entries for the specified address for both the current PCID *and* Global entries. (Note: Only kernel mappings set Global=1.)
Unfortunately, some INVLPG implementations can leave Global translations unflushed when PCIDs are enabled.
As a workaround, never enable PCIDs on affected processors.
I expect there to eventually be microcode mitigations to replace this software workaround. However, the exact version numbers where that will happen are not known today. Once the version numbers are set in stone, the processor list can be tweaked to only disable PCIDs on affected processors with affected microcode.
Note: if anyone wants a quick fix that doesn't require patching, just stick 'nopcid' on your kernel command-line.
--- arch/x86/include/asm/intel-family.h | 5 +++++ arch/x86/mm/init.c | 25 +++++++++++++++++++++++++ 2 files changed, 30 insertions(+)
arch/x86/include/asm/intel-family.h +5 -0
@@ -96,6 +96,11 @@#define INTEL_FAM6_LAKEFIELD 0x8A#define INTEL_FAM6_ALDERLAKE 0x97#define INTEL_FAM6_ALDERLAKE_L 0x9A +#define INTEL_FAM6_ALDERLAKE_N 0xBE + +#define INTEL_FAM6_RAPTORLAKE 0xB7 +#define INTEL_FAM6_RAPTORLAKE_P 0xBA +#define INTEL_FAM6_RAPTORLAKE_S 0xBF/* "Small Core" Processors (Atom) */
arch/x86/mm/init.c +25 -0
@@ -9,6 +9,7 @@#include <linux/sched/task.h> #include <asm/set_memory.h> +#include <asm/cpu_device_id.h> #include <asm/e820/api.h> #include <asm/init.h> #include <asm/page.h>
@@ -208,6 +209,24 @@ static void __init probe_page_size_mask( } } +#define INTEL_MATCH (_model) { .vendor = X86_VENDOR_INTEL, \ + .family = 6, \ + .model = _model, \ + } +/* +* INVLPG may not properly flush Global entries +* on these CPUs when PCIDs are enabled. +*/ +static const struct x86_cpu_id invlpg_miss_ids[] = { +INTEL_MATCH (INTEL_FAM6_ALDERLAKE ), +INTEL_MATCH (INTEL_FAM6_ALDERLAKE_L ), +INTEL_MATCH (INTEL_FAM6_ALDERLAKE_N ), +INTEL_MATCH (INTEL_FAM6_RAPTORLAKE ), +INTEL_MATCH (INTEL_FAM6_RAPTORLAKE_P ), +INTEL_MATCH (INTEL_FAM6_RAPTORLAKE_S ), + {} +}; +static void setup_pcid (void ) {if (!IS_ENABLED (CONFIG_X86_64 ))
@@ -216,6 +235,12 @@ static void setup_pcid(void)if (!boot_cpu_has (X86_FEATURE_PCID ))return ; +if (x86_match_cpu (invlpg_miss_ids)) { +pr_info ("Incomplete global flushes, disabling PCID" ); +setup_clear_cpu_cap (X86_FEATURE_PCID ); +return ; + } +if (boot_cpu_has (X86_FEATURE_PGE )) {/* * This can't be cr4_set_bits_and_update_boot() -- the
Greg Kroah-Hartman
maintainerPATCH 125/161 spi: fsl-cpm: Use 16 bit mode for large transfers with even size
In reply to Greg Kroah-HartmanFrom: Christophe Leroy <[email protected]>
(cherry picked from upstream fc96ec826bced75cc6b9c07a4ac44bbf651337ab)
On CPM, the RISC core is a lot more efficiant when doing transfers in 16-bits chunks than in 8-bits chunks, but unfortunately the words need to be byte swapped as seen in a previous commit.
So, for large tranfers with an even size, allocate a temporary tx buffer and byte-swap data before and after transfer.
This change allows setting higher speed for transfer. For instance on an MPC 8xx (CPM1 comms RISC processor), the documentation tells that transfer in byte mode at 1 kbit/s uses 0.200% of CPM load at 25 MHz while a word transfer at the same speed uses 0.032% of CPM load. This means the speed can be 6 times higher in word mode for the same CPM load.
For the time being, only do it on CPM1 as there must be a trade-off between the CPM load reduction and the CPU load required to byte swap the data.
--- drivers/spi/spi-fsl-cpm.c | 23 +++++++++++++++++++++++ drivers/spi/spi-fsl-spi.c | 3 +++ 2 files changed, 26 insertions(+)
drivers/spi/spi-fsl-cpm.c +23 -0
@@ -21,6 +21,7 @@#include <linux/spi/spi.h> #include <linux/types.h> #include <linux/platform_device.h> +#include <linux/byteorder/generic.h> #include "spi-fsl-cpm.h" #include "spi-fsl-lib.h"
@@ -120,6 +121,21 @@ int fsl_spi_cpm_bufs(struct mpc8xxx_spi mspi->rx_dma = mspi->dma_dummy_rx; mspi->map_rx_dma =0 ; } +if (t->bits_per_word ==16 && t->tx_buf) { +const u16 *src = t->tx_buf; +u16 *dst; +int i; + + dst =kmalloc (t->len,GFP_KERNEL ); +if (!dst) +return -ENOMEM ; + +for (i =0 ; i < t->len >>1 ; i++) + dst[i] =cpu_to_le16p (src + i); + + mspi->tx = dst; + mspi->map_tx_dma =1 ; + }if (mspi->map_tx_dma) {void *nonconst_tx = (void *)mspi->tx;/* shut up gcc */
@@ -173,6 +189,13 @@ void fsl_spi_cpm_bufs_complete(struct mpif (mspi->map_rx_dma)dma_unmap_single (dev, mspi->rx_dma, t->len,DMA_FROM_DEVICE ); mspi->xfer_in_progress =NULL ; + +if (t->bits_per_word ==16 && t->rx_buf) { +int i; + +for (i =0 ; i < t->len; i +=2 ) +le16_to_cpus (t->rx_buf + i); + } }EXPORT_SYMBOL_GPL (fsl_spi_cpm_bufs_complete);
drivers/spi/spi-fsl-spi.c +3 -0
@@ -369,6 +369,9 @@ static int fsl_spi_do_one_msg(struct spireturn -EINVAL ;if (t->bits_per_word ==16 || t->bits_per_word ==32 ) t->bits_per_word =8 ;/* pretend its 8 bits */ +if (t->bits_per_word ==8 && t->len >=256 && + (mpc8xxx_spi->flags &SPI_CPM1 )) + t->bits_per_word =16 ; } }
Greg Kroah-Hartman
maintainerPATCH 156/161 x86/show_trace_log_lvl: Ensure stack pointer is aligned, again
In reply to Greg Kroah-HartmanFrom: Vernon Lovejoy <[email protected]>
commit 2e4be0d011f21593c6b316806779ba1eba2cd7e0 upstream.
The commit e335bb51cc15 ("x86/unwind: Ensure stack pointer is aligned") tried to align the stack pointer in show_trace_log_lvl(), otherwise the "stack < stack_info.end" check can't guarantee that the last read does not go past the end of the stack.
However, we have the same problem with the initial value of the stack pointer, it can also be unaligned. So without this patch this trivial kernel module
#include <linux/module.h>
static int init(void)
{
asm volatile("sub $0x4,%rsp");
dump_stack();
asm volatile("add $0x4,%rsp");
return -EAGAIN;
}
module_init(init);
MODULE_LICENSE("GPL");crashes the kernel.
--- arch/x86/kernel/dumpstack.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
arch/x86/kernel/dumpstack.c +5 -2
@@ -171,7 +171,6 @@ void show_trace_log_lvl(struct task_struprintk ("%sCall Trace:\n" , log_lvl);unwind_start (&state, task, regs, stack); - stack = stack ? :get_stack_pointer (task, regs); regs =unwind_get_entry_regs (&state, &partial);/*
@@ -190,9 +189,13 @@ void show_trace_log_lvl(struct task_stru* - hardirq stack * - entry stack */ -for ( ; stack; stack =PTR_ALIGN (stack_info.next_sp,sizeof (long ))) { +for (stack = stack ?:get_stack_pointer (task, regs); + stack; + stack = stack_info.next_sp) {const char *stack_name; + stack =PTR_ALIGN (stack,sizeof (long )); +if (get_stack_info (stack, task, &stack_info, &visit_mask)) {/* * We weren't on a valid stack. It's possible that
Greg Kroah-Hartman
maintainerPATCH 157/161 ASoC: Intel: Skylake: Fix declaration of enum skl_ch_cfg
In reply to Greg Kroah-HartmanFrom: Cezary Rojewski <[email protected]>
commit 95109657471311601b98e71f03d0244f48dc61bb upstream.
Constant 'C4_CHANNEL' does not exist on the firmware side. Value 0xC is reserved for 'C7_1' instead.
--- include/uapi/sound/skl-tplg-interface.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/uapi/sound/skl-tplg-interface.h +2 -1
@@ -66,7 +66,8 @@ enum skl_ch_cfg {SKL_CH_CFG_DUAL_MONO =9 ,SKL_CH_CFG_I2S_DUAL_STEREO_0 =10 ,SKL_CH_CFG_I2S_DUAL_STEREO_1 =11 , -SKL_CH_CFG_4_CHANNEL =12 , +SKL_CH_CFG_7_1 =12 , +SKL_CH_CFG_4_CHANNEL =SKL_CH_CFG_7_1 , SKL_CH_CFG_INVALID };
Greg Kroah-Hartman
maintainerPATCH 158/161 forcedeth: Fix an error handling path in nv_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit 5b17a4971d3b2a073f4078dd65331efbe35baa2d upstream.
If an error occures after calling nv_mgmt_acquire_sema(), it should be undone with a corresponding nv_mgmt_release_sema() call.
Add it in the error handling path of the probe as already done in the remove function.
--- drivers/net/ethernet/nvidia/forcedeth.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/nvidia/forcedeth.c +1 -0
@@ -6099,6 +6099,7 @@ static int nv_probe(struct pci_dev *pci_return 0 ; out_error: +nv_mgmt_release_sema (dev);if (phystate_orig)writel (phystate|NVREG_ADAPTCTL_RUNNING , base + NvRegAdapterControl); out_freering:
Greg Kroah-Hartman
maintainerPATCH 159/161 net/mlx5: Fix error message when failing to allocate device memory
In reply to Greg Kroah-HartmanFrom: Roi Dayan <[email protected]>
commit a65735148e0328f80c0f72f9f8d2f609bfcf4aff upstream.
Fix spacing for the error and also the correct error code pointer.
--- drivers/net/ethernet/mellanox/mlx5/core/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/main.c +1 -1
@@ -887,7 +887,7 @@ static int mlx5_init_once(struct mlx5_co dev->dm =mlx5_dm_create (dev);if (IS_ERR (dev->dm)) -mlx5_core_warn (dev,"Failed to init device memory%d\n" , err); +mlx5_core_warn (dev,"Failed to init device memory %ld\n" ,PTR_ERR (dev->dm)); dev->tracer =mlx5_fw_tracer_create (dev); dev->hv_vhca =mlx5_hv_vhca_create (dev);
Greg Kroah-Hartman
maintainerPATCH 160/161 net/mlx5: Devcom, fix error flow in mlx5_devcom_register_device
In reply to Greg Kroah-HartmanFrom: Shay Drory <[email protected]>
commit af87194352cad882d787d06fb7efa714acd95427 upstream.
In case devcom allocation is failed, mlx5 is always freeing the priv. However, this priv might have been allocated by a different thread, and freeing it might lead to use-after-free bugs.
Fix it by freeing the priv only in case it was allocated by the running thread.
--- drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c +2 -1
@@ -110,7 +110,8 @@ struct mlx5_devcom *mlx5_devcom_register priv->devs[idx] = dev; devcom =mlx5_devcom_alloc (priv, idx);if (!devcom) { -kfree (priv); +if (new_priv) +kfree (priv);return ERR_PTR (-ENOMEM ); }
Greg Kroah-Hartman
maintainerPATCH 161/161 3c589_cs: Fix an error handling path in tc589_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit 640bf95b2c7c2981fb471acdafbd3e0458f8390d upstream.
Should tc589_config() fail, some resources need to be released as already done in the remove function.
--- drivers/net/ethernet/3com/3c589_cs.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/ethernet/3com/3c589_cs.c +10 -1
@@ -196,6 +196,7 @@ static int tc589_probe(struct pcmcia_dev {struct el3_private *lp;struct net_device *dev; +int ret;dev_dbg (&link->dev,"3c589_attach()\n" );
@@ -219,7 +220,15 @@ static int tc589_probe(struct pcmcia_dev dev->ethtool_ops = &netdev_ethtool_ops; -return tc589_config (link); + ret =tc589_config (link); +if (ret) + goto err_free_netdev; + +return 0 ; + +err_free_netdev: +free_netdev (dev); +return ret; }static void tc589_detach (struct pcmcia_device *link)
Greg Kroah-Hartman
maintainerPATCH 155/161 xen/pvcalls-back: fix double frees with pvcalls_new_active_socket()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit 8fafac202d18230bb9926bda48e563fd2cce2a4f upstream.
In the pvcalls_new_active_socket() function, most error paths call pvcalls_back_release_active(fedata->dev, fedata, map) which calls sock_release() on "sock". The bug is that the caller also frees sock.
Fix this by making every error path in pvcalls_new_active_socket() release the sock, and don't free it in the caller.
--- drivers/xen/pvcalls-back.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/xen/pvcalls-back.c +4 -5
@@ -321,8 +321,10 @@ static struct sock_mapping *pvcalls_new_void *page; map =kzalloc (sizeof (*map),GFP_KERNEL ); -if (map ==NULL ) +if (map ==NULL ) { +sock_release (sock);return NULL ; + } map->fedata = fedata; map->sock = sock;
@@ -414,10 +416,8 @@ static int pvcalls_back_connect(struct x req->u.connect.ref, req->u.connect.evtchn, sock); -if (!map) { +if (!map) ret = -EFAULT ; -sock_release (sock); - } out: rsp =RING_GET_RESPONSE (&fedata->ring, fedata->ring.rsp_prod_pvt++);
@@ -558,7 +558,6 @@ static void __pvcalls_back_accept(struct sock);if (!map) { ret = -EFAULT ; -sock_release (sock); goto out_error; }
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.244 release. There are 161 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 Tue, 30 May 2023 19:08:13 +0000. Anything received after that time might be too late.
Build results:
total: 159 pass: 159 fail: 0 Qemu test results: total: 455 pass: 455 fail: 0
Guenter
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.244 release. There are 161 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 Tue, 30 May 2023 19:08:13 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.244-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.4.244-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-5.4.y
* git commit: 99ecfa2a4afcb3256e9102eb5cc0525d97aec466
* git describe: v5.4.243-162-g99ecfa2a4afc
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.4.y/build/v5.4.243-162-g99ecfa2a4afc
## Test Regressions (compared to v5.4.243)
## Metric Regressions (compared to v5.4.243)
## Test Fixes (compared to v5.4.243)
## Metric Fixes (compared to v5.4.243)
## Test result summary
total: 134703, pass: 113495, fail: 3730, skip: 17279, xfail: 199
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 145 total, 144 passed, 1 failed
* arm64: 45 total, 39 passed, 6 failed
* i386: 28 total, 20 passed, 8 failed
* mips: 27 total, 27 passed, 0 failed
* parisc: 6 total, 6 passed, 0 failed
* powerpc: 30 total, 30 passed, 0 failed
* riscv: 12 total, 11 passed, 1 failed
* s390: 6 total, 6 passed, 0 failed
* sh: 12 total, 12 passed, 0 failed
* sparc: 6 total, 6 passed, 0 failed
* x86_64: 38 total, 36 passed, 2 failed
## Test suites summary
* boot
* fwts
* kselftest-android
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers-dma-buf
* kselftest-efivarfs
* kselftest-exec
* kselftest-filesystems
* kselftest-filesystems-binderfs
* kselftest-firmware
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-net-forwarding
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-sigaltstack
* kselftest-size
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-user_events
* kselftest-vDSO
* kselftest-watchdog
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* perf
* rcutorture
* v4l2-compliance
* vdso
--
Linaro LKFT
https://lkft.linaro.org
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.244 release. There are 161 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 Tue, 30 May 2023 19:08:13 +0000. Anything received after that time might be too late.
No problems seen on x86_64 and aarch64.
Thanks,
Harshit
Quoted 10 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.244-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.244 release. There are 161 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 Tue, 30 May 2023 19:08:13 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.244-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.4:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
59 tests: 59 pass, 0 failLinux version: 5.4.244-rc1-g99ecfa2a4afc
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Hello Greg,
Quoted 10 lines
From: Greg Kroah-Hartman <[email protected]>
Sent: Sunday, May 28, 2023 8:09 PMThis is the start of the stable review cycle for the 5.4.244 release. There are 161 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 Tue, 30 May 2023 19:08:13 +0000. Anything received after that time might be too late.
CIP configurations built and booted with Linux 5.4.244-rc1 (99ecfa2a4afc):
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/881425010
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/commits/linux-5.4.y
Kind regards, Chris
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.244 release. There are 161 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 Tue, 30 May 2023 19:08:13 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.244-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian