Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3099198iob; Mon, 16 May 2022 13:04:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFr86S0c4vIvKI8J2NQJC7eEwFX0yHe8sk50H2PB/rU6NYirCopv/Kye/V5MIOA0lrHjHp X-Received: by 2002:aa7:9110:0:b0:4fa:e388:af57 with SMTP id 16-20020aa79110000000b004fae388af57mr18678013pfh.1.1652731467288; Mon, 16 May 2022 13:04:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652731467; cv=none; d=google.com; s=arc-20160816; b=oD2gaZm1cdpT3TNJLMwJzq2kOrN4YolKE7msNmhcYa9xWgE486lX6z9RisobMIbgZe 16xWhy/HaqajqoOMnADj+DKwppkVL810jl8G/GW9nDZ+0s7lbP4wdcBwOHxAHnUUb1+k wVl6dhalK5uAZNUS0KQfR1nxmJHgpzzjqf3yhjkp2Wvxe0It/JeGok5GdKz8DnEs391A fJSkuytG45HOAgvgIV6an17SL56KdCcc4Qe3ZyOq89hNOPRzGUCTIbI3yvIndAQOLOkL u/z3K8NarXi+WSP6dUoaB7ptVFKm59kp8u5xdJY6pwQcEztWGkqRtNl3sSsLxGvEnKFh snxg== 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=VoXb2bXvCSX5v2SqoN+ctteJO87ahBdAfTNnShB93R5I92v2GO1uVAhnJSPTxsUzFo 0nvInGuiuo4QUVBKCdO1QiQ4L0+0aZYMIsfwc8vzIYPTq9NVg4ADZTc8z+Ipu8fWM49V fU7FCfvriEAq2uryyrkhI1ze5txifG7jorseOGtvjne6fQOHAsZRn9T85/7tT7uAwV1V aGOII/9RAyVowZCxJUTLUSlWvDZtZT2ZfPqSgmdcaXV5ZvgG0Mo1QHKLnqCfou1jkqOZ GMry5JHEyFemRE4NqHVBVLLFSpxKfzIud6rHsjs7e+ewjm+VkY4efs+kOJN6CMCR3UL2 bRTg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=stj2aNYD; 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 b2-20020a056a000cc200b0050d9b909542si15228844pfv.265.2022.05.16.13.04.15; Mon, 16 May 2022 13:04:27 -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=stj2aNYD; 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 S236490AbiEPKDU (ORCPT + 99 others); Mon, 16 May 2022 06:03:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238025AbiEPKCn (ORCPT ); Mon, 16 May 2022 06:02:43 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8925755A5; Mon, 16 May 2022 03:02:41 -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=stj2aNYDMNKtVVFXkAJyNwiVwE 5jmjneZb5CXQlIaAfydH3UNASfeBHXJcLNzbvqYwsBt2IrRd9XfI+1teMYw5QlVX5eqDFFjnFJeXO QTdBoeSqgSkHaJzS3Pz2gQPsDt7oGbRlvvMOFUF8dP8ZqOD0ul8dfjg2JmQu91KrDV9VHotNsjAbI QTJYH9rOwmmOZ5V3l0OXeu4AluaJosZCBME2vLXAKa+bmjW4pVVpIR7H/6gt/dVZel1Svrb0Xk39P rup9+leHFKAvzB912bBW6/1wYRtxqRgmgHyyz6pB+gj+cDkEuAbntk1l8rP3GMvxuyRaBRQWh1dEW xZSey3CQ==; Received: from 91-158-25-70.elisa-laajakaista.fi ([91.158.25.70] helo=toshino.localdomain) by mail.kapsi.fi with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nqXYg-0005yU-O8; Mon, 16 May 2022 13:02:34 +0300 From: cyndis@kapsi.fi To: thierry.reding@gmail.com, jonathanh@nvidia.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, digetx@gmail.com Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, Mikko Perttunen Subject: [PATCH v1 12/13] gpu: host1x: Use RESTART_W to skip timed out jobs on Tegra186+ Date: Mon, 16 May 2022 13:02:12 +0300 Message-Id: <20220516100213.1536571-13-cyndis@kapsi.fi> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220516100213.1536571-1-cyndis@kapsi.fi> References: <20220516100213.1536571-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