From patchwork Fri Sep 22 01:34:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haneen Mohammed X-Patchwork-Id: 9965281 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 DE0806020C for ; Fri, 22 Sep 2017 07:33:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF68026E69 for ; Fri, 22 Sep 2017 07:33:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C44722970F; Fri, 22 Sep 2017 07:33:11 +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 8207126E69 for ; Fri, 22 Sep 2017 07:33:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAE3C6E961; Fri, 22 Sep 2017 07:32:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id E43E96E92C for ; Fri, 22 Sep 2017 01:34:14 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id h4so3155460pfk.0 for ; Thu, 21 Sep 2017 18:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=aV6Wqnz1v5NotepWraBfBrct6Puv7OP7BnIlVT/iUvU=; b=f8LBF5y7N6Y5A91UZHAbO63E2LShUlPhufAiPuVRG/kJkMM9HjVjCWb5Cnf1tuX01S G75FH8teBLkRpr25EJWW8B6ApdLt6olnjeFIdfU0Bf2XENpLykHgUnY8pnZrLNGLmKs/ 7/65+gj7gurR6Z+rlf267vYzSvSC15G2SguB4jfRKwNd0ciIpe6QQjjgI3Bc3L39bXj5 1Hp6poMd4EuFRgrmiAcmTjKIdCR/eXP3AaSCd0Bubdgl/Cwy6K1KLBqFoauZ4bICaA30 NFae1zzDttKVkst5fMCgx1Ra5XuF0jqsZqsWnPRUjVdIhTUvTPMnApxaBe8/VR1RxQZZ CPcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=aV6Wqnz1v5NotepWraBfBrct6Puv7OP7BnIlVT/iUvU=; b=ieq8Zk+R9wr98PORBvAzDORo3Wt8HLBoBFbdUglIEkUUcfiuLAD888J/TdMp3Q+729 R2BsCeLgVIE1AE8JYeL9JbYyIEz8eoOeGs+Y7Y09JpOhENN9e9oEZr2WY7K+7Tyry1p2 Hr89ZUXTAlOLaoTG1iYOK72mkT9pRDTu1ayL2uxctVVpQh0VDsfYSZxdwMJ2TjF7zjIc rkeuGtm6OKhLUtKFuse6tRpkQFkF0QTFhfwyGUrWWjfXexEG83QyulVzvanB6x0pgQ+c QwFGWXwo8FIihmFPf23N6649huMwpitiFZxThOa+7Yf3/o2Rxq4ssZr0pw7y+SSJde4L woHQ== X-Gm-Message-State: AHPjjUjxCw85PyjmudIUpYrVMkPCVbZ2+Km+qq4dBboMsGwRA045d+eZ r0uYbUeD+FbqCq2TS8GIYOr89kMG X-Google-Smtp-Source: AOwi7QBHEH0zNhAihCO0l12xRrgMXGP9acYyRdwEhZQqfO9JOowGa35jG5YuQk5eNdtnxs6mYq6sUQ== X-Received: by 10.98.217.133 with SMTP id b5mr7705821pfl.227.1506044053327; Thu, 21 Sep 2017 18:34:13 -0700 (PDT) Received: from Haneen ([64.77.242.50]) by smtp.gmail.com with ESMTPSA id g68sm4261007pfb.120.2017.09.21.18.34.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Sep 2017 18:34:12 -0700 (PDT) Date: Thu, 21 Sep 2017 19:34:09 -0600 From: Haneen Mohammed To: dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm: Remove obsolete "This is gross" comment Message-ID: <20170922013409.GA2741@Haneen> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-Mailman-Approved-At: Fri, 22 Sep 2017 07:32:36 +0000 Cc: gregkh@linuxfoundation.org, outreachy-kernel , Daniel Vetter 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Remove obsolete comment which was initially added in 2008 to annotate that idr_find() was used before idr_remove() since idr_remove() didn't use to return feedback. The comment now is irrelevant with commit f6cd7daecff5 ("drm: Release driver references to handle before making it available again"). In addition, remove the todo item about this issue. Signed-off-by: Haneen Mohammed --- Changes in v2: - remove todo item regarding this comment Documentation/gpu/todo.rst | 6 ------ drivers/gpu/drm/drm_gem.c | 9 --------- 2 files changed, 15 deletions(-) diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst index 22af55d..5e96dc7 100644 --- a/Documentation/gpu/todo.rst +++ b/Documentation/gpu/todo.rst @@ -180,12 +180,6 @@ Contact: Daniel Vetter, respective driver maintainers Core refactorings ================= -Use new IDR deletion interface to clean up drm_gem_handle_delete() ------------------------------------------------------------------- - -See the "This is gross" comment -- apparently the IDR system now can return an -error code instead of oopsing. - Clean up the DRM header mess ---------------------------- diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index c55f338..b9bddaa 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c @@ -282,15 +282,6 @@ drm_gem_handle_delete(struct drm_file *filp, u32 handle) { struct drm_gem_object *obj; - /* This is gross. The idr system doesn't let us try a delete and - * return an error code. It just spews if you fail at deleting. - * So, we have to grab a lock around finding the object and then - * doing the delete on it and dropping the refcount, or the user - * could race us to double-decrement the refcount and cause a - * use-after-free later. Given the frequency of our handle lookups, - * we may want to use ida for number allocation and a hash table - * for the pointers, anyway. - */ spin_lock(&filp->table_lock); /* Check if we currently have a reference on the object */