Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3629113pxb; Mon, 24 Jan 2022 13:55:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4xOdaKiHcY41agw4U360hSfZCMCJgYBZl5IjGJGDXoYgo8kiCrG467PNxBP++VEOCIhm1 X-Received: by 2002:a62:1bd0:0:b0:4c9:f8f:e3c5 with SMTP id b199-20020a621bd0000000b004c90f8fe3c5mr6328150pfb.3.1643061320286; Mon, 24 Jan 2022 13:55:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643061320; cv=none; d=google.com; s=arc-20160816; b=EQxaXl9EssU0f4/60/yhvE3wN94lonl7TPet0Vi4JehIG7VYh/hAwjH2DvjM0zGDHK ryASjy2eqU6paYiHmFVGBBWoygp8padG8kUNAxr1lT7ERkIreheq3PVFMjNTXiKiFaXy Q9F3hcjiUkgMI87RaSeO3Yrl/JBN326qnNQGR/2eWALND955QEwxh8kG+rG/4WDzhYBe 4rfAAk5rn7pzTVWuB/K8R7/Y0vS16kM/+rI6ZegDx9yrJdK8m+ebSmFR/fxCwMHFndHe MzLaFZMDqoRPrhIx3Qv/sH3h65N20xVork8eCQy6bxNHoNUH7Bs2p+dALRRmzTbhjpEB ul1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vmxDxQv1nZrP2cy3G6+3A0j53q3yEF3S8rFyUWOmdhM=; b=cX8E0NrSX5AZXyczoLo+HJrecSbPO4C2H3aToSuGSRT22d5vyddNYuAn9F8ns2PTE6 WYq46KGm5sPrN3lDGIA7emkDSLHfVU09FNU7Wgc5G0kWju9acKl3KM713qr98WiOrNyR viQ3daICE//ZvRb+/nTN7Z2/d8cWC1X5SFmZL7/9mUuSoSkk4JrKVBoxtVYn4cFg/226 LqoefXVm5r21B5bsELKxSB+tTSLHxcjddA8ZGyAxL4kQ4/Ew18omRiQ0F/FwO7mHtWJi SiEpUlgZM/JyaTgthO2rwR+mK3Ph4XpimL/9sIkWpFOUuXA3Fw3OhZtcFXCrLYZ/kxIO V65Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UdHM1mmE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 20si13469063plk.412.2022.01.24.13.55.08; Mon, 24 Jan 2022 13:55:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UdHM1mmE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1457870AbiAXVmZ (ORCPT + 99 others); Mon, 24 Jan 2022 16:42:25 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:59368 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345225AbiAXVH3 (ORCPT ); Mon, 24 Jan 2022 16:07:29 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 43A5BB80FA1; Mon, 24 Jan 2022 21:07:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 58E7BC340E5; Mon, 24 Jan 2022 21:07:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643058445; bh=nu01olkCxJuUw8m66Dp5sIuc0VHqWRn2P7ZjH/2o+yY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UdHM1mmESkkCw0UlYhMwwG2M1ihl8LdTlx0kU/OeG1xTsGJ5ETGsvtcImWc6Lt3Ej pPr1viDe2rFWxfpDIRXAjEnGIpOeHDQvmdssCvtkNyWDIRVs15bcYanjI8H2iz2iFx jcBGbjMtyi+v3Er16UvJFVw7j/Ym7uKBufm8Rvac= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dmitry Baryshkov , Abhinav Kumar , Rob Clark , Sasha Levin Subject: [PATCH 5.16 0264/1039] drm/msm/dsi: fix initialization in the bonded DSI case Date: Mon, 24 Jan 2022 19:34:13 +0100 Message-Id: <20220124184134.174887354@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Dmitry Baryshkov [ Upstream commit 92cb1bedde9dba78d802fe2510949743a2581aed ] Commit 739b4e7756d3 ("drm/msm/dsi: Fix an error code in msm_dsi_modeset_init()") changed msm_dsi_modeset_init() to return an error code in case msm_dsi_manager_validate_current_config() returns false. However this is not an error case, but a slave DSI of the bonded DSI link. In this case msm_dsi_modeset_init() should return 0, but just skip connector and bridge initialization. To reduce possible confusion, drop the msm_dsi_manager_validate_current_config() function, and specif 'bonded && !master' condition directly in the msm_dsi_modeset_init(). Fixes: 739b4e7756d3 ("drm/msm/dsi: Fix an error code in msm_dsi_modeset_init()") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar Link: https://lore.kernel.org/r/20211125180114.561278-1-dmitry.baryshkov@linaro.org Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/dsi/dsi.c | 10 +++++++--- drivers/gpu/drm/msm/dsi/dsi.h | 1 - drivers/gpu/drm/msm/dsi/dsi_manager.c | 17 ----------------- 3 files changed, 7 insertions(+), 21 deletions(-) diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c index 75ae3008b68f4..fc280cc434943 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.c +++ b/drivers/gpu/drm/msm/dsi/dsi.c @@ -215,9 +215,13 @@ int msm_dsi_modeset_init(struct msm_dsi *msm_dsi, struct drm_device *dev, goto fail; } - if (!msm_dsi_manager_validate_current_config(msm_dsi->id)) { - ret = -EINVAL; - goto fail; + if (msm_dsi_is_bonded_dsi(msm_dsi) && + !msm_dsi_is_master_dsi(msm_dsi)) { + /* + * Do not return an eror here, + * Just skip creating encoder/connector for the slave-DSI. + */ + return 0; } msm_dsi->encoder = encoder; diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index 569c8ff062ba4..a63666e59d19e 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -82,7 +82,6 @@ int msm_dsi_manager_cmd_xfer(int id, const struct mipi_dsi_msg *msg); bool msm_dsi_manager_cmd_xfer_trigger(int id, u32 dma_base, u32 len); int msm_dsi_manager_register(struct msm_dsi *msm_dsi); void msm_dsi_manager_unregister(struct msm_dsi *msm_dsi); -bool msm_dsi_manager_validate_current_config(u8 id); void msm_dsi_manager_tpg_enable(void); /* msm dsi */ diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 20c4d650fd80c..e58ec5c1a4c37 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -649,23 +649,6 @@ fail: return ERR_PTR(ret); } -bool msm_dsi_manager_validate_current_config(u8 id) -{ - bool is_bonded_dsi = IS_BONDED_DSI(); - - /* - * For bonded DSI, we only have one drm panel. For this - * use case, we register only one bridge/connector. - * Skip bridge/connector initialisation if it is - * slave-DSI for bonded DSI configuration. - */ - if (is_bonded_dsi && !IS_MASTER_DSI_LINK(id)) { - DBG("Skip bridge registration for slave DSI->id: %d\n", id); - return false; - } - return true; -} - /* initialize bridge */ struct drm_bridge *msm_dsi_manager_bridge_init(u8 id) { -- 2.34.1