public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@kernel.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@gmail.com>,
	Wolfram Sang <wsa@kernel.org>,
	linux-i2c@vger.kernel.org, kernel@pengutronix.de,
	Orson Zhai <orsonzhai@gmail.com>
Subject: Re: [PATCH] i2c: sprd: Delete i2c adapter in .remove's error path
Date: Tue, 6 Jun 2023 18:16:47 +0200	[thread overview]
Message-ID: <20230606161647.vgspajognrc3voth@intel.intel> (raw)
In-Reply-To: <20230309120418.rbzfefxxrqqsawd4@pengutronix.de>

Hi Uwe,

On Thu, Mar 09, 2023 at 01:04:18PM +0100, Uwe Kleine-König wrote:
> On Thu, Mar 09, 2023 at 01:17:22PM +0200, Andy Shevchenko wrote:
> > On Thu, Mar 9, 2023 at 11:58 AM Uwe Kleine-König
> > <u.kleine-koenig@pengutronix.de> wrote:
> > >
> > > If pm runtime resume fails the .remove callback used to exit early. This
> > > resulted in an error message by the driver core but the device gets
> > > removed anyhow. This lets the registered i2c adapter stay around with an
> > > unbound parent device.
> > >
> > > So only skip clk disabling if resume failed, but do delete the adapter.
> > 
> > Still worrisome. I would disable clock independently, but the questions are:
> 
> Note that pm-runtime stuff disables the clk, so if resume failed, you
> have to assume the clk already being off.

this is because resume fails only of the clock fails to be
enabled and in that case we shouldn't worry about it...

> > 1) why the heck we need this dance with PM runtime for disabling clocks;
> > 2) why can't we use devm_clk_get_enabled() or so in the probe;
> 
> These questions are orthogonal to my patch, right?

... but (orthoginally to this patch) I guess Andy is asking what
happens to the clock when the remove is called through another
path. Maybe a next patch can use the devm_clk...() wrapper.

As for this one, I'm good with it:

Reviewed-by: Andi Shyti <andi.shyti@kernel.org>

Andi

> Runtime PM might delay suspend, so if you submit two transfers shortly
> after another, this might be more effective as the device isn't
> suspended in between. (Attention: half-baked knowledge)
> 
> Best regards
> Uwe
> 
> -- 
> Pengutronix e.K.                           | Uwe Kleine-König            |
> Industrial Linux Solutions                 | https://www.pengutronix.de/ |



  parent reply	other threads:[~2023-06-06 16:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  9:58 [PATCH] i2c: sprd: Delete i2c adapter in .remove's error path Uwe Kleine-König
2023-03-09 11:17 ` Andy Shevchenko
2023-03-09 12:04   ` Uwe Kleine-König
2023-05-30 13:53     ` Uwe Kleine-König
2023-06-06 16:16     ` Andi Shyti [this message]
2023-06-15  8:34   ` Geert Uytterhoeven
2023-06-07 10:30 ` 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=20230606161647.vgspajognrc3voth@intel.intel \
    --to=andi.shyti@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=orsonzhai@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=wsa@kernel.org \
    --cc=zhang.lyra@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox