linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: rojay@codeaurora.org
Cc: wsa@kernel.org, dianders@chromium.org,
	saiprakash.ranjan@codeaurora.org, gregkh@linuxfoundation.org,
	mka@chromium.org, skananth@codeaurora.org,
	msavaliy@qti.qualcomm.com, skakit@codeaurora.org,
	rnayak@codeaurora.org, agross@kernel.org,
	bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org,
	linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	sumit.semwal@linaro.org, linux-media@vger.kernel.org
Subject: Re: [PATCH V9] i2c: i2c-qcom-geni: Add shutdown callback for i2c
Date: Fri, 7 May 2021 13:09:21 -0700	[thread overview]
Message-ID: <CAE-0n51YQf=NZxnw9+FLU=PSG8di7Ztp5pP03JdLXgEWGM0AZg@mail.gmail.com> (raw)
In-Reply-To: <d23263dcb0f1535275ff37524b0203b2@codeaurora.org>

Quoting rojay@codeaurora.org (2021-05-07 03:07:42)
> On 2021-05-05 07:08, Stephen Boyd wrote:
> > Quoting Roja Rani Yarubandi (2021-04-20 04:13:55)
>
> > In fact, where is that code? I'd expect to see i2c_del_adapter() in
> > here
> > so we know the adapter can't accept transfers anymore. Maybe
> > i2c_del_adapter() could be called, and then there's nothing to do after
> > that? This whole patch is trying to rip the adapter out from under the
> > i2c core framework, when we should take the opposite approach and
> > remove
> > it from the core framework so that it can't transfer anything anymore
> > and thus the IOMMU can remove the mapping.
> >
>
> IIUC about probe/remove/shutdown calls, during "remove" we will unplug
> the
> device with opposite calls to "probe's" plug operations.
> For example i2c_add_adapter() from 'probe' and i2c_del_adapter() from
> 'remove'.
> For "shutdown", as system is going to shutdown, there is no need of
> unplug
> operations to be done.
>
> And also, I had a glance on other upstream i2c drivers, and noticed
> "i2c-i801.c"
> driver has i2c_del_adapter() called from remove callback but not from
> shutdown
> callback.

Sure, other drivers could also be broken.

>
> And actually I tried calling i2c_del_adapter() from geni_i2c_shutdown(),
> and it resulted in below WARNING trace
> [   90.320282] Call trace:
> [   90.322807]  _regulator_put+0xc4/0xcc
> [   90.326583]  regulator_bulk_free+0x48/0x6c
> [   90.330808]  devm_regulator_bulk_release+0x20/0x2c
> [   90.335744]  release_nodes+0x1d0/0x244
> [   90.339609]  devres_release_all+0x3c/0x54
> [   90.343735]  device_release_driver_internal+0x108/0x194
> [   90.349109]  device_release_driver+0x24/0x30
> [   90.353510]  bus_remove_device+0xd0/0xf4
> [   90.357548]  device_del+0x1a8/0x2f8
> [   90.361143]  device_unregister+0x1c/0x34
> [   90.365181]  __unregister_client+0x78/0x88
> [   90.369397]  device_for_each_child+0x64/0xb4
> [   90.373797]  i2c_del_adapter+0xf0/0x1d4
> [   90.377745]  geni_i2c_shutdown+0x9c/0xc0
> [   90.381783]  platform_drv_shutdown+0x28/0x34
> [   90.386182]  device_shutdown+0x148/0x1f0
>
> Can you please suggest me what might be missing here?
>

It looks like some device that is on the i2c bus is putting a regulator
in the remove path without disabling it. Can you print out which device
driver it is and fix that driver to call regulator_disable() on the
driver remove path? I'll try locally and see if I can find the driver
too.

  reply	other threads:[~2021-05-07 20:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 10:07 rojay
2021-05-07 20:09 ` Stephen Boyd [this message]
2021-05-08  7:56   ` Stephen Boyd
2021-05-11 12:58     ` rojay
  -- strict thread matches above, loose matches on Subject: below --
2021-04-20 11:13 Roja Rani Yarubandi
2021-05-05  1:38 ` Stephen Boyd

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='CAE-0n51YQf=NZxnw9+FLU=PSG8di7Ztp5pP03JdLXgEWGM0AZg@mail.gmail.com' \
    --to=swboyd@chromium.org \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mka@chromium.org \
    --cc=msavaliy@qti.qualcomm.com \
    --cc=rnayak@codeaurora.org \
    --cc=rojay@codeaurora.org \
    --cc=saiprakash.ranjan@codeaurora.org \
    --cc=skakit@codeaurora.org \
    --cc=skananth@codeaurora.org \
    --cc=sumit.semwal@linaro.org \
    --cc=wsa@kernel.org \
    --subject='Re: [PATCH V9] i2c: i2c-qcom-geni: Add shutdown callback for i2c' \
    /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

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).