Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp6778295rwn; Tue, 13 Sep 2022 08:54:56 -0700 (PDT) X-Google-Smtp-Source: AA6agR6V4obu7Lk/0TjCtZAwGHaTheajpEnzSDEQ2s6UIcujnSdSVSqT4n5yY+AC71KOaPVXZaoJ X-Received: by 2002:a05:6402:1f86:b0:447:8edd:1c4b with SMTP id c6-20020a0564021f8600b004478edd1c4bmr26351351edc.163.1663084496288; Tue, 13 Sep 2022 08:54:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663084496; cv=none; d=google.com; s=arc-20160816; b=Iv5P+gN7ZhFX7CWiatoZLceDAWQntz5+7YbJQgsekEEMV/VTJb/E92O1eMqZ0FFMx/ KG1HGBrBPhCfsv3DaHnnXm49Srzd9VbnVuwjFmR/8ZeFrA2BvrlvpeDoweXekZGgy+U2 kg9JN1s1Ws5RIplU+7EdB20v49nik/onNjeY1BrGTDGmqgIEOKcCIwjMVgkB3vcc8NOu KoKEsyJXPUR9rLD4GopugDkltJQrCKLfqkUYeIYisb0HKAKZmH6uQAsLLQXu1kdpAIPw L3y8Vc6RnT4Zv2oFMX2kttUNd+cqjupDnmzfg7LVFNdqD9w6c5DucOBwte/pB9yy+zJy Y8HA== 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=MOLGl2ZE2yw0atfsNlEYTQTMuWM3wJMgOMWbCXsCI+c=; b=XJqYW/DafNdj3uj4YzoOHr5BkI3YNNYho8M5ls9Pp1qtPzkXVUOakYuA90s0pl2iB7 vz4onnurahNBnZsh7QuByuribynZLG3IY3KqshR+asE/RNN4Bv1JkdLCq678QDwzKuhA ZYzopjGZMS7IKpV8RhT7gCKhp7YjpBGg2lpBIoS2RNslgz6xV5x7EoKza/Xy3J6SJTOP db3rEAVn6OZG948IEUXnfKbeO0ZR5ei1YnOxoSRgruXeCY+xcfoyldQKfkfpuH4rvKO8 vLdIGC8Tz4Q6+i9jk5OzfqUJSC9/RU4r3vUYDBE7za1VoBlexhKYeEsG2zE5GUZVKfMG 6wGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uX2LYjWF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f11-20020a056402194b00b00451d665e753si4357115edz.499.2022.09.13.08.54.30; Tue, 13 Sep 2022 08:54:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=uX2LYjWF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232340AbiIMPbB (ORCPT + 99 others); Tue, 13 Sep 2022 11:31:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236571AbiIMP3I (ORCPT ); Tue, 13 Sep 2022 11:29:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 88D985B796; Tue, 13 Sep 2022 07:39:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 5DE6EB81029; Tue, 13 Sep 2022 14:37:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4541C433C1; Tue, 13 Sep 2022 14:37:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1663079867; bh=b06b0l8kwYRi7e3XNh/w/6ReSmTYreK4a3sgVSKi4b4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uX2LYjWFbGoU/6tg7CaLR72UD9Srw4SmEUp2MFCln4fu3b3OTiOoO4wkND/3kk8pR RsnpOmLPL+1ATNtTpneM59GaL2HEM8p1I7QJx8eQ8gz23fLcj9ZAkejCkWmOnB7vbp l4NHAk/Ul0ft4K9hdu3inpi8ED2+5w5bGe7X0+NY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Christian=20K=C3=B6nig?= , Zhenneng Li , Alex Deucher , Sasha Levin Subject: [PATCH 4.9 25/42] drm/radeon: add a force flush to delay work when radeon Date: Tue, 13 Sep 2022 16:07:56 +0200 Message-Id: <20220913140343.578497793@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220913140342.228397194@linuxfoundation.org> References: <20220913140342.228397194@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Zhenneng Li [ Upstream commit f461950fdc374a3ada5a63c669d997de4600dffe ] Although radeon card fence and wait for gpu to finish processing current batch rings, there is still a corner case that radeon lockup work queue may not be fully flushed, and meanwhile the radeon_suspend_kms() function has called pci_set_power_state() to put device in D3hot state. Per PCI spec rev 4.0 on 5.3.1.4.1 D3hot State. > Configuration and Message requests are the only TLPs accepted by a Function in > the D3hot state. All other received Requests must be handled as Unsupported Requests, > and all received Completions may optionally be handled as Unexpected Completions. This issue will happen in following logs: Unable to handle kernel paging request at virtual address 00008800e0008010 CPU 0 kworker/0:3(131): Oops 0 pc = [] ra = [] ps = 0000 Tainted: G W pc is at si_gpu_check_soft_reset+0x3c/0x240 ra is at si_dma_is_lockup+0x34/0xd0 v0 = 0000000000000000 t0 = fff08800e0008010 t1 = 0000000000010000 t2 = 0000000000008010 t3 = fff00007e3c00000 t4 = fff00007e3c00258 t5 = 000000000000ffff t6 = 0000000000000001 t7 = fff00007ef078000 s0 = fff00007e3c016e8 s1 = fff00007e3c00000 s2 = fff00007e3c00018 s3 = fff00007e3c00000 s4 = fff00007fff59d80 s5 = 0000000000000000 s6 = fff00007ef07bd98 a0 = fff00007e3c00000 a1 = fff00007e3c016e8 a2 = 0000000000000008 a3 = 0000000000000001 a4 = 8f5c28f5c28f5c29 a5 = ffffffff810f4338 t8 = 0000000000000275 t9 = ffffffff809b66f8 t10 = ff6769c5d964b800 t11= 000000000000b886 pv = ffffffff811bea20 at = 0000000000000000 gp = ffffffff81d89690 sp = 00000000aa814126 Disabling lock debugging due to kernel taint Trace: [] si_dma_is_lockup+0x34/0xd0 [] radeon_fence_check_lockup+0xd0/0x290 [] process_one_work+0x280/0x550 [] worker_thread+0x70/0x7c0 [] worker_thread+0x130/0x7c0 [] kthread+0x200/0x210 [] worker_thread+0x0/0x7c0 [] kthread+0x14c/0x210 [] ret_from_kernel_thread+0x18/0x20 [] kthread+0x0/0x210 Code: ad3e0008 43f0074a ad7e0018 ad9e0020 8c3001e8 40230101 <88210000> 4821ed21 So force lockup work queue flush to fix this problem. Acked-by: Christian König Signed-off-by: Zhenneng Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/radeon/radeon_device.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 82b01123c3868..227c4733de2ea 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c @@ -1661,6 +1661,9 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, if (r) { /* delay GPU reset to resume */ radeon_fence_driver_force_completion(rdev, i); + } else { + /* finish executing delayed work */ + flush_delayed_work(&rdev->fence_drv[i].lockup_work); } } -- 2.35.1