From patchwork Sat Jan 21 17:29:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9530543 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 187C1600CA for ; Sat, 21 Jan 2017 17:29:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AB3D2846D for ; Sat, 21 Jan 2017 17:29:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F20CD2848D; Sat, 21 Jan 2017 17:29:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B9A272846D for ; Sat, 21 Jan 2017 17:29:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 39A466E29A; Sat, 21 Jan 2017 17:29:15 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 146796E28F for ; Sat, 21 Jan 2017 17:29:11 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id c85so14767792wmi.1 for ; Sat, 21 Jan 2017 09:29:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=bsMS5NZZYewOooYC/AGKcrPeeOrranO/Cn8l+z/AtUA=; b=LIMLtzay8AJHUOjP+P7ea4htXcCf0V8EcBYNMHgDrayBOdjHNHgXY//on/OSrVDsDA gnWuLYWwRB9L30sEEqt65kV9rPfgM3epRgpMpi5zox8mQPom8xwL7wPu4i3mu1Vm/IxP 1DXPbxm/cAr8lEFbxuwUtA7BFxCP2gE5TtRUjy0n96pGJ3RZb28QMswT0G8TMPr+FxSS XZUvL3e91H1w+ynyQmxwp9/CntQ+r/AnhIL5iIiXGca/bksPXDyMNhi+zQCpvcRBTDho RZZzeJHJontRrDrakZL9Fo8vdP7shNMPpRuRUxbFqpwh4x+0wce1RiuXKujYv+/1GMLk Qe7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=bsMS5NZZYewOooYC/AGKcrPeeOrranO/Cn8l+z/AtUA=; b=tsuPSx2WFWExodIL2FFUUIgeIay9U4T2maKwZcIib0+10zEt4nUZbmD2qt38afkCg+ PKfmswCaf2RDGthqxp4ItdGzhbdQcKrXbdzlwFsdkrG7i4ymFn8C7jPd5Y3VlSyIatEA ZhAQgI/34L0JGmWHCvHf2LAzWtfKcC5XPM+o3JXH6RVEPCw3TpdRTrY0HHAYeZ4NcY7S wEiQ2zaauKwb7x+0MMq7KQ0RsUgNCaazoa7kfyUdzfNIYwuNJpz2q9xPRg5tliywWEcW c6OaSfTJYbuIhcfQE3W+1xI2cKh7yFVh0rVKNjl8piU6q6oOZ5jhIHMKXczgvLedhRMv BVqQ== X-Gm-Message-State: AIkVDXKFeDt6U0dSKXlsw2R3Fk9lqIBUn6E1LWLbZgSG7IHyr0lGxn1LVJ6L1eQwbkndFw== X-Received: by 10.28.156.151 with SMTP id f145mr8238014wme.8.1485019749468; Sat, 21 Jan 2017 09:29:09 -0800 (PST) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id e16sm5420904wra.36.2017.01.21.09.29.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Jan 2017 09:29:08 -0800 (PST) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Sat, 21 Jan 2017 17:29:05 +0000 Message-Id: <20170121172905.1646-2-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170121172905.1646-1-chris@chris-wilson.co.uk> References: <20170121172905.1646-1-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Assert that the context-switch completion matches our context X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP When execlists signals the context completion, it also provides the context id for the status event. Assert that id matches the one we expect. Signed-off-by: Chris Wilson Reviewed-by: Joonas Lahtinen --- drivers/gpu/drm/i915/intel_lrc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 432ee495dec2..6aa8761c333a 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -595,6 +595,10 @@ static void intel_lrc_irq_handler(unsigned long data) if (!(status & GEN8_CTX_STATUS_COMPLETED_MASK)) continue; + /* Check the context id for this event matches */ + GEM_BUG_ON(readl(buf + 2 * idx + 1) != + port[0].request->ctx->hw_id); + GEM_BUG_ON(port[0].count == 0); if (--port[0].count == 0) { GEM_BUG_ON(status & GEN8_CTX_STATUS_PREEMPTED);