Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1642866 > unrolled thread
| Started by | Suman Anna <s-anna@ti.com> |
|---|---|
| First post | 2017-05-17 00:20 +0200 |
| Last post | 2017-05-22 11:30 +0200 |
| Articles | 4 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory Suman Anna <s-anna@ti.com> - 2017-05-17 00:20 +0200
Re: [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory Sekhar Nori <nsekhar@ti.com> - 2017-05-18 08:20 +0200
Re: [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory Suman Anna <s-anna@ti.com> - 2017-05-18 18:10 +0200
Re: [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory Sekhar Nori <nsekhar@ti.com> - 2017-05-22 11:30 +0200
| From | Suman Anna <s-anna@ti.com> |
|---|---|
| Date | 2017-05-17 00:20 +0200 |
| Subject | [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory |
| Message-ID | <tHSYW-371-3@gated-at.bofh.it> |
The DSP device on Davinci platforms does not have an MMU and requires
specific DDR memory to boot. This memory is reserved using the rproc_mem
kernel boot parameter and is assigned to the device on non-DT boots.
The remoteproc core uses the DMA API and so will fall back to assigning
random memory if this memory is not assigned to the device, but the DSP
remote processor boot will not be successful in such cases. So, check
that memory has been reserved and assigned to the device specifically
before even creating the DSP device.
Signed-off-by: Suman Anna <s-anna@ti.com>
---
arch/arm/mach-davinci/devices-da8xx.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index 7cf529ffbe5a..1ccf52e49886 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -814,6 +814,8 @@ static struct platform_device da8xx_dsp = {
.resource = da8xx_rproc_resources,
};
+static bool rproc_mem_inited __initdata;
+
#if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC)
static phys_addr_t rproc_base __initdata;
@@ -852,6 +854,8 @@ void __init da8xx_rproc_reserve_cma(void)
ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
if (ret)
pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
+ else
+ rproc_mem_inited = true;
}
#else
@@ -866,6 +870,12 @@ int __init da8xx_register_rproc(void)
{
int ret;
+ if (!rproc_mem_inited) {
+ pr_warn("%s: memory not reserved for DSP, not registering DSP device\n",
+ __func__);
+ return -ENOMEM;
+ }
+
ret = platform_device_register(&da8xx_dsp);
if (ret)
pr_err("%s: can't register DSP device: %d\n", __func__, ret);
--
2.12.0
[toc] | [next] | [standalone]
| From | Sekhar Nori <nsekhar@ti.com> |
|---|---|
| Date | 2017-05-18 08:20 +0200 |
| Subject | Re: [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory |
| Message-ID | <tImWZ-64l-7@gated-at.bofh.it> |
| In reply to | #1642866 |
On Wednesday 17 May 2017 03:43 AM, Suman Anna wrote:
> The DSP device on Davinci platforms does not have an MMU and requires
> specific DDR memory to boot. This memory is reserved using the rproc_mem
> kernel boot parameter and is assigned to the device on non-DT boots.
> The remoteproc core uses the DMA API and so will fall back to assigning
> random memory if this memory is not assigned to the device, but the DSP
> remote processor boot will not be successful in such cases. So, check
> that memory has been reserved and assigned to the device specifically
> before even creating the DSP device.
>
> Signed-off-by: Suman Anna <s-anna@ti.com>
> ---
> arch/arm/mach-davinci/devices-da8xx.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
> index 7cf529ffbe5a..1ccf52e49886 100644
> --- a/arch/arm/mach-davinci/devices-da8xx.c
> +++ b/arch/arm/mach-davinci/devices-da8xx.c
> @@ -814,6 +814,8 @@ static struct platform_device da8xx_dsp = {
> .resource = da8xx_rproc_resources,
> };
>
> +static bool rproc_mem_inited __initdata;
> +
> #if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC)
>
> static phys_addr_t rproc_base __initdata;
> @@ -852,6 +854,8 @@ void __init da8xx_rproc_reserve_cma(void)
> ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
> if (ret)
> pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
> + else
> + rproc_mem_inited = true;
> }
>
> #else
> @@ -866,6 +870,12 @@ int __init da8xx_register_rproc(void)
> {
> int ret;
>
> + if (!rproc_mem_inited) {
> + pr_warn("%s: memory not reserved for DSP, not registering DSP device\n",
> + __func__);
We now have a warning and an error if dma_declare_contiguous() fails. I
like this message better. So can you replace the existing error message
with this text instead ?
Thanks,
Sekhar
[toc] | [prev] | [next] | [standalone]
| From | Suman Anna <s-anna@ti.com> |
|---|---|
| Date | 2017-05-18 18:10 +0200 |
| Subject | Re: [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory |
| Message-ID | <tIw9Y-54I-17@gated-at.bofh.it> |
| In reply to | #1643840 |
Hi Sekhar,
On 05/18/2017 01:10 AM, Sekhar Nori wrote:
> On Wednesday 17 May 2017 03:43 AM, Suman Anna wrote:
>> The DSP device on Davinci platforms does not have an MMU and requires
>> specific DDR memory to boot. This memory is reserved using the rproc_mem
>> kernel boot parameter and is assigned to the device on non-DT boots.
>> The remoteproc core uses the DMA API and so will fall back to assigning
>> random memory if this memory is not assigned to the device, but the DSP
>> remote processor boot will not be successful in such cases. So, check
>> that memory has been reserved and assigned to the device specifically
>> before even creating the DSP device.
>>
>> Signed-off-by: Suman Anna <s-anna@ti.com>
>> ---
>> arch/arm/mach-davinci/devices-da8xx.c | 10 ++++++++++
>> 1 file changed, 10 insertions(+)
>>
>> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
>> index 7cf529ffbe5a..1ccf52e49886 100644
>> --- a/arch/arm/mach-davinci/devices-da8xx.c
>> +++ b/arch/arm/mach-davinci/devices-da8xx.c
>> @@ -814,6 +814,8 @@ static struct platform_device da8xx_dsp = {
>> .resource = da8xx_rproc_resources,
>> };
>>
>> +static bool rproc_mem_inited __initdata;
>> +
>> #if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC)
>>
>> static phys_addr_t rproc_base __initdata;
>> @@ -852,6 +854,8 @@ void __init da8xx_rproc_reserve_cma(void)
>> ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
>> if (ret)
>> pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
>> + else
>> + rproc_mem_inited = true;
>> }
>>
>> #else
>> @@ -866,6 +870,12 @@ int __init da8xx_register_rproc(void)
>> {
>> int ret;
>>
>> + if (!rproc_mem_inited) {
>> + pr_warn("%s: memory not reserved for DSP, not registering DSP device\n",
>> + __func__);
>
> We now have a warning and an error if dma_declare_contiguous() fails. I
> like this message better. So can you replace the existing error message
> with this text instead ?
Hmm, this trace is not just covering the dma_declare_contiguous failure.
There can be two different errors in da8xx_rproc_reserve_cma, and this
trace only shows up when the device is being registered. So not sure how
your suggestion improves anything by dropping/replacing one of them.
regards
Suman
[toc] | [prev] | [next] | [standalone]
| From | Sekhar Nori <nsekhar@ti.com> |
|---|---|
| Date | 2017-05-22 11:30 +0200 |
| Subject | Re: [PATCH 1/3] ARM: davinci: da8xx: Create DSP device only when assigned memory |
| Message-ID | <tJRP5-3Ve-37@gated-at.bofh.it> |
| In reply to | #1644717 |
On Thursday 18 May 2017 09:29 PM, Suman Anna wrote:
> Hi Sekhar,
>
> On 05/18/2017 01:10 AM, Sekhar Nori wrote:
>> On Wednesday 17 May 2017 03:43 AM, Suman Anna wrote:
>>> The DSP device on Davinci platforms does not have an MMU and requires
>>> specific DDR memory to boot. This memory is reserved using the rproc_mem
>>> kernel boot parameter and is assigned to the device on non-DT boots.
>>> The remoteproc core uses the DMA API and so will fall back to assigning
>>> random memory if this memory is not assigned to the device, but the DSP
>>> remote processor boot will not be successful in such cases. So, check
>>> that memory has been reserved and assigned to the device specifically
>>> before even creating the DSP device.
>>>
>>> Signed-off-by: Suman Anna <s-anna@ti.com>
>>> ---
>>> arch/arm/mach-davinci/devices-da8xx.c | 10 ++++++++++
>>> 1 file changed, 10 insertions(+)
>>>
>>> diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
>>> index 7cf529ffbe5a..1ccf52e49886 100644
>>> --- a/arch/arm/mach-davinci/devices-da8xx.c
>>> +++ b/arch/arm/mach-davinci/devices-da8xx.c
>>> @@ -814,6 +814,8 @@ static struct platform_device da8xx_dsp = {
>>> .resource = da8xx_rproc_resources,
>>> };
>>>
>>> +static bool rproc_mem_inited __initdata;
>>> +
>>> #if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC)
>>>
>>> static phys_addr_t rproc_base __initdata;
>>> @@ -852,6 +854,8 @@ void __init da8xx_rproc_reserve_cma(void)
>>> ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
>>> if (ret)
>>> pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
>>> + else
>>> + rproc_mem_inited = true;
>>> }
>>>
>>> #else
>>> @@ -866,6 +870,12 @@ int __init da8xx_register_rproc(void)
>>> {
>>> int ret;
>>>
>>> + if (!rproc_mem_inited) {
>>> + pr_warn("%s: memory not reserved for DSP, not registering DSP device\n",
>>> + __func__);
>>
>> We now have a warning and an error if dma_declare_contiguous() fails. I
>> like this message better. So can you replace the existing error message
>> with this text instead ?
>
> Hmm, this trace is not just covering the dma_declare_contiguous failure.
> There can be two different errors in da8xx_rproc_reserve_cma, and this
I seem to have missed that part. I now applied this series to v4.13/soc.
I don't have a branch in linux-next. So, it may be a while before it
ends up there. But I do merge all the patches I apply to master branch
of my tree.
Thanks,
Sekhar
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web