From: "Kornel Dulęba" <mindal@semihalf.com>
To: netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: "Chandrashekar Devegowda" <chandrashekar.devegowda@intel.com>,
"Intel Corporation" <linuxwwan@intel.com>,
"Chiranjeevi Rapolu" <chiranjeevi.rapolu@linux.intel.com>,
"Liu Haijun" <haijun.liu@mediatek.com>,
"M Chetan Kumar" <m.chetan.kumar@linux.intel.com>,
"Ricardo Martinez" <ricardo.martinez@linux.intel.com>,
"Loic Poulain" <loic.poulain@linaro.org>,
"Sergey Ryazanov" <ryazanov.s.a@gmail.com>,
"Johannes Berg" <johannes@sipsolutions.net>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
rad@semihalf.com, mw@semihalf.com, upstream@semihalf.com,
"Kornel Dulęba" <mindal@semihalf.com>
Subject: [PATCH 2/2] net: wwan: t7xx: Fix Runtime PM initialization
Date: Thu, 26 Jan 2023 13:25:35 +0000 [thread overview]
Message-ID: <20230126132535.80339-3-mindal@semihalf.com> (raw)
In-Reply-To: <20230126132535.80339-1-mindal@semihalf.com>
For PCI devices the Runtime PM refcount is incremented twice:
1. During device enumeration with a call to pm_runtime_forbid.
2. Just before a driver probe logic is called.
Because of that in order to enable Runtime PM on a given device
we have to call both pm_runtime_allow and pm_runtime_put_noidle,
once it's ready to be runtime suspended.
The former was missing causing the pm refcount to never reach 0.
Fixes: d10b3a695ba0 ("net: wwan: t7xx: Runtime PM")
Signed-off-by: Kornel Dulęba <mindal@semihalf.com>
---
drivers/net/wwan/t7xx/t7xx_pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/wwan/t7xx/t7xx_pci.c b/drivers/net/wwan/t7xx/t7xx_pci.c
index 871f2a27a398..226fc1703e90 100644
--- a/drivers/net/wwan/t7xx/t7xx_pci.c
+++ b/drivers/net/wwan/t7xx/t7xx_pci.c
@@ -121,6 +121,8 @@ void t7xx_pci_pm_init_late(struct t7xx_pci_dev *t7xx_dev)
iowrite32(T7XX_L1_BIT(0), IREG_BASE(t7xx_dev) + ENABLE_ASPM_LOWPWR);
atomic_set(&t7xx_dev->md_pm_state, MTK_PM_RESUMED);
+ pm_runtime_mark_last_busy(&t7xx_dev->pdev->dev);
+ pm_runtime_allow(&t7xx_dev->pdev->dev);
pm_runtime_put_noidle(&t7xx_dev->pdev->dev);
}
--
2.39.1.456.gfc5497dd1b-goog
next prev parent reply other threads:[~2023-01-26 13:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-26 13:25 [PATCH 0/2] net: wwan: t7xx: Fix Runtime PM implementation Kornel Dulęba
2023-01-26 13:25 ` [PATCH 1/2] net: wwan: t7xx: Fix Runtime PM resume sequence Kornel Dulęba
2023-01-26 13:25 ` Kornel Dulęba [this message]
2023-01-28 13:50 ` [PATCH 0/2] net: wwan: t7xx: Fix Runtime PM implementation patchwork-bot+netdevbpf
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=20230126132535.80339-3-mindal@semihalf.com \
--to=mindal@semihalf.com \
--cc=chandrashekar.devegowda@intel.com \
--cc=chiranjeevi.rapolu@linux.intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haijun.liu@mediatek.com \
--cc=johannes@sipsolutions.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxwwan@intel.com \
--cc=loic.poulain@linaro.org \
--cc=m.chetan.kumar@linux.intel.com \
--cc=mw@semihalf.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=rad@semihalf.com \
--cc=ricardo.martinez@linux.intel.com \
--cc=ryazanov.s.a@gmail.com \
--cc=upstream@semihalf.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®