mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Hugo <jeff.hugo@oss.qualcomm.com>
To: Alexandra Lu <alexandra.lu@nokia.com>,
	Manivannan Sadhasivam <mani@kernel.org>
Cc: Vivek Pernamitta <vivek.pernamitta@oss.qualcomm.com>,
	mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] bus: mhi: host: pci_generic: Fix runtime PM imbalance for no_m3 devices
Date: Fri, 14 Aug 2026 14:04:46 -0600	[thread overview]
Message-ID: <369f1fa7-1849-4164-8b72-c27b00329b06@oss.qualcomm.com> (raw)
In-Reply-To: <20260807143353.1932381-1-alexandra.lu@nokia.com>

On 8/7/2026 8:33 AM, Alexandra Lu wrote:
> mhi_pci_probe() drops the runtime PM reference taken by local_pci_probe()
> only when the device supports both PME from D3hot and M3, but
> mhi_pci_remove() re-takes it based on PME capability alone, without
> checking no_m3.
> 
> For a device that is PME capable and has no_m3 set, probe therefore never
> drops the reference while remove takes an extra one, leaving the runtime
> PM usage count one higher after every bind/unbind cycle.  That is benign
> for the device being removed, since the PCI core resumes it to D0 on
> unbind regardless, but the struct device outlives the binding, so the
> count accumulates across repeated cycles and can end up preventing
> runtime suspend altogether.
> 
> Cache no_m3 in the driver's private data, as is already done for
> reset_on_remove, and gate the removal side on it as well.  Unlike
> reset_on_remove it is cached for virtual functions too, because the probe
> side gate tests info->no_m3 for physical and virtual functions alike.
> 
> QDU100 is currently the only device that sets no_m3.
> 
> Fixes: 0494cf9793b7 ("bus: mhi: host: pci_generic: Disable runtime PM for QDU100")
> Assisted-by: Cursor:claude-opus-5
> Signed-off-by: Alexandra Lu <alexandra.lu@nokia.com>

Seems sane to me.

Reviewed-by: Jeff Hugo <jeff.hugo@oss.qualcomm.com>

  reply	other threads:[~2026-08-14 20:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 14:33 Alexandra Lu
2026-08-14 20:04 ` Jeff Hugo [this message]
2026-08-15  6:23 ` Manivannan Sadhasivam
2026-09-26 10:18 ` 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=369f1fa7-1849-4164-8b72-c27b00329b06@oss.qualcomm.com \
    --to=jeff.hugo@oss.qualcomm.com \
    --cc=alexandra.lu@nokia.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mhi@lists.linux.dev \
    --cc=vivek.pernamitta@oss.qualcomm.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

all inboxes | Powered by JetHome®