mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v1 1/1] platform/x86/intel: atomisp2: Replace deprecated UNIVERSAL_DEV_PM_OPS()
Date: Mon, 8 Apr 2024 18:20:03 +0200	[thread overview]
Message-ID: <609652ce-0336-4d69-ab79-f84c8a8506e5@redhat.com> (raw)
In-Reply-To: <20240403105511.558395-1-andriy.shevchenko@linux.intel.com>

Hi Andy,

On 4/3/24 12:55 PM, Andy Shevchenko wrote:
> The UNIVERSAL_DEV_PM_OPS() macro is deprecated. Replace it.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

As mentioned in the description of DEFINE_RUNTIME_DEV_PM_OPS()
DEFINE_RUNTIME_DEV_PM_OPS() is NOT a 1:1 replacement for
UNIVERSAL_DEV_PM_OPS() specifically it uses pm_runtime_force_suspend() /
pm_runtime_force_resume() .

Specifically pm_runtime_force_suspend() may NOT get set (and in this case
will not set) needs_force_resume skipping a resume + suspend cycle
after a system suspend, which is a problem if firmware has touched
the state of the device during the suspend/resume cycle since the device
may now actually be left powered on.

It seems there is no direct replacement for UNIVERSAL_DEV_PM_OPS()
without a behavior change.

Regards,

Hans




> ---
>  drivers/platform/x86/intel/atomisp2/pm.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/intel/atomisp2/pm.c b/drivers/platform/x86/intel/atomisp2/pm.c
> index 805fc0d8515c..1081b632bd5e 100644
> --- a/drivers/platform/x86/intel/atomisp2/pm.c
> +++ b/drivers/platform/x86/intel/atomisp2/pm.c
> @@ -118,8 +118,7 @@ static int isp_pci_resume(struct device *dev)
>  	return 0;
>  }
>  
> -static UNIVERSAL_DEV_PM_OPS(isp_pm_ops, isp_pci_suspend,
> -			    isp_pci_resume, NULL);
> +static DEFINE_RUNTIME_DEV_PM_OPS(isp_pm_ops, isp_pci_suspend, isp_pci_resume, NULL);
>  
>  static const struct pci_device_id isp_id_table[] = {
>  	{ PCI_VDEVICE(INTEL, 0x0f38), },
> @@ -133,7 +132,7 @@ static struct pci_driver isp_pci_driver = {
>  	.id_table = isp_id_table,
>  	.probe = isp_probe,
>  	.remove = isp_remove,
> -	.driver.pm = &isp_pm_ops,
> +	.driver.pm = pm_ptr(&isp_pm_ops),
>  };
>  
>  module_pci_driver(isp_pci_driver);


  reply	other threads:[~2024-04-08 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-03 10:55 Andy Shevchenko
2024-04-08 16:20 ` Hans de Goede [this message]
2024-04-09 17:15   ` Andy Shevchenko
2024-04-10 11:00     ` Hans de Goede

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=609652ce-0336-4d69-ab79-f84c8a8506e5@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®