Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2898404pxb; Tue, 24 Aug 2021 10:08:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz36Cka/szKQ+kqZI+uNwa9J5e4AFxIeNQpzPwQpY0VD+14zChyWBeVJGM8bFbkCQxXeAKk X-Received: by 2002:a05:6638:304a:: with SMTP id u10mr36132149jak.62.1629824894348; Tue, 24 Aug 2021 10:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824894; cv=none; d=google.com; s=arc-20160816; b=U+2n263By9HHbMxRmH9vweOvHbA7YT7ig4ZySPIWXIQUNi9iEyZyRFbAeUkzcnZWF2 IXiXw/qp0Espp4i3Ej6UlkgSsIc6AolvKmiGRzAMW2xvHbG6g5qovrmrKaxBVC36yrec Amj3FekGpzILYT5aKH2xK32K/XOOsXVSfpB8a11FzW8Vie04OXgcoUQhg2AyexpIq6CG vGO2nsKjHaI+BJGdJ/FfeyghI/PTfbWbe2FlFDMQYBE2Zibt7jSuUoDUU4eB0LCjEfCE azkqOXEYvQVC97fKr/ez+NrBhqjqzrhdY9nzdEzaONzLvvmQ9iPNx2o6U02z8589ZfQ0 9QfQ== 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=DqdSt9ft3kMcCc5NXznzdEqchEkVzqQSjwiPT+0XNug=; b=SU3zKH7kRXI9Ozfor1P2KWZ4tks2OKgFmhWFh7HPWAvdERbVIkJ8aKv3HuLI7vQK2M t6CjvremqqeH0o/dtEZXG2WmS4jSVp8NXu0yWOlnTlHmUF3wIr76+tK/khcv57F4yDWV tM0EMIEOhOsggG5QC2Um0tCYoTvyG7Nzizug0dqbKcXpNBAmU+XKokV7Nwk9JI5egd3Z 2hAtvjj2muR8hz7VHLoU02LknveeukVBT3SW+rKyWBbn4w+wKyXoqhsvau+nG7zbJjiz 3FA9Z1GrttWd3TAs1Gk8+2XATCRbNliDPJRFgF1CYSg2uzxA5wiMHmHIoxzr++ePBOvf lKsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HCpfP96u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r11si23189465ill.21.2021.08.24.10.08.02; Tue, 24 Aug 2021 10:08:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HCpfP96u; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S238508AbhHXRIA (ORCPT + 99 others); Tue, 24 Aug 2021 13:08:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:46492 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239849AbhHXRFB (ORCPT ); Tue, 24 Aug 2021 13:05:01 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DFEF615E5; Tue, 24 Aug 2021 16:59:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824377; bh=mLwimhvPJUaM0AzE3Rie3EShPwzzNOWD2+XmNKUdug8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HCpfP96uLgr10HdcjX5TxhO+TIhj5lHHzGWKy3VY0fNA9c99en7+8JZ5KIV3sK+lb S9FuCoRrdQI7jqNbB+nvET0YibXfasM250N5hpeUtticLdN8ryR1ZIofho6/DIUowD 4dqQreY/THChLaBE+9Np407ymcnfSJTPNE/gIVupmk9BWCg2j2dfZmx1VgmSANfKYS RSSIvemtX4b+V7ndVjquuMLS9Lohu86LKX+s5bhDq1k4ZsC4bAwoDIhwCtM5BNbf2h 1OFT/YdoB53DCZ3z1umP5LSl1jDaUAw9MN284pBajdbVo3A3lX+85Vaz0lCbOy/hQA xA57DRCCCfY+A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Yifan Zhang , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 27/98] drm/amdgpu: fix the doorbell missing when in CGPG issue for renoir. Date: Tue, 24 Aug 2021 12:57:57 -0400 Message-Id: <20210824165908.709932-28-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165908.709932-1-sashal@kernel.org> References: <20210824165908.709932-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.61-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.61-rc1 X-KernelTest-Deadline: 2021-08-26T16:58+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yifan Zhang [ Upstream commit 1c0539a6fc8a4a4b77278e35d763073890de96b9 ] If GC has entered CGPG, ringing doorbell > first page doesn't wakeup GC. Enlarge CP_MEC_DOORBELL_RANGE_UPPER to workaround this issue. Signed-off-by: Yifan Zhang Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index fb15e8b5af32..ac3a88197b2f 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -1271,6 +1271,16 @@ static bool is_raven_kicker(struct amdgpu_device *adev) return false; } +static bool check_if_enlarge_doorbell_range(struct amdgpu_device *adev) +{ + if ((adev->asic_type == CHIP_RENOIR) && + (adev->gfx.me_fw_version >= 0x000000a5) && + (adev->gfx.me_feature_version >= 52)) + return true; + else + return false; +} + static void gfx_v9_0_check_if_need_gfxoff(struct amdgpu_device *adev) { if (gfx_v9_0_should_disable_gfxoff(adev->pdev)) @@ -3619,7 +3629,16 @@ static int gfx_v9_0_kiq_init_register(struct amdgpu_ring *ring) if (ring->use_doorbell) { WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_LOWER, (adev->doorbell_index.kiq * 2) << 2); - WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_UPPER, + /* If GC has entered CGPG, ringing doorbell > first page + * doesn't wakeup GC. Enlarge CP_MEC_DOORBELL_RANGE_UPPER to + * workaround this issue. And this change has to align with firmware + * update. + */ + if (check_if_enlarge_doorbell_range(adev)) + WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_UPPER, + (adev->doorbell.size - 4)); + else + WREG32_SOC15(GC, 0, mmCP_MEC_DOORBELL_RANGE_UPPER, (adev->doorbell_index.userqueue_end * 2) << 2); } -- 2.30.2