mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manivannan Sadhasivam <mani@kernel.org>
To: Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: manivannan.sadhasivam@oss.qualcomm.com,
	 Manivannan Sadhasivam <mani@kernel.org>,
	 Jeff Hugo <jeff.hugo@oss.qualcomm.com>,
	mhi@lists.linux.dev,  linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	 Abel Vesa <abel.vesa@oss.qualcomm.com>,
	Len Brown <len.brown@intel.com>,
	 stable@vger.kernel.org
Subject: Re: [PATCH 1/2] bus: mhi: host: Add mhi_pm_suspend_force() API
Date: Wed, 02 Dec 2026 18:49:46 +0530	[thread overview]
Message-ID: <179621758635.121678.9242560214471179720.b4-reply@b4> (raw)
In-Reply-To: <CAFEp6-1xoB3j1QEXZJHe-1ektFxXdg=cr6=mwGbUuX0XB0dEvw@mail.gmail.com>

On 2026-12-02 11:15 +0100, Loic Poulain wrote:
> On Wed, Dec 2, 2026 at 9:44 AM Manivannan Sadhasivam via B4 Relay
> <devnull+manivannan.sadhasivam.oss.qualcomm.com@kernel.org> wrote:
> >
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
> >
> > Currently, mhi_pm_suspend() returns -EBUSY when suspend is not completed
> > due to device asserting WAKE or packets pending to be transferred to the
> > device. While this suspend abort works fine for runtime suspend, it is a
> > disaster for system suspend, because a single driver aborting suspend
> > aborts the entire suspend process.
> >
> > So to fix this issue, introduce a new API mhi_pm_suspend_force(), which
> > forces the MHI stack to trigger suspend instead of bailing out. It does so
> > by waiting 100ms for the pending packets to be drained and ignoring device
> > WAKE. Even if the device is wakeup capable, suspend can proceed and the
> > device can wakeup the system later.
> 
> Why ignoring device wake? can we have more info on this.
> 

My wording was slightly off in the above paragraph. I wrote it in such a way to
sound like the API deals with device's wakeup capability, but it is just the
wakeup count of the device enforced by the MHI host.

To your question, we should not see any driver holding dev_wake during system
suspend as all of them just do mhi_device_get_sync() to access the device and
make sure it stays in M0 and call mhi_device_put() to allow it to enter M3.
But userspace can hold the device_wake through debugfs. So if device_wake is set
during system suspend, most likely it would come from userspace vote and the MHI
stack can do nothing about it, other than forcing system suspend.

- Mani



  reply	other threads:[~2026-12-02 13:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-02  8:43 [PATCH 0/2] bus: mhi: host: Do not abort system suspend when the MHI device is busy Manivannan Sadhasivam via B4 Relay
2026-12-02  8:43 ` [PATCH 1/2] bus: mhi: host: Add mhi_pm_suspend_force() API Manivannan Sadhasivam via B4 Relay
2026-12-02 10:15   ` Loic Poulain
2026-12-02 13:19     ` Manivannan Sadhasivam [this message]
2026-12-02 13:50   ` Loic Poulain
2026-12-02  8:43 ` [PATCH 2/2] bus: mhi: host: pci_generic: Use mhi_pm_suspend_force() for system suspend Manivannan Sadhasivam via B4 Relay
2026-12-02 10:19   ` Loic Poulain

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=179621758635.121678.9242560214471179720.b4-reply@b4 \
    --to=mani@kernel.org \
    --cc=abel.vesa@oss.qualcomm.com \
    --cc=jeff.hugo@oss.qualcomm.com \
    --cc=len.brown@intel.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=manivannan.sadhasivam@oss.qualcomm.com \
    --cc=mhi@lists.linux.dev \
    --cc=stable@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®