From patchwork Mon Jul 25 08:00:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1660243 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lrstz4vr4z9sPL for ; Mon, 25 Jul 2022 18:01:30 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1oFt1h-00081M-4S; Mon, 25 Jul 2022 08:01:17 +0000 Received: from mail-pl1-f169.google.com ([209.85.214.169]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1oFt1Z-0007lS-BP for kernel-team@lists.ubuntu.com; Mon, 25 Jul 2022 08:01:09 +0000 Received: by mail-pl1-f169.google.com with SMTP id i3so5243325pld.0 for ; Mon, 25 Jul 2022 01:01:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WvVeCXpzTT4Npc+Zde8VXaUWWcNRTNXfeafsItNSJ70=; b=YOq/+4mRrMEHW5PqjXfl+2ZSpF+8BGygDjyNIxCtG7pWHunQGJVL9PYZfUvrCLLBEO Be2/OOyUcodfgmwPV4C5V5LeqHTSY8MvEPJV5tTEdjXQuLdP0cSB10V82yWYXQrcHXri TqB65GMjAXAQGGQfnMFC552sUCgATfFL23djG/lewa6jxgdIPAYt/eQWdqx6oED66jGP BTtDacbnS2i0oYl4/vVoJFHEP7s7CHsfvz5TAvXRzhuQ9rPT/wv+qMf8I0R7X4oI0Uo6 mO/GapmO1zKFf193JX7jE2n4syYOrgpgfNJt6//WrytLo0AJ4KIm3hgLQemaXvh5tCq3 uFDA== X-Gm-Message-State: AJIora8+TSwDaUp2b2LaLYRRPegeWVfD58sZdxh7dsKWIkqhbx38GUG1 UCOYwWqxSt2ypm3ccGYXRwfU4WRHcQE= X-Google-Smtp-Source: AGRyM1vcZJAmqU8z0eU0Km4gqWz6OPCgLfvGYPDSM2Pv+9UvDKSeoGhZKbw5/csOVv6C13Luo6e/UQ== X-Received: by 2002:a17:902:d581:b0:16c:66bf:baef with SMTP id k1-20020a170902d58100b0016c66bfbaefmr10992493plh.29.1658736065459; Mon, 25 Jul 2022 01:01:05 -0700 (PDT) Received: from yewun.. (61-227-111-139.dynamic-ip.hinet.net. [61.227.111.139]) by smtp.gmail.com with ESMTPSA id a7-20020a170902b58700b0016a058b7547sm8403290pls.294.2022.07.25.01.01.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 01:01:05 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH v2 3/3][jammy] drm/amd/display: Reset DMCUB before HW init Date: Mon, 25 Jul 2022 16:00:58 +0800 Message-Id: <20220725080058.2892400-4-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220725080058.2892400-1-vicamo.yang@canonical.com> References: <20220725080058.2892400-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.169; envelope-from=vicamo@gmail.com; helo=mail-pl1-f169.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Nicholas Kazlauskas BugLink: https://bugs.launchpad.net/bugs/1957026 [Why] If the firmware wasn't reset by PSP or HW and is currently running then the firmware will hang or perform underfined behavior when we modify its firmware state underneath it. [How] Reset DMCUB before setting up cache windows and performing HW init. Reviewed-by: Aurabindo Jayamohanan Pillai Acked-by: Pavle Kotarac Tested-by: Daniel Wheeler Signed-off-by: Nicholas Kazlauskas Signed-off-by: Alex Deucher (cherry picked from commit 791255ca9fbe38042cfd55df5deb116dc11fef18) Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 +++++ 1 file changed, 5 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 785db0708c95..5d127f288027 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -1050,6 +1050,11 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev) return 0; } + /* Reset DMCUB if it was previously running - before we overwrite its memory. */ + status = dmub_srv_hw_reset(dmub_srv); + if (status != DMUB_STATUS_OK) + DRM_WARN("Error resetting DMUB HW: %d\n", status); + hdr = (const struct dmcub_firmware_header_v1_0 *)dmub_fw->data; fw_inst_const = dmub_fw->data +