Skip to content

Commit

Permalink
input/ts: ft8719/nt36xxx: Remove touch controller PM-QoS triggers
Browse files Browse the repository at this point in the history
 * doesn't work and ends up affining it to all cores instead
 * additionally affine spi irq's to big cluster (based on sultan's commit)

Log:

[    0.529834] IRQ-234 not set for request with affinity flag
[    0.529848] ------------[ cut here ]------------
[    0.529863] WARNING: CPU: 3 PID: 251 at kernel/power/qos.c:622 pm_qos_add_request+0x1b0/0x240
[    0.529864] Modules linked in:
[    0.529873] CPU: 3 PID: 251 Comm: kworker/u16:7 Tainted: G S              4.14.227-QuicksilveR\xe2\x84\xa2-v2.5/92d5181c #10
[    0.529875] Hardware name: Qualcomm Technologies, Inc. trinket pm6125 + pmi632 IDP (DT)
[    0.529889] Workqueue: events_unbound async_run_entry_fn
[    0.529893] task: 000000008c9ff257 task.stack: 00000000f1674f29
[    0.529897] pc : pm_qos_add_request+0x1b0/0x240
[    0.529900] lr : pm_qos_add_request+0x1b0/0x240
[    0.529903] sp : ffffff800fc43bd0 pstate : 60000005
[    0.529905] x29: ffffff800fc43bd0 x28: ffffffedb902b030
[    0.529908] x27: ffffff9363206000 x26: ffffffedb932c880
[    0.529912] x25: 00000000bb008905 x24: 0000000000000051
[    0.529916] x23: 0000000000000001 x22: ffffff936373b000
[    0.529919] x21: 0000000000000001 x20: ffffffedb7a5e7d8
[    0.529923] x19: 00000000ffffffff x18: ffffff93634a728c
[    0.529926] x17: 00000000001f2e20 x16: 0000000000000000
[    0.529930] x15: 0000000000000000 x14: 0000000000000082
[    0.529933] x13: 0000000000000040 x12: 0000000000000000
[    0.529937] x11: 0000000000000000 x10: ffffffffffffffff
[    0.529940] x9 : 69f5cb5eed6dba00 x8 : 69f5cb5eed6dba00
[    0.529944] x7 : 0000000000000000 x6 : ffffff93634b44a2
[    0.529947] x5 : 0000000000000000 x4 : 0000000000000000
[    0.529951] x3 : 0000000000006761 x2 : 0000000000000002
[    0.529954] x1 : 0000000000000000 x0 : 000000000000002e
[    0.529961] \x0aPC: 0xffffff9360f35f88:
[    0.529964] 5f88  a94257f6 f9400bf7 a8c47bfd d65f03c0 a9434ff4 a94257f6 f9400bf7 a8c47bfd
[    0.529975] 5fa8  d65f03c0 b9401281 f000cc20 52801fe8 91350c00 b900029f f9000688 9400131f
[    0.529986] 5fc8  d4210000 17ffffcd b000eca9 d538d088 91006129 900116ca b8696908 913d014a
[    0.529996] 5fe8  1100fd09 7100011f 1a88b129 13067d29 f869d949 9ac82528 3607f848 d5384116
[    0.530009] \x0aLR: 0xffffff9360f35f88:
[    0.530010] 5f88  a94257f6 f9400bf7 a8c47bfd d65f03c0 a9434ff4 a94257f6 f9400bf7 a8c47bfd
[    0.530019] 5fa8  d65f03c0 b9401281 f000cc20 52801fe8 91350c00 b900029f f9000688 9400131f
[    0.530029] 5fc8  d4210000 17ffffcd b000eca9 d538d088 91006129 900116ca b8696908 913d014a
[    0.530039] 5fe8  1100fd09 7100011f 1a88b129 13067d29 f869d949 9ac82528 3607f848 d5384116
[    0.530049] \x0aSP: 0xffffff800fc43b90:
[    0.530050] 3b90  60f35fc8 ffffff93 60000005 00000000 ffffffc8 ffffff80 ed6dba00 69f5cb5e
[    0.530060] 3bb0  ffffffff ffffffff 60f35fc8 ffffff93 0fc43bd0 ffffff80 60f35fc8 ffffff93
[    0.530070] 3bd0  0fc43c10 ffffff80 61860b58 ffffff93 00000001 00000000 61860b1c ffffff93
[    0.530079] 3bf0  6373b000 ffffff93 00000002 00000000 ffffffff 00000000 b7de6800 ffffffed
[    0.530089]
[    0.530091] Call trace:
[    0.530096] pm_qos_add_request+0x1b0/0x240
[    0.530102] nvt_ts_probe+0x8a0/0xd10
[    0.530108] spi_drv_probe+0xd4/0x100
[    0.530114] driver_probe_device+0x424/0x460
[    0.530117] __driver_attach+0xb8/0xe8
[    0.530122] bus_for_each_dev+0xc0/0xf0
[    0.530125] driver_attach+0x20/0x28
[    0.530127] driver_attach_async+0xc/0x18
[    0.530131] async_run_entry_fn+0x40/0x160
[    0.530136] process_one_work+0x19c/0x430
[    0.530139] worker_thread+0x2b0/0x658
[    0.530143] kthread+0x1bc/0x1c8
[    0.530148] ret_from_fork+0x10/0x1c
[    0.530154] ---[ end trace d4c11db9e3197763 ]---

Signed-off-by: Edwiin Kusuma Jaya <[email protected]>
  • Loading branch information
