From: Tony Lindgren <tony@atomide.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Vignesh R <vigneshr@ti.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
linux-pm@vger.kernel.org,
Janusz Krzysztofik <jmkrzyszt@gmail.com>,
Wolfram Sang <wsa@kernel.org>,
Andreas Kemnade <andreas@kemnade.info>,
linux-i2c@vger.kernel.org, kernel@pengutronix.de,
Aaro Koskinen <aaro.koskinen@iki.fi>,
linux-omap@vger.kernel.org
Subject: Re: [PATCH] i2c: omap: Improve error reporting for problems during .remove()
Date: Thu, 13 Apr 2023 10:11:24 +0300 [thread overview]
Message-ID: <20230413071124.GB36234@atomide.com> (raw)
In-Reply-To: <20230413070745.mpcqpqokqspzavca@pengutronix.de>
* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [230413 07:07]:
> On Thu, Apr 13, 2023 at 09:39:15AM +0300, Tony Lindgren wrote:
> > Oh OK. Care to clarify a bit why we are not allowed to return errors
> > on remove though? Are we getting rid of the return value for remove?
> > Sorry if I'm not following the cunning plan here :)
>
> Yes, that's the plan. If you look at the caller of the remove functions
> (before 5c5a7680e67ba6fbbb5f4d79fa41485450c1985c):
>
> static void platform_remove(struct device *_dev)
> {
> struct platform_driver *drv = to_platform_driver(_dev->driver);
> struct platform_device *dev = to_platform_device(_dev);
>
> if (drv->remove) {
> int ret = drv->remove(dev);
>
> if (ret)
> dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
> }
> dev_pm_domain_detach(_dev, true);
> }
>
> you see it's pointless to return an error value. But the prototype
> seduces driver authors to do it yielding to error that can easily
> prevented if .remove returns void. See also
> 5c5a7680e67ba6fbbb5f4d79fa41485450c1985c for some background and details
> of the quest.
OK thanks. So maybe check the pm_runtime_get_sync() and on error do
pm_runtime_put_noidle(), or pm_runtime_resume_and_get(). Both ways
are fine for me, maybe you already figured it out.
Regards,
Tony
next prev parent reply other threads:[~2023-04-13 7:11 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-02 10:55 [PATCH] i2c: omap: Don't do pm_runtime_resume in .remove() Uwe Kleine-König
2023-04-02 20:50 ` Andreas Kemnade
2023-04-03 5:48 ` Uwe Kleine-König
2023-04-03 6:04 ` Tony Lindgren
2023-04-06 6:44 ` Wolfram Sang
2023-04-06 8:23 ` [PATCH] i2c: omap: Improve error reporting for problems during .remove() Uwe Kleine-König
2023-04-13 5:12 ` Tony Lindgren
2023-04-13 6:24 ` Uwe Kleine-König
2023-04-13 6:39 ` Tony Lindgren
2023-04-13 7:07 ` Uwe Kleine-König
2023-04-13 7:11 ` Tony Lindgren [this message]
2023-04-13 7:37 ` Uwe Kleine-König
2023-04-13 7:40 ` Tony Lindgren
2023-04-13 16:49 ` Wolfram Sang
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=20230413071124.GB36234@atomide.com \
--to=tony@atomide.com \
--cc=aaro.koskinen@iki.fi \
--cc=andreas@kemnade.info \
--cc=jmkrzyszt@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
--cc=vigneshr@ti.com \
--cc=wsa@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 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.