From: Johan Hovold <johan@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org,
Loic Poulain <loic.poulain@linaro.org>
Subject: Re: mhi resume failure on reboot with 6.13-rc2
Date: Thu, 19 Dec 2024 09:36:32 +0100 [thread overview]
Message-ID: <Z2PbEPYpqFfrLSJi@hovoldconsulting.com> (raw)
In-Reply-To: <20241218183555.qste4gve7vnvdml2@thinkpad>
On Thu, Dec 19, 2024 at 12:05:55AM +0530, Manivannan Sadhasivam wrote:
> On Wed, Dec 18, 2024 at 03:26:38PM +0100, Johan Hovold wrote:
> > On Wed, Dec 18, 2024 at 07:39:10PM +0530, Manivannan Sadhasivam wrote:
> > > On Wed, Dec 18, 2024 at 02:55:02PM +0100, Johan Hovold wrote:
> > > > But that's not going to happen as that reset is what is currently
> > > > causing the deadlock and which would simply be skipped if you switch to
> > > > pci_try_reset_function().
> > > >
> > >
> > > mhi_pci_runtime_resume() will queue the recovery_work() and return. So I was
> > > hoping that by the time pci_try_reset_function() is called, the lock would be
> > > available.
> >
> > We can't rely on luck with timings, and this is the very reason for the
> > deadlock I'm currently seeing (i.e. the recovery thread is still running
> > when another thread grabs the lock and waits for the recovery thread to
> > finish).
> >
> > Perhaps the recovery work should be done synchronously in the resume
> > handler to avoid such issues.
>
> Synchronously? How can that help when the recovery_work() cannot acquire the
> lock?
During system suspend, pm core waits for any on-going runtime resume
operations to complete before taking the device lock and suspending the
device.
Unfortunately, that's currently not the case during shutdown() where
those operations are reversed, so that would indeed need to be addressed
first.
But what the driver is currently doing looks highly questionable as it
returns success when it failed to resume the device (after scheduling
the asynchronous recovery work).
Johan
next prev parent reply other threads:[~2024-12-19 8:36 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-11 14:17 mhi resume failure on reboot with 6.13-rc2 Johan Hovold
2024-12-11 14:53 ` Manivannan Sadhasivam
2024-12-11 15:03 ` Johan Hovold
2024-12-16 7:40 ` Manivannan Sadhasivam
2024-12-16 7:43 ` Manivannan Sadhasivam
2024-12-16 13:20 ` Johan Hovold
2024-12-16 14:13 ` Manivannan Sadhasivam
2024-12-16 16:25 ` Loic Poulain
2024-12-17 9:57 ` Johan Hovold
2024-12-18 8:48 ` Johan Hovold
2024-12-18 8:40 ` Johan Hovold
2024-12-18 11:38 ` Manivannan Sadhasivam
2024-12-18 12:02 ` Johan Hovold
2024-12-18 12:30 ` Manivannan Sadhasivam
2024-12-18 13:55 ` Johan Hovold
2024-12-18 14:09 ` Manivannan Sadhasivam
2024-12-18 14:26 ` Johan Hovold
2024-12-18 18:35 ` Manivannan Sadhasivam
2024-12-19 8:36 ` Johan Hovold [this message]
2025-01-08 12:49 ` Manivannan Sadhasivam
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=Z2PbEPYpqFfrLSJi@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=loic.poulain@linaro.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=mhi@lists.linux.dev \
/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