Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1587049rwo; Sat, 22 Jul 2023 17:45:59 -0700 (PDT) X-Google-Smtp-Source: APBJJlGa8oVyNPXIttHBSfBlwJkME1CPhDujEmW1YWyNgTZb+Tu5w8xsfbEjdJMrMqdhvuXKsYhv X-Received: by 2002:a17:906:3156:b0:975:63f4:4b with SMTP id e22-20020a170906315600b0097563f4004bmr6054215eje.36.1690073159510; Sat, 22 Jul 2023 17:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690073159; cv=none; d=google.com; s=arc-20160816; b=iz3mBxSR0FDOrIxPpcRQr39jCj0nI3phAfOUoEaC6TZ8uZjDB4sPqFkYV4DyNwBzoL MUg88S3LGsQtlsVG8Wc0roL3aGHjCDMNEyj2B9oLHf9pXYRmhB5iNQAqwtWX1HA6vbS/ B0MPdeYuAnyzWqE9Kgl3mYFnGh7YwB72BrMT5UJoyoH+gjTDI814GhIqqYdcHkQkBCnG 4n7uCLO5T/V4wLSW63xFkS7yK7kXJ/QWUC+Fe3+gDsO1s5sABYJdrWvZU7kpgaaFSJ2Q OUMNwBnrNuD6MLEYHUiNJydUapCVG7lb2mej3Qr81N+wSLEpQ5ZSOAX74E/IIEYLVbXw C6Jg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=vVgISWlTwfwz+O68FcT/FolFr++XCKB3akDBXf1asFQ=; fh=T5hOwDD7XRZh+34JvGzQ1H1VRIwb8W4aZBBLFoX7Ja8=; b=KAZTEc79UQsHYj/XXqebRwazRFy4vfvHtjrbK/F1dzJIPmgUpxNjy3MQQFiySl/p1U Oo/z05dlNrKLgzfsJAbt3VrZFW9UzY/WwdVifSwpFYQ1BqDlaRseExI5U89cCpT/AoXA oF/Yn7VHflJTPqlyedZ27hZR8kECe4PrfSbEPOOsqp7lULFfnKwLvnP1bokZMzng/apo KjvPT/ZwGDRNQQAJ+KbjBdKawTsqXuz7T+DpKzchChLzjvKvuvk+x163On/CJIvaf6yw JZ6XyPThuHl6tOZ+C5Ee+ophXAXQXubsTRnTfhKSD+hiSMAABKBvbKYtV3xlygNaQqg8 i33w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=AqGbeV6p; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l23-20020a170906a41700b00992e520a593si4045428ejz.1004.2023.07.22.17.45.35; Sat, 22 Jul 2023 17:45:59 -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=@collabora.com header.s=mail header.b=AqGbeV6p; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229557AbjGWADF (ORCPT + 99 others); Sat, 22 Jul 2023 20:03:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229618AbjGWAC4 (ORCPT ); Sat, 22 Jul 2023 20:02:56 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0F9F1B2 for ; Sat, 22 Jul 2023 17:02:55 -0700 (PDT) Received: from workpc.. (109-252-150-127.dynamic.spd-mgts.ru [109.252.150.127]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id F11386606EFD; Sun, 23 Jul 2023 01:02:53 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1690070574; bh=GUuN4Hv+kEehufgIB+sVRE0fxNfkqINjDEaKIO9+P1Q=; h=From:To:Cc:Subject:Date:From; b=AqGbeV6pC2fIb/cqylud/UkiC8DxdE0s/TJYG5HnWornI3FbcLwir3HZxPb08Rh63 DKmQkuJyJ9/New8LCz6h5fxvTfnjGAxOJ0q2u0+27itaQXiOjHcMRpBmA8sI7KBixO 9xnu4sVyGaGGXVMB7UFZt8Fx9irW6ZiuaWBbREuDxkmNNqULMlnUOyyoXK2us5Vfn1 KCcMz4pTLl7k79AFBBr1QLzvPvsi92e5aMo5GjeInznloDxr2Hhjj2Jo6z7GTtMrjv zoHkRk+sJbFteXAi+WwSt0mNQKw9rzt2wLnups1KKQSQ2Briyf8Ujy6eh9I+sktCbQ 7PcR+ZKCGuUGA== From: Dmitry Osipenko To: Rob Herring , Steven Price , Boris Brezillon Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: [PATCH v2] drm/panfrost: Sync IRQ by job's timeout handler Date: Sun, 23 Jul 2023 03:01:42 +0300 Message-ID: <20230723000142.206908-1-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 Panfrost IRQ handler may stuck for a long time, for example this happens when there is a bad HDMI connection and HDMI handler takes a long time to finish processing, holding Panfrost. Make Panfrost's job timeout handler to sync IRQ before checking fence signal status in order to prevent spurious job timeouts due to a slow IRQ processing. Signed-off-by: Dmitry Osipenko --- Changelog: v2: - Moved synchronize_irq() after first signal-check to avoid unnecessary blocking on syncing. - Added warn message about high interrupt latency. drivers/gpu/drm/panfrost/panfrost_job.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index dbc597ab46fb..a7663d7847a2 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -720,6 +720,13 @@ static enum drm_gpu_sched_stat panfrost_job_timedout(struct drm_sched_job if (dma_fence_is_signaled(job->done_fence)) return DRM_GPU_SCHED_STAT_NOMINAL; + synchronize_irq(pfdev->js->irq); + + if (dma_fence_is_signaled(job->done_fence)) { + dev_warn(pfdev->dev, "unexpectedly high interrupt latency\n"); + return DRM_GPU_SCHED_STAT_NOMINAL; + } + dev_err(pfdev->dev, "gpu sched timeout, js=%d, config=0x%x, status=0x%x, head=0x%x, tail=0x%x, sched_job=%p", js, job_read(pfdev, JS_CONFIG(js)), -- 2.41.0