Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp708907pxv; Thu, 15 Jul 2021 14:05:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1gfSXjylE4aZiBluGEEi8KCpj4YBMhfBsKfBxMtTrrnhkZxXMxeZkcLpocxkx+HMqzqd7 X-Received: by 2002:a17:906:60d3:: with SMTP id f19mr7758053ejk.413.1626383135414; Thu, 15 Jul 2021 14:05:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626383135; cv=none; d=google.com; s=arc-20160816; b=YxlQgQ9QmzxM/vAJ+NbxFP8xTZlLuThG7TXd1Ybl7iLffQrxytn/k+c7r2R75+YJyC 8rYuchjMcP6Aej/NyW4uc1VHcJxYfLMqcARGqXj8b2IgeiUC3j9s8cfvuTMK3+ABbNX2 WQFH9z2Yqaa6Q48D5cJSzp+pYWy4abEwxyJEtVD6GrMM5SeWGaYl5a+cM7vaRmAaK6CX 51QmuibdObYOdhk3rG8teUm21MHLL+WNhXzTuWxQwn+wiHW+Jbhqhz1rHyX3LYAP9dWl 6/CP/UfWfpvW+4dkYxx4Q944q/fst5bHgHofGj7ycWybpKhHkUXqB5/C5UViXjlrrql/ fGnA== 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=XjwJarjA27VmVcOyzs1w3cqld5nGh9qVYTqtwmuevAU=; b=kOyLXk1q0e/ov87qnZ+2x9WwAQr6BAGs+URdqAJoEIR+CAF7PRe7PrLW+sEfpPTUl1 cQZol+3l+JCp8Urzeyus4d/Sc5B/OlZzQVJBMBwPp6vE+keRRcSY+f2p0SZu0tGGGl7F pG43E3q7lwxSJUpzyfswaSoaLWLxs+UA6ld0BYxC7+vosB1Qcv3IVXD3DG+I9IqhT2C0 x/g2hE48WgOa4z783tF+diwrA/+HrX7T4ZI29q7TbqOnwmN3X+Dx0gpLbOa2i+eIwvQ4 DqlWLygn13L0wb6hFTaQiAZlKHgDcGbBmTcqWW76B0IQ39RbJoa+oALlasVpwykE0akO 45Lg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UwXTEOIN; 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 e23si8176175ejj.438.2021.07.15.14.05.10; Thu, 15 Jul 2021 14:05:35 -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=UwXTEOIN; 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 S240846AbhGOTN3 (ORCPT + 99 others); Thu, 15 Jul 2021 15:13:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:38862 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241942AbhGOTBN (ORCPT ); Thu, 15 Jul 2021 15:01:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0C296613E0; Thu, 15 Jul 2021 18:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1626375475; bh=n86+w8O6N0pvk5qMBoCzjmKUr1xZRZkBBwAiYoSVUe4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UwXTEOINRT2a/1athoKbT++g4DkWitiuC/g5/wWwjWd3kQgIF0lGiQdW6S7+k7Kx7 6hRRvenewFynDe0G1ECjMoP5xo3NEaRGFx7lbuLXpH+jv6760G9I+C2bGl83Khw4XR DYUAUJE1Dy9DpzY8CTr2lNNRcuE/ECjGvZp2Ycas= 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.12 102/242] drm/amdgpu: fix bad address translation for sienna_cichlid Date: Thu, 15 Jul 2021 20:37:44 +0200 Message-Id: <20210715182610.970298269@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210715182551.731989182@linuxfoundation.org> References: <20210715182551.731989182@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 183814493658..bda4438c3925 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 a064c097690c..66fd797a6f0e 100644 --- a/drivers/gpu/drm/amd/amdgpu/umc_v8_7.c +++ b/drivers/gpu/drm/amd/amdgpu/umc_v8_7.c @@ -233,7 +233,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