Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3876413pxb; Tue, 17 Nov 2020 06:01:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyrfKtg2JbbKsPz3lylHxZopShNktSnkAM8fkzZHY5FEWWqSX9yrpdmCE5hf6WbsLFZLShJ X-Received: by 2002:a05:6402:17b4:: with SMTP id j20mr22120124edy.24.1605621692057; Tue, 17 Nov 2020 06:01:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605621692; cv=none; d=google.com; s=arc-20160816; b=R4+YypVy4wAEwk+yWV8eTX+BIJeSybgLPTjNrEX8jk4VfXhtTakqAVgcU8DZ/27bSO FLcsbzn4hugE2E+PPxvgFXfOUigzsqvPWPNh3OW1r2Xq0Uo/wXL0LyHKrV7esw4ns/TY Thw1EAM5kmcYMBBlIj7tWM/D3tJrQW8Y/PSdaCMp2KBD3H6gjGj3s7FlvmVHcuNzaTDV ++voy9VV+XmyV8MbQhZSEhMh8XnTmnJPsGTRgXF7Lh+v+x25mBMav2vWABAhk8Nu1ipo eQgVyG8dCrshaZe+HTtFcYetTh0i072/4HE+XkHaKIJ4kKUOZ3skqpW7hcu4D6YXjEND ILSA== 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=tio+tRhbeW1YohfMhht6t5KerJyBf0TijEIKEomNv3o=; b=OfD4r/hFv2aLacZ+Wg1irhwYp//xYamKejmueFo5V7VQdZdRgQEbWY0tfV3svguTM9 aC+pgfEF24sbO9bkqZVoHty+tGX2EC1op5FStj/X1Wz6ykP7kZ7QNszKtyAryfmzV36t Zqu5YO6bHuQu4WtGlNVZWl1ZRHeQPtzPso11rxkLUG+A4LSWW1kBTHt0lC9V+nLhmOu/ X5hMx46O1UIlgoC8y4r8lXfpfftg6knwpKqT2F49t+osVQ6wGjb3waFpqc0KInOFkU0B WL75IYtvQyCLMSUoAX/hvtP4kwpfXHocwP4RgKy1dH4zNgy/2/Ar58RWbnjVWS/3vqfI lpog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=v1yvS4cd; 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=fail (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 l25si13702492ejz.442.2020.11.17.06.01.08; Tue, 17 Nov 2020 06:01:32 -0800 (PST) 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=default header.b=v1yvS4cd; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732702AbgKQN61 (ORCPT + 99 others); Tue, 17 Nov 2020 08:58:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:51402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730719AbgKQNSq (ORCPT ); Tue, 17 Nov 2020 08:18:46 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 599FF241A5; Tue, 17 Nov 2020 13:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619126; bh=SnepZuuxBUTh5IC8cqvisuAQiXYcSoQE1ksk/gIdIa4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=v1yvS4cdh4OvC3dDEdi5eOdJZl/oFbCM/BqiZ5mowtoTqjp+A7FBlmWrDrhEmQ6N5 jsT8W9cuCw5cyVuZV2MlS6L6E6pRRmJiUCu9/kIOxqovrW96/+MSWX/YJ8+C16qW6r GJSCil4+JPL80R3U4DdjgPJ8Fgxyvd4FBjR2m5yI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Sandeep Raghuraman , Alex Deucher , Sasha Levin Subject: [PATCH 4.19 036/101] drm/amdgpu: perform srbm soft reset always on SDMA resume Date: Tue, 17 Nov 2020 14:05:03 +0100 Message-Id: <20201117122114.847410966@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@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: Evan Quan [ Upstream commit 253475c455eb5f8da34faa1af92709e7bb414624 ] This can address the random SDMA hang after pci config reset seen on Hawaii. Signed-off-by: Evan Quan Tested-by: Sandeep Raghuraman Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/cik_sdma.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c index d0fa2aac23888..ca66c2f797584 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c @@ -1086,22 +1086,19 @@ static int cik_sdma_soft_reset(void *handle) { u32 srbm_soft_reset = 0; struct amdgpu_device *adev = (struct amdgpu_device *)handle; - u32 tmp = RREG32(mmSRBM_STATUS2); + u32 tmp; - if (tmp & SRBM_STATUS2__SDMA_BUSY_MASK) { - /* sdma0 */ - tmp = RREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET); - tmp |= SDMA0_F32_CNTL__HALT_MASK; - WREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET, tmp); - srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK; - } - if (tmp & SRBM_STATUS2__SDMA1_BUSY_MASK) { - /* sdma1 */ - tmp = RREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET); - tmp |= SDMA0_F32_CNTL__HALT_MASK; - WREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET, tmp); - srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK; - } + /* sdma0 */ + tmp = RREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET); + tmp |= SDMA0_F32_CNTL__HALT_MASK; + WREG32(mmSDMA0_F32_CNTL + SDMA0_REGISTER_OFFSET, tmp); + srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA_MASK; + + /* sdma1 */ + tmp = RREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET); + tmp |= SDMA0_F32_CNTL__HALT_MASK; + WREG32(mmSDMA0_F32_CNTL + SDMA1_REGISTER_OFFSET, tmp); + srbm_soft_reset |= SRBM_SOFT_RESET__SOFT_RESET_SDMA1_MASK; if (srbm_soft_reset) { tmp = RREG32(mmSRBM_SOFT_RESET); -- 2.27.0