From patchwork Fri Oct 4 20:18:33 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Faye-Lund X-Patchwork-Id: 2990481 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 29976BF924 for ; Fri, 4 Oct 2013 22:57:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 69207202A7 for ; Fri, 4 Oct 2013 22:57:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0DF1B2029B for ; Fri, 4 Oct 2013 22:57:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09CDDE8066 for ; Fri, 4 Oct 2013 15:57:33 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by gabe.freedesktop.org (Postfix) with ESMTP id 01875E7E25 for ; Fri, 4 Oct 2013 13:18:37 -0700 (PDT) Received: by mail-ea0-f171.google.com with SMTP id n15so2041887ead.16 for ; Fri, 04 Oct 2013 13:18:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=rsEfriqgm84CmDJzuTcQxiyxYUgwKD7j3PKe4lEkSDU=; b=qYCaBYcWbL9CYKfVvbVuuHaPtJx76suZ83xqjegfucS6rI5lHp3wOtwk6NUTdI8HQ/ i4H6aUA1l/ZiEIrTllS7KbHuixts/FsM7X7n0HmEduWQDV29/cxg6A4Vm8891Hx+OvIW Wu/d6AboMBhkjC6ZC2ect/lq9AFdcwD8YXj5Ii3Azn6nM4u9E6gK8rO4t9IU28KFSNcN rElPucKLQUY6wlcmLrdCMx++Ot3prgishtc0eOxdml8BoGil/PuwSPvyrfAiQ+edeYA4 8IslpE1jlgmdecTHunFcb17rwagCb27TcoFuMKQY3+TKEYE8ov+Y61a+cmEMfQcpQmp6 Ut9g== X-Received: by 10.15.98.9 with SMTP id bi9mr111557eeb.67.1380917916881; Fri, 04 Oct 2013 13:18:36 -0700 (PDT) Received: from localhost.localdomain (cm-84.215.107.111.getinternet.no. [84.215.107.111]) by mx.google.com with ESMTPSA id a1sm31702503eem.1.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 04 Oct 2013 13:18:36 -0700 (PDT) From: Erik Faye-Lund To: linux-tegra@vger.kernel.org Subject: [PATCH] gpu: host1x: check relocs after all gathers are consumed Date: Fri, 4 Oct 2013 20:18:33 +0000 Message-Id: <1380917913-20482-1-git-send-email-kusmabite@gmail.com> X-Mailer: git-send-email 1.7.9.5 Cc: Terje Bergstrom , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The num_relocs count are passed to the kernel per job, not per gather. For multi-gather jobs, we would previously fail if there were relocs in other gathers aside from the first one. Fix this by simply moving the check until all gathers have been consumed. Signed-off-by: Erik Faye-Lund Reviewed-by: Arto Merilainen Acked-By: Terje Bergstrom --- drivers/gpu/host1x/job.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index c4e1050..c9ddff8 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -436,10 +436,6 @@ static int validate(struct host1x_firewall *fw, struct host1x_job_gather *g) } } - /* No relocs should remain at this point */ - if (fw->num_relocs) - err = -EINVAL; - out: return err; } @@ -493,6 +489,10 @@ static inline int copy_gathers(struct host1x_job *job, struct device *dev) offset += g->words * sizeof(u32); } + /* No relocs should remain at this point */ + if (fw.num_relocs) + return -EINVAL; + return 0; }