From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8977539DBDF for ; Thu, 30 Apr 2026 08:10:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777536640; cv=none; b=O/+UN8+X+oLK+kzLvdU54s8OdFrlkhDsP59g8Ucfhe4UtuYCYJZDhX4V8mfU/rN0EGe/9NMnMZouboN8c9uMGcT5Iba6NBHdJvxVz2aOARD3coS6xa19ogGWX/ZQIpBd/KoPKJAknX6PiKisw5vD/tav1M5ktS8Rfx96oZqoqEM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777536640; c=relaxed/simple; bh=JRFm17Wq30t/hsV74w8ufye5HTxnPS70PRqVcBEiMHs=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=mFzIkRKaUMCH2pF1NjWK3bgrQdaVLOWGBl6jm64/HXNS+7RhM7AAx6gIkfbI5qwV79FsNsHj21/rOTPuVf7twZqjZcIH4eQOQONQpgK5wlksioJ3deXbZ2uFcAVW9+wdxd9RFEAPF7HavlLqCmqibm2TkwE+g8oejHCYkpVxgsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=fwNzz+Na; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="fwNzz+Na" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id E5A324E42B73; Thu, 30 Apr 2026 08:10:35 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id AC82760495; Thu, 30 Apr 2026 08:10:35 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 17DA91072B755; Thu, 30 Apr 2026 10:10:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1777536634; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=dnqNnTF0DYaAxbSZWlFQjgF0Ulm0iKJS5gN4T0zzOZ8=; b=fwNzz+Nahzd38yd2W8yYXV3nQsiEuOlIsLSQuH5OhRM1zDbACIAU/uKtL012G9uEA2HkmS nB3OykRQmJIxe0b9U7rd8nFEVcqvZbj7i7PEncC8dtmG0AnoyXJ+ZZWxuh39kFr8+bAdEt oUumRVDNKQoPOxcGlC6PGhC7FIEa2dzQ9cGl6bFnVG8F/weTPUqAl+XJUwskomgQ34DPWh lTB9JC/oGYDeGhyLBwuRd1o6tA7d/5sVC7VkpxCakZZHfBDi9atmyXLyyq+KtiUfnzG5so Cb/C0zlhjp8UankqPtmDYFWIOYJkkgrJBVDkkPo3sz3dyCIxqUUhzmIPQJcTLg== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 30 Apr 2026 10:10:29 +0200 Message-Id: Subject: Re: [PATCH v4] drm/bridge: cdns-dsi: Replace deprecated UNIVERSAL_DEV_PM_OPS() Cc: "Vitor Soares" , , , , "Tomi Valkeinen" To: "Vitor Soares" , "Andrzej Hajda" , "Neil Armstrong" , "Robert Foss" , "Laurent Pinchart" , "Jonas Karlman" , "Jernej Skrabec" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "David Airlie" , "Simona Vetter" From: "Luca Ceresoli" X-Mailer: aerc 0.20.1 References: <20260407144142.1420354-2-ivitro@gmail.com> In-Reply-To: <20260407144142.1420354-2-ivitro@gmail.com> X-Last-TLS-Session-Version: TLSv1.3 On Tue Apr 7, 2026 at 4:41 PM CEST, Vitor Soares wrote: > From: Vitor Soares > > The deprecated UNIVERSAL_DEV_PM_OPS() macro uses the provided callbacks > for both runtime PM and system sleep. This causes the DSI clocks to be > disabled twice: once during runtime suspend and again during system > suspend, resulting in a WARN message from the clock framework when > attempting to disable already-disabled clocks. > > [ 84.384540] clk:231:5 already disabled > [ 84.388314] WARNING: CPU: 2 PID: 531 at /drivers/clk/clk.c:1181 clk_co= re_disable+0xa4/0xac > ... > [ 84.579183] Call trace: > [ 84.581624] clk_core_disable+0xa4/0xac > [ 84.585457] clk_disable+0x30/0x4c > [ 84.588857] cdns_dsi_suspend+0x20/0x58 [cdns_dsi] > [ 84.593651] pm_generic_suspend+0x2c/0x44 > [ 84.597661] ti_sci_pd_suspend+0xbc/0x15c > [ 84.601670] dpm_run_callback+0x8c/0x14c > [ 84.605588] __device_suspend+0x1a0/0x56c > [ 84.609594] dpm_suspend+0x17c/0x21c > [ 84.613165] dpm_suspend_start+0xa0/0xa8 > [ 84.617083] suspend_devices_and_enter+0x12c/0x634 > [ 84.621872] pm_suspend+0x1fc/0x368 > > To address this issue, replace UNIVERSAL_DEV_PM_OPS() with > SET_RUNTIME_PM_OPS(), enabling suspend/resume handling through the This is not what the patch does, the patch uses RUNTIME_PM_OPS. > _enable()/_disable() hooks managed by the DRM framework for both > runtime and system-wide PM. > > Cc: stable@vger.kernel.org # 6.1.x > Fixes: e19233955d9e ("drm/bridge: Add Cadence DSI driver") > Reviewed-by: Tomi Valkeinen > Signed-off-by: Vitor Soares > --- > v3 -> v4 > - Add Reviewed-by from Tomi Valkeinen > - Rebase on top of drm-misc-fixes > - Verified issue still present on current mainline > > v2 -> v3 > - Fix warning: 'cdns_dsi_suspend' defined but not used [-Wunused-functio= n] > - Fix warning: 'cdns_dsi_resume' defined but not used [-Wunused-function= ] > > v1 -> v2 > - Rely only on SET_RUNTIME_PM_OPS() for the PM. > > drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c b/drivers/gpu= /drm/bridge/cadence/cdns-dsi-core.c > index 0dd85e26248c..e07a9892df4e 100644 > --- a/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c > +++ b/drivers/gpu/drm/bridge/cadence/cdns-dsi-core.c > @@ -1230,7 +1230,7 @@ static const struct mipi_dsi_host_ops cdns_dsi_ops = =3D { > .transfer =3D cdns_dsi_transfer, > }; > > -static int __maybe_unused cdns_dsi_resume(struct device *dev) > +static int cdns_dsi_resume(struct device *dev) > { > struct cdns_dsi *dsi =3D dev_get_drvdata(dev); > > @@ -1241,7 +1241,7 @@ static int __maybe_unused cdns_dsi_resume(struct de= vice *dev) > return 0; > } > > -static int __maybe_unused cdns_dsi_suspend(struct device *dev) > +static int cdns_dsi_suspend(struct device *dev) > { > struct cdns_dsi *dsi =3D dev_get_drvdata(dev); > > @@ -1251,8 +1251,9 @@ static int __maybe_unused cdns_dsi_suspend(struct d= evice *dev) > return 0; > } > > -static UNIVERSAL_DEV_PM_OPS(cdns_dsi_pm_ops, cdns_dsi_suspend, cdns_dsi_= resume, > - NULL); > +static const struct dev_pm_ops cdns_dsi_pm_ops =3D { > + RUNTIME_PM_OPS(cdns_dsi_suspend, cdns_dsi_resume, NULL) > +}; Not an expert here, but the docs [0] suggest using DEFINE_RUNTIME_DEV_PM_OPS(). Is there a good reason to not do so? [0] https://elixir.bootlin.com/linux/v7.0.1/source/include/linux/pm.h#L455-= L456 Luca -- Luca Ceresoli, Bootlin Embedded Linux and Kernel engineering https://bootlin.com