From patchwork Wed Jun 14 23:18:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 9787727 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 10ECF602CB for ; Thu, 15 Jun 2017 00:57:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07197284DC for ; Thu, 15 Jun 2017 00:57:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F016E284ED; Thu, 15 Jun 2017 00:57:33 +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 900F6284DC for ; Thu, 15 Jun 2017 00:57:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D1AF16E654; Thu, 15 Jun 2017 00:57:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x243.google.com (mail-lf0-x243.google.com [IPv6:2a00:1450:4010:c07::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3D51A6E630 for ; Wed, 14 Jun 2017 23:18:58 +0000 (UTC) Received: by mail-lf0-x243.google.com with SMTP id o28so1618370lfk.1 for ; Wed, 14 Jun 2017 16:18:58 -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=6Po8CV6f3/vJlmXOZCKqf2S9TKxt3Thh6L55yWobvNM=; b=mnVH7sYEgHEP3zqIP6IJb4ayXpO2UuIEAS7j3l/CI9qKbtWNczpFb+FusUV57SJBeM 4Ts/l+RXWgomcWvyjbh6pKiMG6TB8a+n596YszFL5hqS+s9Z5UJkOqInakQv7Ze/oFVQ LVePzuBFDbIOF53XS583Bli/r2CiNL/kX67MhKIpG1aB8dzyEmBkuO0dqEASiflBshCa xGJULebLqQNcDs//FCCcPx8cRf1s8dd5iooeM2Rjg9DQSIM8VZSplEkmXCINvYRCXTfM XWx99GkJMBeMXuZgZIxT7lFWRaD3Gqb1/tkOrVlMHp+t+IH0xzHQI2k8sMAYcOEf1n8X gOTw== 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=6Po8CV6f3/vJlmXOZCKqf2S9TKxt3Thh6L55yWobvNM=; b=C7jXPX90pnuy7v343lAZhoeBZdGvfU6eqqCyfO2Aehr/jdJl8FscFtwkszbEwWyZRn krb6xca+yzaGUzw29tHt3FqVaHzLdKlP4prKHu3YshSZPydM+QK0Ex+3Cara+HlngCCq ya0LvdPLfRY5QBqFynUVL40BkTlSI6HwtS3+TfNfbghiP5WjCcxw+ddD+wlBY0+V9Ws8 mIeBm/iV7ywNp2YjwAVrOuGtLs37Yy+EOKsp3MpV3k+OoauVO7pJbUZnw/gE4btTvS8z 3TyxEcNyRTPpuQkpB6LK+FPMLS3PDKnbR17qBR75A/3z8JDKT3gtFWnTzmoiErgD1Lnm xaTQ== X-Gm-Message-State: AKS2vOwOrkqjbacVPGU8aDhP5qVXHVpenYS4811RKeK6tZKE6DZRYBSI hCztEUSQrfCkjC6bJaA= X-Received: by 10.25.221.7 with SMTP id u7mr613150lfg.155.1497482336725; Wed, 14 Jun 2017 16:18:56 -0700 (PDT) Received: from localhost.localdomain (ppp109-252-91-7.pppoe.spdop.ru. [109.252.91.7]) by smtp.gmail.com with ESMTPSA id i24sm290165ljb.63.2017.06.14.16.18.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Jun 2017 16:18:56 -0700 (PDT) From: Dmitry Osipenko To: Thierry Reding , Mikko Perttunen , Erik Faye-Lund Subject: [PATCH v3 02/20] drm/tegra: Correct idr_alloc() minimum id Date: Thu, 15 Jun 2017 02:18:25 +0300 Message-Id: <9c19a44219acd988e678cf9abe21363911184625.1497480754.git.digetx@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: References: In-Reply-To: References: X-Mailman-Approved-At: Thu, 15 Jun 2017 00:57:20 +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 --- 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 b49d32a89f40..f9282da94a1f 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c @@ -539,7 +539,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;