Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1586182ybv; Thu, 20 Feb 2020 23:47:25 -0800 (PST) X-Google-Smtp-Source: APXvYqy0v+2ZjEdj56ah3uFa7yyUHOwEMMluUTDICc0U4DyFQK+vQ82TYzAiUt8gsd54I69U5dcB X-Received: by 2002:a9d:7305:: with SMTP id e5mr25779301otk.64.1582271245145; Thu, 20 Feb 2020 23:47:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582271245; cv=none; d=google.com; s=arc-20160816; b=sNZ14afKico2GWmXUkFd/crhhYKSFEuPwPInc3c7s+PdI8wpv+xgVQUSlvYnphxBl7 sIAH8oK6gyK9B2q49bUyg3Br3ujjlXOg+bZAo5DQWWTN4fKZnlPpHNzgOARxEWMVfNcK AC4ryRgotHXv1OxJoiQKIHx4krqexfHenJMJZ6nKyaodAIoTZ6Wl4Z5h89q8qaKs5tav GtKl6hd8P07BnPlpfsrKjasrT7pyam735EwxPTrd7Wf+rgP6KlVIVWuNd5lkcIlUoFx1 +nY3yE2EPkEMn49eSKRTS37w0PN1AYx2Bb0i7ZxNU2JPfERwP5oPSsTWE7pu6sRSJI5K Es6g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PTtgWApg5O6hi5lEsn8Gp3WN+Ncq4T/FllH31zE4Hq8=; b=mDGM8lyblArTHUBkvlKset9H+67B160wxHuzUoKxHw1HZD4YJAuffcl/RGkXRNcjtt spAuDcZQuSOns7RSLfosVrSFe0XdgF/LW0OAG7iNgJRh07MVo81Xe+qe9dMvfe86iFfc 53wxPib5kYfJlpaOya/h5Lwpd8GaJNSDdtRO1VEoD06TCPATGqRz2f4ICJZjiH2M/eiY G79PKtuo9rWo3SPGzMWW3tGY9pL4BzUyx/qjjjXsMfBZjuUC/TZAQCBF+5kfektTtYbP TNf5fMUrh0lqEBXyAmRPxXoYCKc/ZiEuWEfa3A5dQRnSJIajKuEJBLh9mEtYC988xUQ7 OhOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R4Ih67B6; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w26si1028026otl.213.2020.02.20.23.47.13; Thu, 20 Feb 2020 23:47:25 -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; dkim=pass header.i=@kernel.org header.s=default header.b=R4Ih67B6; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728768AbgBUHqm (ORCPT + 99 others); Fri, 21 Feb 2020 02:46:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:42122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728739AbgBUHqf (ORCPT ); Fri, 21 Feb 2020 02:46:35 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 831A1222C4; Fri, 21 Feb 2020 07:46:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1582271194; bh=gqwbBlP1p3HZ52B2xdObmey5c3N+SJaIq90toCEc2bU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R4Ih67B6vD7JlwbqipV7KfScPRXa2Smyz2Inb0W7iXCcr8gxtAHfTxuUNv9/1uhHm PmchLpTgkyhdp/00CM4ibQPHlnKFDpGAHnV8b8EpWHBeelogFDeLEc/aKeJ7Hv79mg dusiPIwZ/ZLS16G+0JcDpP43goyyRoPlmUysE5Ng= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rob Clark , Sasha Levin Subject: [PATCH 5.5 037/399] drm/msm/adreno: fix zap vs no-zap handling Date: Fri, 21 Feb 2020 08:36:02 +0100 Message-Id: <20200221072405.962554582@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200221072402.315346745@linuxfoundation.org> References: <20200221072402.315346745@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Clark [ Upstream commit 15ab987c423df561e0949d77fb5043921ae59956 ] We can have two cases, when it comes to "zap" fw. Either the fw requires zap fw to take the GPU out of secure mode at boot, or it does not and we can write RBBM_SECVID_TRUST_CNTL directly. Previously we decided based on whether zap fw load succeeded, but this is not a great plan because: 1) we could have zap fw in the filesystem on a device where it is not required 2) we could have the inverse case Instead, shift to deciding based on whether we have a 'zap-shader' node in dt. In practice, there is only one device (currently) with upstream dt that does not use zap (cheza), and it already has a /delete-node/ for the zap-shader node. Fixes: abccb9fe3267 ("drm/msm/a6xx: Add zap shader load") Signed-off-by: Rob Clark Signed-off-by: Sasha Levin --- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 11 +++++++++-- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c index b02e2042547f6..7d9e63e20dedd 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_gpu.c @@ -753,11 +753,18 @@ static int a5xx_hw_init(struct msm_gpu *gpu) gpu->funcs->flush(gpu, gpu->rb[0]); if (!a5xx_idle(gpu, gpu->rb[0])) return -EINVAL; - } else { - /* Print a warning so if we die, we know why */ + } else if (ret == -ENODEV) { + /* + * This device does not use zap shader (but print a warning + * just in case someone got their dt wrong.. hopefully they + * have a debug UART to realize the error of their ways... + * if you mess this up you are about to crash horribly) + */ dev_warn_once(gpu->dev->dev, "Zap shader not enabled - using SECVID_TRUST_CNTL instead\n"); gpu_write(gpu, REG_A5XX_RBBM_SECVID_TRUST_CNTL, 0x0); + } else { + return ret; } /* Last step - yield the ringbuffer */ diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index dc8ec2c94301b..686c34d706b0d 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -537,12 +537,19 @@ static int a6xx_hw_init(struct msm_gpu *gpu) a6xx_flush(gpu, gpu->rb[0]); if (!a6xx_idle(gpu, gpu->rb[0])) return -EINVAL; - } else { - /* Print a warning so if we die, we know why */ + } else if (ret == -ENODEV) { + /* + * This device does not use zap shader (but print a warning + * just in case someone got their dt wrong.. hopefully they + * have a debug UART to realize the error of their ways... + * if you mess this up you are about to crash horribly) + */ dev_warn_once(gpu->dev->dev, "Zap shader not enabled - using SECVID_TRUST_CNTL instead\n"); gpu_write(gpu, REG_A6XX_RBBM_SECVID_TRUST_CNTL, 0x0); ret = 0; + } else { + return ret; } out: -- 2.20.1