From patchwork Sun May 14 20:47:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 9725969 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4C4B960381 for ; Mon, 15 May 2017 00:51:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FAA528935 for ; Mon, 15 May 2017 00:51:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34ADA2893B; Mon, 15 May 2017 00:51:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CE14528935 for ; Mon, 15 May 2017 00:51:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C50B46E1B1; Mon, 15 May 2017 00:49:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 922AB6E032 for ; Sun, 14 May 2017 20:48:55 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id v42so12683529wrc.3 for ; Sun, 14 May 2017 13:48:55 -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; bh=mDxRLZH94qCOSSzCLf9zbPryFcaUNBX3cPC5uGxI5lU=; b=e98Wj8bbsYF0Dy3Nxgea4GdxXAfoyurXIXZyfQUzpDLUdRxJ8tGV4pxqiL8Tz039VB Tm0PMoXZY4uVcmfBXKIUgwOPsVeMcun52LLMhtwtCPjY0F77XPwZRJ4zKlRSM0vOWPax zTGEYtfnpn6u6ACzgNs6iN4XkyMsetd21R41NXtq64fMRN6BjZ1M07HseM6OvGEKhx6k vBLq3Tdd/rA6WLnjlAydUvJNrfEKLmTSeUXwZICSPvo2gE4DGFJhqMlrMm0yyypmRfxK WsT+52h6nNB5AI/nyWn1u9OrMBUjfr3VcwrcDjJiAryOdhT9fpNxwnNFnRXD4hXJGXhR uGXg== 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; bh=mDxRLZH94qCOSSzCLf9zbPryFcaUNBX3cPC5uGxI5lU=; b=LTUeBx4+ViP7E4k+MOu994ZvyhmxY/ZBNhRyglY0ZE7L32jA+gSYOXe8Mu+RtXqgSA 9d0cKOgMhQXKf4XrOtXEshDPGiJAiC9rYi+FKLrcglTGyH+7vosR4fFx5j8slUCjYQbH ngkSYlZ57l1UV2U7K7rt6RQodxNtPQAoSFFupNiSn6rICUsBIoBtNLtwg5ewRmk4M2lH vPf2Ebjhm7pqHw9JlVFVFOoKWS5yJjgZaY673sxdhYgcZ2wjeDIv2IM2HSQhbrDumhb3 nlHU5J/3+bKIx5jeMbwSjeP1vGtj5xXKc7W2fwnmSd/6j8lgKYxUX3KETNcjcOcFeH80 dh+g== X-Gm-Message-State: AODbwcBkpjNelrv1iQ/zLAGl0i1ydWjamVuJj23Ze4mu0T3JYq5RT/UA qmIF2C1rRdiarqP4TL4= X-Received: by 10.46.88.65 with SMTP id x1mr1084780ljd.105.1494794934266; Sun, 14 May 2017 13:48:54 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-91-175.pppoe.spdop.ru. [109.252.91.175]) by smtp.gmail.com with ESMTPSA id 75sm1839959lja.53.2017.05.14.13.48.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 May 2017 13:48:53 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen Subject: [PATCH v2] drm/tegra: Correct idr_alloc() minimum id Date: Sun, 14 May 2017 23:47:34 +0300 Message-Id: <20170514204734.22130-4-digetx@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170514204734.22130-1-digetx@gmail.com> References: <20170514204734.22130-1-digetx@gmail.com> X-Mailman-Approved-At: Mon, 15 May 2017 00:48:34 +0000 Cc: linux-tegra@vger.kernel.org, DRI Development X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The client ID 0 is reserved by the host1x/cdma to mark the timeout timer work as already been scheduled and context ID is used as the clients one. This fixes spurious CDMA timeouts. Fixes: bdd2f9cd10eb ("drm/tegra: Don't leak kernel pointer to userspace") Signed-off-by: Dmitry Osipenko Reviewed-by: Mikko Perttunen --- v2: Changed the commit description, now explains the cause of CDMA timeouts. drivers/gpu/drm/tegra/drm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index c5844a065681..489cb32453f7 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -548,7 +548,7 @@ static int tegra_client_open(struct tegra_drm_file *fpriv, if (err < 0) return err; - err = idr_alloc(&fpriv->contexts, context, 0, 0, GFP_KERNEL); + err = idr_alloc(&fpriv->contexts, context, 1, 0, GFP_KERNEL); if (err < 0) { client->ops->close_channel(context); return err;