* [PATCH 0/2] misc: fastrpc: minor fixes.
@ 2019-02-15 10:40 Srinivas Kandagatla
2019-02-15 10:40 ` [PATCH 1/2] misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER Srinivas Kandagatla
2019-02-15 10:40 ` [PATCH 2/2] misc: fastrpc: Fix device_open when no session is available Srinivas Kandagatla
0 siblings, 2 replies; 4+ messages in thread
From: Srinivas Kandagatla @ 2019-02-15 10:40 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-next, Srinivas Kandagatla
Here are two minor fixes, one to fix build error on x86 platforms
which do not have CONFIG_DMA_SHARED_BUFFER selected,
and other is to hanle possiblity of running out of compute
context banks.
Thanks,
srini
Srinivas Kandagatla (1):
misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER
Thierry Escande (1):
misc: fastrpc: Fix device_open when no session is available
drivers/misc/Kconfig | 1 +
drivers/misc/fastrpc.c | 11 ++++++++++-
2 files changed, 11 insertions(+), 1 deletion(-)
--
2.20.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER
2019-02-15 10:40 [PATCH 0/2] misc: fastrpc: minor fixes Srinivas Kandagatla
@ 2019-02-15 10:40 ` Srinivas Kandagatla
2019-02-15 23:14 ` Randy Dunlap
2019-02-15 10:40 ` [PATCH 2/2] misc: fastrpc: Fix device_open when no session is available Srinivas Kandagatla
1 sibling, 1 reply; 4+ messages in thread
From: Srinivas Kandagatla @ 2019-02-15 10:40 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-next, Srinivas Kandagatla, Randy Dunlap
Fastrpc is a dma buf exporter as well, so select the corresponding
DMA_SHARED_BUFFER config to fix below compilation errors on platforms
without this config.
ld: drivers/misc/fastrpc.o: in function 'fastrpc_free_map':
fastrpc.c:(.text+0xbe): undefined reference to 'dma_buf_unmap_attachment'
ld: fastrpc.c:(.text+0xcb): undefined reference to 'dma_buf_detach'
ld: fastrpc.c:(.text+0xd4): undefined reference to 'dma_buf_put'
ld: drivers/misc/fastrpc.o: in function 'fastrpc_map_create':
fastrpc.c:(.text+0xb2b): undefined reference to 'dma_buf_get'
ld: fastrpc.c:(.text+0xb47): undefined reference to 'dma_buf_attach'
ld: fastrpc.c:(.text+0xb61): undefined reference to 'dma_buf_map_attachment'
ld: fastrpc.c:(.text+0xc36): undefined reference to 'dma_buf_put'
ld: fastrpc.c:(.text+0xc48): undefined reference to 'dma_buf_detach'
ld: drivers/misc/fastrpc.o: in function 'fastrpc_device_ioctl':
fastrpc.c:(.text+0x1756): undefined reference to 'dma_buf_get'
ld: fastrpc.c:(.text+0x1776): undefined reference to 'dma_buf_put'
ld: fastrpc.c:(.text+0x1780): undefined reference to 'dma_buf_put'
ld: fastrpc.c:(.text+0x1abf): undefined reference to 'dma_buf_export'
ld: fastrpc.c:(.text+0x1ae7): undefined reference to 'dma_buf_fd'
ld: fastrpc.c:(.text+0x1cb5): undefined reference to 'dma_buf_put'
ld: fastrpc.c:(.text+0x1cca): undefined reference to 'dma_buf_put'
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/misc/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
index 7e0726253755..53cd16f795d6 100644
--- a/drivers/misc/Kconfig
+++ b/drivers/misc/Kconfig
@@ -299,6 +299,7 @@ config QCOM_FASTRPC
tristate "Qualcomm FastRPC"
depends on ARCH_QCOM || COMPILE_TEST
depends on RPMSG
+ select DMA_SHARED_BUFFER
help
Provides a communication mechanism that allows for clients to
make remote method invocations across processor boundary to
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] misc: fastrpc: Fix device_open when no session is available
2019-02-15 10:40 [PATCH 0/2] misc: fastrpc: minor fixes Srinivas Kandagatla
2019-02-15 10:40 ` [PATCH 1/2] misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER Srinivas Kandagatla
@ 2019-02-15 10:40 ` Srinivas Kandagatla
1 sibling, 0 replies; 4+ messages in thread
From: Srinivas Kandagatla @ 2019-02-15 10:40 UTC (permalink / raw)
To: gregkh; +Cc: linux-kernel, linux-next, Thierry Escande, Srinivas Kandagatla
From: Thierry Escande <thierry.escande@linaro.org>
This change fixes fastrpc_device_open() when no session is available and
return an error in such case.
Signed-off-by: Thierry Escande <thierry.escande@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
drivers/misc/fastrpc.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
index 4b0db33896df..89aec17738ef 100644
--- a/drivers/misc/fastrpc.c
+++ b/drivers/misc/fastrpc.c
@@ -1016,10 +1016,19 @@ static int fastrpc_device_open(struct inode *inode, struct file *filp)
INIT_LIST_HEAD(&fl->user);
fl->tgid = current->tgid;
fl->cctx = cctx;
+
+ fl->sctx = fastrpc_session_alloc(cctx);
+ if (!fl->sctx) {
+ dev_err(&cctx->rpdev->dev, "No session available\n");
+ mutex_destroy(&fl->mutex);
+ kfree(fl);
+
+ return -EBUSY;
+ }
+
spin_lock(&cctx->lock);
list_add_tail(&fl->user, &cctx->users);
spin_unlock(&cctx->lock);
- fl->sctx = fastrpc_session_alloc(cctx);
return 0;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER
2019-02-15 10:40 ` [PATCH 1/2] misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER Srinivas Kandagatla
@ 2019-02-15 23:14 ` Randy Dunlap
0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2019-02-15 23:14 UTC (permalink / raw)
To: Srinivas Kandagatla, gregkh; +Cc: linux-kernel, linux-next
On 2/15/19 2:40 AM, Srinivas Kandagatla wrote:
> Fastrpc is a dma buf exporter as well, so select the corresponding
> DMA_SHARED_BUFFER config to fix below compilation errors on platforms
> without this config.
>
> ld: drivers/misc/fastrpc.o: in function 'fastrpc_free_map':
> fastrpc.c:(.text+0xbe): undefined reference to 'dma_buf_unmap_attachment'
> ld: fastrpc.c:(.text+0xcb): undefined reference to 'dma_buf_detach'
> ld: fastrpc.c:(.text+0xd4): undefined reference to 'dma_buf_put'
> ld: drivers/misc/fastrpc.o: in function 'fastrpc_map_create':
> fastrpc.c:(.text+0xb2b): undefined reference to 'dma_buf_get'
> ld: fastrpc.c:(.text+0xb47): undefined reference to 'dma_buf_attach'
> ld: fastrpc.c:(.text+0xb61): undefined reference to 'dma_buf_map_attachment'
> ld: fastrpc.c:(.text+0xc36): undefined reference to 'dma_buf_put'
> ld: fastrpc.c:(.text+0xc48): undefined reference to 'dma_buf_detach'
> ld: drivers/misc/fastrpc.o: in function 'fastrpc_device_ioctl':
> fastrpc.c:(.text+0x1756): undefined reference to 'dma_buf_get'
> ld: fastrpc.c:(.text+0x1776): undefined reference to 'dma_buf_put'
> ld: fastrpc.c:(.text+0x1780): undefined reference to 'dma_buf_put'
> ld: fastrpc.c:(.text+0x1abf): undefined reference to 'dma_buf_export'
> ld: fastrpc.c:(.text+0x1ae7): undefined reference to 'dma_buf_fd'
> ld: fastrpc.c:(.text+0x1cb5): undefined reference to 'dma_buf_put'
> ld: fastrpc.c:(.text+0x1cca): undefined reference to 'dma_buf_put'
>
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Thanks.
> ---
> drivers/misc/Kconfig | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
> index 7e0726253755..53cd16f795d6 100644
> --- a/drivers/misc/Kconfig
> +++ b/drivers/misc/Kconfig
> @@ -299,6 +299,7 @@ config QCOM_FASTRPC
> tristate "Qualcomm FastRPC"
> depends on ARCH_QCOM || COMPILE_TEST
> depends on RPMSG
> + select DMA_SHARED_BUFFER
> help
> Provides a communication mechanism that allows for clients to
> make remote method invocations across processor boundary to
>
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-02-15 23:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 10:40 [PATCH 0/2] misc: fastrpc: minor fixes Srinivas Kandagatla
2019-02-15 10:40 ` [PATCH 1/2] misc: fastrpc: select CONFIG_DMA_SHARED_BUFFER Srinivas Kandagatla
2019-02-15 23:14 ` Randy Dunlap
2019-02-15 10:40 ` [PATCH 2/2] misc: fastrpc: Fix device_open when no session is available Srinivas Kandagatla
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).