Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2691647pxj; Mon, 31 May 2021 08:21:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/SySBDp7TMuNhSgE0GiJaTdfggcKpPr3ozhUfq6IzgYFSjkp+w1Z1d7S7HWiBrSbsRz3a X-Received: by 2002:a05:6402:3551:: with SMTP id f17mr25900279edd.313.1622474507716; Mon, 31 May 2021 08:21:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622474507; cv=none; d=google.com; s=arc-20160816; b=AkKiH8oLZoT8L6693lvrMRnJ7NFe7R1B/3IZzfPKvepCYJ2eMXUfi7WMj/3OS4sHgq F7QQjVtGSwMzLrPdXr0i3CUk4JYJ5eD1XBMxDI8pU+etUfWWtUb/fL6BGUnyWqnA2d/k zVugKz5yfpZH68PySyqxxhMCVXp1PzNQzsAkNabCv4540AGA8ph2Bn0RrnW1TeMRrRlN tqCtHCs+eHW+rlWKVnxdYfx68+XE81Q7S4TujXe2RBNkD4/FtWLxrt1EUEF0NS6JcpcV E/jFmgPUk44Y9/xa1hY/TGbtiWid9k2zVl9FpraEB6X3N+8I1vF9jwGtGnUwdYzZNdqX 0j8A== 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=u8oWY3QZqt60lff7zKcgTXUTXO6thrhlcKW2oE4bOqs=; b=DtA5IaVq3Bk5QYPpXo7+BbAsKlvuZj4449IyM27YIetZuPwu8vrit3+OL867+5Pzoo D3BT9Y6TI2yyM1VpeJ0dkqTtLPwshNceYipfAyVbgLKSZ/4jK5niQDk2J6NfoDMraroF 9LJdT45IplucvchyTrg8X2jSqHNyQaT+woCnH3ljsEs9reMYZ5DqAAWvBCNxy8m18UEk riKThdF9v8b5vlGgC5QfHXzixSJKo13FKLvEaMBVa4QQ4YditUJ1Rmk3pc2QH6sku5FW c/8eETSBXT4LaPbhAxvWOzzMmQfoD17SLGpQOrjsz7hUNHOMp6AaCPk6iIvgFUq2UbcZ +16w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=plZSfSFJ; 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 ay10si5564018edb.78.2021.05.31.08.21.25; Mon, 31 May 2021 08:21:47 -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=plZSfSFJ; 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 S233333AbhEaPTC (ORCPT + 99 others); Mon, 31 May 2021 11:19:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:43914 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233661AbhEaOOr (ORCPT ); Mon, 31 May 2021 10:14:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DA37261995; Mon, 31 May 2021 13:42:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468549; bh=6j6ZMMCKN0uBgMN7g5/8gcsFHGF6ZdFMAlH5D3cbRqI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=plZSfSFJPQ3FFZIlJCos/ymTxA5ECzvr6ho6OHC6aXXx56DN4ankmOXhq9aPS84Y9 oWopX2UNvVH5PPGrUrhGruycD9vKJkUReA7lKDXSCupPfi1FVotuvaTVxK/F8WO1a0 KB8xW+3dBIhkQiWrG+9sspO01koh8rnPeTdhsKz4= 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.4 032/177] drm/amdgpu/vcn2.0: add cancel_delayed_work_sync before power gate Date: Mon, 31 May 2021 15:13:09 +0200 Message-Id: <20210531130649.034675421@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210531130647.887605866@linuxfoundation.org> References: <20210531130647.887605866@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 @@ -293,6 +293,8 @@ static int vcn_v2_0_hw_fini(void *handle struct amdgpu_ring *ring = &adev->vcn.inst->ring_dec; int i; + 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)))