Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp1136330rwb; Thu, 19 Jan 2023 07:05:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXv95vbNw2bAIDxOskCTxQDN/ZK73yuxifIAaoudYvJ4Zdli8KFIuI8xRCdZ883cNlLhuRPY X-Received: by 2002:a05:6a20:d2cd:b0:b6:1413:6b68 with SMTP id ir13-20020a056a20d2cd00b000b614136b68mr13418749pzb.46.1674140736192; Thu, 19 Jan 2023 07:05:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674140736; cv=none; d=google.com; s=arc-20160816; b=eAV0v0CV9xA8NgiE+mSfPIQdnUP81zAatp6NZ9mwg6GVImRSsfRQnPsso6y4KDxmqf Na9GJqsNi3rsNQE0uF4URTAU7yU791tKlF1+uQ2/nHeBQqG1BZ4isKWRZ849cjkHPB63 FpgrKaLVdHEfEh4UDUVdkAYdlOA+hK/DW/R/7gIYn2ep0fwWR6+LRktQnwrNtWX2LDIV Ik1dgA2mwWAwxYgRkeNwtzSjGVh8jazS3JUOYtvcRsVZliUTv2qop739GJRSXKIRtqDR +8PhPg1nIqbH8k7kHq2vtjIE/d7qyQleAekzRBl1CKWp6B4ZfjVevzPmeqY+N8sCuJ+s qMhQ== 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=cCRPUE11I9wW6gD+lY0+1Jt5X4C0ntbc38lYEy0+g/A=; b=AvnfQv5VC9q2mb2h01UPj8Ip9mHujtR0AdIgc4et737sjkuQ+uJOFkKcoNnnXHZhpR mIopDne2ckSHk2vYSbk5Ui2nLcWdMi/H3wY5VFP3yEgZBpgLVIlK6CyKzGZcEu5/yD1p McpIIPdFfTRoGOzR2TKKUUmwXUvy0WuAXq8/nZtn7VOWRzNeMgkOGsKi6pEtbsPwZ8No s5It56OVAsypSjB0L7mb2J8gw9LciqgrSv5zlIye1hQ3NZvpsmVCvBlVXAFnd1/SPTcf dstCXmLuRVJNN1F2PRG4NNddxJyfZQJCMXKhaBMga+JgfVR92qSw+60i+uj6I3+crqkU ePew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=15TLyCCW; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kapsi.fi Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x7-20020a63db47000000b004b4b10e649esi28699255pgi.511.2023.01.19.07.05.28; Thu, 19 Jan 2023 07:05:36 -0800 (PST) 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=15TLyCCW; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kapsi.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231344AbjASNjW (ORCPT + 44 others); Thu, 19 Jan 2023 08:39:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbjASNjN (ORCPT ); Thu, 19 Jan 2023 08:39:13 -0500 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDCE3568BB; Thu, 19 Jan 2023 05:39:11 -0800 (PST) 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=cCRPUE11I9wW6gD+lY0+1Jt5X4C0ntbc38lYEy0+g/A=; b=15TLyCCWQtQEJR3z4yDIfqLMgP JaVqVFodu42tudZ8L/Ko/nuZTv2buHzhIjCjisR/vTpsphfa43AAays8wddolbEto9xofoW1/N+iG PbqWKI7Uxu4GAJczSEv5YZSeqRquA8SXEoAvmB8aY2Y5PypGk8hhuw/XdmFdZZHS+2xeyYBunZa2q 1YWbE18e5u9mJzpIluDXIF4MhUg59zuh6vAsH5kVEaXYsaJsPMIB4zfi62URrvPpHFEvttru2geWP zpZyCSxvVu7ZUgU9mPnPdfoVS8gRrcPqeVuigcU//zmTvr7uMaR2GkV79PAQugGbwGFj3IrYLoBW1 MUUhzclg==; 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 1pIV8H-0016bd-AX; Thu, 19 Jan 2023 15:39:09 +0200 From: Mikko Perttunen To: Thierry Reding , Jonathan Hunter Cc: Mikko Perttunen , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 4/4] drm/tegra: firewall: Check for is_addr_reg existence in IMM check Date: Thu, 19 Jan 2023 15:39:01 +0200 Message-Id: <20230119133901.1892413-4-cyndis@kapsi.fi> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230119133901.1892413-1-cyndis@kapsi.fi> References: <20230119133901.1892413-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 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 In the IMM opcode check, don't call is_addr_reg if it's not set. Fixes: 8cc95f3fd35e ("drm/tegra: Add job firewall") Signed-off-by: Mikko Perttunen --- drivers/gpu/drm/tegra/firewall.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/tegra/firewall.c b/drivers/gpu/drm/tegra/firewall.c index 1824d2db0e2c..d53f890fa689 100644 --- a/drivers/gpu/drm/tegra/firewall.c +++ b/drivers/gpu/drm/tegra/firewall.c @@ -97,6 +97,9 @@ static int fw_check_regs_imm(struct tegra_drm_firewall *fw, u32 offset) { bool is_addr; + if (!fw->client->ops->is_addr_reg) + return 0; + is_addr = fw->client->ops->is_addr_reg(fw->client->base.dev, fw->class, offset); if (is_addr) -- 2.39.0