mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Len Brown <lenb@kernel.org>
To: rafael@kernel.org, Manivannan Sadhasivam <mani@kernel.org>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: linux-pm@vger.kernel.org, mhi@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: [RFC 2/2] bus: mhi: host: Add diagnostic print for -EBUSY in mhi_pm_suspend()
Date: Fri, 13 Nov 2026 12:18:00 -0300	[thread overview]
Message-ID: <b490fbf692dcd8883b05a1475a7197104f596f0d.1794582108.git.len.brown@intel.com> (raw)
In-Reply-To: <7ce7895da501c3204416b69b0049ff488904f6a5.1794582108.git.len.brown@intel.com>

From: Len Brown <len.brown@intel.com>

mhi_pm_suspend() sometimes returns -EBUSY, but doesn't tell us why.

Print dev_wake and pending_pkts when it does.

Signed-off-by: Len Brown <len.brown@intel.com>
---
 drivers/bus/mhi/host/pm.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/mhi/host/pm.c b/drivers/bus/mhi/host/pm.c
index ced83fbb1a51..2eb7344b3b39 100644
--- a/drivers/bus/mhi/host/pm.c
+++ b/drivers/bus/mhi/host/pm.c
@@ -871,8 +871,12 @@ int mhi_pm_suspend(struct mhi_controller *mhi_cntrl)
 
 	/* Return busy if there are any pending resources */
 	if (atomic_read(&mhi_cntrl->dev_wake) ||
-	    atomic_read(&mhi_cntrl->pending_pkts))
+	    atomic_read(&mhi_cntrl->pending_pkts)) {
+		dev_err(dev, "DEBUG: suspend busy (early): dev_wake: %d pending_pkts: %d\n",
+			atomic_read(&mhi_cntrl->dev_wake),
+			atomic_read(&mhi_cntrl->pending_pkts));
 		return -EBUSY;
+	}
 
 	/* Take MHI out of M2 state */
 	read_lock_bh(&mhi_cntrl->pm_lock);
@@ -900,6 +904,9 @@ int mhi_pm_suspend(struct mhi_controller *mhi_cntrl)
 	if (atomic_read(&mhi_cntrl->dev_wake) ||
 	    atomic_read(&mhi_cntrl->pending_pkts)) {
 		write_unlock_irq(&mhi_cntrl->pm_lock);
+		dev_err(dev, "DEBUG: suspend busy (recheck): dev_wake: %d pending_pkts: %d\n",
+			atomic_read(&mhi_cntrl->dev_wake),
+			atomic_read(&mhi_cntrl->pending_pkts));
 		return -EBUSY;
 	}
 
-- 
2.45.2


  reply	other threads:[~2026-11-13 15:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13 15:17 [PATCH 0/2] bus: mhi: Address MHI system suspend abort Len Brown
2026-11-13 15:17 ` [PATCH v2 1/2] bus: mhi: pci_generic: Prevent MHI from aborting system suspend Len Brown
2026-11-13 15:18   ` Len Brown [this message]
2026-11-13 15:21   ` 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=b490fbf692dcd8883b05a1475a7197104f596f0d.1794582108.git.len.brown@intel.com \
    --to=lenb@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=mani@kernel.org \
    --cc=mhi@lists.linux.dev \
    --cc=rafael@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®