Re: [PATCH] input: gpio-keys - optimize wakeup sequence.

From: Gareth Randall
Date: Wed Oct 18 2023 - 17:53:55 EST


Dear Mr Singh,

I am not a maintainer but can point out some issues you need to resolve with this post.

1. Put the patch in the body of the email and not in an attachment.
2. You need a "Signed-off-by:" line.
3. The email needs to start with a description of the what the patch resolves. Don't put "suggested changes".

There are probably other issues as well but I hope this helps you to get started. Note that I am not involved in the review process.

Yours,

Gareth

On 17/10/2023 11:34, Abhishek Kumar Singh wrote:
Dear Mr. Dmitry,

Greetings!



This patch is related to optimization in input key event driver of Kernel module.

Suggested change to avoid the many APIs call chain if there is no key press event triggered.



There is a call back function gpio_keys_resume() called for every suspend/resume of the device.

And whenever this function is called, it is reading the status of the key.

And gpio_keys_resume() API further calls the below chain of API irrespective of key press event.



APIs call chain:

static void gpio_keys_report_state(struct gpio_keys_drvdata *ddata)

static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)

gpiod_get_value_cansleep(bdata->gpiod);

input_event(input, type, *bdata->code, state);

input_sync(input);




Suggested changes to avoid the above APIs call chain if there is no key press event triggered.

It will save the device computational resources, power resources and optimize the suspend/resume time"


Please help to review the attached patch and integrate in main line kernel code.




Thanks and Regards,
Abhishek Kumar Singh
Sr. Chief Engineer, Samsung Electronics, Noida-India