Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1396686imu; Tue, 20 Nov 2018 17:20:08 -0800 (PST) X-Google-Smtp-Source: AFSGD/XOPSeVuFfpp25O41dVoGpVzsE8oj4aove1XqS/6qsb8BLkTvSAr/urccMMR2Eykv7sFyK1 X-Received: by 2002:a17:902:aa4c:: with SMTP id c12mr1951679plr.48.1542763208204; Tue, 20 Nov 2018 17:20:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542763208; cv=none; d=google.com; s=arc-20160816; b=t2QJ/TcdscvMqoOuDAtPryQqM9iCDFIulmchgaOVk9DcYYOPkDncSalbkMT9KbbwZS 2pJL32pDWyJS5uf0VpgANFLHxjV2kcjVZQniZH2V/EE8a3CXrd6dBlL7yGu0lTITaecy GJRhnbevCsiekL0e6F8SmV/FdPPgylCRGD7ecpuGOfoqx53QboC8CM4mdMY5qvMclPRW 5vb8+9XK8CeETQxErKalpcZ49DcFHmIw3wuYk269LBOpQJNUCqpUxOR2PRZLLQE1PtrD EeZr6OELuFNV3lGTQFfra50trIEADHBFmW5qm5QvWw/vHsZVWYLVjDnPylX2SlRQ5vFN zPIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=j0DqoqqVavVIdhng1N1LqoVWu4Qg5u3VhfR+D7maLjo=; b=oHch76+2F91hHXkYB7Wwc14FuZLFl44uXwOKvUSpqaG+RZVcHI/ryCvVGIqwGc2vwd LI/3RK/Bahv1Yy7uj3EV3LJNR/aJTCAPwnRIHl79a8Qz8fnZpsbi0LmafoiMNkpCeihn T2x2WFcfHxaLvC1vNAzulCkeFG9GGoItUmNnt0i48mn0rKLCiGtHhxsvNvycbaljD5NQ xo+rHNetxPtM8vZpwctQifUAZo2OKtMB6kUR5yz3lmwkaJ1OioQcE0Ef5pWnGXF9S6tA hVNyNLIvHUIu9XuhZd/SLEbTyAv4FmCi9sD36eIcQB0JqstYo6v4RslKSYi+0BEY2vJC idqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bh5-v6si11500770plb.204.2018.11.20.17.19.53; Tue, 20 Nov 2018 17:20:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbeKULJi (ORCPT + 99 others); Wed, 21 Nov 2018 06:09:38 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41810 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725903AbeKULJi (ORCPT ); Wed, 21 Nov 2018 06:09:38 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 740E83082A2F; Wed, 21 Nov 2018 00:37:41 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-11.bss.redhat.com [10.20.1.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 66F0E18978; Wed, 21 Nov 2018 00:37:37 +0000 (UTC) From: Lyude Paul To: intel-gfx@lists.freedesktop.org Cc: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/i915: Synchronize hpd work in i915_hpd_storm_ctl_show() Date: Tue, 20 Nov 2018 19:37:17 -0500 Message-Id: <20181121003718.17704-1-lyude@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Wed, 21 Nov 2018 00:37:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While trying to add a chamelium test for short HPD IRQs, I ran into issues where a hotplug storm would be triggered, but the point at which it would be reported by the kernel would be after igt actually finished checking i915_hpd_storm_ctl's status. So, fix this by simply synchronizing our IRQ work, dig_port_work, and hotplug_work before printing out the HPD storm status in i915_hpd_storm_ctl_show(). Signed-off-by: Lyude Paul Cc: Ville Syrjälä --- drivers/gpu/drm/i915/i915_debugfs.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 69447c68b9af..af4268a6d2d9 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -4592,6 +4592,13 @@ static int i915_hpd_storm_ctl_show(struct seq_file *m, void *data) struct drm_i915_private *dev_priv = m->private; struct i915_hotplug *hotplug = &dev_priv->hotplug; + /* Synchronize with everything first in case there's been an HPD + * storm, but we haven't finished handling it in the kernel yet + */ + synchronize_irq(dev_priv->drm.irq); + flush_work(&dev_priv->hotplug.dig_port_work); + flush_work(&dev_priv->hotplug.hotplug_work); + seq_printf(m, "Threshold: %d\n", hotplug->hpd_storm_threshold); seq_printf(m, "Detected: %s\n", yesno(delayed_work_pending(&hotplug->reenable_work))); -- 2.19.1