From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 43C0C1D07BA; Thu, 17 Apr 2025 18:44:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744915467; cv=none; b=rmTWZEelu3TKiR8B6MJSW4y5C7Qdw1GE6zjIbA7hwgEtKsU1pDqCr+TrPT63ZgJRwH4D4AU1eiiXIc8KZmqmHXoE2EhOTLsHOGQ/gER5a71M2rbBdhzvrUlxx9Pqagqy9WnODjtGzVNztTlOjr5JuRrd1YTlP1ZIKYMZ8NwOa30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744915467; c=relaxed/simple; bh=YZFeUeo8uyNDUxZhj29D1jLUIwLfZAEhx1ugkNVRMfg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sVUgxCLGYekUmIUgGD+zl5POEGwx9WHUadn1KofyUIREN4j29MHMnUzR563Eqe4xW85u7t8SBaj2IRxMGny5l1KqXM/Zprjv+8Dga8satdHYGIR9qn6c/IhTUbDSmZ5qxTkcUPm+1kyyIWOPwumUnZHGzmDOmsKF6+R8cPf7A3s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jd2dTiyP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jd2dTiyP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22590C4CEE4; Thu, 17 Apr 2025 18:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744915466; bh=YZFeUeo8uyNDUxZhj29D1jLUIwLfZAEhx1ugkNVRMfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jd2dTiyPoVSOoaDimL1ToHUbmC9yqBjwoE34SWlv6yuUQINb/aRrQTm1dkSzIuG6+ edIobqAE+i0dMBOIsHB9NatoxbTArFBzlB2052Oa5oIycgCuteP5OxtxlTB5NksciR 0nolszsxJMnvOMzKpBh+7tjmnaEDGja7yLpFfHew= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Dmitry Baryshkov , Luca Ceresoli , Robert Foss , Sasha Levin Subject: [PATCH 6.12 137/393] drm/bridge: panel: forbid initializing a panel with unknown connector type Date: Thu, 17 Apr 2025 19:49:06 +0200 Message-ID: <20250417175113.095468941@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250417175107.546547190@linuxfoundation.org> References: <20250417175107.546547190@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Luca Ceresoli [ Upstream commit b296955b3a740ecc8b3b08e34fd64f1ceabb8fb4 ] Having an DRM_MODE_CONNECTOR_Unknown connector type is considered bad, and drm_panel_bridge_add_typed() and derivatives are deprecated for this. drm_panel_init() won't prevent initializing a panel with a DRM_MODE_CONNECTOR_Unknown connector type. Luckily there are no in-tree users doing it, so take this as an opportinuty to document a valid connector type must be passed. Returning an error if this rule is violated is not possible because drm_panel_init() is a void function. Add at least a warning to make any violations noticeable, especially to non-upstream drivers. Reviewed-by: Dmitry Baryshkov Signed-off-by: Luca Ceresoli Signed-off-by: Robert Foss Link: https://patchwork.freedesktop.org/patch/msgid/20250214-drm-assorted-cleanups-v7-5-88ca5827d7af@bootlin.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_panel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_panel.c b/drivers/gpu/drm/drm_panel.c index 19ab0a794add3..fd8fa2e0ef6fa 100644 --- a/drivers/gpu/drm/drm_panel.c +++ b/drivers/gpu/drm/drm_panel.c @@ -49,7 +49,7 @@ static LIST_HEAD(panel_list); * @dev: parent device of the panel * @funcs: panel operations * @connector_type: the connector type (DRM_MODE_CONNECTOR_*) corresponding to - * the panel interface + * the panel interface (must NOT be DRM_MODE_CONNECTOR_Unknown) * * Initialize the panel structure for subsequent registration with * drm_panel_add(). @@ -57,6 +57,9 @@ static LIST_HEAD(panel_list); void drm_panel_init(struct drm_panel *panel, struct device *dev, const struct drm_panel_funcs *funcs, int connector_type) { + if (connector_type == DRM_MODE_CONNECTOR_Unknown) + DRM_WARN("%s: %s: a valid connector type is required!\n", __func__, dev_name(dev)); + INIT_LIST_HEAD(&panel->list); INIT_LIST_HEAD(&panel->followers); mutex_init(&panel->follower_lock); -- 2.39.5