Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp4475363imw; Tue, 19 Jul 2022 07:18:38 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tNKn7tsdUytMHpCrDJxMDmyl9FISAqLMEGkhCn7gPW+rbPbWdVRQx0IKx2rY7EIQh4rrBv X-Received: by 2002:aa7:c151:0:b0:43b:a52c:deaa with SMTP id r17-20020aa7c151000000b0043ba52cdeaamr909136edp.19.1658240318649; Tue, 19 Jul 2022 07:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658240318; cv=none; d=google.com; s=arc-20160816; b=Byx2Ob3FeOV3hRKnCpQuc8qbn6pTE4wzvubdQmgEMnUntR/FaPnt7nqm+DHXU0Bf0E zYcZAMu7eqSQ+hGBsIxK/ze9/n+XsVXrtsvbAuUG5mFdVrx0P300gSisfW6eNtiTlt+2 tArcCqGciQfBau1PzzVXudWpPiBUW86felS5tjsNqonFZpknoLC43djyzrRt5euR75v+ EU3FpK89VgsNbcnDcA9qTUiXU5fN9NDDbi+XJADYmITJBEqK8XE36qTWvOM/o7PMJB2f nHUbjKBygGfpx4/+dCQegPAAsW704mRj5maHX1exAXdaIGKjo0v77tLzM+vk7NER6EYS YBLA== 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=dYjUI0sRVj8AASyUuqguY1Jj8Uzgkjja94vaq/6xy8c=; b=pT4iikJmVtMv7fJZD1CpckjoiaH8mUwAbj82NxIa+8tWIevVAwjMHJKD7700xYTzIS P5CifR4QXYR1FKtwKV9SVpYNqU4jhknMV0CJ8Jx99EXFkcXfiiSDNVbsEHtAW2vqMHtV psnONBFu9p+wAPNHuI6QsjCqB3vbTCAPR1oa2PRyVL8Zl4fDALwQUtCfpDtP9pnSyX2W kSk3h13j0kc+xlNR1QM2ru279YpuBebRwmQTHQo3kwtBeokbL4Ak8i1wmpk//zDe+iMm owmM7CI6KwzqwTWe7LdXV0VN8F1LQpqmQLrJxZzloEB7v3iG6xXRV6o/nY/dmYwAnaY/ iZOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HaRjCKKS; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z18-20020a05640240d200b00435bcb8758dsi3800820edb.12.2022.07.19.07.18.14; Tue, 19 Jul 2022 07:18:38 -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=HaRjCKKS; 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 S242884AbiGSNDh (ORCPT + 99 others); Tue, 19 Jul 2022 09:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239532AbiGSM7V (ORCPT ); Tue, 19 Jul 2022 08:59:21 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FA2149B60; Tue, 19 Jul 2022 05:24:14 -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 dfw.source.kernel.org (Postfix) with ESMTPS id E056761922; Tue, 19 Jul 2022 12:24:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7962C341DC; Tue, 19 Jul 2022 12:24:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658233453; bh=mPWFpi/NvBUG7VpmrRy9y9gCA5c8Z8stgsW5SFbdZ2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HaRjCKKSE8fD3UnkQF68uIWrlbNY4odHPONtNfSwq8y/COM3zF+neHLPo1Ab00xN+ m5b6C/onLGVFcb6EiLJq6QsNEX5h73JFwGoSCe7e9IBqy+tVFPeLBwF7OSNfy2esb8 ZhadPV2eASJXxMhp9YXm3e2IzP1tXOnuHwkNO+7U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Fangzhi Zuo , Solomon Chiu , Daniel Wheeler , Alex Deucher , Sasha Levin Subject: [PATCH 5.18 128/231] drm/amd/display: Ignore First MST Sideband Message Return Error Date: Tue, 19 Jul 2022 13:53:33 +0200 Message-Id: <20220719114725.221481298@linuxfoundation.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20220719114714.247441733@linuxfoundation.org> References: <20220719114714.247441733@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.8 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: Fangzhi Zuo [ Upstream commit acea108fa067d140bd155161a79b1fcd967f4137 ] [why] First MST sideband message returns AUX_RET_ERROR_HPD_DISCON on certain intel platform. Aux transaction considered failure if HPD unexpected pulled low. The actual aux transaction success in such case, hence do not return error. [how] Not returning error when AUX_RET_ERROR_HPD_DISCON detected on the first sideband message. v2: squash in additional DMI entries v3: squash in static fix Signed-off-by: Fangzhi Zuo Acked-by: Solomon Chiu Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 39 +++++++++++++++++++ .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h | 8 ++++ .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 17 ++++++++ 3 files changed, 64 insertions(+) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index b55a433e829e..bfbd701a4c9a 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -72,6 +72,7 @@ #include #include #include +#include #include #include @@ -1391,6 +1392,41 @@ static bool dm_should_disable_stutter(struct pci_dev *pdev) return false; } +static const struct dmi_system_id hpd_disconnect_quirk_table[] = { + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3660"), + }, + }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3260"), + }, + }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Precision 3460"), + }, + }, + {} +}; + +static void retrieve_dmi_info(struct amdgpu_display_manager *dm) +{ + const struct dmi_system_id *dmi_id; + + dm->aux_hpd_discon_quirk = false; + + dmi_id = dmi_first_match(hpd_disconnect_quirk_table); + if (dmi_id) { + dm->aux_hpd_discon_quirk = true; + DRM_INFO("aux_hpd_discon_quirk attached\n"); + } +} + static int amdgpu_dm_init(struct amdgpu_device *adev) { struct dc_init_data init_data; @@ -1521,6 +1557,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) } INIT_LIST_HEAD(&adev->dm.da_list); + + retrieve_dmi_info(&adev->dm); + /* Display Core create. */ adev->dm.dc = dc_create(&init_data); diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h index 7e44b0429448..4844601a5f47 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h @@ -546,6 +546,14 @@ struct amdgpu_display_manager { * last successfully applied backlight values. */ u32 actual_brightness[AMDGPU_DM_MAX_NUM_EDP]; + + /** + * @aux_hpd_discon_quirk: + * + * quirk for hpd discon while aux is on-going. + * occurred on certain intel platform + */ + bool aux_hpd_discon_quirk; }; enum dsc_clock_force_state { diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c index 31ac1fce36f8..d864cae1af67 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c @@ -58,6 +58,8 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, ssize_t result = 0; struct aux_payload payload; enum aux_return_code_type operation_result; + struct amdgpu_device *adev; + struct ddc_service *ddc; if (WARN_ON(msg->size > 16)) return -E2BIG; @@ -76,6 +78,21 @@ static ssize_t dm_dp_aux_transfer(struct drm_dp_aux *aux, result = dc_link_aux_transfer_raw(TO_DM_AUX(aux)->ddc_service, &payload, &operation_result); + /* + * w/a on certain intel platform where hpd is unexpected to pull low during + * 1st sideband message transaction by return AUX_RET_ERROR_HPD_DISCON + * aux transaction is succuess in such case, therefore bypass the error + */ + ddc = TO_DM_AUX(aux)->ddc_service; + adev = ddc->ctx->driver_context; + if (adev->dm.aux_hpd_discon_quirk) { + if (msg->address == DP_SIDEBAND_MSG_DOWN_REQ_BASE && + operation_result == AUX_RET_ERROR_HPD_DISCON) { + result = 0; + operation_result = AUX_RET_SUCCESS; + } + } + if (payload.write && result >= 0) result = msg->size; -- 2.35.1