adithya2306 authored and kutemeikito committed Dec 21, 2023
1 parent b2f6052 commit a1346d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 24 deletions.
20 changes: 6 additions & 14 deletions drivers/input/touchscreen/ft8719_spi_c3j/focaltech_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,6 @@ static void fts_irq_read_report(void)
fts_prc_queue_work(ts_data);
#endif

pm_qos_update_request(&ts_data->pm_touch_req, 100);
pm_qos_update_request(&ts_data->pm_spi_req, 100);

ret = fts_read_parse_touchdata(ts_data);
Expand All @@ -718,7 +717,6 @@ static void fts_irq_read_report(void)
}

pm_qos_update_request(&ts_data->pm_spi_req, PM_QOS_DEFAULT_VALUE);
pm_qos_update_request(&ts_data->pm_touch_req, PM_QOS_DEFAULT_VALUE);

#if FTS_ESDCHECK_EN
fts_esdcheck_set_intr(0);
Expand Down Expand Up @@ -1600,19 +1598,15 @@ static int fts_ts_probe_entry(struct spi_device *client, struct fts_ts_data *ts_

ts_data->pm_spi_req.type = PM_QOS_REQ_AFFINE_IRQ;
ts_data->pm_spi_req.irq = geni_spi_get_master_irq(client);
irq_set_perf_affinity(ts_data->pm_spi_req.irq, IRQF_PERF_AFFINE);
pm_qos_add_request(&ts_data->pm_spi_req, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE);

ts_data->pm_touch_req.type = PM_QOS_REQ_AFFINE_IRQ;
ts_data->pm_touch_req.irq = client->irq;
pm_qos_add_request(&ts_data->pm_touch_req, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE);

ret = fts_irq_registration(ts_data);
if (ret) {
FTS_ERROR("request irq failed");
goto err_irq_req;
}
ret = fts_irq_registration(ts_data);
if (ret) {
FTS_ERROR("request irq failed");
goto err_irq_req;
}

ret = fts_fwupg_init(ts_data);
if (ret) {
Expand All @@ -1639,7 +1633,6 @@ static int fts_ts_probe_entry(struct spi_device *client, struct fts_ts_data *ts_
return 0;

err_irq_req:
pm_qos_remove_request(&ts_data->pm_touch_req);
pm_qos_remove_request(&ts_data->pm_spi_req);
fts_ts_enable_regulator(false);
err_enable_regulator:
Expand Down Expand Up @@ -1706,7 +1699,6 @@ static int fts_ts_remove_entry(struct fts_ts_data *ts_data)
free_irq(ts_data->irq, ts_data);
input_unregister_device(ts_data->input_dev);

pm_qos_remove_request(&ts_data->pm_touch_req);
pm_qos_remove_request(&ts_data->pm_spi_req);

if (ts_data->ts_workqueue)
Expand Down
1 change: 0 additions & 1 deletion drivers/input/touchscreen/ft8719_spi_c3j/focaltech_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ struct fts_ts_data {
struct mutex report_mutex;
struct mutex bus_lock;
struct pm_qos_request pm_spi_req;
struct pm_qos_request pm_touch_req;
int irq;
int log_level;
int fw_is_running; /* confirm fw is running when using spi:default 0 */
Expand Down
9 changes: 1 addition & 8 deletions drivers/input/touchscreen/nt36xxx_spi_c3j/nt36xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,6 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)
int32_t i = 0;
int32_t finger_cnt = 0;

pm_qos_update_request(&ts->pm_touch_req, 100);
pm_qos_update_request(&ts->pm_spi_req, 100);

#if WAKEUP_GESTURE
Expand Down Expand Up @@ -1440,7 +1439,6 @@ static irqreturn_t nvt_ts_work_func(int irq, void *data)

XFER_ERROR:
pm_qos_update_request(&ts->pm_spi_req, PM_QOS_DEFAULT_VALUE);
pm_qos_update_request(&ts->pm_touch_req, PM_QOS_DEFAULT_VALUE);

mutex_unlock(&ts->lock);

Expand Down Expand Up @@ -1883,13 +1881,9 @@ static int32_t nvt_ts_probe(struct spi_device *client)

ts->pm_spi_req.type = PM_QOS_REQ_AFFINE_IRQ;
ts->pm_spi_req.irq = geni_spi_get_master_irq(client);
irq_set_perf_affinity(ts->pm_spi_req.irq, IRQF_PERF_AFFINE);
pm_qos_add_request(&ts->pm_spi_req, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE);

ts->pm_touch_req.type = PM_QOS_REQ_AFFINE_IRQ;
ts->pm_touch_req.irq = client->irq;
pm_qos_add_request(&ts->pm_touch_req, PM_QOS_CPU_DMA_LATENCY,
PM_QOS_DEFAULT_VALUE);
}

#if WAKEUP_GESTURE
Expand Down Expand Up @@ -2115,7 +2109,6 @@ static int32_t nvt_ts_remove(struct spi_device *client)
unregister_early_suspend(&ts->early_suspend);
#endif

pm_qos_remove_request(&ts->pm_touch_req);
pm_qos_remove_request(&ts->pm_spi_req);

#if NVT_TOUCH_MP
Expand Down
1 change: 0 additions & 1 deletion drivers/input/touchscreen/nt36xxx_spi_c3j/nt36xxx.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ struct nvt_ts_data {
struct mutex xbuf_lock;
bool irq_enabled;
struct pm_qos_request pm_spi_req;
struct pm_qos_request pm_touch_req;
#if WAKEUP_GESTURE
bool delay_gesture;
bool is_gesture_mode;
Expand Down

0 comments on commit a1346d1

Please sign in to comment.