From 0c22d4ca18428acd8547c1703a759d6ef787f3ed Mon Sep 17 00:00:00 2001 From: haojl2 Date: Wed, 5 Jun 2019 22:55:13 +0800 Subject: [PATCH] himax_v2_mmi: Fix kernel dump issue. Fix kernel dump issue after selftest excuted. Use kzlloc area for DMA translation Change-Id: Ibe7d32bd924d76481f72cce006f5c6bff5219f93 Signed-off-by: haojl2 Reviewed-on: https://gerrit.mot.com/1366923 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- .../input/touchscreen/himax_v2_mmi/himax_common.c | 14 +++++++++----- .../input/touchscreen/himax_v2_mmi/himax_common.h | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c index a157c78e4454..96112bcdebcb 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.c +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.c @@ -2595,17 +2595,16 @@ int himax_report_data(struct himax_ts_data *ts, int ts_path, int ts_status) static int himax_ts_operation(struct himax_ts_data *ts, int ts_path, int ts_status) { uint8_t hw_reset_check[2]; - static uint8_t buf[128]; - memset(buf, 0x00, sizeof(buf)); + memset(ts->xfer_buff, 0x00, 128 * sizeof(uint8_t)); memset(hw_reset_check, 0x00, sizeof(hw_reset_check)); - ts_status = himax_touch_get(ts, buf, ts_path, ts_status); + ts_status = himax_touch_get(ts, ts->xfer_buff, ts_path, ts_status); if (ts_status == HX_TS_GET_DATA_FAIL) goto END_FUNCTION; - ts_status = himax_distribute_touch_data(buf, ts_path, ts_status); - ts_status = himax_err_ctrl(ts, buf, ts_path, ts_status); + ts_status = himax_distribute_touch_data(ts->xfer_buff, ts_path, ts_status); + ts_status = himax_err_ctrl(ts, ts->xfer_buff, ts_path, ts_status); if (ts_status == HX_REPORT_DATA || ts_status == HX_TS_NORMAL_END) ts_status = himax_parse_report_data(ts, ts_path, ts_status); else @@ -2829,6 +2828,11 @@ int himax_chip_common_init(void) g_embedded_fw.size = (size_t)_binary___Himax_firmware_bin_end - (size_t)_binary___Himax_firmware_bin_start; #endif + ts->xfer_buff = devm_kzalloc(ts->dev, 128 * sizeof(uint8_t), GFP_KERNEL); + if (ts->xfer_buff == NULL) { + err = -ENOMEM; + goto err_dt_platform_data_fail; + } I("PDATA START\n"); pdata = kzalloc(sizeof(struct himax_i2c_platform_data), GFP_KERNEL); diff --git a/drivers/input/touchscreen/himax_v2_mmi/himax_common.h b/drivers/input/touchscreen/himax_v2_mmi/himax_common.h index 195e7ed12886..ecdb667b0702 100644 --- a/drivers/input/touchscreen/himax_v2_mmi/himax_common.h +++ b/drivers/input/touchscreen/himax_v2_mmi/himax_common.h @@ -379,6 +379,7 @@ struct himax_ts_data { struct mutex spi_lock; struct spi_device *spi; int hx_irq; + uint8_t *xfer_buff; /******* SPI-end *******/ int in_self_test;