* [PATCH] CMA: correct unlock target
@ 2014-05-29 6:29 Joonsoo Kim
2014-05-29 7:34 ` Marek Szyprowski
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Joonsoo Kim @ 2014-05-29 6:29 UTC (permalink / raw)
To: linux-arm-kernel
'cma: Remove potential deadlock situation' introduces per cma area mutex
for bitmap management. It is good, but there is one mistake. When we
can't find appropriate area in bitmap, we release cma_mutex global lock
rather than cma->lock and this is a bug. So fix it.
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
index 6f6bffc..83969f8 100644
--- a/drivers/base/dma-contiguous.c
+++ b/drivers/base/dma-contiguous.c
@@ -331,7 +331,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
start, count, mask);
if (pageno >= cma->count) {
- mutex_unlock(&cma_mutex);
+ mutex_unlock(&cma->lock);
break;
}
bitmap_set(cma->bitmap, pageno, count);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] CMA: correct unlock target
2014-05-29 6:29 [PATCH] CMA: correct unlock target Joonsoo Kim
@ 2014-05-29 7:34 ` Marek Szyprowski
2014-05-29 14:56 ` Laura Abbott
2014-05-29 19:37 ` David Rientjes
2014-05-29 23:48 ` Michal Nazarewicz
2 siblings, 1 reply; 6+ messages in thread
From: Marek Szyprowski @ 2014-05-29 7:34 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On 2014-05-29 08:29, Joonsoo Kim wrote:
> 'cma: Remove potential deadlock situation' introduces per cma area mutex
> for bitmap management. It is good, but there is one mistake. When we
> can't find appropriate area in bitmap, we release cma_mutex global lock
> rather than cma->lock and this is a bug. So fix it.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Thanks for spotting this issue. I've added it to my tree.
> diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
> index 6f6bffc..83969f8 100644
> --- a/drivers/base/dma-contiguous.c
> +++ b/drivers/base/dma-contiguous.c
> @@ -331,7 +331,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
> pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
> start, count, mask);
> if (pageno >= cma->count) {
> - mutex_unlock(&cma_mutex);
> + mutex_unlock(&cma->lock);
> break;
> }
> bitmap_set(cma->bitmap, pageno, count);
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] CMA: correct unlock target
2014-05-29 7:34 ` Marek Szyprowski
@ 2014-05-29 14:56 ` Laura Abbott
2014-05-30 6:07 ` Marek Szyprowski
0 siblings, 1 reply; 6+ messages in thread
From: Laura Abbott @ 2014-05-29 14:56 UTC (permalink / raw)
To: linux-arm-kernel
On 5/29/2014 12:34 AM, Marek Szyprowski wrote:
> Hello,
>
> On 2014-05-29 08:29, Joonsoo Kim wrote:
>> 'cma: Remove potential deadlock situation' introduces per cma area mutex
>> for bitmap management. It is good, but there is one mistake. When we
>> can't find appropriate area in bitmap, we release cma_mutex global lock
>> rather than cma->lock and this is a bug. So fix it.
>>
>> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
>
> Thanks for spotting this issue. I've added it to my tree.
>
>> diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
>> index 6f6bffc..83969f8 100644
>> --- a/drivers/base/dma-contiguous.c
>> +++ b/drivers/base/dma-contiguous.c
>> @@ -331,7 +331,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
>> pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
>> start, count, mask);
>> if (pageno >= cma->count) {
>> - mutex_unlock(&cma_mutex);
>> + mutex_unlock(&cma->lock);
>> break;
>> }
>> bitmap_set(cma->bitmap, pageno, count);
>
> Best regards
Acked-by: Laura Abbott <lauraa@codeaurora.org>
Who actually ended up picking up that patch? I sent it out but didn't realize it had been
picked up.
--
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] CMA: correct unlock target
2014-05-29 6:29 [PATCH] CMA: correct unlock target Joonsoo Kim
2014-05-29 7:34 ` Marek Szyprowski
@ 2014-05-29 19:37 ` David Rientjes
2014-05-29 23:48 ` Michal Nazarewicz
2 siblings, 0 replies; 6+ messages in thread
From: David Rientjes @ 2014-05-29 19:37 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, 29 May 2014, Joonsoo Kim wrote:
> 'cma: Remove potential deadlock situation' introduces per cma area mutex
> for bitmap management. It is good, but there is one mistake. When we
> can't find appropriate area in bitmap, we release cma_mutex global lock
> rather than cma->lock and this is a bug. So fix it.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: David Rientjes <rientjes@google.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] CMA: correct unlock target
2014-05-29 6:29 [PATCH] CMA: correct unlock target Joonsoo Kim
2014-05-29 7:34 ` Marek Szyprowski
2014-05-29 19:37 ` David Rientjes
@ 2014-05-29 23:48 ` Michal Nazarewicz
2 siblings, 0 replies; 6+ messages in thread
From: Michal Nazarewicz @ 2014-05-29 23:48 UTC (permalink / raw)
To: linux-arm-kernel
On Thu, May 29 2014, Joonsoo Kim <iamjoonsoo.kim@lge.com> wrote:
> 'cma: Remove potential deadlock situation' introduces per cma area mutex
> for bitmap management. It is good, but there is one mistake. When we
> can't find appropriate area in bitmap, we release cma_mutex global lock
> rather than cma->lock and this is a bug. So fix it.
>
> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
> diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
> index 6f6bffc..83969f8 100644
> --- a/drivers/base/dma-contiguous.c
> +++ b/drivers/base/dma-contiguous.c
> @@ -331,7 +331,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
> pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
> start, count, mask);
> if (pageno >= cma->count) {
> - mutex_unlock(&cma_mutex);
> + mutex_unlock(&cma->lock);
> break;
> }
> bitmap_set(cma->bitmap, pageno, count);
> --
> 1.7.9.5
--
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Micha? ?mina86? Nazarewicz (o o)
ooo +--<mpn@google.com>--<xmpp:mina86@jabber.org>--ooO--(_)--Ooo--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] CMA: correct unlock target
2014-05-29 14:56 ` Laura Abbott
@ 2014-05-30 6:07 ` Marek Szyprowski
0 siblings, 0 replies; 6+ messages in thread
From: Marek Szyprowski @ 2014-05-30 6:07 UTC (permalink / raw)
To: linux-arm-kernel
Hello,
On 2014-05-29 16:56, Laura Abbott wrote:
> On 5/29/2014 12:34 AM, Marek Szyprowski wrote:
> > Hello,
> >
> > On 2014-05-29 08:29, Joonsoo Kim wrote:
> >> 'cma: Remove potential deadlock situation' introduces per cma area mutex
> >> for bitmap management. It is good, but there is one mistake. When we
> >> can't find appropriate area in bitmap, we release cma_mutex global lock
> >> rather than cma->lock and this is a bug. So fix it.
> >>
> >> Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> >
> > Thanks for spotting this issue. I've added it to my tree.
> >
> >> diff --git a/drivers/base/dma-contiguous.c b/drivers/base/dma-contiguous.c
> >> index 6f6bffc..83969f8 100644
> >> --- a/drivers/base/dma-contiguous.c
> >> +++ b/drivers/base/dma-contiguous.c
> >> @@ -331,7 +331,7 @@ struct page *dma_alloc_from_contiguous(struct device *dev, int count,
> >> pageno = bitmap_find_next_zero_area(cma->bitmap, cma->count,
> >> start, count, mask);
> >> if (pageno >= cma->count) {
> >> - mutex_unlock(&cma_mutex);
> >> + mutex_unlock(&cma->lock);
> >> break;
> >> }
> >> bitmap_set(cma->bitmap, pageno, count);
> >
> > Best regards
>
> Acked-by: Laura Abbott <lauraa@codeaurora.org>
>
> Who actually ended up picking up that patch? I sent it out but didn't realize it had been
> picked up.
I've taken it to my dma-mapping tree some time ago, I think that
I've replied to the original mail with information about taking it.
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-05-30 6:07 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-29 6:29 [PATCH] CMA: correct unlock target Joonsoo Kim
2014-05-29 7:34 ` Marek Szyprowski
2014-05-29 14:56 ` Laura Abbott
2014-05-30 6:07 ` Marek Szyprowski
2014-05-29 19:37 ` David Rientjes
2014-05-29 23:48 ` Michal Nazarewicz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).