linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Jean Delvare <jdelvare@suse.com>
Cc: "linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH] i2c: i801: Use pm_runtime_forbid to prevent suspending
Date: Fri, 21 May 2021 20:59:56 +0200	[thread overview]
Message-ID: <196f4945-32f9-b8ba-3ea9-ffef4b38a082@gmail.com> (raw)
In-Reply-To: <f42094aa-fc5b-ab1f-26fc-7f6bf2d11a35@gmail.com>

On 20.05.2021 13:14, Heiner Kallweit wrote:
> Using pm_runtime_get_sync() here is not the best approach.
> pm_runtime_forbid() is better suited and it doesn't require
> cleanup activities in the remove callback.
> 
Please disregard this patch. The user may re-enable runtime pm
via sysfs and that's not what we want.


> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> ---
>  drivers/i2c/busses/i2c-i801.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c
> index 6b17afb7b..4e8dc2b0d 100644
> --- a/drivers/i2c/busses/i2c-i801.c
> +++ b/drivers/i2c/busses/i2c-i801.c
> @@ -1664,7 +1664,7 @@ i801_acpi_io_handler(u32 function, acpi_physical_address address, u32 bits,
>  		 * BIOS is accessing the host controller so prevent it from
>  		 * suspending automatically from now on.
>  		 */
> -		pm_runtime_get_sync(&pdev->dev);
> +		pm_runtime_forbid(&pdev->dev);
>  	}
>  
>  	if ((function & ACPI_IO_MASK) == ACPI_READ)
> @@ -1704,11 +1704,6 @@ static void i801_acpi_remove(struct i801_priv *priv)
>  
>  	acpi_remove_address_space_handler(adev->handle,
>  		ACPI_ADR_SPACE_SYSTEM_IO, i801_acpi_io_handler);
> -
> -	mutex_lock(&priv->acpi_lock);
> -	if (priv->acpi_reserved)
> -		pm_runtime_put(&priv->pci_dev->dev);
> -	mutex_unlock(&priv->acpi_lock);
>  }
>  #else
>  static inline int i801_acpi_probe(struct i801_priv *priv) { return 0; }
> 


      reply	other threads:[~2021-05-21 19:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 11:14 [PATCH] i2c: i801: Use pm_runtime_forbid to prevent suspending Heiner Kallweit
2021-05-21 18:59 ` Heiner Kallweit [this message]

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=196f4945-32f9-b8ba-3ea9-ffef4b38a082@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=jdelvare@suse.com \
    --cc=linux-i2c@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;
as well as URLs for NNTP newsgroup(s).