Re: [PATCH v9 52/55] input: touchscreen: atmel_mxt_ts: Added sysfs entry for touchscreen status

From: Dmitry Osipenko
Date: Fri Mar 27 2020 - 09:38:05 EST


27.03.2020 15:49, Wang, Jiada ÐÐÑÐÑ:
>>> +static void mxt_watchdog_work(struct work_struct *work)
>>> +{
>>> +ÂÂÂ struct mxt_data *data =
>>> +ÂÂÂÂÂÂÂ container_of(work, struct mxt_data, watchdog_work);
>>> +ÂÂÂ u16 info_buf;
>>> +ÂÂÂ int ret = 0;
>>> +ÂÂÂ u8 size = 2;
>>
>>> +ÂÂÂ if (data->suspended || data->in_bootloader)
>>> +ÂÂÂÂÂÂÂ return;
>>> +
>>> +ÂÂÂ ret = __mxt_read_reg(data->client, 0, size, &info_buf);
>>
>> Looks like this need to be protected with a lock to not race with the
>> suspending / bootloader states.
>>
> right, I will add lock in next version

Alternatively, maybe the watchdog_work could be just stopped in
suspended / bootloader states.