Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2655250pxj; Mon, 31 May 2021 07:31:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8rWUbZRtFlriBJNeAAGjQOOTiHi3++FlYgU3M8fZ36acMmsw2/g62CWZB1oHUdq8u8ikh X-Received: by 2002:a17:906:39c6:: with SMTP id i6mr23624760eje.334.1622471465950; Mon, 31 May 2021 07:31:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471465; cv=none; d=google.com; s=arc-20160816; b=I6oL91NfHly/bKgMeAkV8cwpW0aW5qt52+51oPUdPMJZVHOfmVRjFzhUZNUgBqXGvl oyib8Hle+UTYuKmt4Gj0CptrY1uN3TlRkE72j8KKKkh8Tpn1eSMjZYUZekanIup+g9+1 8luVoEkKjva2zqr48vo4X8Tx2ooTkeaefgU2htWIKPTWrTZbnPz1K8v2CoQcDrUQzH8q UGybcarnw2uVM3B2fQ29/F3VvjmZj1V6qUtxsVt8wDDbOsmjs9p/ydAb5/i3psLepKf1 O8H2PpoIHWPdz2iWP56uTB9fCZAZQ4IC3n1uGBBdcIqoZRsaUJBWQuY0Wge4nvbgczVm VBcg== 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=xcqQ9iZE/w90beCjgmwJgKKMk46PKSoH8lUacYVIwEw=; b=x2SyVRGv6ES7rw+EYZuVMBSaBwjDaIgP9WLfWEvYyHxzroQePtiJYB6t/nyr98cBOt DtIpGxizbWml70y9q+d1zWrr/V69f8XckyGVxwa7YszNXIhJO5cp9vdj5I6V5j3FHBAC gO+Y4EFgeyHslJxDSdAR6NVcv3ygB47zi+iPMw5T0hAscO2ve2na1GUepzFk6Q+6mzTV 3Vh6ZFURKaNClssY7aWRKnSwpu26tsCv38XkRvzD7NnyR/5JBfBd7S+mq5NXy8qLSbCX jstZGm7HUvaqjHTXXbr3Xphpg3CU3/CRYk/45NkzvyxM53XX78OVEtU4bhBDxRcwzG21 LUtA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CEJsD+vl; 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 w11si16334942ede.2.2021.05.31.07.30.42; Mon, 31 May 2021 07:31:05 -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=CEJsD+vl; 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 S231929AbhEaOal (ORCPT + 99 others); Mon, 31 May 2021 10:30:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:55176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231342AbhEaNx3 (ORCPT ); Mon, 31 May 2021 09:53:29 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E0D426187E; Mon, 31 May 2021 13:33:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468000; bh=Tg5e3P3m5H6s4Zj5G9dfzDFhHNm44SLJ5FAMgs/JNWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CEJsD+vlq3nHueHkJMoV0vj1WAlpD3Sej2Mz06y9Hrm4aQonpk+Rez4Ug7oQwBwfK 6z8xINRczBf3XQUWCq3Q3Kv4n3kJJw1hT/14yMOqnDNq9He7+o4iudEfpU4TKi90gm Sea4G6PBz90ccpVpAs6q9d4VzkT+rK4BJAdYBNB8= 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 Subject: [PATCH 5.10 044/252] drm/amdgpu/vcn2.0: add cancel_delayed_work_sync before power gate Date: Mon, 31 May 2021 15:11:49 +0200 Message-Id: <20210531130659.488583452@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130657.971257589@linuxfoundation.org> References: <20210531130657.971257589@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 commit 0c6013377b4027e69d8f3e63b6bf556b6cb87802 upstream. 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: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v2_0.c @@ -262,6 +262,8 @@ static int vcn_v2_0_hw_fini(void *handle { struct amdgpu_device *adev = (struct amdgpu_device *)handle; + cancel_delayed_work_sync(&adev->vcn.idle_work); + if ((adev->pg_flags & AMD_PG_SUPPORT_VCN_DPG) || (adev->vcn.cur_state != AMD_PG_STATE_GATE && RREG32_SOC15(VCN, 0, mmUVD_STATUS)))