From patchwork Tue Jun 13 23:15:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 775534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wnR6p0YCMz9sCX for ; Wed, 14 Jun 2017 09:38:58 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gPFp28g1"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753870AbdFMXi5 (ORCPT ); Tue, 13 Jun 2017 19:38:57 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34514 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753624AbdFMXi5 (ORCPT ); Tue, 13 Jun 2017 19:38:57 -0400 Received: by mail-lf0-f67.google.com with SMTP id o28so14872964lfk.1 for ; Tue, 13 Jun 2017 16:38:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=Pj0wY+4Bh/VB0fVNrnmw3lnqQrWYXTHmH034fBP1TIo=; b=gPFp28g1m2YlZ18DgjrA4pwEXfTXJApb129LhxZFfZ16a+hjnXLOrEck6siqjvh/6T yPYOgxZib6qrTmnPdki7njMhJ29Kgk07dSuvvW+wESEW2B2DA51RJJCWSt2WgOeYpRxl O0gwslN0dJvJmhqMf0XY4v6rBXhAUQWE2G1qbGTIf7Ryowz9jl/IkN7tfEHSI6FNTjtr Va8r5QnxcRV/zsv1U/jnsi+5YyG1X2WyMDnnZJD1KoFMJSRoTRBt5fhNdQqJ8s05tl4+ K7LjFvoRggT2vIi2rwitajLO5EwnyQ5UCOQqNV6DMoiC5lw+LTFfi6lOzYz6I+WcrVzN pyRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=Pj0wY+4Bh/VB0fVNrnmw3lnqQrWYXTHmH034fBP1TIo=; b=Ah6LQhQtOvmrXmTEZGwu2FVPATleiMtxbD7+ObkdjlUBLwSGcWRF5gHj3E2/cA/ZZh 2RJ8AVQESJd291Co2YsPm2B1hN4UWDPD46Qd+OqOtGq4F8HiBub71vJsOII06TdO021w bE9Kyf0iRhyWmqOj9ICoB6N21O4sHt+dWsW5Pn634XOCN2XAOVoK06TaQ+C5PWLaNMbm fd53lvNcWI4mh6CGFHNQVf5Km0MLZ93I8AX9gD/YMWV+RqyLkdk5nK3wjBrn8KNDKPIN SyTR+vhni0F8lz06KOsQww4e/SGtKzT1d1PMF73Pkb5/x3qrkLHGtFHeY9dmZ91BKcGP Xzlg== X-Gm-Message-State: AKS2vOxE1ZgREA/iO6LR8HhVWwzLrnNFf6RtItIPxHXqL2UuM+RwLgV2 qpvTiTeaEE5qNBjdwjo= X-Received: by 10.46.9.146 with SMTP id 140mr803546ljj.42.1497397135523; Tue, 13 Jun 2017 16:38:55 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-91-7.pppoe.spdop.ru. [109.252.91.7]) by smtp.gmail.com with ESMTPSA id f27sm3785725lfa.27.2017.06.13.16.38.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jun 2017 16:38:54 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen , Erik Faye-Lund Cc: linux-tegra@vger.kernel.org, DRI Development Subject: [PATCH v2 12/22] gpu: host1x: Correct host1x_job_pin() error handling Date: Wed, 14 Jun 2017 02:15:51 +0300 Message-Id: X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org In case of relocations / waitchecks patching failure the jobs pins stay referenced till DRM file get closed, wasting memory. Add the missed unpinning. Signed-off-by: Dmitry Osipenko Reviewed-by: Erik Faye-Lund Reviewed-by: Mikko Perttunen --- drivers/gpu/host1x/job.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/host1x/job.c b/drivers/gpu/host1x/job.c index d9933828fe87..14f3f957ffab 100644 --- a/drivers/gpu/host1x/job.c +++ b/drivers/gpu/host1x/job.c @@ -592,22 +592,20 @@ int host1x_job_pin(struct host1x_job *job, struct device *dev) err = do_relocs(job, g->bo); if (err) - break; + goto out; err = do_waitchks(job, host, g->bo); if (err) - break; + goto out; } - if (IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL) && !err) { - err = copy_gathers(job, dev); - if (err) { - host1x_job_unpin(job); - return err; - } - } + if (!IS_ENABLED(CONFIG_TEGRA_HOST1X_FIREWALL)) + goto out; + err = copy_gathers(job, dev); out: + if (err) + host1x_job_unpin(job); wmb(); return err;