Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3030187iog; Mon, 27 Jun 2022 07:48:45 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t2qPlIz5up+TFs3JPShr6EtlOzxVZWSi7UDX7XCNHmhGQ3o0g775dqrF6bTt1zFWT3JnCL X-Received: by 2002:a17:902:db0f:b0:16a:7b83:aeda with SMTP id m15-20020a170902db0f00b0016a7b83aedamr11922099plx.165.1656341324964; Mon, 27 Jun 2022 07:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656341324; cv=none; d=google.com; s=arc-20160816; b=s8MvkFugdumLMmXnYigKQQugYG7rrbugfkCF9vhllD1C55oIGzug/0TR++dNNnVv8l byGZCeN2avBFCuCS3Qc4128Uvr2W5RrvUQZFnOPmq16TUP72Hvro4uRByGLCoEzCXrlJ hJIzx9BePWT73GiafqXsib18Yi7/jsroLyA3ah/m/I2b7C9RrhUE3wAzykRwnVG2YOFk yJzI7nIrM+pAjt34mkswA2UOmjpo3XQcvScWAxjSKILfFiZgsfgMcICpt5M3I4ubAeMt 8VhFRGmuob+kJx73JpP6RL+BvBh35QiJIwHT0XcqA1v39fdhDKpyskbPNjokCcvlxE2b bkNg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pGQX1JKxanPmqedEue8d2htEoS8AyrUnifwuz1TiUYY=; b=LQmdsX/0i5AScl8qUI19dYEdEZEVbFnAwMbTxaB0MiP4YGuPMKF7me0mNigvcu4u4y 3pIQhHnPVSOe0JXSh+em1lhQNkbGtOnDKVut3xWtEficjHQMIzEhhpfdLtDQeaKAij0T TKJSHAHrlg+U2TdzB6VM8/WvNt/2jcv8h7RohYfD9KxcYi9Pxmkguf3B6+jmdeVJ1ztY nORH5VhvYcVAFall+IP5RTt1v5adFCZESHq6k/MgUJNJFZDdUQLPqZBek6nwBeTg2Yha XBcQvIt0vhYriEYAFCjjPD90TsBhkJTwyTCLYMVLJITXrKN8SgA/arizhAXP4UXJtH22 GQcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=dFIiw1xO; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w9-20020a63b749000000b003fece25ad1asi14076118pgt.242.2022.06.27.07.48.32; Mon, 27 Jun 2022 07:48:44 -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=fail header.i=@kapsi.fi header.s=20161220 header.b=dFIiw1xO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237211AbiF0OVg (ORCPT + 99 others); Mon, 27 Jun 2022 10:21:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237034AbiF0OUp (ORCPT ); Mon, 27 Jun 2022 10:20:45 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3119E12D15; Mon, 27 Jun 2022 07:20:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pGQX1JKxanPmqedEue8d2htEoS8AyrUnifwuz1TiUYY=; b=dFIiw1xO8Eob5L8eHMuTQBIMXO Gz5nY9aLINS2Cjumz/XJZvMsVZC8lyWBMyOmXBb45vpBp0TS54TNlHav0vQEP1b1wyxW/NcqYDH6j sNwLt2T7wqraBNaYI/3YK9mbuNf9J0na+cgFmlvAG2yD9i8QIFKUv0IYfvABLTAD+NcNnSZdyFgIQ 9D1HecvqgwxWtMIyRSfm3X8rhk9A6EyYoEmSPt6y4fA7WByF6UODC9yfSNNapTDD6nwKpF84/eYF+ 2cizfjpMxIFS6q5UwcIy/dYa4l/o+4kQzb1g+KK0g/blSJ3xxdmfbnvP9eVFdbJJ7Ky5bxXQb39sz rxeuH4TQ==; Received: from 91-158-25-70.elisa-laajakaista.fi ([91.158.25.70] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1o5pbP-003N2J-E0; Mon, 27 Jun 2022 17:20:34 +0300 From: Mikko Perttunen To: Rob Herring , Krzysztof Kozlowski , Thierry Reding , Jonathan Hunter , Dmitry Osipenko Cc: Mikko Perttunen , Robin Murphy , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v7/v3 21/22] gpu: host1x: Use RESTART_W to skip timed out jobs on Tegra186+ Date: Mon, 27 Jun 2022 17:20:07 +0300 Message-Id: <20220627142008.2072474-22-cyndis@kapsi.fi> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220627142008.2072474-1-cyndis@kapsi.fi> References: <20220627142008.2072474-1-cyndis@kapsi.fi> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 91.158.25.70 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: Mikko Perttunen When MLOCK enforcement is enabled, the 0-word write currently done is rejected by the hardware outside of an MLOCK region. As such, on these chips, which also have the newer, more convenient RESTART_W opcode, use that instead to skip over the timed out job. Signed-off-by: Mikko Perttunen --- drivers/gpu/host1x/cdma.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/host1x/cdma.c b/drivers/gpu/host1x/cdma.c index 765e5aa64eb6..bb1f3c746be4 100644 --- a/drivers/gpu/host1x/cdma.c +++ b/drivers/gpu/host1x/cdma.c @@ -457,9 +457,24 @@ void host1x_cdma_update_sync_queue(struct host1x_cdma *cdma, * to offset 0xbad. This does nothing but * has a easily detected signature in debug * traces. + * + * On systems with MLOCK enforcement enabled, + * the above 0 word writes would fall foul of + * the enforcement. As such, in the first slot + * put a RESTART_W opcode to the beginning + * of the next job. We don't use this for older + * chips since those only support the RESTART + * opcode with inconvenient alignment requirements. */ - mapped[2*slot+0] = 0x1bad0000; - mapped[2*slot+1] = 0x1bad0000; + if (i == 0 && host1x->info->has_wide_gather) { + unsigned int next_job = (job->first_get/8 + job->num_slots) + % HOST1X_PUSHBUFFER_SLOTS; + mapped[2*slot+0] = (0xd << 28) | (next_job * 2); + mapped[2*slot+1] = 0x0; + } else { + mapped[2*slot+0] = 0x1bad0000; + mapped[2*slot+1] = 0x1bad0000; + } } job->cancelled = true; -- 2.36.1