Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp66110rwi; Sun, 9 Oct 2022 18:36:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM52GOx8czbhZkfWCKZBZMC3sow30AiI+2hmtpxJjoW4sY8XL6atmMzTjLj5OfocPxZrrLf1 X-Received: by 2002:a17:902:e844:b0:178:4930:8aa5 with SMTP id t4-20020a170902e84400b0017849308aa5mr16697761plg.69.1665365811868; Sun, 09 Oct 2022 18:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665365811; cv=none; d=google.com; s=arc-20160816; b=AMOwFItmcdHV3neDiA3kP22NWfeDi2m3CQu3mZfNEsGGeaeMaNkAJaJLuu/3Kbycmw T1XhISmfAuvAzkyPYu3bIqzmJwRK/TB3NH413DiOx9u64yaEA0hlBYAd3rhy6JhaEUr9 5M7RS0yWmlQVk8kLbBdHGmaorw99erizznQtIW+bZ80gdbLGThu9par8geRKcwIlRkee aPcDRTHvum76xqucnv+w+z7eSe2D0qrEIafSNF0lYT3PA9fQjOy4GyN7kc9XPlZOhDoV XCt4Lh98iEnsULP0gdNsY8KXk4pjwUxUrFsZTij2Auye9TAD+IMWJucratidLremEGkR YYIw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gDD/Sh5mVY13bUKw+0Uy4drzjv2ghMr4dMHypPSl1+g=; b=JgOvCbpGt84txzjYrn6JmDZAHmjx/GyhJbcF8z+kK0hY0cWYtJLnFApjuLbQPJBks2 4herRF+wIZROx5FHKYn0NuyLI0yURYeu2moGSvfvmq8S50Z0AF0fUi1mu9rZUAIrPrRX rcLL5XPOPDG9K5Vs5zLvtjT7hSYvXPkNlBDzdAGj5EIhD6lrpXNHFbfpPEqYDv6nGs8A UY5ds3cuL2hiiQ1h+5RN3IV+MznIrg37eXnGMBjqj8LVX+avCifU97hDZFIpiIWRikdt LR9jHtPeQybQY8dnWNT9JA4ElVZdKirwkOnvotmuD/wxxDcLEUt39Gbx0aqqExA6adHT ppTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Misfq8Bu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bg22-20020a056a02011600b0044ed36e4c57si10954326pgb.217.2022.10.09.18.36.40; Sun, 09 Oct 2022 18:36:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Misfq8Bu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232398AbiJJAXD (ORCPT + 99 others); Sun, 9 Oct 2022 20:23:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232579AbiJJAVL (ORCPT ); Sun, 9 Oct 2022 20:21:11 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9474F58DD5; Sun, 9 Oct 2022 16:55:24 -0700 (PDT) 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 67B77B80DE9; Sun, 9 Oct 2022 23:55:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB72AC43470; Sun, 9 Oct 2022 23:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1665359721; bh=eMMz/bzyjKDaTSFfsHVIqdswAnQO2E3Q+3QAdTBksh4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Misfq8Buls/7r/Vs/fLCOS9oMIdu0HfdIxYpKYLLp81LVwoynpoQoEwphX95evgQi 9CnAL+4QyeupK5FfeDLv07og6X/hsvlmpLjQlpfwSnJQx80VIQZusOyyt8Hz9tyXYL Uz2rhoL+KOdRJlCwEFa+XpHbTlkLneUYqwbwY4gSyvP7veLGNDF4NUTomuP2wxBiaV etPFsOIVDH/YhMlsHDofTS0I5kOdPericCnLonvXn/XwhhQk2fT035I7/CY0tLCSVt v2UXut089T3MAM1WzNdm+FUxpTOoyErCy1A5+Z7QulsiqMmCl1FEDSfXYFu05BBIBQ V0jIblhZU8STQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Khaled Almahallawy , Imre Deak , Jani Nikula , Or Cochvi , Sasha Levin , maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.15 23/25] drm/dp: Don't rewrite link config when setting phy test pattern Date: Sun, 9 Oct 2022 19:54:23 -0400 Message-Id: <20221009235426.1231313-23-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221009235426.1231313-1-sashal@kernel.org> References: <20221009235426.1231313-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Khaled Almahallawy [ Upstream commit 7b4d8db657192066bc6f1f6635d348413dac1e18 ] The sequence for Source DP PHY CTS automation is [2][1]: 1- Emulate successful Link Training(LT) 2- Short HPD and change link rates and number of lanes by LT. (This is same flow for Link Layer CTS) 3- Short HPD and change PHY test pattern and swing/pre-emphasis levels (This step should not trigger LT) The problem is with DP PHY compliance setup as follow: [DPTX + on board LTTPR]------Main Link--->[Scope] ^ | | | | | ----------Aux Ch------>[Aux Emulator] At step 3, before writing TRAINING_LANEx_SET/LINK_QUAL_PATTERN_SET to declare the pattern/swing requested by scope, we write link config in LINK_BW_SET/LANE_COUNT_SET on a port that has LTTPR. As LTTPR snoops aux transaction, LINK_BW_SET/LANE_COUNT_SET writes indicate a LT will start [Check DP 2.0 E11 -Sec 3.6.8.2 & 3.6.8.6.3], and LTTPR will reset the link and stop sending DP signals to DPTX/Scope causing the measurements to fail. Note that step 3 will not trigger LT and DP link will never recovered by the Aux Emulator/Scope. The reset of link can be tested with a monitor connected to LTTPR port simply by writing to LINK_BW_SET or LANE_COUNT_SET as follow igt/tools/dpcd_reg write --offset=0x100 --value 0x14 --device=2 OR printf '\x14' | sudo dd of=/dev/drm_dp_aux2 bs=1 count=1 conv=notrunc seek=$((0x100)) This single aux write causes the screen to blank, sending short HPD to DPTX, setting LINK_STATUS_UPDATE = 1 in DPCD 0x204, and triggering LT. As stated in [1]: "Before any TX electrical testing can be performed, the link between a DPTX and DPRX (in this case, a piece of test equipment), including all LTTPRs within the path, shall be trained as defined in this Standard." In addition, changing Phy pattern/Swing/Pre-emphasis (Step 3) uses the same link rate and lane count applied on step 2, so no need to redo LT. The fix is to not rewrite link config in step 3, and just writes TRAINING_LANEx_SET and LINK_QUAL_PATTERN_SET [1]: DP 2.0 E11 - 3.6.11.1 LTTPR DPTX_PHY Electrical Compliance [2]: Configuring UnigrafDPTC Controller - Automation Test Sequence https://www.keysight.com/us/en/assets/9922-01244/help-files/ D9040DPPC-DisplayPort-Test-Software-Online-Help-latest.chm Cc: Imre Deak Cc: Jani Nikula Cc: Or Cochvi Signed-off-by: Khaled Almahallawy Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20220916054900.415804-1-khaled.almahallawy@intel.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_dp_helper.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 7bb24523a749..b8815e7f5832 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -2376,17 +2376,8 @@ int drm_dp_set_phy_test_pattern(struct drm_dp_aux *aux, struct drm_dp_phy_test_params *data, u8 dp_rev) { int err, i; - u8 link_config[2]; u8 test_pattern; - link_config[0] = drm_dp_link_rate_to_bw_code(data->link_rate); - link_config[1] = data->num_lanes; - if (data->enhanced_frame_cap) - link_config[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; - err = drm_dp_dpcd_write(aux, DP_LINK_BW_SET, link_config, 2); - if (err < 0) - return err; - test_pattern = data->phy_pattern; if (dp_rev < 0x12) { test_pattern = (test_pattern << 2) & -- 2.35.1