diff options
author | Holmes Chou <holmeschou@google.com> | 2022-06-17 04:45:48 +0000 |
---|---|---|
committer | Holmes Chou <holmeschou@google.com> | 2022-06-17 04:49:30 +0000 |
commit | 25c9399ebc41a8a94a0576270a86af1d87163d8c (patch) | |
tree | a4f2f5a0589be0533906d9cdcff5cc88f67f4f07 | |
parent | 371ae84a426d0bb26c093254ad6c71139b812f6e (diff) | |
download | lwis-android-gs-pantah-5.10-android13-d1.tar.gz |
LWIS: Use device name in thread nameandroid-13.0.0_r0.45android-13.0.0_r0.32android-13.0.0_r0.31android-gs-pantah-5.10-android13-d1
Use device name in thread name to make it easier to identify and debug
Bug: 236078820
Test: GCA, CTS, adb shell ps
Change-Id: I711642550958332bd2ffb9ce411552cd66156875
Signed-off-by: Holmes Chou <holmeschou@google.com>
-rw-r--r-- | lwis_device_i2c.c | 3 | ||||
-rw-r--r-- | lwis_device_ioreg.c | 3 | ||||
-rw-r--r-- | lwis_device_top.c | 3 | ||||
-rw-r--r-- | lwis_util.c | 13 | ||||
-rw-r--r-- | lwis_util.h | 3 |
5 files changed, 13 insertions, 12 deletions
diff --git a/lwis_device_i2c.c b/lwis_device_i2c.c index 58bcd48..4849552 100644 --- a/lwis_device_i2c.c +++ b/lwis_device_i2c.c @@ -266,8 +266,7 @@ static int lwis_i2c_device_probe(struct platform_device *plat_dev) } /* Create associated kworker threads */ - ret = lwis_create_kthread_workers(&i2c_dev->base_dev, "lwis_i2c_trans_kthread", - "lwis_i2c_prd_io_kthread"); + ret = lwis_create_kthread_workers(&i2c_dev->base_dev); if (ret) { dev_err(i2c_dev->base_dev.dev,"Failed to create lwis_i2c_kthread"); lwis_base_unprobe(&i2c_dev->base_dev); diff --git a/lwis_device_ioreg.c b/lwis_device_ioreg.c index ec3b6b9..ef71b79 100644 --- a/lwis_device_ioreg.c +++ b/lwis_device_ioreg.c @@ -128,8 +128,7 @@ static int lwis_ioreg_device_probe(struct platform_device *plat_dev) } /* Create associated kworker threads */ - ret = lwis_create_kthread_workers(&ioreg_dev->base_dev, "lwis_ioreg_trans_kthread", - "lwis_ioreg_prd_io_kthread"); + ret = lwis_create_kthread_workers(&ioreg_dev->base_dev); if (ret) { dev_err(ioreg_dev->base_dev.dev, "Failed to create lwis_ioreg_kthread"); lwis_base_unprobe(&ioreg_dev->base_dev); diff --git a/lwis_device_top.c b/lwis_device_top.c index fb58bab..c124f2b 100644 --- a/lwis_device_top.c +++ b/lwis_device_top.c @@ -494,8 +494,7 @@ static int lwis_top_device_probe(struct platform_device *plat_dev) lwis_top_event_subscribe_init(top_dev); /* Create associated kworker threads */ - ret = lwis_create_kthread_workers(&top_dev->base_dev, "lwis_top_trans_kthread", - "lwis_top_prd_io_kthread"); + ret = lwis_create_kthread_workers(&top_dev->base_dev); if (ret) { dev_err(top_dev->base_dev.dev, "Failed to create lwis_top_kthread"); lwis_base_unprobe(&top_dev->base_dev); diff --git a/lwis_util.c b/lwis_util.c index 3e8c37e..43cd266 100644 --- a/lwis_util.c +++ b/lwis_util.c @@ -96,17 +96,22 @@ const char *lwis_device_type_to_string(int32_t type) } } -int lwis_create_kthread_workers(struct lwis_device *lwis_dev, const char *transaction_worker_name, - const char *periodic_io_worker_name) +int lwis_create_kthread_workers(struct lwis_device *lwis_dev) { + char t_name[LWIS_MAX_NAME_STRING_LEN]; + char p_name[LWIS_MAX_NAME_STRING_LEN]; + if (!lwis_dev) { pr_err("lwis_create_kthread_workers: lwis_dev is NULL\n"); return -ENODEV; } + scnprintf(t_name, LWIS_MAX_NAME_STRING_LEN, "lwis_t_%s", lwis_dev->name); + scnprintf(p_name, LWIS_MAX_NAME_STRING_LEN, "lwis_p_%s", lwis_dev->name); + kthread_init_worker(&lwis_dev->transaction_worker); lwis_dev->transaction_worker_thread = kthread_run(kthread_worker_fn, - &lwis_dev->transaction_worker, transaction_worker_name); + &lwis_dev->transaction_worker, t_name); if (IS_ERR(lwis_dev->transaction_worker_thread)) { dev_err(lwis_dev->dev, "transaction kthread_run failed\n"); return -EINVAL; @@ -114,7 +119,7 @@ int lwis_create_kthread_workers(struct lwis_device *lwis_dev, const char *transa kthread_init_worker(&lwis_dev->periodic_io_worker); lwis_dev->periodic_io_worker_thread = kthread_run(kthread_worker_fn, - &lwis_dev->periodic_io_worker, periodic_io_worker_name); + &lwis_dev->periodic_io_worker, p_name); if (IS_ERR(lwis_dev->periodic_io_worker_thread)) { dev_err(lwis_dev->dev, "periodic_io kthread_run failed\n"); return -EINVAL; diff --git a/lwis_util.h b/lwis_util.h index 577e78a..1b1456f 100644 --- a/lwis_util.h +++ b/lwis_util.h @@ -67,8 +67,7 @@ static inline ktime_t lwis_get_time() /* * lwis_create_kthread_workers: Creates kthread workers associated with this lwis device. */ -int lwis_create_kthread_workers(struct lwis_device *lwis_dev, const char *transaction_worker_name, - const char *periodic_io_worker_name); +int lwis_create_kthread_workers(struct lwis_device *lwis_dev); /* * lwis_set_kthread_priority: Set kthread priority. |