From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 BEF683A48E3; Thu, 17 Sep 2026 16:02:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789660951; cv=none; b=ni907UExKX6rU2Ahq7zTr/jzy3Je0ruLqr8XO5Ims/1ZQepBuEye7Wb3k8tW3oXWpd/abqYh9h8gfnWLf6mTio0fD33u7LJdGf7S3OeUPs7A0dBAvmBu8mXPCvFptNlvM3wgSptZ2sCZfVOWijzIKTHWKKAenyuuzeebjlwP6Xc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789660951; c=relaxed/simple; bh=HLzV2Br5xXA6FWVM4QkayfIOd++51CmSlMkDEk9bUWM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NZOKfXbt8Meb/Edm+1y0E1bo16qkYdF1k0LeRrBqvO5QZJOzUxijsQvX3uHBSO5F2puh45BFQIgqucM3JJKw7GFAnZjn2AcBGt4t/Jp72h1yXFV3hr5C8QzuLXik230RyZaf1MUHxlz6APGyQSPJfn5MNSNDIHz/IfbnHmNegN0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JluceuO0; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JluceuO0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 240961F000FF; Thu, 17 Sep 2026 16:02:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789660950; bh=4T9Sl+HmFk5W+D3Oe2Jkiha6q4cyXQPyna7ZWUmkYbc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JluceuO08GR9KV+fzj8evX1O0S9yjFzS5QU5l+eTLE5F/8542Jqpz79oy8hSvuwqC UK7Y2wbEUZVyMp+gmD8ffwJfLB3HurQAtjSmO7ZqW8yA9yAm9QcpKXcJazD2D5ztih Fkr++0D3kEAxzeh6X+lPXdUr+sN5BqgM5jqx8Mfc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Laurent Pinchart , Tommaso Merciai , Biju Das , Sasha Levin Subject: [PATCH 6.18 0007/1250] drm: rz-du: Ensure correct suspend/resume ordering with VSP Date: Thu, 17 Sep 2026 15:56:42 +0100 Message-ID: <20260917151552.118981574@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260917151551.901433442@linuxfoundation.org> References: <20260917151551.901433442@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tommaso Merciai [ Upstream commit c94e765abb051df62b9f7c27116ef9307216c868 ] The VSP serves as an interface to memory and a compositor to the DU. It therefore needs to be suspended after and resumed before the DU, to be properly stopped and restarted in a controlled fashion driven by the DU driver. This currently works by chance. Avoid relying on luck by enforcing the correct suspend/resume ordering with device links. Based on similar work done by Laurent Pinchart for R-Car DU. commit db5be3a7d6bd ("drm: rcar-du: Ensure correct suspend/resume ordering with VSP") Reviewed-by: Laurent Pinchart Signed-off-by: Tommaso Merciai Link: https://patch.msgid.link/20260330144651.817338-1-tommaso.merciai.xr@bp.renesas.com Signed-off-by: Biju Das Signed-off-by: Sasha Levin --- drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c | 16 ++++++++++++++++ drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h | 2 ++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c index 040d4e4aff000..ab49604d69acf 100644 --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -293,6 +294,9 @@ static void rzg2l_du_vsp_cleanup(struct drm_device *dev, void *res) { struct rzg2l_du_vsp *vsp = res; + if (vsp->link) + device_link_del(vsp->link); + put_device(vsp->vsp); } @@ -317,6 +321,18 @@ int rzg2l_du_vsp_init(struct rzg2l_du_vsp *vsp, struct device_node *np, if (ret < 0) return ret; + /* + * Enforce suspend/resume ordering between the DU (consumer) and the + * VSP (supplier). The DU will be suspended before and resume after the + * VSP. + */ + vsp->link = device_link_add(rcdu->dev, vsp->vsp, DL_FLAG_STATELESS); + if (!vsp->link) { + dev_err(rcdu->dev, "Failed to create device link to VSP %s\n", + dev_name(vsp->vsp)); + return -EINVAL; + } + ret = vsp1_du_init(vsp->vsp); if (ret < 0) return ret; diff --git a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h index 322eb80dcbaff..a22aaf0843ed7 100644 --- a/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h +++ b/drivers/gpu/drm/renesas/rz-du/rzg2l_du_vsp.h @@ -15,6 +15,7 @@ #include struct device; +struct device_link; struct drm_framebuffer; struct rzg2l_du_device; struct rzg2l_du_format_info; @@ -29,6 +30,7 @@ struct rzg2l_du_vsp_plane { struct rzg2l_du_vsp { unsigned int index; struct device *vsp; + struct device_link *link; struct rzg2l_du_device *dev; }; -- 2.53.0