All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-omap@vger.kernel.org,
	Arthur Demchenkov <spinal.by@gmail.com>,
	Carl Philipp Klemm <philipp@uvos.xyz>,
	Merlijn Wajer <merlijn@wizzup.org>, Pavel Machek <pavel@ucw.cz>,
	ruleh <ruleh@gmx.de>, Sebastian Reichel <sre@kernel.org>
Subject: Re: [PATCH 4/5] Input: omap4-keypad - use PM runtime autosuspend
Date: Sun, 10 Jan 2021 21:01:29 -0800	[thread overview]
Message-ID: <X/vbqdQTTDg2UUaJ@google.com> (raw)
In-Reply-To: <20210110190529.46135-5-tony@atomide.com>

Hi Tony,

On Sun, Jan 10, 2021 at 09:05:28PM +0200, Tony Lindgren wrote:
> @@ -350,15 +379,12 @@ static int omap4_keypad_probe(struct platform_device *pdev)
>  
>  	error = omap4_keypad_check_revision(&pdev->dev,
>  					    keypad_data);
> -	if (!error) {
> -		/* Ensure device does not raise interrupts */
> -		omap4_keypad_stop(keypad_data);
> -	}
> -
> -	pm_runtime_put_sync(&pdev->dev);

Why are we moving this down? The idea was to make sure the power usage
counters are correct even if we exit probe early.

Can we call pm_runtime_mark_last_busy() and pm_runtime_put_autosuspend()
here?

>  	if (error)
>  		return error;
>  
> +	/* Ensure device does not raise interrupts */
> +	omap4_keypad_stop(keypad_data);
> +
>  	/* input device allocation */
>  	keypad_data->input = input_dev = devm_input_allocate_device(dev);
>  	if (!input_dev)
> @@ -419,7 +445,8 @@ static int omap4_keypad_probe(struct platform_device *pdev)
>  	if (error)
>  		dev_warn(dev, "failed to set up wakeup irq: %d\n", error);
>  
> -	platform_set_drvdata(pdev, keypad_data);
> +	pm_runtime_mark_last_busy(&pdev->dev);
> +	pm_runtime_put_autosuspend(&pdev->dev);
>  
>  	return 0;
>  }
> -- 
> 2.30.0

Thanks.

-- 
Dmitry

  reply	other threads:[~2021-01-11  5:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-10 19:05 [PATCHv5 0/5] Lost key-up interrupt handling for omap4-keypad Tony Lindgren
2021-01-10 19:05 ` [PATCH 1/5] Input: omap4-keypad - disable unused long interrupts Tony Lindgren
2021-01-11  6:25   ` Dmitry Torokhov
2021-01-10 19:05 ` [PATCH 2/5] Input: omap4-keypad - scan keys in two phases and simplify with bitmask Tony Lindgren
2021-01-11  4:48   ` Dmitry Torokhov
2021-01-11  5:56     ` Tony Lindgren
2021-01-11  6:26       ` Dmitry Torokhov
2021-01-10 19:05 ` [PATCH 3/5] Input: omap4-keypad - move rest of key scanning to a separate function Tony Lindgren
2021-01-11  4:50   ` Dmitry Torokhov
2021-01-11  5:57     ` Tony Lindgren
2021-01-11  6:27       ` Dmitry Torokhov
2021-01-10 19:05 ` [PATCH 4/5] Input: omap4-keypad - use PM runtime autosuspend Tony Lindgren
2021-01-11  5:01   ` Dmitry Torokhov [this message]
2021-01-11  5:12     ` Tony Lindgren
2021-01-11  6:02       ` Tony Lindgren
2021-01-11  6:27         ` Dmitry Torokhov
2021-01-10 19:05 ` [PATCH 5/5] Input: omap4-keypad - implement errata check for lost key-up events Tony Lindgren
2021-01-11  6:10   ` Tony Lindgren
2021-01-11  6:28     ` Dmitry Torokhov
2021-01-11  8:33   ` Pavel Machek
2021-01-11  9:02     ` Tony Lindgren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=X/vbqdQTTDg2UUaJ@google.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=merlijn@wizzup.org \
    --cc=pavel@ucw.cz \
    --cc=philipp@uvos.xyz \
    --cc=ruleh@gmx.de \
    --cc=spinal.by@gmail.com \
    --cc=sre@kernel.org \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.