Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2654546pxj; Mon, 31 May 2021 07:30:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzgy+TQ/Zl4PHqLLkdEd03NI1vdTvhdBpvWJ3NXrVjUUwo+CmjzxP1tzUZWZtkPZJ+HSyl1 X-Received: by 2002:a5d:83ce:: with SMTP id u14mr17369003ior.45.1622471408157; Mon, 31 May 2021 07:30:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471408; cv=none; d=google.com; s=arc-20160816; b=nazRGJDEbdFzJw/yKnWwrP14byGPiMIi6fP1xWWzbYMHqN9nXDYaMUHQS1cbmKtSBD oHXlkpA741GLQMUv+5krGVYrP21EcVM59NCrKABBNa+vIMku5JKhZ6hCeKg6jEBZWCqD qGePy3TN8X1zVVjFAYWmuMl+EdxB133Kj5mgRVkpzS+XRjOSHEbrX5pZhG2Z+M7a4eLE Uj1v/ap8SRcaa0wsDJKOiVAWhe+cSbe4/45YE+cXA6Nkn1phXXJ6zutnkmP/3t3OfLru vx1M/JY4zZoLu47CoasTz1FU7F4vddpBiyLSpN6EU75dNNMKmzU/FinsMcR7SzAd9at3 gD2A== 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=qIpbKRSzYPtFBgLPbMa3+U2WU62vIvimqAfwi2BsAnU=; b=wUSn/8mYD8hSGDF1ydoS9nKCx2RVyuTzDuX0BmDHXNSkly8DT/662zUkZ1r+AtWv6g N9dTs80kB7gBQzTRgvGM0mNs1TzwTtsHZu1ubOfu2Csmf+SbpCMcwouDdz8Sfv3plOBT yyUixDHKqlAXXRJA/XPf3bExQQOB9g0LUPZD3TotkX0LDyKQ1rmGnKiTUGGBWPU5ARfg vo14D9shZq2p/VaeHePCeBnsCy1FDdOLnUq4q8Xk4Z2sklX8pWhUWmDjoytIyT9bVpXp xnE4cKt8XEbtlXwhSaH2b6Vcs6QoIXKFe1zirwoUcQrDbrxyOPtFmsIZSDePtcHR7aK5 0aJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UjkYNGGw; 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 l11si15520953jaj.50.2021.05.31.07.29.55; Mon, 31 May 2021 07:30:08 -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=UjkYNGGw; 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 S234142AbhEaOaf (ORCPT + 99 others); Mon, 31 May 2021 10:30:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:55092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbhEaNxX (ORCPT ); Mon, 31 May 2021 09:53:23 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 270436190A; Mon, 31 May 2021 13:33:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622467997; bh=QLBD041yQo5NyAE2ImFoaa9Bz71vfy3icMW+1NbCstQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UjkYNGGw5Y65BdkPFicJybamxVB60rVRUMn33aFsCVoxwUpNIIAMFY7x1+sDlrEeL wYZ9+4EhGonU4HUJ3jiQOaqPAzRBMqhYYXYwx5RGsIpmVCzCs1Yg6KMPFj6FYn97UQ mMm/1C/hcp9Z1CZ/W8hbt2KaudO1bDbwQOi/QpIY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kevin Wang , Likun Gao , Alex Deucher Subject: [PATCH 5.10 043/252] drm/amdkfd: correct sienna_cichlid SDMA RLC register offset error Date: Mon, 31 May 2021 15:11:48 +0200 Message-Id: <20210531130659.457476819@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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: Kevin Wang commit ba515a5821dc0d101ded0379b14b1d1471ebfaba upstream. 1.correct KFD SDMA RLC queue register offset error. (all sdma rlc register offset is base on SDMA0.RLC0_RLC0_RB_CNTL) 2.HQD_N_REGS (19+6+7+12) 12: the 2 more resgisters than navi1x (SDMAx_RLCy_MIDCMD_DATA{9,10}) the patch also can be fixed NULL pointer issue when read /sys/kernel/debug/kfd/hqds on sienna_cichlid chip. Signed-off-by: Kevin Wang Reviewed-by: Likun Gao Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v10_3.c @@ -157,16 +157,16 @@ static uint32_t get_sdma_rlc_reg_offset( mmSDMA0_RLC0_RB_CNTL) - mmSDMA0_RLC0_RB_CNTL; break; case 1: - sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA1, 0, + sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA0, 0, mmSDMA1_RLC0_RB_CNTL) - mmSDMA0_RLC0_RB_CNTL; break; case 2: - sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA2, 0, - mmSDMA2_RLC0_RB_CNTL) - mmSDMA2_RLC0_RB_CNTL; + sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA0, 0, + mmSDMA2_RLC0_RB_CNTL) - mmSDMA0_RLC0_RB_CNTL; break; case 3: - sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA3, 0, - mmSDMA3_RLC0_RB_CNTL) - mmSDMA2_RLC0_RB_CNTL; + sdma_engine_reg_base = SOC15_REG_OFFSET(SDMA0, 0, + mmSDMA3_RLC0_RB_CNTL) - mmSDMA0_RLC0_RB_CNTL; break; } @@ -451,7 +451,7 @@ static int hqd_sdma_dump_v10_3(struct kg engine_id, queue_id); uint32_t i = 0, reg; #undef HQD_N_REGS -#define HQD_N_REGS (19+6+7+10) +#define HQD_N_REGS (19+6+7+12) *dump = kmalloc(HQD_N_REGS*2*sizeof(uint32_t), GFP_KERNEL); if (*dump == NULL)