All of lore.kernel.org
 help / color / mirror / Atom feed
From: m.szyprowski@samsung.com (Marek Szyprowski)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] CMA: correct unlock target
Date: Thu, 29 May 2014 09:34:43 +0200	[thread overview]
Message-ID: <5386E313.6070705@samsung.com> (raw)
In-Reply-To: <1401344958-3790-1-git-send-email-iamjoonsoo.kim@lge.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Laura Abbott <lauraa@codeaurora.org>,
	Michal Nazarewicz <mina86@mina86.com>,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	Russell King - ARM Linux <linux@arm.linux.org.uk>
Subject: Re: [PATCH] CMA: correct unlock target
Date: Thu, 29 May 2014 09:34:43 +0200	[thread overview]
Message-ID: <5386E313.6070705@samsung.com> (raw)
In-Reply-To: <1401344958-3790-1-git-send-email-iamjoonsoo.kim@lge.com>

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


  reply	other threads:[~2014-05-29  7:34 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-29  6:29 [PATCH] CMA: correct unlock target Joonsoo Kim
2014-05-29  6:29 ` Joonsoo Kim
2014-05-29  7:34 ` Marek Szyprowski [this message]
2014-05-29  7:34   ` Marek Szyprowski
2014-05-29 14:56   ` Laura Abbott
2014-05-29 14:56     ` Laura Abbott
2014-05-30  6:07     ` Marek Szyprowski
2014-05-30  6:07       ` Marek Szyprowski
2014-05-29 19:37 ` David Rientjes
2014-05-29 19:37   ` David Rientjes
2014-05-29 23:48 ` Michal Nazarewicz
2014-05-29 23:48   ` Michal Nazarewicz

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=5386E313.6070705@samsung.com \
    --to=m.szyprowski@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.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.