* [PATCH v2 08/15] habanalabs: add comments in uapi/misc/habanalabs.h
@ 2019-02-28 9:55 Oded Gabbay
2019-02-28 9:55 ` [PATCH 11/15] habanalabs: print pointer using %p Oded Gabbay
0 siblings, 1 reply; 6+ messages in thread
From: Oded Gabbay @ 2019-02-28 9:55 UTC (permalink / raw)
To: gregkh, linux-kernel
Add comment about minimum and maximum size of command buffer.
Add some text about the expected input of CS IOCTL.
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
Changes in v2:
- Add changelog in the commit message
include/uapi/misc/habanalabs.h | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/uapi/misc/habanalabs.h b/include/uapi/misc/habanalabs.h
index 23d6ad3459cb..7fd6f633534c 100644
--- a/include/uapi/misc/habanalabs.h
+++ b/include/uapi/misc/habanalabs.h
@@ -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
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 11/15] habanalabs: print pointer using %p
2019-02-28 9:55 [PATCH v2 08/15] habanalabs: add comments in uapi/misc/habanalabs.h Oded Gabbay
@ 2019-02-28 9:55 ` Oded Gabbay
2019-02-28 12:01 ` Greg KH
2019-03-02 1:00 ` Joe Perches
0 siblings, 2 replies; 6+ messages in thread
From: Oded Gabbay @ 2019-02-28 9:55 UTC (permalink / raw)
To: gregkh, linux-kernel
Don't cast pointer to u64 to print it. Instead, print the pointer using
%p.
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
---
Changes in v2:
- Add changelog in the commit message
drivers/misc/habanalabs/goya/goya.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
index 13923f4127af..39824214ce61 100644
--- a/drivers/misc/habanalabs/goya/goya.c
+++ b/drivers/misc/habanalabs/goya/goya.c
@@ -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;
}
--
2.17.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 11/15] habanalabs: print pointer using %p
2019-02-28 9:55 ` [PATCH 11/15] habanalabs: print pointer using %p Oded Gabbay
@ 2019-02-28 12:01 ` Greg KH
2019-02-28 12:59 ` Oded Gabbay
2019-03-02 1:00 ` Joe Perches
1 sibling, 1 reply; 6+ messages in thread
From: Greg KH @ 2019-02-28 12:01 UTC (permalink / raw)
To: Oded Gabbay; +Cc: linux-kernel
On Thu, Feb 28, 2019 at 11:55:45AM +0200, Oded Gabbay wrote:
> Don't cast pointer to u64 to print it. Instead, print the pointer using
> %p.
>
> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
> ---
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 11/15] habanalabs: print pointer using %p
2019-02-28 12:01 ` Greg KH
@ 2019-02-28 12:59 ` Oded Gabbay
0 siblings, 0 replies; 6+ messages in thread
From: Oded Gabbay @ 2019-02-28 12:59 UTC (permalink / raw)
To: Greg KH; +Cc: Linux-Kernel@Vger. Kernel. Org
On Thu, Feb 28, 2019 at 2:02 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Thu, Feb 28, 2019 at 11:55:45AM +0200, Oded Gabbay wrote:
> > Don't cast pointer to u64 to print it. Instead, print the pointer using
> > %p.
> >
> > Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
> > ---
> > Changes in v2:
> > - Add changelog in the commit message
>
> This isn't marked "v2" :(
Yes, sorry about that, will do better next time.
>
> Anyway, I'll try to piece this all together, next time it's easier to
> just resend the whole series...
Got it,
Thanks,
Oded
>
> greg k-h
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 11/15] habanalabs: print pointer using %p
2019-02-28 9:55 ` [PATCH 11/15] habanalabs: print pointer using %p Oded Gabbay
2019-02-28 12:01 ` Greg KH
@ 2019-03-02 1:00 ` Joe Perches
2019-03-02 9:36 ` Oded Gabbay
1 sibling, 1 reply; 6+ messages in thread
From: Joe Perches @ 2019-03-02 1:00 UTC (permalink / raw)
To: Oded Gabbay, gregkh, linux-kernel
On Thu, 2019-02-28 at 11:55 +0200, Oded Gabbay wrote:
> 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.
> diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
[]
> @@ -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);
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 11/15] habanalabs: print pointer using %p
2019-03-02 1:00 ` Joe Perches
@ 2019-03-02 9:36 ` Oded Gabbay
0 siblings, 0 replies; 6+ messages in thread
From: Oded Gabbay @ 2019-03-02 9:36 UTC (permalink / raw)
To: Joe Perches; +Cc: Greg Kroah-Hartman, Linux-Kernel@Vger. Kernel. Org
On Sat, Mar 2, 2019 at 3:00 AM Joe Perches <joe@perches.com> wrote:
>
> On Thu, 2019-02-28 at 11:55 +0200, Oded Gabbay wrote:
> > 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
>
> > diff --git a/drivers/misc/habanalabs/goya/goya.c b/drivers/misc/habanalabs/goya/goya.c
> []
> > @@ -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);
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-03-02 9:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-28 9:55 [PATCH v2 08/15] habanalabs: add comments in uapi/misc/habanalabs.h Oded Gabbay
2019-02-28 9:55 ` [PATCH 11/15] habanalabs: print pointer using %p Oded Gabbay
2019-02-28 12:01 ` Greg KH
2019-02-28 12:59 ` Oded Gabbay
2019-03-02 1:00 ` Joe Perches
2019-03-02 9:36 ` Oded Gabbay
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).