All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dma-buf: might_sleep() in dma_buf_unmap_attachment()
@ 2012-09-28  7:29 Rob Clark
  2012-09-28  7:39 ` Maarten Lankhorst
  0 siblings, 1 reply; 3+ messages in thread
From: Rob Clark @ 2012-09-28  7:29 UTC (permalink / raw)
  To: dri-devel, linaro-mm-sig, linux-media
  Cc: patches, daniel.vetter, sumit.semwal, maarten.lankhorst,
	Rob Clark

From: Rob Clark <rob@ti.com>

We never really clarified if unmap could be done in atomic context.
But since mapping might require sleeping, this implies mutex in use
to synchronize mapping/unmapping, so unmap could sleep as well.  Add
a might_sleep() to clarify this.

Signed-off-by: Rob Clark <rob@ti.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/base/dma-buf.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
index c30f3e1..877eacb 100644
--- a/drivers/base/dma-buf.c
+++ b/drivers/base/dma-buf.c
@@ -298,6 +298,8 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
 				struct sg_table *sg_table,
 				enum dma_data_direction direction)
 {
+	might_sleep();
+
 	if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
 		return;
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dma-buf: might_sleep() in dma_buf_unmap_attachment()
  2012-09-28  7:29 [PATCH] dma-buf: might_sleep() in dma_buf_unmap_attachment() Rob Clark
@ 2012-09-28  7:39 ` Maarten Lankhorst
  2012-09-29  6:24   ` Sumit Semwal
  0 siblings, 1 reply; 3+ messages in thread
From: Maarten Lankhorst @ 2012-09-28  7:39 UTC (permalink / raw)
  To: Rob Clark
  Cc: dri-devel, linaro-mm-sig, linux-media, patches, daniel.vetter,
	sumit.semwal, Rob Clark

Op 28-09-12 09:29, Rob Clark schreef:
> From: Rob Clark <rob@ti.com>
>
> We never really clarified if unmap could be done in atomic context.
> But since mapping might require sleeping, this implies mutex in use
> to synchronize mapping/unmapping, so unmap could sleep as well.  Add
> a might_sleep() to clarify this.
>
> Signed-off-by: Rob Clark <rob@ti.com>
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/base/dma-buf.c |    2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
> index c30f3e1..877eacb 100644
> --- a/drivers/base/dma-buf.c
> +++ b/drivers/base/dma-buf.c
> @@ -298,6 +298,8 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
>  				struct sg_table *sg_table,
>  				enum dma_data_direction direction)
>  {
> +	might_sleep();
> +
>  	if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
>  		return;
>  
Looks good to me!

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dma-buf: might_sleep() in dma_buf_unmap_attachment()
  2012-09-28  7:39 ` Maarten Lankhorst
@ 2012-09-29  6:24   ` Sumit Semwal
  0 siblings, 0 replies; 3+ messages in thread
From: Sumit Semwal @ 2012-09-29  6:24 UTC (permalink / raw)
  To: Maarten Lankhorst
  Cc: Rob Clark, dri-devel, linaro-mm-sig, linux-media, patches,
	daniel.vetter, Rob Clark

On Friday 28 September 2012 01:09 PM, Maarten Lankhorst wrote:
> Op 28-09-12 09:29, Rob Clark schreef:
>> From: Rob Clark <rob@ti.com>
>>
>> We never really clarified if unmap could be done in atomic context.
>> But since mapping might require sleeping, this implies mutex in use
>> to synchronize mapping/unmapping, so unmap could sleep as well.  Add
>> a might_sleep() to clarify this.
>>
>> Signed-off-by: Rob Clark <rob@ti.com>
>> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> ---
>>   drivers/base/dma-buf.c |    2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/base/dma-buf.c b/drivers/base/dma-buf.c
>> index c30f3e1..877eacb 100644
>> --- a/drivers/base/dma-buf.c
>> +++ b/drivers/base/dma-buf.c
>> @@ -298,6 +298,8 @@ void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
>>   				struct sg_table *sg_table,
>>   				enum dma_data_direction direction)
>>   {
>> +	might_sleep();
>> +
>>   	if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
>>   		return;
>>
> Looks good to me!
>
> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Thanks Rob,

Applied to for-next.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-29  6:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28  7:29 [PATCH] dma-buf: might_sleep() in dma_buf_unmap_attachment() Rob Clark
2012-09-28  7:39 ` Maarten Lankhorst
2012-09-29  6:24   ` Sumit Semwal

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.