All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Lee Jones <lee.jones@linaro.org>,
	linux-pwm@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH 3/3] pwm: lpss: Simplify using devm_pwmchip_add
Date: Fri, 9 Apr 2021 15:28:07 +0200	[thread overview]
Message-ID: <YHBWZw8haF0SU1Cc@orome.fritz.box> (raw)
In-Reply-To: <20210407080155.55004-3-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1528 bytes --]

On Wed, Apr 07, 2021 at 10:01:55AM +0200, Uwe Kleine-König wrote:
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/pwm/pwm-lpss-pci.c      | 4 ----
>  drivers/pwm/pwm-lpss-platform.c | 4 +---
>  drivers/pwm/pwm-lpss.c          | 8 +-------
>  drivers/pwm/pwm-lpss.h          | 1 -
>  4 files changed, 2 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/pwm/pwm-lpss-pci.c b/drivers/pwm/pwm-lpss-pci.c
> index cf749ea0de9f..c893ec3d2fb4 100644
> --- a/drivers/pwm/pwm-lpss-pci.c
> +++ b/drivers/pwm/pwm-lpss-pci.c
> @@ -69,12 +69,8 @@ static int pwm_lpss_probe_pci(struct pci_dev *pdev,
>  
>  static void pwm_lpss_remove_pci(struct pci_dev *pdev)
>  {
> -	struct pwm_lpss_chip *lpwm = pci_get_drvdata(pdev);
> -
>  	pm_runtime_forbid(&pdev->dev);
>  	pm_runtime_get_sync(&pdev->dev);
> -
> -	pwm_lpss_remove(lpwm);
>  }

Isn't this going to defeat your quest to make all drivers release
resources only after pwmchip_remove() was called? Before this patch
you'd be able to fix that by moving pwm_lpss_remove() before the runtime
PM stuff, but after using devm_pwmchip_add() the pwmchip_remove() will
always get called after the driver's ->remove() returns.

Granted, in this case it's perhaps not the best example because this
driver is actually grabbing a runtime PM reference, so that should be
safe. However, I'm thinking in general device-managed PWM chip addition
and removal becomes less useful because of the ordering requirements.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-04-09 13:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-07  8:01 [PATCH 1/3] pwm: lpss: Don't modify HW state in .remove callback Uwe Kleine-König
2021-04-07  8:01 ` [PATCH 2/3] pwm: Add a devm managed function to add pwm_chips Uwe Kleine-König
2021-04-07  8:01 ` [PATCH 3/3] pwm: lpss: Simplify using devm_pwmchip_add Uwe Kleine-König
2021-04-09 13:28   ` Thierry Reding [this message]
2021-04-09 21:47     ` Uwe Kleine-König
2021-04-09 13:21 ` [PATCH 1/3] pwm: lpss: Don't modify HW state in .remove callback Thierry Reding
2021-04-10 13:46   ` Uwe Kleine-König
2021-04-10 21:26     ` Uwe Kleine-König

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=YHBWZw8haF0SU1Cc@orome.fritz.box \
    --to=thierry.reding@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=lee.jones@linaro.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.