From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D1457C3F379 for ; Thu, 27 Feb 2020 14:09:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D70424656 for ; Thu, 27 Feb 2020 14:09:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812582; bh=j7Esz9MRrziFaKvbegGmJ2sP8Zk9oZqygIPzkHsLPYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sE6edXv9F8RylsLSlaoqG2xbWkCYN1pRDCAM2GtYUnOyF5CBPSHl1JoummQqROx/C a2BQHc+RpolitgmQunjh4uh92c8QU5G7w9gYvWqa8pMcGe6fPlgDk+YEYzXiX2zEEh B2YtTE7b1fkmAbJmIUGhNIyFRUqPYG3b3iEXl8y4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388415AbgB0OJl (ORCPT ); Thu, 27 Feb 2020 09:09:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:47626 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387491AbgB0OJi (ORCPT ); Thu, 27 Feb 2020 09:09:38 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 53A3D20578; Thu, 27 Feb 2020 14:09:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582812577; bh=j7Esz9MRrziFaKvbegGmJ2sP8Zk9oZqygIPzkHsLPYc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fYN6v2kJNnI9GnLiEtMGDzFPDqChER8Vh5EdSJmqvrF9kKw6KCDMcQIAMNCdhnVaN TNJkzuopPukeoJf7kJmvaUoMDWQP3HaO9YqY9SVAJfGssuhdye/saWJg5lCI9yzqML kX6PabOPcq7aIDtAfndZ6i8IYTgkaZneqy9uGcrA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaojie Yuan , Alex Deucher Subject: [PATCH 5.4 072/135] drm/amdgpu/gfx10: disable gfxoff when reading rlc clock Date: Thu, 27 Feb 2020 14:36:52 +0100 Message-Id: <20200227132240.183783419@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200227132228.710492098@linuxfoundation.org> References: <20200227132228.710492098@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alex Deucher commit b08c3ed609aabc4e76e74edc4404f0c26279d7ed upstream. Otherwise we readback all ones. Fixes rlc counter readback while gfxoff is active. Reviewed-by: Xiaojie Yuan Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -3977,11 +3977,13 @@ static uint64_t gfx_v10_0_get_gpu_clock_ { uint64_t clock; + amdgpu_gfx_off_ctrl(adev, false); mutex_lock(&adev->gfx.gpu_clock_mutex); WREG32_SOC15(GC, 0, mmRLC_CAPTURE_GPU_CLOCK_COUNT, 1); clock = (uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_LSB) | ((uint64_t)RREG32_SOC15(GC, 0, mmRLC_GPU_CLOCK_COUNT_MSB) << 32ULL); mutex_unlock(&adev->gfx.gpu_clock_mutex); + amdgpu_gfx_off_ctrl(adev, true); return clock; }