Commit 38d3d4d7 authored by Siva Rebbagondla's avatar Siva Rebbagondla Committed by Stefan Bader

UBUNTU: SAUCE: Redpine: improve kernel thread handling to fix kernel panic

BugLink: https://bugs.launchpad.net/bugs/1777858

While running regressions, observed below kernel panic when sdio disconnect
called. The root cause of this issue is, kthread_stop() is taking care of
wait_for_completion() by default. Hence, removing wait_for_completion()
from rsi_disconnect().

... 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.4.0-128-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
Signed-off-by: default avatarSiva Rebbagondla <siva.rebbagondla@redpinesignals.com>
Acked-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Acked-by: default avatarShrirang Bagul <shrirang.bagul@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
[klebers: fixed Buglink]
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 52848387
...@@ -90,7 +90,6 @@ static inline int rsi_kill_thread(struct rsi_thread *handle) ...@@ -90,7 +90,6 @@ static inline int rsi_kill_thread(struct rsi_thread *handle)
atomic_inc(&handle->thread_done); atomic_inc(&handle->thread_done);
rsi_set_event(&handle->event); rsi_set_event(&handle->event);
wait_for_completion(&handle->completion);
return kthread_stop(handle->task); return kthread_stop(handle->task);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment