Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp692270ybg; Mon, 1 Jun 2020 11:49:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkQrhcDf/fsVIkpOKyGTZX/Ts7X2ecGfsrCiBA2f9XLm0zYNjFtj0QZCiklVQGUDrT3xFy X-Received: by 2002:a05:6402:1d84:: with SMTP id dk4mr7652826edb.22.1591037385312; Mon, 01 Jun 2020 11:49:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591037385; cv=none; d=google.com; s=arc-20160816; b=pKh1K0X8ENqxkl3LqPrAoB6K6ngkYiiLkqmwK08Ck3PYiRRghdzAlQIOjTuGAvD3Jc RWj1psVuuPAdn7Fetk5GTWIsxYKSr0vhSbBFYtglJtMoKunWL2SVOFaq4Lmcu55B0y+s 93BdM7mVuXw8wHYe4c0vEUEDgT6GoYny7z/v88OaO3BIYgZ7WoPv6FZF1ohh9ogN9w9L Zbb9PKcMNb9dIki8vt8Ti7C7D1yeLcg3WftMRihr3+Ul3yI4GY+o3ERY3GPzyWKpp76m 7KemLd88fZhOyqZVIrxNkBYrdImdVLQeYr9M8h/kvUbAsv85f3xE1IHfpBAXJRTjwYej NBLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=w79NGS34TLqWlkGQdve1mKLkK5oOtTdVDpduBYXjTp0=; b=ATYmDQLg/BUmmNKXxlkxdJo2XszzQ5kvteptyyw+zpEHgQZoushf/mn3CkbPIy2b+F 2MEOH/TWRUfvKk+1dQeSgYDUmUIuOkLfy9N0TBEnegdPXbFv/1kwT+nFjA+/3JflwL0u IZQuBexDrFh9eXEwr7rsxbZUjcuH2CYgs9sPBr4tedC3Owzhy7Ik8UeQljKj3naweoAn t0zYLNnpltFVCF/f2YAnlgrm9zOc5Gh+Qa4Giu035m07Cgoqz/niSYl4JX2qQYiCd69m oqhzbmXqf74x/2yI342MUEq8Ym1XVL9ychL5M5GDTRvWDrxikIc8zavDLnGh2VPMAH+F Ga4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0aXDCCRC; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a63si121933ede.399.2020.06.01.11.49.21; Mon, 01 Jun 2020 11:49:45 -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=@kernel.org header.s=default header.b=0aXDCCRC; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730672AbgFASIH (ORCPT + 99 others); Mon, 1 Jun 2020 14:08:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:53584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730613AbgFASHj (ORCPT ); Mon, 1 Jun 2020 14:07:39 -0400 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 563ED20872; Mon, 1 Jun 2020 18:07:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591034858; bh=vbnUU0idxcT+ABC4e6dGNm6I028AtsCuHcXNWWXjmZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0aXDCCRCJZ/mbdoYpK2iLspepqYaiXj71BpVVcqO/2bK0zaNBvczjedGgxSrQNudn nxgye+2Atl0SSopl4keWGYdlR5/o38ruFUQM3F0+x1AGNPvlZdpPXA4e5090lB/g2x NuBlcd7rJZmQi2+7Q0h1QffJng7pz5JzohhwiEo8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Evan Quan , Alex Deucher , Sasha Levin Subject: [PATCH 5.4 044/142] drm/amdgpu: drop unnecessary cancel_delayed_work_sync on PG ungate Date: Mon, 1 Jun 2020 19:53:22 +0200 Message-Id: <20200601174042.468195530@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200601174037.904070960@linuxfoundation.org> References: <20200601174037.904070960@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: Evan Quan [ Upstream commit 1fe48ec08d9f2e26d893a6c05bd6c99a3490f9ef ] As this is already properly handled in amdgpu_gfx_off_ctrl(). In fact, this unnecessary cancel_delayed_work_sync may leave a small time window for race condition and is dangerous. Signed-off-by: Evan Quan Reviewed-by: Alex Deucher Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +----- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++--------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 14417cebe38b..6f118292e40f 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -4290,11 +4290,7 @@ static int gfx_v10_0_set_powergating_state(void *handle, switch (adev->asic_type) { case CHIP_NAVI10: case CHIP_NAVI14: - if (!enable) { - amdgpu_gfx_off_ctrl(adev, false); - cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work); - } else - amdgpu_gfx_off_ctrl(adev, true); + amdgpu_gfx_off_ctrl(adev, enable); break; default: break; diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index c34ddaa65324..6004fdacc866 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c @@ -4839,10 +4839,9 @@ static int gfx_v9_0_set_powergating_state(void *handle, switch (adev->asic_type) { case CHIP_RAVEN: case CHIP_RENOIR: - if (!enable) { + if (!enable) amdgpu_gfx_off_ctrl(adev, false); - cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work); - } + if (adev->pg_flags & AMD_PG_SUPPORT_RLC_SMU_HS) { gfx_v9_0_enable_sck_slow_down_on_power_up(adev, true); gfx_v9_0_enable_sck_slow_down_on_power_down(adev, true); @@ -4868,12 +4867,7 @@ static int gfx_v9_0_set_powergating_state(void *handle, amdgpu_gfx_off_ctrl(adev, true); break; case CHIP_VEGA12: - if (!enable) { - amdgpu_gfx_off_ctrl(adev, false); - cancel_delayed_work_sync(&adev->gfx.gfx_off_delay_work); - } else { - amdgpu_gfx_off_ctrl(adev, true); - } + amdgpu_gfx_off_ctrl(adev, enable); break; default: break; -- 2.25.1