rsi: improve kernel thread handling to fix kernel panic
Subsystems (5)
Sasha Levin
maintainerPATCH 4/10 serial: uartps: console_setup() can't be placed to init section
In reply to Sasha LevinFrom: Michal Simek <[email protected]>
[ Upstream commit 4bb1ce2350a598502b23088b169e16b43d4bc639 ]
When console device is rebinded, console_setup() is called again. But marking it as __init means that function will be clear after boot is complete. If console device is binded again console_setup() is not found and error "Unable to handle kernel paging request at virtual address" is reported.
--- drivers/tty/serial/xilinx_uartps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/xilinx_uartps.c +1 -1
@@ -1120,7 +1120,7 @@ static void cdns_uart_console_write(struct console *co, const char *s,* * Return: 0 on success, negative errno otherwise. */ -static int __init cdns_uart_console_setup (struct console *co,char *options) +static int cdns_uart_console_setup (struct console *co,char *options) {struct uart_port *port = &cdns_uart_port[co->index];int baud =9600 ;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 6/10 ACPI / SBS: Fix GPE storm on recent MacBookPro's
In reply to Sasha LevinFrom: Ronald Tschalär <[email protected]>
[ Upstream commit ca1721c5bee77105829cbd7baab8ee0eab85b06d ]
On Apple machines, plugging-in or unplugging the power triggers a GPE for the EC. Since these machines expose an SBS device, this GPE ends up triggering the acpi_sbs_callback(). This in turn tries to get the status of the SBS charger. However, on MBP13,* and MBP14,* machines, performing the smbus-read operation to get the charger's status triggers the EC's GPE again. The result is an endless re-triggering and handling of that GPE, consuming significant CPU resources (> 50% in irq).
In the end this is quite similar to commit 3031cddea633 (ACPI / SBS:
Don't assume the existence of an SBS charger), except that on the above machines a status of all 1's is returned. And like there, we just want ignore the charger here.
--- drivers/acpi/sbs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/acpi/sbs.c +6 -2
@@ -439,9 +439,13 @@ static int acpi_ac_get_present(struct acpi_sbs *sbs)/* * The spec requires that bit 4 always be 1. If it's not set, assume -* that the implementation doesn't support an SBS charger +* that the implementation doesn't support an SBS charger. +* +* And on some MacBooks a status of 0xffff is always returned, no +* matter whether the charger is plugged in or not, which is also +* wrong, so ignore the SBS charger for those too. */ -if (!((status >>4 ) &0x1 )) +if (!((status >>4 ) &0x1 ) || status ==0xffff )return -ENODEV ; sbs->charger_present = (status >>15 ) &0x1 ;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 7/10 iommu/dmar: Fix buffer overflow during PCI bus notification
In reply to Sasha LevinFrom: Julia Cartwright <[email protected]>
[ Upstream commit cffaaf0c816238c45cd2d06913476c83eb50f682 ]
Commit 57384592c433 ("iommu/vt-d: Store bus information in RMRR PCI device path") changed the type of the path data, however, the change in path type was not reflected in size calculations. Update to use the correct type and prevent a buffer overflow.
This bug manifests in systems with deep PCI hierarchies, and can lead to an overflow of the static allocated buffer (dmar_pci_notify_info_buf), or can lead to overflow of slab-allocated data.
BUG: KASAN: global-out-of-bounds in dmar_alloc_pci_notify_info+0x1d5/0x2e0
Write of size 1 at addr ffffffff90445d80 by task swapper/0/1
CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.14.87-rt49-02406-gd0a0e96 #1
Call Trace:
? dump_stack+0x46/0x59
? print_address_description+0x1df/0x290
? dmar_alloc_pci_notify_info+0x1d5/0x2e0
? kasan_report+0x256/0x340
? dmar_alloc_pci_notify_info+0x1d5/0x2e0
? e820__memblock_setup+0xb0/0xb0
? dmar_dev_scope_init+0x424/0x48f
? __down_write_common+0x1ec/0x230
? dmar_dev_scope_init+0x48f/0x48f
? dmar_free_unused_resources+0x109/0x109
? cpumask_next+0x16/0x20
? __kmem_cache_create+0x392/0x430
? kmem_cache_create+0x135/0x2f0
? e820__memblock_setup+0xb0/0xb0
? intel_iommu_init+0x170/0x1848
? _raw_spin_unlock_irqrestore+0x32/0x60
? migrate_enable+0x27a/0x5b0
? sched_setattr+0x20/0x20
? migrate_disable+0x1fc/0x380
? task_rq_lock+0x170/0x170
? try_to_run_init_process+0x40/0x40
? locks_remove_file+0x85/0x2f0
? dev_prepare_static_identity_mapping+0x78/0x78
? rt_spin_unlock+0x39/0x50
? lockref_put_or_lock+0x2a/0x40
? dput+0x128/0x2f0
? __rcu_read_unlock+0x66/0x80
? __fput+0x250/0x300
? __rcu_read_lock+0x1b/0x30
? mntput_no_expire+0x38/0x290
? e820__memblock_setup+0xb0/0xb0
? pci_iommu_init+0x25/0x63
? pci_iommu_init+0x25/0x63
? do_one_initcall+0x7e/0x1c0
? initcall_blacklisted+0x120/0x120
? kernel_init_freeable+0x27b/0x307
? rest_init+0xd0/0xd0
? kernel_init+0xf/0x120
? rest_init+0xd0/0xd0
? ret_from_fork+0x1f/0x40
The buggy address belongs to the variable:
dmar_pci_notify_info_buf+0x40/0x60--- drivers/iommu/dmar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dmar.c +1 -1
@@ -134,7 +134,7 @@ dmar_alloc_pci_notify_info(struct pci_dev *dev, unsigned long event)for (tmp = dev; tmp; tmp = tmp->bus->self) level++; - size =sizeof (*info) + level *sizeof (struct acpi_dmar_pci_path ); + size =sizeof (*info) + level *sizeof (info->path[0 ]);if (size <=sizeof (dmar_pci_notify_info_buf)) { info = (struct dmar_pci_notify_info *)dmar_pci_notify_info_buf; }else {
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 1/10 rsi: improve kernel thread handling to fix kernel panic
From: Siva Rebbagondla <[email protected]>
[ Upstream commit 4c62764d0fc21a34ffc44eec1210038c3a2e4473 ]
While running regressions, observed below kernel panic when sdio disconnect called. This is because of, kthread_stop() is taking care of wait_for_completion() by default. When wait_for_completion triggered in kthread_stop and as it was done already, giving kernel panic. Hence, removing redundant wait_for_completion() from rsi_kill_thread().
... skipping ...
BUG: unable to handle kernel NULL pointer dereference at (null) IP: [<ffffffff810a63df>] exit_creds+0x1f/0x50 PGD 0 Oops: 0002 [#1] SMP CPU: 0 PID: 6502 Comm: rmmod Tainted: G OE 4.15.9-Generic #154-Ubuntu Hardware name: Dell Inc. Edge Gateway 3003/ , BIOS 01.00.00 04/17/2017 Stack: ffff88007392e600 ffff880075847dc0 ffffffff8108160a 0000000000000000 ffff88007392e600 ffff880075847de8 ffffffff810a484b ffff880076127000 ffff88003cd3a800 ffff880074f12a00 ffff880075847e28 ffffffffc09bed15 Call Trace: [<ffffffff8108160a>] __put_task_struct+0x5a/0x140 [<ffffffff810a484b>] kthread_stop+0x10b/0x110 [<ffffffffc09bed15>] rsi_disconnect+0x2f5/0x300 [ven_rsi_sdio] [<ffffffff81578bcb>] ? __pm_runtime_resume+0x5b/0x80 [<ffffffff816f0918>] sdio_bus_remove+0x38/0x100 [<ffffffff8156cc64>] __device_release_driver+0xa4/0x150 [<ffffffff8156d7a5>] driver_detach+0xb5/0xc0 [<ffffffff8156c6c5>] bus_remove_driver+0x55/0xd0 [<ffffffff8156dfbc>] driver_unregister+0x2c/0x50 [<ffffffff816f0b8a>] sdio_unregister_driver+0x1a/0x20 [<ffffffffc09bf0f5>] rsi_module_exit+0x15/0x30 [ven_rsi_sdio] [<ffffffff8110cad8>] SyS_delete_module+0x1b8/0x210 [<ffffffff81851dc8>] entry_SYSCALL_64_fastpath+0x1c/0xbb
--- drivers/net/wireless/rsi/rsi_common.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/wireless/rsi/rsi_common.h +0 -1
@@ -75,7 +75,6 @@ static inline int rsi_kill_thread(struct rsi_thread *handle)atomic_inc (&handle->thread_done);rsi_set_event (&handle->event); -wait_for_completion (&handle->completion);return kthread_stop (handle->task); }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 2/10 9p: do not trust pdu content for stat item size
From: Gertjan Halkes <[email protected]>
[ Upstream commit 2803cf4379ed252894f046cb8812a48db35294e3 ]
v9fs_dir_readdir() could deadloop if a struct was sent with a size set to -2
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88021
--- fs/9p/vfs_dir.c | 8 +++----- net/9p/protocol.c | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-)
fs/9p/vfs_dir.c +3 -5
@@ -104,7 +104,6 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)int err =0 ;struct p9_fid *fid;int buflen; -int reclen =0 ;struct p9_rdir *rdir;p9_debug (P9_DEBUG_VFS ,"name %pD\n" , file);
@@ -129,11 +128,10 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)while (rdir->head < rdir->tail) { err =p9stat_read (fid->clnt, rdir->buf + rdir->head, rdir->tail - rdir->head, &st); -if (err) { +if (err <=0 ) {p9_debug (P9_DEBUG_VFS ,"returned %d\n" , err);return -EIO ; } - reclen = st.size+2 ; over = !dir_emit (ctx, st.name,strlen (st.name),v9fs_qid2ino (&st.qid),dt_type (&st));
@@ -141,8 +139,8 @@ static int v9fs_dir_readdir(struct file *file, struct dir_context *ctx)if (over)return 0 ; - rdir->head += reclen; - ctx->pos += reclen; + rdir->head += err; + ctx->pos += err; } } }
net/9p/protocol.c +2 -1
@@ -578,9 +578,10 @@ int p9stat_read(struct p9_client *clnt, char *buf, int len, struct p9_wstat *st)if (ret) {p9_debug (P9_DEBUG_9P ,"<<< p9stat_read failed: %d\n" , ret);trace_9p_protocol_dump (clnt, &fake_pdu); +return ret; } -return ret; +return fake_pdu.offset; }EXPORT_SYMBOL (p9stat_read);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 8/10 appletalk: Fix use-after-free in atalk_proc_exit
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 6377f787aeb945cae7abbb6474798de129e1f3ac ]
KASAN report this:
BUG: KASAN: use-after-free in pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71
Read of size 8 at addr ffff8881f41fe5b0 by task syz-executor.0/2806
CPU: 0 PID: 2806 Comm: syz-executor.0 Not tainted 5.0.0-rc7+ #45
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1ubuntu1 04/01/2014
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0xfa/0x1ce lib/dump_stack.c:113
print_address_description+0x65/0x270 mm/kasan/report.c:187
kasan_report+0x149/0x18d mm/kasan/report.c:317
pde_subdir_find+0x12d/0x150 fs/proc/generic.c:71
remove_proc_entry+0xe8/0x420 fs/proc/generic.c:667
atalk_proc_exit+0x18/0x820 [appletalk]
atalk_exit+0xf/0x5a [appletalk]
__do_sys_delete_module kernel/module.c:1018 [inline]
__se_sys_delete_module kernel/module.c:961 [inline]
__x64_sys_delete_module+0x3dc/0x5e0 kernel/module.c:961
do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x462e99
Code: f7 d8 64 89 02 b8 ff ff ff ff c3 66 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb2de6b9c58 EFLAGS: 00000246 ORIG_RAX: 00000000000000b0
RAX: ffffffffffffffda RBX: 000000000073bf00 RCX: 0000000000462e99
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000200001c0
RBP: 0000000000000002 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb2de6ba6bc
R13: 00000000004bccaa R14: 00000000006f6bc8 R15: 00000000ffffffff
Allocated by task 2806:
set_track mm/kasan/common.c:85 [inline]
__kasan_kmalloc.constprop.3+0xa0/0xd0 mm/kasan/common.c:496
slab_post_alloc_hook mm/slab.h:444 [inline]
slab_alloc_node mm/slub.c:2739 [inline]
slab_alloc mm/slub.c:2747 [inline]
kmem_cache_alloc+0xcf/0x250 mm/slub.c:2752
kmem_cache_zalloc include/linux/slab.h:730 [inline]
__proc_create+0x30f/0xa20 fs/proc/generic.c:408
proc_mkdir_data+0x47/0x190 fs/proc/generic.c:469
0xffffffffc10c01bb
0xffffffffc10c0166
do_one_initcall+0xfa/0x5ca init/main.c:887
do_init_module+0x204/0x5f6 kernel/module.c:3460
load_module+0x66b2/0x8570 kernel/module.c:3808
__do_sys_finit_module+0x238/0x2a0 kernel/module.c:3902
do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Freed by task 2806:
set_track mm/kasan/common.c:85 [inline]
__kasan_slab_free+0x130/0x180 mm/kasan/common.c:458
slab_free_hook mm/slub.c:1409 [inline]
slab_free_freelist_hook mm/slub.c:1436 [inline]
slab_free mm/slub.c:2986 [inline]
kmem_cache_free+0xa6/0x2a0 mm/slub.c:3002
pde_put+0x6e/0x80 fs/proc/generic.c:647
remove_proc_entry+0x1d3/0x420 fs/proc/generic.c:684
0xffffffffc10c031c
0xffffffffc10c0166
do_one_initcall+0xfa/0x5ca init/main.c:887
do_init_module+0x204/0x5f6 kernel/module.c:3460
load_module+0x66b2/0x8570 kernel/module.c:3808
__do_sys_finit_module+0x238/0x2a0 kernel/module.c:3902
do_syscall_64+0x147/0x600 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x49/0xbe
The buggy address belongs to the object at ffff8881f41fe500
which belongs to the cache proc_dir_entry of size 256
The buggy address is located 176 bytes inside of
256-byte region [ffff8881f41fe500, ffff8881f41fe600)
The buggy address belongs to the page:
page:ffffea0007d07f80 count:1 mapcount:0 mapping:ffff8881f6e69a00 index:0x0
flags: 0x2fffc0000000200(slab)
raw: 02fffc0000000200 dead000000000100 dead000000000200 ffff8881f6e69a00
raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8881f41fe480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff8881f41fe500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881f41fe580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881f41fe600: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb
ffff8881f41fe680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fbIt should check the return value of atalk_proc_init fails, otherwise atalk_exit will trgger use-after-free in pde_subdir_find while unload the module.This patch fix error cleanup path of atalk_init
--- include/linux/atalk.h | 2 +- net/appletalk/atalk_proc.c | 2 +- net/appletalk/ddp.c | 37 ++++++++++++++++++++++++++------ net/appletalk/sysctl_net_atalk.c | 5 ++++- 4 files changed, 37 insertions(+), 9 deletions(-)
include/linux/atalk.h +1 -1
@@ -150,7 +150,7 @@ extern int sysctl_aarp_retransmit_limit;extern int sysctl_aarp_resolve_time;#ifdef CONFIG_SYSCTL -extern void atalk_register_sysctl (void ); +extern int atalk_register_sysctl (void );extern void atalk_unregister_sysctl (void );#else #define atalk_register_sysctl () do { } while(0)
net/appletalk/atalk_proc.c +1 -1
@@ -293,7 +293,7 @@ int __init atalk_proc_init(void) goto out; } -void __exit atalk_proc_exit(void) +void atalk_proc_exit (void ) {remove_proc_entry ("interface" , atalk_proc_dir);remove_proc_entry ("route" , atalk_proc_dir);
net/appletalk/ddp.c +31 -6
@@ -1913,12 +1913,16 @@ static const char atalk_err_snap[] __initconst =/* Called by proto.c on kernel start up */ static int __init atalk_init (void ) { -int rc =proto_register (&ddp_proto,0 ); +int rc; -if (rc !=0 ) + rc =proto_register (&ddp_proto,0 ); +if (rc) goto out; - (void )sock_register (&atalk_family_ops); + rc =sock_register (&atalk_family_ops); +if (rc) + goto out_proto; + ddp_dl =register_snap_client (ddp_snap_id, atalk_rcv);if (!ddp_dl)printk (atalk_err_snap);
@@ -1926,12 +1930,33 @@ static int __init atalk_init(void)dev_add_pack (<alk_packet_type);dev_add_pack (&ppptalk_packet_type); -register_netdevice_notifier (&ddp_notifier); + rc =register_netdevice_notifier (&ddp_notifier); +if (rc) + goto out_sock; +aarp_proto_init (); -atalk_proc_init (); -atalk_register_sysctl (); + rc =atalk_proc_init (); +if (rc) + goto out_aarp; + + rc =atalk_register_sysctl (); +if (rc) + goto out_proc; out:return rc; +out_proc: +atalk_proc_exit (); +out_aarp: +aarp_cleanup_module (); +unregister_netdevice_notifier (&ddp_notifier); +out_sock: +dev_remove_pack (&ppptalk_packet_type); +dev_remove_pack (<alk_packet_type); +unregister_snap_client (ddp_dl); +sock_unregister (PF_APPLETALK ); +out_proto: +proto_unregister (&ddp_proto); + goto out; }module_init (atalk_init);
net/appletalk/sysctl_net_atalk.c +4 -1
@@ -44,9 +44,12 @@ static struct ctl_table atalk_table[] = {static struct ctl_table_header *atalk_table_header; -void atalk_register_sysctl (void ) +int __init atalk_register_sysctl (void ) { atalk_table_header =register_net_sysctl (&init_net,"net/appletalk" , atalk_table); +if (!atalk_table_header) +return -ENOMEM ; +return 0 ; }void atalk_unregister_sysctl (void )
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 10/10 include/linux/swap.h: use offsetof() instead of custom __swapoffset macro
In reply to Sasha LevinFrom: Pi-Hsun Shih <[email protected]>
[ Upstream commit a4046c06be50a4f01d435aa7fe57514818e6cc82 ]
Use offsetof() to calculate offset of a field to take advantage of compiler built-in version when possible, and avoid UBSAN warning when compiling with Clang:
UBSAN: Undefined behaviour in mm/swapfile.c:3010:38 member access within null pointer of type 'union swap_header' CPU: 6 PID: 1833 Comm: swapon Tainted: G S 4.19.23 #43 Call trace: dump_backtrace+0x0/0x194 show_stack+0x20/0x2c __dump_stack+0x20/0x28 dump_stack+0x70/0x94 ubsan_epilogue+0x14/0x44 ubsan_type_mismatch_common+0xf4/0xfc __ubsan_handle_type_mismatch_v1+0x34/0x54 __se_sys_swapon+0x654/0x1084 __arm64_sys_swapon+0x1c/0x24 el0_svc_common+0xa8/0x150 el0_svc_compat_handler+0x2c/0x38 el0_svc_compat+0x8/0x18
--- include/linux/swap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/swap.h +2 -2
@@ -143,9 +143,9 @@ struct swap_extent {/* * Max bad pages in the new format.. */ -#define __swapoffset (x) ((unsigned long)&((union swap_header *)0)->x)#define MAX_SWAP_BADPAGES \ - ((__swapoffset(magic.magic) - __swapoffset(info.badpages)) / sizeof(int)) + ((offsetof(union swap_header, magic.magic) - \ + offsetof(union swap_header, info.badpages)) / sizeof(int))enum {SWP_USED = (1 <<0 ),/* is slot in swap_info[] used? */
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 9/10 lib/div64.c: off by one in shift
In reply to Sasha LevinFrom: Stanislaw Gruszka <[email protected]>
[ Upstream commit cdc94a37493135e355dfc0b0e086d84e3eadb50d ]
fls counts bits starting from 1 to 32 (returns 0 for zero argument). If we add 1 we shift right one bit more and loose precision from divisor, what cause function incorect results with some numbers.
Corrected code was tested in user-space, see bugzilla:
https://bugzilla.kernel.org/show_bug.cgi?id=202391
--- lib/div64.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/div64.c +2 -2
@@ -100,7 +100,7 @@ u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) quot =div_u64_rem (dividend, divisor, &rem32); *remainder = rem32; }else { -int n =1 +fls (high); +int n =fls (high); quot =div_u64 (dividend >> n, divisor >> n);if (quot !=0 )
@@ -138,7 +138,7 @@ u64 div64_u64(u64 dividend, u64 divisor)if (high ==0 ) { quot =div_u64 (dividend, divisor); }else { -int n =1 +fls (high); +int n =fls (high); quot =div_u64 (dividend >> n, divisor >> n);if (quot !=0 )
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 5/10 ARM: samsung: Limit SAMSUNG_PM_CHECK config option to non-Exynos platforms
In reply to Sasha LevinFrom: Bartlomiej Zolnierkiewicz <[email protected]>
[ Upstream commit 6862fdf2201ab67cd962dbf0643d37db909f4860 ]
"S3C2410 PM Suspend Memory CRC" feature (controlled by SAMSUNG_PM_CHECK config option) is incompatible with highmem (uses phys_to_virt() instead of proper mapping) which is used by the majority of Exynos boards. The issue manifests itself in OOPS on affected boards, i.e. on Odroid-U3 I got the following one:
Unable to handle kernel paging request at virtual address f0000000 pgd = 1c0f9bb4 [f0000000] *pgd=00000000 Internal error: Oops: 5 [#1] PREEMPT SMP ARM [<c0458034>] (crc32_le) from [<c0121f8c>] (s3c_pm_makecheck+0x34/0x54) [<c0121f8c>] (s3c_pm_makecheck) from [<c0121efc>] (s3c_pm_run_res+0x74/0x8c) [<c0121efc>] (s3c_pm_run_res) from [<c0121ecc>] (s3c_pm_run_res+0x44/0x8c) [<c0121ecc>] (s3c_pm_run_res) from [<c01210b8>] (exynos_suspend_enter+0x64/0x148) [<c01210b8>] (exynos_suspend_enter) from [<c018893c>] (suspend_devices_and_enter+0x9ec/0xe74) [<c018893c>] (suspend_devices_and_enter) from [<c0189534>] (pm_suspend+0x770/0xc04) [<c0189534>] (pm_suspend) from [<c0186ce8>] (state_store+0x6c/0xcc) [<c0186ce8>] (state_store) from [<c09db434>] (kobj_attr_store+0x14/0x20) [<c09db434>] (kobj_attr_store) from [<c02fa63c>] (sysfs_kf_write+0x4c/0x50) [<c02fa63c>] (sysfs_kf_write) from [<c02f97a4>] (kernfs_fop_write+0xfc/0x1e4) [<c02f97a4>] (kernfs_fop_write) from [<c027b198>] (__vfs_write+0x2c/0x140) [<c027b198>] (__vfs_write) from [<c027b418>] (vfs_write+0xa4/0x160) [<c027b418>] (vfs_write) from [<c027b5d8>] (ksys_write+0x40/0x8c) [<c027b5d8>] (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28)
Add PLAT_S3C24XX, ARCH_S3C64XX and ARCH_S5PV210 dependencies to SAMSUNG_PM_CHECK config option to hide it on Exynos platforms.
--- arch/arm/plat-samsung/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/plat-samsung/Kconfig +1 -1
@@ -287,7 +287,7 @@ config S3C_PM_DEBUG_LED_SMDK config SAMSUNG_PM_CHECK bool "S3C2410 PM Suspend Memory CRC" - depends on PM + depends on PM && (PLAT_S3C24XX || ARCH_S3C64XX || ARCH_S5PV210) select CRC32 help Enable the PM code's memory area checksum over sleep. This option
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 3/10 9p locks: add mount option for lock retry interval
In reply to Sasha LevinFrom: Dinu-Razvan Chis-Serban <[email protected]>
[ Upstream commit 5e172f75e51e3de1b4274146d9b990f803cb5c2a ]
The default P9_LOCK_TIMEOUT can be too long for some users exporting a local file system to a guest VM (30s), make this configurable at mount time.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=195727
--- fs/9p/v9fs.c | 21 +++++++++++++++++++++ fs/9p/v9fs.h | 1 + fs/9p/vfs_file.c | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-)
fs/9p/v9fs.c +21 -0
@@ -59,6 +59,8 @@ enum { Opt_cache_loose, Opt_fscache, Opt_mmap,/* Access options */ Opt_access, Opt_posixacl, +/* Lock timeout option */ + Opt_locktimeout,/* Error token */ Opt_err };
@@ -78,6 +80,7 @@ static const match_table_t tokens = { {Opt_cachetag, "cachetag=%s"}, {Opt_access, "access=%s"}, {Opt_posixacl, "posixacl"}, + {Opt_locktimeout, "locktimeout=%u"}, {Opt_err, NULL} };
@@ -126,6 +129,7 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)#ifdef CONFIG_9P_FSCACHE v9ses->cachetag =NULL ;#endif + v9ses->session_lock_timeout =P9_LOCK_TIMEOUT ;if (!opts)return 0 ;
@@ -298,6 +302,23 @@ static int v9fs_parse_options(struct v9fs_session_info *v9ses, char *opts)#endif break ; +case Opt_locktimeout: + r =match_int (&args[0 ], &option); +if (r <0 ) { +p9_debug (P9_DEBUG_ERROR , +"integer field, but no integer?\n" ); + ret = r; +continue ; + } +if (option <1 ) { +p9_debug (P9_DEBUG_ERROR , +"locktimeout must be a greater than zero integer.\n" ); + ret = -EINVAL ; +continue ; + } + v9ses->session_lock_timeout = (long )option *HZ ; +break ; +default :continue ; }
fs/9p/v9fs.h +1 -0
@@ -117,6 +117,7 @@ struct v9fs_session_info {struct list_head slist;/* list of sessions registered with v9fs */ struct backing_dev_info bdi;struct rw_semaphore rename_sem; +long session_lock_timeout;/* retry interval for blocking locks */ };/* cache_validity flags */
fs/9p/vfs_file.c +5 -1
@@ -152,6 +152,7 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)uint8_t status;int res =0 ;unsigned char fl_type; +struct v9fs_session_info *v9ses; fid = filp->private_data;BUG_ON (fid ==NULL );
@@ -187,6 +188,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)if (IS_SETLKW (cmd)) flock.flags =P9_LOCK_FLAGS_BLOCK ; + v9ses =v9fs_inode2v9ses (file_inode (filp)); +/* * if its a blocked request and we get P9_LOCK_BLOCKED as the status * for lock request, keep on trying
@@ -200,7 +203,8 @@ static int v9fs_file_do_lock(struct file *filp, int cmd, struct file_lock *fl)break ;if (status ==P9_LOCK_BLOCKED && !IS_SETLKW (cmd))break ; -if (schedule_timeout_interruptible (P9_LOCK_TIMEOUT ) !=0 ) +if (schedule_timeout_interruptible (v9ses->session_lock_timeout) + !=0 )break ; }
Signature · 1 line
2.19.1