habanalabs: add comments in uapi/misc/habanalabs.h
PATCH v2 8/15 habanalabs: add comments in uapi/misc/habanalabs.h
Add comment about minimum and maximum size of command buffer. Add some text about the expected input of CS IOCTL.
---
Changes in v2:
- Add changelog in the commit message
include/uapi/misc/habanalabs.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
include/uapi/misc/habanalabs.h +9 -1
@@ -112,7 +112,9 @@ struct hl_cb_in {__u64 cb_handle;/* HL_CB_OP_* */ __u32 op; -/* Size of CB. Minimum requested size must be PAGE_SIZE */ +/* Size of CB. Maximum size is 2MB. The minimum size that will be +* allocated, regardless of this parameter's value, is PAGE_SIZE +*/ __u32 cb_size;/* Context ID - Currently not in use */ __u32 ctx_id;
@@ -364,6 +366,12 @@ union hl_mem_args {* internal. The driver will get completion notifications from the device only * on JOBS which are enqueued in the external queues. * +* For jobs on external queues, the user needs to create command buffers +* through the CB ioctl and give the CB's handle to the CS ioctl. For jobs on +* internal queues, the user needs to prepare a "command buffer" with packets +* on either the SRAM or DRAM, and give the device address of that buffer to +* the CS ioctl. +* * This IOCTL is asynchronous in regard to the actual execution of the CS. This * means it returns immediately after ALL the JOBS were enqueued on their * relevant queues. Therefore, the user mustn't assume the CS has been completed
Signature · 1 line
2.17.1
PATCH 11/15 habanalabs: print pointer using %p
Don't cast pointer to u64 to print it. Instead, print the pointer using %p.
---
Changes in v2:
- Add changelog in the commit message
drivers/misc/habanalabs/goya/goya.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/misc/habanalabs/goya/goya.c +2 -3
@@ -4276,9 +4276,8 @@ static int goya_parse_cb_no_ext_quque(struct hl_device *hdev,return 0 ;dev_err (hdev->dev, -"Internal CB address 0x%llx + 0x%x is not in SRAM nor in DRAM\n" , - (u64 ) (uintptr_t ) parser->user_cb, - parser->user_cb_size); +"Internal CB address %p + 0x%x is not in SRAM nor in DRAM\n" , + parser->user_cb, parser->user_cb_size);return -EFAULT ; }
Signature · 1 line
2.17.1
Greg KH
maintainerRe: [PATCH 11/15] habanalabs: print pointer using %p
Quoted 7 lines · Oded Gabbay
Don't cast pointer to u64 to print it. Instead, print the pointer using %p.
Signed-off-by Oded Gabbay <[email protected]>---
Changes in v2:
- Add changelog in the commit message
This isn't marked "v2" :(
Anyway, I'll try to piece this all together, next time it's easier to just resend the whole series...
greg k-h
Re: [PATCH 11/15] habanalabs: print pointer using %p
Quoted 11 lines · Greg KH
Quoted 7 lines · Oded Gabbay
Don't cast pointer to u64 to print it. Instead, print the pointer using %p.
Signed-off-by Oded Gabbay <[email protected]>---
Changes in v2:
- Add changelog in the commit messageThis isn't marked "v2" :(
Yes, sorry about that, will do better next time.
Quoted 3 lines
Anyway, I'll try to piece this all together, next time it's easier to just resend the whole series...
Got it,
Thanks,
Oded
Quoted 2 lines
greg k-h
Re: [PATCH 11/15] habanalabs: print pointer using %p
In reply to Oded GabbayQuoted 2 lines · Oded Gabbay
Don't cast pointer to u64 to print it. Instead, print the pointer using %p.
You might want to use %px here if you _really_
want the actual address and not the hashed output
%p normally produces.
drivers/misc/habanalabs/goya/goya.c
Quoted 1 line
drivers/misc/habanalabs/goya/goya.c +0
-0
[]
Quoted 9 lines
drivers/misc/habanalabs/goya/goya.c +2
-3@@ -4276,9 +4276,8 @@ static int goya_parse_cb_no_ext_quque(struct hl_device *hdev,return 0 ;dev_err (hdev->dev, -"Internal CB address 0x%llx + 0x%x is not in SRAM nor in DRAM\n" , - (u64 ) (uintptr_t ) parser->user_cb, - parser->user_cb_size); +"Internal CB address %p + 0x%x is not in SRAM nor in DRAM\n" , + parser->user_cb, parser->user_cb_size);
Re: [PATCH 11/15] habanalabs: print pointer using %p
Quoted 8 lines · Joe Perches
Quoted 2 lines · Oded Gabbay
Don't cast pointer to u64 to print it. Instead, print the pointer using %p.
You might want to use %px here if you _really_
want the actual address and not the hashed output
%p normally produces.
Yes, you are correct. Thanks for pointing it out, I'll fix that. Oded
Quoted 14 lines
drivers/misc/habanalabs/goya/goya.c
Quoted 2 lines
drivers/misc/habanalabs/goya/goya.c +0
-0[]
Quoted 9 lines
drivers/misc/habanalabs/goya/goya.c +2
-3@@ -4276,9 +4276,8 @@ static int goya_parse_cb_no_ext_quque(struct hl_device *hdev,return 0 ;dev_err (hdev->dev, -"Internal CB address 0x%llx + 0x%x is not in SRAM nor in DRAM\n" , - (u64 ) (uintptr_t ) parser->user_cb, - parser->user_cb_size); +"Internal CB address %p + 0x%x is not in SRAM nor in DRAM\n" , + parser->user_cb, parser->user_cb_size);