From patchwork Mon Nov 14 22:17:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lyude Paul X-Patchwork-Id: 20056 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2393923wru; Mon, 14 Nov 2022 14:25:11 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Pgz2NFy8KyUr1Sl8vEAKMGEvIVvNKZf+uEM2VObrrTO/KVMQJ85HzcjVoxQyJTSX27xqQ X-Received: by 2002:a05:6402:3458:b0:458:b9f9:9fba with SMTP id l24-20020a056402345800b00458b9f99fbamr13136459edc.305.1668464711793; Mon, 14 Nov 2022 14:25:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668464711; cv=none; d=google.com; s=arc-20160816; b=B2Cck9u2EB2hoFmmvx7kEiid+iywydxVM6RxQ/YvzNjVa0EwSU41a+OrWgajV0RHTG eV8vwAkqynCxTZW30RWGCHsnoE1GyHppJ8qdh2O+AupoZJnaeR6oEVHS4MPOdrMxyd8u qqJyUIiw283LTS8LSzMg4nA2iVNlkvFSbmdFMa7SVGPXD8imLQ8vWY+QX/GcPVMqOxDO v2FyhVCazrk50PVXWfPcurFLmIXWNSvxXMaAba5UpgcKGNpilkTgi/T695LZbmR1pPhN g7pXiFtC1z5gyaz4CTlndysBi19QqcyqVXDaQZz+km6JEtXPGvch9uYBDpvDv9gPactI jCkQ== 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=O/M4W3uv7gwCZ1OdzG4UeM3eO9Q4aCQx77adsACSB0c=; b=QtEfc4D9V7lj21rtrPcrbOHkW4i6R7tKVAqg4bhBmNHqY0+02K2nx3oFJABdfTjCbU Zp/kzFrE+xyzAaM2joVjt6Lndxd6wkpD19w0uX3gH/9fRGHEVb9hjnz8Ysg6NK4cnjXa ycyi5KYvKtZjgoE9G0Ao7lqPlsumjN7J1kKcwji0b30yljbm18kdHTNSLKBVQrypCZ2I A3BXp0RzeCRJ7WSN0EoawsWmMSJrUQmcWvAP4LNyopjld//Iw6zW4DcPZBbUAg071jSC wOiLeeclfmsXqdVcVs+8a1lD50MRblDkPq8IQDAmceS7Wm343aHDKJ75Zo+Zg60letuy e+4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dJ5iQu48; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sh44-20020a1709076eac00b007ae26c753edsi10647305ejc.52.2022.11.14.14.24.47; Mon, 14 Nov 2022 14:25:11 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=dJ5iQu48; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237410AbiKNWUU (ORCPT + 99 others); Mon, 14 Nov 2022 17:20:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236879AbiKNWTr (ORCPT ); Mon, 14 Nov 2022 17:19:47 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8124DED5 for ; Mon, 14 Nov 2022 14:18:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668464327; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O/M4W3uv7gwCZ1OdzG4UeM3eO9Q4aCQx77adsACSB0c=; b=dJ5iQu48CKb9ClMtg50GY2b4Mt277uWPxCXzNqD44W9nyt7rosvSLhWHc5QyEdJ/t83OhH 8TV529gjx9l2fyORHzd3GjIoa0Wq+mTANwcfmIpoRGxm6mrSHeZmWhhZHGklTs6dEZDBOG /DI7mxeQPoWWKiv7cEWgJe0nNn0hQEI= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-xk6AjHqqOZyE6qJvTWmfFg-1; Mon, 14 Nov 2022 17:18:44 -0500 X-MC-Unique: xk6AjHqqOZyE6qJvTWmfFg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 07A692A59559; Mon, 14 Nov 2022 22:18:43 +0000 (UTC) Received: from emerald.lyude.net (unknown [10.22.18.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4761E4022C3; Mon, 14 Nov 2022 22:18:42 +0000 (UTC) From: Lyude Paul To: amd-gfx@lists.freedesktop.org Cc: stable@vger.kernel.org, Harry Wentland , Leo Li , Rodrigo Siqueira , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= , "Pan, Xinhui" , David Airlie , Daniel Vetter , hersen wu , Fangzhi Zuo , Wayne Lin , Nicholas Kazlauskas , Roman Li , Hamza Mahfooz , David Francis , Wenjing Liu , Mikita Lipski , dri-devel@lists.freedesktop.org (open list:DRM DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 4/4] drm/amdgpu/dm/dp_mst: Don't grab mst_mgr->lock when computing DSC state Date: Mon, 14 Nov 2022 17:17:55 -0500 Message-Id: <20221114221754.385090-5-lyude@redhat.com> In-Reply-To: <20221114221754.385090-1-lyude@redhat.com> References: <20221114221754.385090-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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?1749512054036510544?= X-GMAIL-MSGID: =?utf-8?q?1749512054036510544?= Now that we've fixed the issue with using the incorrect topology manager, we're actually grabbing the topology manager's lock - and consequently deadlocking. Luckily for us though, there's actually nothing in AMD's DSC state computation code that really should need this lock. The one exception is the mutex_lock() in dm_dp_mst_is_port_support_mode(), however we grab no locks beneath &mgr->lock there so that should be fine to leave be. Signed-off-by: Lyude Paul Gitlab issue: https://gitlab.freedesktop.org/drm/amd/-/issues/2171 Fixes: 8c20a1ed9b4f ("drm/amd/display: MST DSC compute fair share") Cc: # v5.6+ --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c | 4 ---- 1 file changed, 4 deletions(-) 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 5196c9a0e432d..59648f5ffb59d 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 @@ -1148,10 +1148,8 @@ int compute_mst_dsc_configs_for_state(struct drm_atomic_state *state, continue; mst_mgr = aconnector->port->mgr; - mutex_lock(&mst_mgr->lock); ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr, &link_vars_start_index); - mutex_unlock(&mst_mgr->lock); if (ret != 0) return ret; @@ -1208,10 +1206,8 @@ static int pre_compute_mst_dsc_configs_for_state(struct drm_atomic_state *state, continue; mst_mgr = aconnector->port->mgr; - mutex_lock(&mst_mgr->lock); ret = compute_mst_dsc_configs_for_link(state, dc_state, stream->link, vars, mst_mgr, &link_vars_start_index); - mutex_unlock(&mst_mgr->lock); if (ret != 0) return ret;