Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2278655imm; Mon, 28 May 2018 05:16:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpA6oIihiuZmT3UNv1VA7CBUbY7lruQupigjO+sBtJSEXQi2Mw+/DEfeyV5mgjTLoNcvs6H X-Received: by 2002:a17:902:189:: with SMTP id b9-v6mr13555398plb.204.1527509794347; Mon, 28 May 2018 05:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527509794; cv=none; d=google.com; s=arc-20160816; b=YMMpfPeo/yaVCz1z5YRS+DMBIBy5N/uxBc5AsUDeKFuWqr8/61CvoYA47cyoKfU44k 6kYLsKyt3WVnY0tvCigAwCTnEPkukbefbeLE/aHHPawFgLV/a4WlTPQ6ujQiGIqee88+ YUZv3Jn9S4hEMLK32BLjXnKFBFr3OS6gkw2KtGInVu0LHDTa98e0kIYB4l3Di5dKM5f4 gWg6B8il9X/MNCufp1Cs+rhc5S3DYcFRb9QBXtg63FHI5HivYLZJhhzeC7xEf2MtApH9 X8yyQNEdcNeMQfCXyfPbN6R1AFtvfqOre2FoAKiwWgmwErRaXw7uINyOXa2LQzTOIrya 9vIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=weOvd0I672/p0eWXoSd045VEnX3d0HeACh6BdRyO9/k=; b=byAQa5Jl0pgEuj/sgHlZeOHPa+wA4E2t2ZIz0j6gp8n3aIOJHEA4k+/dyrOCcHuGxN azXpEQZDiYnAk2DQDRjPbqoLMVI5071BecTguKuMI+tdKYb9rJiCPq3/wgf5Qv6UQVHI dis5+tMZ3yyZ+0pPVC7t2fJz531vknsYm5feZmCFe/NRy9MqxQDdvJN0B6ZRQrkUf5HU Hx5wg62tBKTu0kIBjIM0UGJ0/YOrcey5HsUltmLsb/wlbttgKq4Q4WjC6YmpdztBA6fE qlSQtb+36YSJJFz7CHwFUxnieSU3+xoQMeiNcLg8Y458A6/BMeiPQRkVApkynV1XwOiU j4Rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vWi1StLU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2-v6si30365751pli.370.2018.05.28.05.16.19; Mon, 28 May 2018 05:16:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vWi1StLU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422980AbeE1MPp (ORCPT + 99 others); Mon, 28 May 2018 08:15:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:50704 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1164969AbeE1LDa (ORCPT ); Mon, 28 May 2018 07:03:30 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 CC6682075C; Mon, 28 May 2018 11:03:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527505410; bh=2O6kzgKwh8v0lMPPztIbai2r3jc9bPh+q+4c/oGoFjg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vWi1StLU2ZoavA/fV19SGjdppGN1+dKfZEneoTixaf/HNxx8zHfG0ncO6BLRO52N8 i9klsnjWOY+/zvgHC5B2GIZgG2sPeMQr4bpgjXY1Dt6oVsIuyHFL2Yshz7uJp4nlHP 9LjsMZDVE/bci0KSId6J2uJt+82OBKqvXPfYi0g4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Monk Liu , Alex Deucher , Sasha Levin Subject: [PATCH 4.14 456/496] drm/amdgpu: disable GFX ring and disable PQ wptr in hw_fini Date: Mon, 28 May 2018 12:04:01 +0200 Message-Id: <20180528100339.126537472@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Monk Liu [ Upstream commit 9f0178fb67699992d38601cb923b434f9986dd68 ] otherwise there will be DMAR reading error comes out from CP since GFX is still alive and CPC's WPTR_POLL is still enabled, which would lead to DMAR read error. fix: we can hault CPG after hw_fini, but cannot halt CPC becaues KIQ stil need to be alive to let RLCV invoke, but its WPTR_POLL could be disabled. Signed-off-by: Monk Liu Acked-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -2889,7 +2889,13 @@ static int gfx_v9_0_hw_fini(void *handle amdgpu_irq_put(adev, &adev->gfx.priv_reg_irq, 0); amdgpu_irq_put(adev, &adev->gfx.priv_inst_irq, 0); if (amdgpu_sriov_vf(adev)) { - pr_debug("For SRIOV client, shouldn't do anything.\n"); + gfx_v9_0_cp_gfx_enable(adev, false); + /* must disable polling for SRIOV when hw finished, otherwise + * CPC engine may still keep fetching WB address which is already + * invalid after sw finished and trigger DMAR reading error in + * hypervisor side. + */ + WREG32_FIELD15(GC, 0, CP_PQ_WPTR_POLL_CNTL, EN, 0); return 0; } gfx_v9_0_cp_enable(adev, false);