linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Chandrasekar Ramakrishnan <rcsekar@samsung.com>,
	 Vincent Mailhol <mailhol@kernel.org>,
	 Patrik Flykt <patrik.flykt@linux.intel.com>,
	 Dong Aisheng <b29396@freescale.com>,
	Varka Bhadram <varkabhadram@gmail.com>,
	 Wu Bo <wubo.oduw@gmail.com>,
	Markus Schneider-Pargmann <msp@baylibre.com>,
	 Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-can@vger.kernel.org, kernel@pengutronix.de,
	 Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH v4 1/4] can: m_can: m_can_plat_remove(): add missing pm_runtime_disable()
Date: Mon, 29 Sep 2025 10:40:13 +0200	[thread overview]
Message-ID: <20250929-m_can-fix-state-handling-v4-1-682b49b49d9a@pengutronix.de> (raw)
In-Reply-To: <20250929-m_can-fix-state-handling-v4-0-682b49b49d9a@pengutronix.de>

Commit 227619c3ff7c ("can: m_can: move runtime PM enable/disable to
m_can_platform") moved the PM runtime enable from the m_can core
driver into the m_can_platform.

That patch forgot to move the pm_runtime_disable() to
m_can_plat_remove(), so that unloading the m_can_platform driver
causes an "Unbalanced pm_runtime_enable!" error message.

Add the missing pm_runtime_disable() to m_can_plat_remove() to fix the
problem.

Cc: Patrik Flykt <patrik.flykt@linux.intel.com>
Fixes: 227619c3ff7c ("can: m_can: move runtime PM enable/disable to m_can_platform")
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/m_can/m_can_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/m_can/m_can_platform.c b/drivers/net/can/m_can/m_can_platform.c
index b832566efda0..057eaa7b8b4b 100644
--- a/drivers/net/can/m_can/m_can_platform.c
+++ b/drivers/net/can/m_can/m_can_platform.c
@@ -180,7 +180,7 @@ static void m_can_plat_remove(struct platform_device *pdev)
 	struct m_can_classdev *mcan_class = &priv->cdev;
 
 	m_can_class_unregister(mcan_class);
-
+	pm_runtime_disable(mcan_class->dev);
 	m_can_class_free_dev(mcan_class->net);
 }
 

-- 
2.51.0


  reply	other threads:[~2025-09-29  8:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-29  8:40 [PATCH v4 0/4] can: m_can: fix pm_runtime and CAN state handling Marc Kleine-Budde
2025-09-29  8:40 ` Marc Kleine-Budde [this message]
2025-09-29  8:40 ` [PATCH v4 2/4] can: m_can: m_can_handle_state_errors(): fix CAN state transition to Error Active Marc Kleine-Budde
2025-09-29  8:40 ` [PATCH v4 3/4] can: m_can: m_can_chip_config(): bring up interface in correct state Marc Kleine-Budde
2025-09-29  8:40 ` [PATCH v4 4/4] can: m_can: fix CAN state in system PM Marc Kleine-Budde
2025-10-08  8:23 ` [PATCH v4 0/4] can: m_can: fix pm_runtime and CAN state handling Marc Kleine-Budde

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=20250929-m_can-fix-state-handling-v4-1-682b49b49d9a@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=b29396@freescale.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=msp@baylibre.com \
    --cc=p.zabel@pengutronix.de \
    --cc=patrik.flykt@linux.intel.com \
    --cc=rcsekar@samsung.com \
    --cc=varkabhadram@gmail.com \
    --cc=wubo.oduw@gmail.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;
as well as URLs for NNTP newsgroup(s).