From: akpm@linux-foundation.org
To: jic23@cam.ac.uk, James.Bottomley@HansenPartnership.com,
airlied@linux.ie, guenter.roeck@ericsson.com,
rusty@rustcorp.com.au, thellstrom@vmware.com, tj@kernel.org,
mm-commits@vger.kernel.org
Subject: [nacked] drm-vmwgfx-use-ida_simple_get-for-id-allocation.patch removed from -mm tree
Date: Fri, 02 Sep 2011 17:10:45 -0700 [thread overview]
Message-ID: <201109030010.p830AjKM018605@imap1.linux-foundation.org> (raw)
The patch titled
drm/vmwgfx: use ida_simple_get() for id allocation
has been removed from the -mm tree. Its filename was
drm-vmwgfx-use-ida_simple_get-for-id-allocation.patch
This patch was dropped because it was nacked
The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/
------------------------------------------------------
Subject: drm/vmwgfx: use ida_simple_get() for id allocation
From: Jonathan Cameron <jic23@cam.ac.uk>
Some messing with error codes to return 0 on out id's and match
current situation. Is this necessary? Looks a touch 'interesting'.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Tejun Heo <tj@kernel.org>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c | 34 +++-------------
1 file changed, 8 insertions(+), 26 deletions(-)
diff -puN drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c~drm-vmwgfx-use-ida_simple_get-for-id-allocation drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c~drm-vmwgfx-use-ida_simple_get-for-id-allocation
+++ a/drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c
@@ -37,7 +37,6 @@
#include <linux/kernel.h>
struct vmwgfx_gmrid_man {
- spinlock_t lock;
struct ida gmr_ida;
uint32_t max_gmr_ids;
};
@@ -49,34 +48,20 @@ static int vmw_gmrid_man_get_node(struct
{
struct vmwgfx_gmrid_man *gman =
(struct vmwgfx_gmrid_man *)man->priv;
- int ret;
int id;
mem->mm_node = NULL;
- do {
- if (unlikely(ida_pre_get(&gman->gmr_ida, GFP_KERNEL) == 0))
- return -ENOMEM;
-
- spin_lock(&gman->lock);
- ret = ida_get_new(&gman->gmr_ida, &id);
-
- if (unlikely(ret == 0 && id >= gman->max_gmr_ids)) {
- ida_remove(&gman->gmr_ida, id);
- spin_unlock(&gman->lock);
+ id = ida_simple_get(&gman->gmr_ida, 0, gman->max_gmr_ids, GFP_KERNEL);
+ if (id < 0) {
+ if (id == -ENOSPC)
return 0;
- }
-
- spin_unlock(&gman->lock);
-
- } while (ret == -EAGAIN);
-
- if (likely(ret == 0)) {
- mem->mm_node = gman;
- mem->start = id;
+ return id;
}
+ mem->mm_node = gman;
+ mem->start = id;
- return ret;
+ return 0;
}
static void vmw_gmrid_man_put_node(struct ttm_mem_type_manager *man,
@@ -86,9 +71,7 @@ static void vmw_gmrid_man_put_node(struc
(struct vmwgfx_gmrid_man *)man->priv;
if (mem->mm_node) {
- spin_lock(&gman->lock);
- ida_remove(&gman->gmr_ida, mem->start);
- spin_unlock(&gman->lock);
+ ida_simple_remove(&gman->gmr_ida, mem->start);
mem->mm_node = NULL;
}
}
@@ -102,7 +85,6 @@ static int vmw_gmrid_man_init(struct ttm
if (unlikely(gman == NULL))
return -ENOMEM;
- spin_lock_init(&gman->lock);
ida_init(&gman->gmr_ida);
gman->max_gmr_ids = p_size;
man->priv = (void *) gman;
_
Patches currently in -mm which might be from jic23@cam.ac.uk are
linux-next.patch
hwmon-convert-idr-to-ida-and-use-ida_simple-interface.patch
drivers-hwmon-hwmonc-convert-idr-to-ida-and-use-ida_simple_get.patch
drivers-scsi-sdc-use-ida_simple_get-and-ida_simple_remove-in-place-of-boilerplate-code.patch
drivers-scsi-osd-osd_uldc-use-ida_simple_get-to-handle-id.patch
drivers-rtc-classc-convert-idr-to-ida-and-use-ida_simple_get.patch
w1-ds2760-and-ds2780-use-ida-for-id-and-ida_simple_get-to-get-it.patch
reply other threads:[~2011-09-03 0:11 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201109030010.p830AjKM018605@imap1.linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=airlied@linux.ie \
--cc=guenter.roeck@ericsson.com \
--cc=jic23@cam.ac.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=rusty@rustcorp.com.au \
--cc=thellstrom@vmware.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.