Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2726591pxj; Mon, 31 May 2021 09:12:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfa2aBLq42+m8BlCERdH7M1o9R/bLrmpzUuVao+QCCDKG/YuN/T2Ln+Qg/8UCNTzpnB+Vf X-Received: by 2002:a92:da90:: with SMTP id u16mr1836915iln.230.1622477531517; Mon, 31 May 2021 09:12:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622477531; cv=none; d=google.com; s=arc-20160816; b=gvhAaYe0TA6t5Zr7Hh6xp0ravCmMeWlKdP1D8Y1qqvy0Hzxwc4UCUhjnfHC5nAxbQl s73MnW25XQE+HBEkAGq6fEf9U9JTF1TuvIOMsiyeM3XcMi126ZXpUBVJSWS1x6BM5ghs NMmL7F0kSSzrr8iu2rwppveCUEdMYQ88ekPAlnAKLZWXs111rS46tRzPzRQkKaSQC2mZ qSPijb9WBnVt0jQ/ZFemCpevOVnRUD3ltvagyKFDikM1Bw6aGdtsquUpJ10CtkE1oJiI E2X3DljOHn48Jc4bFbL7EYSRFwGczeVjF0dVZlFqHPGNu2H3/5WqEg7qdch+4BBCeZ37 nrGw== 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=OuuhCME7mZPgZL3vujzTsEK2i19AUlL9zMU6lvTjIWBXByqYTQcr49jSHuErN3nWKL 99cV1vA5Lk0nB6tEciKZgjDVT0JECLp7s1fcg0PAjTQccrGvCvAlv3tr37DMoinlCMk9 L/9G59pTVnJ35QBJPPbSmMgQJrvg3AH33LugBiNKk3bnbhT5BDBRmvGcgryqEIOxQmpZ 1iNb0HSolt71VilQTBe/yiUC9NIUEXI7DSeY5zbHCtYjvng/Si1eGp7aGUI1Q7BN44tM +tNWAHh1jVDMN8JrCkEuMHX1hVBJ67EHRy0YISLIVExgiifgF1kqHhhAxTfJOdxOayhc WlKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=u58fQ9RV; 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 m1si14034794ilu.13.2021.05.31.09.11.58; Mon, 31 May 2021 09:12:11 -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=u58fQ9RV; 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 S233669AbhEaQLx (ORCPT + 99 others); Mon, 31 May 2021 12:11:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:33164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233933AbhEaOhh (ORCPT ); Mon, 31 May 2021 10:37:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3407861C52; Mon, 31 May 2021 13:51:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622469115; bh=Tg5e3P3m5H6s4Zj5G9dfzDFhHNm44SLJ5FAMgs/JNWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u58fQ9RVzaFBLQ4tc1H9Q6WsPvfQdqiVQ4AEDbTUutPpXDCfB7/qkrMKPeIVXBKl8 Q0mSsbAB+1ov4iXvoa337ZPHhWVI0TLDOKjfKcwtONLnJZrkeNu8saW0RGYfjiZ3dP xPSEUQvANYnWzvmj+nEMmSzTF3XBbHVcVg/3mrVU= 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.12 058/296] drm/amdgpu/vcn2.0: add cancel_delayed_work_sync before power gate Date: Mon, 31 May 2021 15:11:53 +0200 Message-Id: <20210531130705.778955862@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130703.762129381@linuxfoundation.org> References: <20210531130703.762129381@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)))