Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp656943pxv; Thu, 15 Jul 2021 12:39:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzW902RmXukHuUsKppQnmQHEtKjA6nQl4GQQ8jiK6lc197s5So/ANL54K4RDqepNwhTkYXE X-Received: by 2002:a05:6402:5215:: with SMTP id s21mr9540350edd.356.1626377972550; Thu, 15 Jul 2021 12:39:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626377972; cv=none; d=google.com; s=arc-20160816; b=zda9w3fZPobHyHD0p5zxwHWSvrRe/eLHE1SgRVfU9naouHQO8IHANnVJx7U5308pPm Q1+zRhUF1d+s98G+vn3/Bz8Xygcpcgyj9zBohoXAxSb/2Q9COtUcogXIAXZjZ/mMfYT4 uInK3SUtizKSg71HibdH9uPwc7wFWEKFyPxFe2AStxosvvZWRBeqLRWuJCf1AWm9eb6Y 1wx+kJIQuMFRzsejrN4Oa0r4mtfofbQxl7LBJToIPY7O9IdUFuNMxh3gb4iVrmSMQ5wD egAI97II+b6Fv0TGS7W3nSnoUK/Ar+G/Rngu25LHRk4ZXGU7cRITX0V7ARAzT08Zapug HAvA== 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=K9eLfFx7cbRqus0n5Wnw2RVLQNOi2bBcuG7GmRIrrS0=; b=cV/CHTIeGxN2ZKNhcbbbs1f7KdcmTSFZUJ/CeDP0nTj0hv+JS/DBBvjlSAtul/zeUg T1XEgMVCFyHOa8Ktpu3RgY4WdF8RwqCYjWXxo9KfKud1r/1oc6i0fN/fwkI4wt5hLsvq IO61VWzj1TEvnwCwcX6ancKN8+dn5RTWoPt4kIpaxzRZZP3BDF3o2K6H1XwxhL9UZWsW MQyI7l56RCxgIvEdw4gVDdPIrkf/R+RonWAytWNV1HunRJRF80NDUaAHIyl/qp/+Bo5B Iy/ubPcaSogto9thwxT7r2jM+GVkgfUeFyPS52iSNANt4laQPpNN7Xt90KPMJzfhKgQf FwaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="DhgGl/bZ"; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u26si7593158ejz.460.2021.07.15.12.39.09; Thu, 15 Jul 2021 12:39:32 -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=@linuxfoundation.org header.s=korg header.b="DhgGl/bZ"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241875AbhGOTh7 (ORCPT + 99 others); Thu, 15 Jul 2021 15:37:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:51362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242071AbhGOTMz (ORCPT ); Thu, 15 Jul 2021 15:12:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7DDFE61158; Thu, 15 Jul 2021 19:09:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626376169; bh=HhaYMKe+gYvr5fouIoEMZDfS7Qqzvf/gvr/BR7jO6tM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DhgGl/bZE0C/7Tgh5Mxo1WhmWlRSgKHPIcAVcijrCa7ASW22j6Jyu0RqLJa049gaj gUWPOMYhaobYDQyeMuZ+wLR8T50y6XUUdxh5GZnNfMeTT/hq8mse80UjRP3pqAZh2q 9U8zFOMuO27cfz4PyluivheoXcvjtb3vypxPMQ1k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Stanley.Yang" , Hawking Zhang , Alex Deucher , Sasha Levin Subject: [PATCH 5.13 119/266] drm/amdgpu: fix bad address translation for sienna_cichlid Date: Thu, 15 Jul 2021 20:37:54 +0200 Message-Id: <20210715182634.909727446@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182613.933608881@linuxfoundation.org> References: <20210715182613.933608881@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Stanley.Yang [ Upstream commit 6ec598cc9dfbf40433e94a2ed1a622e3ef80268b ] Signed-off-by: Stanley.Yang Reviewed-by: Hawking Zhang Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h | 5 +++++ drivers/gpu/drm/amd/amdgpu/umc_v8_7.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h index bbcccf53080d..e5a75fb788dd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_umc.h @@ -21,6 +21,11 @@ #ifndef __AMDGPU_UMC_H__ #define __AMDGPU_UMC_H__ +/* + * (addr / 256) * 4096, the higher 26 bits in ErrorAddr + * is the index of 4KB block + */ +#define ADDR_OF_4KB_BLOCK(addr) (((addr) & ~0xffULL) << 4) /* * (addr / 256) * 8192, the higher 26 bits in ErrorAddr * is the index of 8KB block diff --git a/drivers/gpu/drm/amd/amdgpu/umc_v8_7.c b/drivers/gpu/drm/amd/amdgpu/umc_v8_7.c index 89d20adfa001..af59a35788e3 100644 --- a/drivers/gpu/drm/amd/amdgpu/umc_v8_7.c +++ b/drivers/gpu/drm/amd/amdgpu/umc_v8_7.c @@ -234,7 +234,7 @@ static void umc_v8_7_query_error_address(struct amdgpu_device *adev, err_addr &= ~((0x1ULL << lsb) - 1); /* translate umc channel address to soc pa, 3 parts are included */ - retired_page = ADDR_OF_8KB_BLOCK(err_addr) | + retired_page = ADDR_OF_4KB_BLOCK(err_addr) | ADDR_OF_256B_BLOCK(channel_index) | OFFSET_IN_256B_BLOCK(err_addr); -- 2.30.2