From patchwork Mon Dec 16 21:32:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 22543 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0E7BD23FC7 for ; Mon, 16 Dec 2013 21:33:12 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id oz11sf10682622veb.8 for ; Mon, 16 Dec 2013 13:33:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=HpiGe4OxytPCS+wY+GXqi7BDAhf4NAj9dvb24uH15NQ=; b=l2oC2l5Us4U1VO/VcC9rX6q3c6T0k2bevrGt47Eu13R4sHyIMru890ZvaCEA2gi12d f8svwrx7M5IzzZbGAumgoqNBGwMet7yxCmkHuPT3GVvMXutla79anTrsP/YSbqYz9Mov 1X6j5X+trsLy80if5pnT8LJpgfEsnS7dgyrlgfHpw8A7H6n/nQ0dKyVbe0vU2ynXuVyD mRMQHz1f2XwpkRitQLe0WD7WYl378h0icdHRIqFfFD8BjHO3NpruPiS1S+P73CFK3NIk VlZvnAgbZ8xFF/lPXqrKAzKu4Cg4WyRGJsjeQL6Ijyavs/JtUIThzUyvaGUqyltH+drO 8rZQ== X-Gm-Message-State: ALoCoQkLpSD6L//PzjaWPrb1CyDNHhQbP4J1f/+3uOvZ/vM4qFkwpGt4jV2uDDo+w+tu1mH8MusQ X-Received: by 10.236.133.161 with SMTP id q21mr5834467yhi.18.1387229591852; Mon, 16 Dec 2013 13:33:11 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.119.196 with SMTP id kw4ls2163850qeb.90.gmail; Mon, 16 Dec 2013 13:33:11 -0800 (PST) X-Received: by 10.58.29.37 with SMTP id g5mr3097351veh.38.1387229591699; Mon, 16 Dec 2013 13:33:11 -0800 (PST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id sl9si4287076vdc.21.2013.12.16.13.33.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 13:33:11 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id lh4so3542651vcb.23 for ; Mon, 16 Dec 2013 13:33:11 -0800 (PST) X-Received: by 10.52.188.202 with SMTP id gc10mr5955vdc.84.1387229591605; Mon, 16 Dec 2013 13:33:11 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp20333vcz; Mon, 16 Dec 2013 13:33:11 -0800 (PST) X-Received: by 10.68.232.132 with SMTP id to4mr22428590pbc.141.1387229590796; Mon, 16 Dec 2013 13:33:10 -0800 (PST) Received: from mail-pb0-f46.google.com (mail-pb0-f46.google.com [209.85.160.46]) by mx.google.com with ESMTPS id yd9si9952349pab.176.2013.12.16.13.33.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 13:33:10 -0800 (PST) Received-SPF: neutral (google.com: 209.85.160.46 is neither permitted nor denied by best guess record for domain of john.stultz@linaro.org) client-ip=209.85.160.46; Received: by mail-pb0-f46.google.com with SMTP id md12so6023647pbc.19 for ; Mon, 16 Dec 2013 13:33:10 -0800 (PST) X-Received: by 10.66.66.202 with SMTP id h10mr22917352pat.70.1387229576055; Mon, 16 Dec 2013 13:32:56 -0800 (PST) Received: from localhost.localdomain (c-67-170-153-23.hsd1.or.comcast.net. [67.170.153.23]) by mx.google.com with ESMTPSA id nl7sm26678363pbc.6.2013.12.16.13.32.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 16 Dec 2013 13:32:55 -0800 (PST) From: John Stultz To: LKML Cc: John Stultz , Colin Cross , Android Kernel Team , Greg KH Subject: [RFC][PATCH 3/3] staging: ion: Avoid using rt_mutexes directly. Date: Mon, 16 Dec 2013 13:32:44 -0800 Message-Id: <1387229564-19517-4-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1387229564-19517-1-git-send-email-john.stultz@linaro.org> References: <1387229564-19517-1-git-send-email-john.stultz@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.stultz@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , RT_MUTEXES can be configured out of the kernel, causing compile problems with ION. Since there is no documentation as to why directly using rt_mutexes is necessary (and very few drivers directly use rt_mutexes), simply convert the ion_heap lock to a normal mutex. Cc: Colin Cross Cc: Android Kernel Team Cc: Greg KH Reported-by: Jim Davis Signed-off-by: John Stultz --- drivers/staging/android/ion/ion_heap.c | 20 ++++++++++---------- drivers/staging/android/ion/ion_priv.h | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/staging/android/ion/ion_heap.c b/drivers/staging/android/ion/ion_heap.c index 9cf5622..88685da 100644 --- a/drivers/staging/android/ion/ion_heap.c +++ b/drivers/staging/android/ion/ion_heap.c @@ -160,10 +160,10 @@ int ion_heap_pages_zero(struct page *page, size_t size, pgprot_t pgprot) void ion_heap_freelist_add(struct ion_heap *heap, struct ion_buffer *buffer) { - rt_mutex_lock(&heap->lock); + mutex_lock(&heap->lock); list_add(&buffer->list, &heap->free_list); heap->free_list_size += buffer->size; - rt_mutex_unlock(&heap->lock); + mutex_unlock(&heap->lock); wake_up(&heap->waitqueue); } @@ -171,9 +171,9 @@ size_t ion_heap_freelist_size(struct ion_heap *heap) { size_t size; - rt_mutex_lock(&heap->lock); + mutex_lock(&heap->lock); size = heap->free_list_size; - rt_mutex_unlock(&heap->lock); + mutex_unlock(&heap->lock); return size; } @@ -186,7 +186,7 @@ size_t ion_heap_freelist_drain(struct ion_heap *heap, size_t size) if (ion_heap_freelist_size(heap) == 0) return 0; - rt_mutex_lock(&heap->lock); + mutex_lock(&heap->lock); if (size == 0) size = heap->free_list_size; @@ -198,7 +198,7 @@ size_t ion_heap_freelist_drain(struct ion_heap *heap, size_t size) total_drained += buffer->size; ion_buffer_destroy(buffer); } - rt_mutex_unlock(&heap->lock); + mutex_unlock(&heap->lock); return total_drained; } @@ -213,16 +213,16 @@ static int ion_heap_deferred_free(void *data) wait_event_freezable(heap->waitqueue, ion_heap_freelist_size(heap) > 0); - rt_mutex_lock(&heap->lock); + mutex_lock(&heap->lock); if (list_empty(&heap->free_list)) { - rt_mutex_unlock(&heap->lock); + mutex_unlock(&heap->lock); continue; } buffer = list_first_entry(&heap->free_list, struct ion_buffer, list); list_del(&buffer->list); heap->free_list_size -= buffer->size; - rt_mutex_unlock(&heap->lock); + mutex_unlock(&heap->lock); ion_buffer_destroy(buffer); } @@ -235,7 +235,7 @@ int ion_heap_init_deferred_free(struct ion_heap *heap) INIT_LIST_HEAD(&heap->free_list); heap->free_list_size = 0; - rt_mutex_init(&heap->lock); + mutex_init(&heap->lock); init_waitqueue_head(&heap->waitqueue); heap->task = kthread_run(ion_heap_deferred_free, heap, "%s", heap->name); diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h index fc8a4c3..df81ce1 100644 --- a/drivers/staging/android/ion/ion_priv.h +++ b/drivers/staging/android/ion/ion_priv.h @@ -159,7 +159,7 @@ struct ion_heap { struct shrinker shrinker; struct list_head free_list; size_t free_list_size; - struct rt_mutex lock; + struct mutex lock; wait_queue_head_t waitqueue; struct task_struct *task; int (*debug_show)(struct ion_heap *heap, struct seq_file *, void *);