* [PATCH] mmc: davinci_mmc: add warnings for edma failures
@ 2014-11-22 0:00 Angelo Dureghello
2014-11-27 9:50 ` Fwd: " Angelo Dureghello
2014-11-27 10:04 ` Ulf Hansson
0 siblings, 2 replies; 5+ messages in thread
From: Angelo Dureghello @ 2014-11-22 0:00 UTC (permalink / raw)
To: linux-mmc
Add warnings in case the edma engine driver fails to allocate slots or
channels requested from the davinci_mmc driver.
Some ti-davinci based boards (i.e. board-da850-evm.c) are asking for
some reserved chans / slots at board init stage. Later, the mmc driver
results in a silent locked state.
Signed-off-by: Angelo Dureghello <angelo <at> sysam.it>
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 5d4c5e0..65d4990 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -439,8 +439,8 @@ static int mmc_davinci_send_dma_request(struct
mmc_davinci_host *host,
DMA_MEM_TO_DEV,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc) {
- dev_dbg(mmc_dev(host->mmc),
- "failed to allocate DMA TX descriptor");
+ WARN(1, KERN_WARNING
+ "failed to allocate DMA TX descriptor\n");
ret = -1;
goto out;
}
@@ -461,8 +461,8 @@ static int mmc_davinci_send_dma_request(struct
mmc_davinci_host *host,
DMA_DEV_TO_MEM,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc) {
- dev_dbg(mmc_dev(host->mmc),
- "failed to allocate DMA RX descriptor");
+ WARN(1, KERN_WARNING
+ "failed to allocate DMA RX descriptor\n");
ret = -1;
goto out;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Fwd: [PATCH] mmc: davinci_mmc: add warnings for edma failures
2014-11-22 0:00 [PATCH] mmc: davinci_mmc: add warnings for edma failures Angelo Dureghello
@ 2014-11-27 9:50 ` Angelo Dureghello
2014-11-27 10:04 ` Ulf Hansson
1 sibling, 0 replies; 5+ messages in thread
From: Angelo Dureghello @ 2014-11-27 9:50 UTC (permalink / raw)
To: linux-mmc
Dear all,
would like some feedback / comment to this patch.
Even a NACK is good if you find it nonsense or un-useful, just
to close the loop.
Regards
angelo
-------- Original Message --------
Message-ID: <546FD21C.7010208@sysam.it>
Date: Sat, 22 Nov 2014 01:00:28 +0100
From: Angelo Dureghello <angelo@sysam.it>
User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101
Icedove/24.5.0
MIME-Version: 1.0
To: linux-mmc@vger.kernel.org
Subject: [PATCH] mmc: davinci_mmc: add warnings for edma failures
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Add warnings in case the edma engine driver fails to allocate slots or
channels requested from the davinci_mmc driver.
Some ti-davinci based boards (i.e. board-da850-evm.c) are asking for
some reserved chans / slots at board init stage. Later, the mmc driver
results in a silent locked state.
Signed-off-by: Angelo Dureghello <angelo <at> sysam.it>
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 5d4c5e0..65d4990 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -439,8 +439,8 @@ static int mmc_davinci_send_dma_request(struct
mmc_davinci_host *host,
DMA_MEM_TO_DEV,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc) {
- dev_dbg(mmc_dev(host->mmc),
- "failed to allocate DMA TX descriptor");
+ WARN(1, KERN_WARNING
+ "failed to allocate DMA TX descriptor\n");
ret = -1;
goto out;
}
@@ -461,8 +461,8 @@ static int mmc_davinci_send_dma_request(struct
mmc_davinci_host *host,
DMA_DEV_TO_MEM,
DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
if (!desc) {
- dev_dbg(mmc_dev(host->mmc),
- "failed to allocate DMA RX descriptor");
+ WARN(1, KERN_WARNING
+ "failed to allocate DMA RX descriptor\n");
ret = -1;
goto out;
}
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: davinci_mmc: add warnings for edma failures
2014-11-22 0:00 [PATCH] mmc: davinci_mmc: add warnings for edma failures Angelo Dureghello
2014-11-27 9:50 ` Fwd: " Angelo Dureghello
@ 2014-11-27 10:04 ` Ulf Hansson
2014-11-27 10:18 ` Angelo Dureghello
1 sibling, 1 reply; 5+ messages in thread
From: Ulf Hansson @ 2014-11-27 10:04 UTC (permalink / raw)
To: Angelo Dureghello; +Cc: linux-mmc
On 22 November 2014 at 01:00, Angelo Dureghello <angelo@sysam.it> wrote:
> Add warnings in case the edma engine driver fails to allocate slots or
> channels requested from the davinci_mmc driver.
>
> Some ti-davinci based boards (i.e. board-da850-evm.c) are asking for
> some reserved chans / slots at board init stage. Later, the mmc driver
> results in a silent locked state.
So why does davinci_acquire_dma_channels() succeed then? Isn't that
real problem you should be looking into?
Kind regards
Uffe
>
> Signed-off-by: Angelo Dureghello <angelo <at> sysam.it>
>
> diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
> index 5d4c5e0..65d4990 100644
> --- a/drivers/mmc/host/davinci_mmc.c
> +++ b/drivers/mmc/host/davinci_mmc.c
> @@ -439,8 +439,8 @@ static int mmc_davinci_send_dma_request(struct
> mmc_davinci_host *host,
> DMA_MEM_TO_DEV,
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> if (!desc) {
> - dev_dbg(mmc_dev(host->mmc),
> - "failed to allocate DMA TX descriptor");
> + WARN(1, KERN_WARNING
> + "failed to allocate DMA TX descriptor\n");
> ret = -1;
> goto out;
> }
> @@ -461,8 +461,8 @@ static int mmc_davinci_send_dma_request(struct
> mmc_davinci_host *host,
> DMA_DEV_TO_MEM,
> DMA_PREP_INTERRUPT | DMA_CTRL_ACK);
> if (!desc) {
> - dev_dbg(mmc_dev(host->mmc),
> - "failed to allocate DMA RX descriptor");
> + WARN(1, KERN_WARNING
> + "failed to allocate DMA RX descriptor\n");
> ret = -1;
> goto out;
> }
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: davinci_mmc: add warnings for edma failures
2014-11-27 10:04 ` Ulf Hansson
@ 2014-11-27 10:18 ` Angelo Dureghello
2014-11-28 11:20 ` Ulf Hansson
0 siblings, 1 reply; 5+ messages in thread
From: Angelo Dureghello @ 2014-11-27 10:18 UTC (permalink / raw)
To: linux-mmc; +Cc: Ulf Hansson
Hi Uffe,
many hanks for the reply,
>> Add warnings in case the edma engine driver fails to allocate slots or
>> channels requested from the davinci_mmc driver.
>>
>> Some ti-davinci based boards (i.e. board-da850-evm.c) are asking for
>> some reserved chans / slots at board init stage. Later, the mmc driver
>> results in a silent locked state.
>
> So why does davinci_acquire_dma_channels() succeed then? Isn't that
> real problem you should be looking into?
i explain with more details,
my custom am1808 board initialization, based on
arch/arm/mach-davinci/board-da850-evm.c, reserves some dma chans / slots
for the audio at
early boot.
While on kernel 3.5.1 mmc was working properly, moving to kernel
3.17.0, due to the dma-engine wrapper introduction (to be selected
into menuconfig), the mmc host driver locks silently. System cannot
even "reboot" after the failed attempt to reserve the dma slots.
I hardly found out the reason due to missing of clear warnings.
So there is nothing to fix in any other place. Simply, i am suggesting
a more visible warning so the driver, instead of lock-up silently,
throws a problem.
Feel free to add or discard the patch, as you can see it is nothing
functional.
Regards,
Angelo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mmc: davinci_mmc: add warnings for edma failures
2014-11-27 10:18 ` Angelo Dureghello
@ 2014-11-28 11:20 ` Ulf Hansson
0 siblings, 0 replies; 5+ messages in thread
From: Ulf Hansson @ 2014-11-28 11:20 UTC (permalink / raw)
To: Angelo Dureghello; +Cc: linux-mmc
On 27 November 2014 at 11:18, Angelo Dureghello <angelo@sysam.it> wrote:
> Hi Uffe,
>
> many hanks for the reply,
>
>>> Add warnings in case the edma engine driver fails to allocate slots or
>>> channels requested from the davinci_mmc driver.
>>>
>>> Some ti-davinci based boards (i.e. board-da850-evm.c) are asking for
>>> some reserved chans / slots at board init stage. Later, the mmc driver
>>> results in a silent locked state.
>>
>> So why does davinci_acquire_dma_channels() succeed then? Isn't that
>> real problem you should be looking into?
>
> i explain with more details,
>
> my custom am1808 board initialization, based on
> arch/arm/mach-davinci/board-da850-evm.c, reserves some dma chans / slots for
> the audio at
> early boot.
>
> While on kernel 3.5.1 mmc was working properly, moving to kernel
> 3.17.0, due to the dma-engine wrapper introduction (to be selected
> into menuconfig), the mmc host driver locks silently. System cannot
> even "reboot" after the failed attempt to reserve the dma slots.
>
> I hardly found out the reason due to missing of clear warnings.
>
> So there is nothing to fix in any other place. Simply, i am suggesting
> a more visible warning so the driver, instead of lock-up silently,
> throws a problem.
I understand, thanks for clarifying.
So apparently the error handling for this path isn't working. I think
we should fix that instead of just WARN about it.
Kind regards
Uffe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-11-28 11:20 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-22 0:00 [PATCH] mmc: davinci_mmc: add warnings for edma failures Angelo Dureghello
2014-11-27 9:50 ` Fwd: " Angelo Dureghello
2014-11-27 10:04 ` Ulf Hansson
2014-11-27 10:18 ` Angelo Dureghello
2014-11-28 11:20 ` Ulf Hansson
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.