From patchwork Sat Oct 22 07:28:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 7672 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp1108313wrr; Sat, 22 Oct 2022 01:44:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM67LVHwwtPMiYWjwkbWgdX88y1cNs2Sm392ZmteWTkc6NlxT0KV2jivSWFMLpxTlNxsmp0+ X-Received: by 2002:a50:fe85:0:b0:458:5562:bf1e with SMTP id d5-20020a50fe85000000b004585562bf1emr21002518edt.167.1666428260775; Sat, 22 Oct 2022 01:44:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666428260; cv=none; d=google.com; s=arc-20160816; b=a0B9Do7KTwlbotIwTHiAjSEZAaKETIG1Ju3sgvTyAncXK/eV2hbTwFlh7TSGzITnhk B5l9EV527kF0ST0TW0sHdFw+lZN1IgwTshQbK0PzmIhW/rSSX39ye5HpJHsygspc6BzM PGCxz+astRwOnV+qweX8eA4uGNxKtm0zOG5jGZV7YB6BxOqXx50SALfklvsxX2xOrV9e 6hGHbXqziDUVDiENkoOBn0hffGa5nrNCEzvYJ8XxM0RakOxOR48Mux5hmyRFyuyMwutP kQIoJsxyf3PDmD5bpUNWLI78kbKImen38lqkWy31Ug5aYqvbk5wo3VGD9QhuOZk2H2xO iULw== 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=t9iHjmrIaXOkUWC5Tr+UIpzncU5OqM+/tIexRDddLFE=; b=bPETzlLcQe1thDC1oAWr2OBsQ2B0gCpsiK4HDy6rNWz+jA/7IHPUfpNsIW20oSjWmu mqSZzTcYlA+wE5qFLxmjHGcsonaoLoyBPvnEefUbkD2aWa/AQDfHOrCA4OI+IElsITWh mswZVdpkLTI1EO5G3H4kWOVMS29Z/EkaQAlNWtSNyajVNO6j8WFQLapHYpB2cHB5D9GF dyq1NBiu7jPc+O8YqNCQOy2XHSW5juNZ23gTZV/EAD+Ay0f0BQJytiOxbSaF+SCTuQIX mDn/NoIzn2JEMuMF4fAduYKSXccG/VoFUzz5zaYSxeydBjpL9SULTlrwzYwSWCdOYV6/ Drsg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=OjxV7obM; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b11-20020a0564021f0b00b0045bf23171d5si21498965edb.165.2022.10.22.01.43.56; Sat, 22 Oct 2022 01:44:20 -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=@linuxfoundation.org header.s=korg header.b=OjxV7obM; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234488AbiJVInG (ORCPT + 99 others); Sat, 22 Oct 2022 04:43:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234457AbiJVIlV (ORCPT ); Sat, 22 Oct 2022 04:41:21 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AB3F2E8D8A; Sat, 22 Oct 2022 01:06:43 -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 E4E3DB82E1B; Sat, 22 Oct 2022 08:05:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C9BDC433D6; Sat, 22 Oct 2022 08:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666425909; bh=nHlhI1QWXEppbMON++/kcW8SsBgmXCnr015giDmAqlE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OjxV7obM45MpqvLCGzwJNG+Z0GMH0wAG0yFITe6jJ+LVZUtYA0W4SRCzEOSvS3NYw ZFUcrXkL1qmpd3fdfgM59J2NtI1NJufCn0kLvdVVTnsAPm6Rs1eMlfY44biUMqdQN3 enx3hZIY0iaKNq4cHFArLRJ+Sla65Qozve10fNJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Imre Deak , Jani Nikula , Or Cochvi , Khaled Almahallawy , Sasha Levin Subject: [PATCH 5.19 625/717] drm/dp: Dont rewrite link config when setting phy test pattern Date: Sat, 22 Oct 2022 09:28:24 +0200 Message-Id: <20221022072526.098026922@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221022072415.034382448@linuxfoundation.org> References: <20221022072415.034382448@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.3 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747376679550469789?= X-GMAIL-MSGID: =?utf-8?q?1747376679550469789?= 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/display/drm_dp_helper.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/gpu/drm/display/drm_dp_helper.c b/drivers/gpu/drm/display/drm_dp_helper.c index e7c22c2ca90c..f27cd710bc86 100644 --- a/drivers/gpu/drm/display/drm_dp_helper.c +++ b/drivers/gpu/drm/display/drm_dp_helper.c @@ -2636,17 +2636,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) &