habanalabs: use GFP_ATOMIC under spin lock
Subsystems (2)
PATCH 1/1 habanalabs: use GFP_ATOMIC under spin lock
A spin lock is taken here so we should use GFP_ATOMIC.
--- drivers/misc/habanalabs/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/habanalabs/memory.c +1 -1
@@ -120,7 +120,7 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args,spin_lock (&vm->idr_lock); handle =idr_alloc (&vm->phys_pg_pack_handles, phys_pg_pack,1 ,0 , -GFP_KERNEL ); +GFP_ATOMIC );spin_unlock (&vm->idr_lock);if (handle <0 ) {
Greg Kroah-Hartman
maintainerQuoted 16 lines · Wei Yongjun
A spin lock is taken here so we should use
GFP_ATOMIC.Fixes 0feaf86d4e69 ("habanalabs: add virtual memory and MMU modules")Signed-off-by Wei Yongjun <[email protected]>--- drivers/misc/habanalabs/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/habanalabs/memory.c +0
-0
drivers/misc/habanalabs/memory.c static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args, · line 126
Quoted 8 lines
drivers/misc/habanalabs/memory.c +1
-1@@ -120,7 +120,7 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args,spin_lock (&vm->idr_lock); handle =idr_alloc (&vm->phys_pg_pack_handles, phys_pg_pack,1 ,0 , -GFP_KERNEL ); +GFP_ATOMIC );spin_unlock (&vm->idr_lock);if (handle <0 ) {
Ah, nice catch!
Oded, any objection to me taking this patch?
greg k-h
Oded Gabbay
Reviewed-byQuoted 29 lines · Greg Kroah-Hartman
Quoted 16 lines · Wei Yongjun
A spin lock is taken here so we should use
GFP_ATOMIC.Fixes 0feaf86d4e69 ("habanalabs: add virtual memory and MMU modules")Signed-off-by Wei Yongjun <[email protected]>--- drivers/misc/habanalabs/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/habanalabs/memory.c +0
-0drivers/misc/habanalabs/memory.c static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args, · line 126
Quoted 8 lines
drivers/misc/habanalabs/memory.c +1
-1@@ -120,7 +120,7 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args,spin_lock (&vm->idr_lock); handle =idr_alloc (&vm->phys_pg_pack_handles, phys_pg_pack,1 ,0 , -GFP_KERNEL ); +GFP_ATOMIC );spin_unlock (&vm->idr_lock);if (handle <0 ) {Ah, nice catch!
Quoted 3 lines
Oded, any objection to me taking this patch?
greg k-h
No, of course not.
This patch is:
Greg Kroah-Hartman
maintainerQuoted 31 lines · Oded Gabbay
Quoted 29 lines · Greg Kroah-Hartman
Quoted 16 lines · Wei Yongjun
A spin lock is taken here so we should use
GFP_ATOMIC.Fixes 0feaf86d4e69 ("habanalabs: add virtual memory and MMU modules")Signed-off-by Wei Yongjun <[email protected]>--- drivers/misc/habanalabs/memory.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/habanalabs/memory.c +0
-0drivers/misc/habanalabs/memory.c static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args, · line 126
Quoted 8 lines
drivers/misc/habanalabs/memory.c +1
-1@@ -120,7 +120,7 @@ static int alloc_device_memory(struct hl_ctx *ctx, struct hl_mem_in *args,spin_lock (&vm->idr_lock); handle =idr_alloc (&vm->phys_pg_pack_handles, phys_pg_pack,1 ,0 , -GFP_KERNEL ); +GFP_ATOMIC );spin_unlock (&vm->idr_lock);if (handle <0 ) {Ah, nice catch!
Quoted 6 lines
Quoted 3 lines
Oded, any objection to me taking this patch?
greg k-h
No, of course not.
This patch is:Reviewed-by Oded Gabbay <[email protected]>
Great, will go queue it up now, thanks.
greg k-h