Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4853453pxj; Wed, 9 Jun 2021 03:35:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwml6bkc7HQGloHaAtsV2jpEbcek0Dt8SmyltbeXGvp8GPqN2lw/dnfcLiWfixWvdjBE5sH X-Received: by 2002:a17:906:d97:: with SMTP id m23mr27924829eji.392.1623234955526; Wed, 09 Jun 2021 03:35:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623234955; cv=none; d=google.com; s=arc-20160816; b=rGnKUIMptVPF3kw9d9f3C+j8Ow6zgeRmdu9v1KU3sdLgwpceazIUAjgxkPLoQONRiu MjnGGW6q9+ZjXDaoGsuPQj6Qp2ovUHtpSw+//UNIZluqWnhvvISfryRi4YpcYeGUzwZU 1RQdqYxmM8nxQs4Hgw8P55IxCI9xk0yil4veBhwHZYn0QGWkqiDe45AvVc0D2QezXOmy CeyBl9+XINb2qo/c53tvxDLBo7h7AeBKDmoL3Tt0OKJfBxssFqHvlLSR16rCbx+/ZR95 HxGNDdtaxWs+73Vaihd6QRumhCDaTRRpLsbc5J02TWnI4xdS0Krk76PVPGff3JSu7m6A bJjQ== 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=iTHNeIXuQMwu2Fz3vc8/mIeZzEIa1G0/MnNBS9H989U=; b=RiN7LmgMQYqVyzAtc4z7x7CX/dsSoZXPwp+bqjE5vkdHCcXE8KPVIETAy6r7KCdiGM guVXhmz8Z4zQKehjB3t5sY78683jOIkt1G4x8UdGANF7kwDw5Hl1zK5nFSGKcSwPFid7 hT8lf3C3OZwEJ4/oHfsS/0aDiUIXioewA91/pDI0NcTVCtjw5fcSizAyN6mgyrPmD/vy ryymhNbdHoeYjyfI84/wuyFTGykYcv4tD3yAl92GM/UZ5IpKuVcjqG8nB/ks0A8IeLAo 1vxqRZBPNYTuToPZss7kbawOgIfZoB8Vh9ORXXP0Nkzm8GLKlPaji6F4UvMuYwRNsucx irHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TRBPzgjT; 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=pass (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 t14si1933446ejb.624.2021.06.09.03.35.32; Wed, 09 Jun 2021 03:35:55 -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=@linuxfoundation.org header.s=korg header.b=TRBPzgjT; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237418AbhFHTJh (ORCPT + 99 others); Tue, 8 Jun 2021 15:09:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:34182 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237417AbhFHTAf (ORCPT ); Tue, 8 Jun 2021 15:00:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7944061444; Tue, 8 Jun 2021 18:44:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623177841; bh=o7TaCsg6MePXRXccF2YmAicyTl0DIThJk8lL7aNEmKI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TRBPzgjTEp+98mdS+7WrLPwcWHtfgjzbQn/8OblvIZHGqtAnMS3Ad97DQTyRe9awP iYNyZCZ7R3xf0ODbBdYDkTeh1p6YGBvA7Wm6/Es/tM+0t03HEY3Z4MpAXSfnYlBPQ4 Qcup5a1XKIphPLRGsmChsunbi+lT6FdPcW5mzW/g= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, James Zhu , Leo Liu , =?UTF-8?q?Christian=20K=C3=B6nig?= , Alex Deucher , Sasha Levin Subject: [PATCH 5.10 075/137] drm/amdgpu/vcn3: add cancel_delayed_work_sync before power gate Date: Tue, 8 Jun 2021 20:26:55 +0200 Message-Id: <20210608175944.890796389@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210608175942.377073879@linuxfoundation.org> References: <20210608175942.377073879@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: James Zhu [ Upstream commit 4a62542ae064e3b645d6bbf2295a6c05136956c6 ] Add cancel_delayed_work_sync before set power gating state to avoid race condition issue when power gating. Signed-off-by: James Zhu Reviewed-by: Leo Liu Acked-by: Christian König Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c index 700621ddc02e..c9c888be1228 100644 --- a/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c @@ -345,15 +345,14 @@ done: static int vcn_v3_0_hw_fini(void *handle) { struct amdgpu_device *adev = (struct amdgpu_device *)handle; - struct amdgpu_ring *ring; int i; + cancel_delayed_work_sync(&adev->vcn.idle_work); + for (i = 0; i < adev->vcn.num_vcn_inst; ++i) { if (adev->vcn.harvest_config & (1 << i)) continue; - ring = &adev->vcn.inst[i].ring_dec; - if (!amdgpu_sriov_vf(adev)) { if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) || (adev->vcn.cur_state != AMD_PG_STATE_GATE && -- 2.30.2