diff mbox

[3/4] mmc: pxamci: Disable DATA_TRAN_DONE interrupt sooner

Message ID 04139c1a-cee8-f64c-4b0e-2e3c472169a3@tul.cz (mailing list archive)
State New, archived
Headers show

Commit Message

Petr Cvek April 18, 2017, 11:17 p.m. UTC
Disable the DATA_TRAN_DONE interrupt as soon as possible in the handler.

Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
 drivers/mmc/host/pxamci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Robert Jarzmik April 19, 2017, 7:14 p.m. UTC | #1
Petr Cvek <petr.cvek@tul.cz> writes:

> Disable the DATA_TRAN_DONE interrupt as soon as possible in the handler.
Yeah, but why, please explain.
If that's only to "reduce" the race occurrence, then I'd rather have this patch
dropped. Otherwise if there is a compelling reason let's see ...

Cheers.
Petr Cvek April 20, 2017, 11:37 p.m. UTC | #2
Dne 19.4.2017 v 21:14 Robert Jarzmik napsal(a):
> Petr Cvek <petr.cvek@tul.cz> writes:
> 
>> Disable the DATA_TRAN_DONE interrupt as soon as possible in the handler.
> Yeah, but why, please explain.
> If that's only to "reduce" the race occurrence, then I'd rather have this patch
> dropped. Otherwise if there is a compelling reason let's see ...
> 

I created it during researching where put the IRQ enable in the callback and then I left it that way the data done interrupt will be disabled if there was an error at the beginning of the pxamci_data_done(). 

I dropped the patch and re-tested and it works (in the case the tests at the start of the pxamci_data_done() fail there will be probably some irq hell though :-D). 

> Cheers.
>
diff mbox

Patch

diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c
index 48c26d848e9f..570735a10127 100644
--- a/drivers/mmc/host/pxamci.c
+++ b/drivers/mmc/host/pxamci.c
@@ -354,6 +354,8 @@  static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
 	struct mmc_data *data = host->data;
 	struct dma_chan *chan;
 
+	pxamci_disable_irq(host, DATA_TRAN_DONE);
+
 	if (!data) {
 		pr_err("%s: Missing data structure\n",
 			mmc_hostname(host->mmc));
@@ -389,8 +391,6 @@  static int pxamci_data_done(struct pxamci_host *host, unsigned int stat)
 	else
 		data->bytes_xfered = 0;
 
-	pxamci_disable_irq(host, DATA_TRAN_DONE);
-
 	host->data = NULL;
 	if (host->mrq->stop) {
 		pxamci_stop_clock(host);