Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3881752pxb; Tue, 17 Nov 2020 06:07:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhLhwb+EcO5W21yeglokKqAZ3LmFpP/eRp7kW2td3sW1+o/2+NCv+N/JF1RxfhgqzRqpEy X-Received: by 2002:a50:d74c:: with SMTP id i12mr21931840edj.236.1605622050696; Tue, 17 Nov 2020 06:07:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605622050; cv=none; d=google.com; s=arc-20160816; b=rAt+UFXQeuHtigdgfAusuZYv4eB4d3KLmOab23DOVoL7R1ilDC3PnF+2TrIuYJj/Ed quPKcVNnjUBfGdmPsoSRVc2mj90lo1T7s/3qHuTboAEYhQutJgyGtW8UegNJfVMDLiZC 9MxVh9ewZ35LdHtjtcTV9zSy24Qme8Yxu5qj3ss8Et+OclpWcqLuiWRLicw0sR+cYLp7 QEqpermvJ/Vgk7RuT/QHKSuUL04gwX7fZWd7lR4Y3I7x2OaNwS/u5tfY5gK5oyg1HeRp r/kSnvlqx0qxKtQqCal8kardULYYDAAnEIuxsh+dPW6rxMhdOfgwqZBAKnPYyO5Jz+LC RHcA== 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=Z3SjANL8onEJj/YG4k4ufob6pHeXX4rRh1PCaIvE8Q0=; b=MwLBAJTrxq7qZuV79/esmzxNKKB765G4kJrD7eiq0PfhCUi1QqaKZ1UIdOVPOEwwTA m6Z/8ilISQYsFmdcmeso8SvMJoP1nz2rPA3F5mPhW+g1wyrwSkTi0A/vBu1GYSPU9EL4 /Sufh8/qow6QkLazNrjPby5E7coi0sFYGf3VKHNjoQ86ebuOSXTXyOq0OEKLKWAmJvPf 4ghYoPvbmfCdFribvTbfzA1BxZNlWKac7DS6VhmT6bZC/15xKkoNTZQwzDrwot32Fouu pcqv+fw+AwIOzzDcDuKoPq0ZYV8ixeix0/E5Y1dM3lTO91Uv3AO0MIbB9bqxYQ5udMXO d1rQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LGObLs85; 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 w10si13737097ejz.5.2020.11.17.06.07.06; Tue, 17 Nov 2020 06:07:30 -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=LGObLs85; 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 S1729498AbgKQNKi (ORCPT + 99 others); Tue, 17 Nov 2020 08:10:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:39858 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729471AbgKQNK1 (ORCPT ); Tue, 17 Nov 2020 08:10:27 -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 5B031221EB; Tue, 17 Nov 2020 13:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618627; bh=GxFu9G1t5AA2ruExj8LWp+aim6E1dmBTw3yNVClJQFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGObLs85o9hP0X1x8qZUklhqTKZ+fADz9yFRf1y5/tTs51Hm3kK+HmNpKAx4SzAEo JpdzGZ3BvEXC4OQmAmsOuHbnmtB3w2Dzpa4grms52mxliAOHzr29EI0WY23JCz0db8 WGON4pOGLfxJdV7QYISYAmUEwX5AT45Y8codG4h0= 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.9 30/78] drm/amdgpu: perform srbm soft reset always on SDMA resume Date: Tue, 17 Nov 2020 14:04:56 +0100 Message-Id: <20201117122110.571124820@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122109.116890262@linuxfoundation.org> References: <20201117122109.116890262@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 cb952acc71339..2934443fbd4dc 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c @@ -1053,22 +1053,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