Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2655041pxj; Mon, 31 May 2021 07:30:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6MQYBf9YLD0mA+wtRjflCvoPyGJKrfGBjWOhoJFleH7f0jzqKnzif2kIFJeo2qWYPhUkT X-Received: by 2002:a5d:9842:: with SMTP id p2mr17306923ios.132.1622471447165; Mon, 31 May 2021 07:30:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622471447; cv=none; d=google.com; s=arc-20160816; b=IkYy8eVufc5u++9TfWFNtqRNZVDydeyBvB98nyoA66C967jho00eA9++LiA0Sdcgxy cpRkLINAhWHudIpwddy89PB1uuwvc98GhWCdQt9QWLmdwdpD4Gf/fFn5UXJ8J1DkhSP/ d7JtEJe2DN8HdSaDmFsnKlqC3WaQMiliyo2HyMNf57W9500FkKDqi96PpGnU4s3wDytr ziB2wcMOX4a3mZu6fhzrqebVMKw4S/L0iH0Syf4uNJBs+Y57fVeZpqSY2nndE/PypWHv j6Bqapm6IkYYWR7ebvpSOJIW3W2UGRvNb9gXAqJ3otZH/D7iZCFq99c4qicLwutG3qs+ MQxw== 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=oVv/T5CleSvfBOw9wdMvmB+V5HWNOvGJgOKcAcxjtb4=; b=zVWDjZWYhbOUnziSpio/sGwzfEs1qVYz6s/VHGY9O4hfU3NnUHO7WI+E/ZUc7ZkEMK wj0+ZEdrdfGmLECcqu3TH+X9vz++YX1bjq+/8l96RI8yaDaMQPXWfjpBpiKCvKMQaDtA m9VCMQGs4wdV9KCWBtgQ4jscySlsF0FFmFmTRJFxbMJ4jIDRTDeN/iDHwlGfLX7b1nVS /ibUUD7lvAWv1md3B5aN9hwQW631Q6JK3kZ7UAJxnG16B2SyWSMjxZYFAy48iY7RvEJO bRtSUbOqrtGJvaXtKMdp5FZlv+NhJWuYGxsNwW+waX/CytoKGwaOf+v1MhbN675p3Zfm 2XKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QyHhYt66; 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 i5si914112jaq.96.2021.05.31.07.30.34; Mon, 31 May 2021 07:30: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=QyHhYt66; 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 S233202AbhEaObE (ORCPT + 99 others); Mon, 31 May 2021 10:31:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:55338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbhEaNxw (ORCPT ); Mon, 31 May 2021 09:53:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 55CFC61920; Mon, 31 May 2021 13:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622468005; bh=5LlACC9eb6jvWorU9pDA7NG43+2mm3M4Wkkm+rUdpr0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QyHhYt66N65nGO0+D5Znqrsim07Do2DjexL5dO1yKBwFqFl1eJk2VIVXkRqgLpX5t QoU9GGdKNAfHgga5vnNnQtIUjXGpLFhlpwQ9DK1iXv9PzFAilO09nJdIw/yLR8vzoE PRjwzsnwDWPZ9roqJvOEvNTjXlUqW2krCyKpLpiE= 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 046/252] drm/amdgpu/jpeg2.0: add cancel_delayed_work_sync before power gate Date: Mon, 31 May 2021 15:11:51 +0200 Message-Id: <20210531130659.549826794@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 ff48f6dbf0ff896c98d167a67a5b975fb034356b 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/jpeg_v2_0.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c +++ b/drivers/gpu/drm/amd/amdgpu/jpeg_v2_0.c @@ -172,6 +172,8 @@ static int jpeg_v2_0_hw_fini(void *handl { struct amdgpu_device *adev = (struct amdgpu_device *)handle; + cancel_delayed_work_sync(&adev->vcn.idle_work); + if (adev->jpeg.cur_state != AMD_PG_STATE_GATE && RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS)) jpeg_v2_0_set_powergating_state(adev, AMD_PG_STATE_GATE);