Only READ data transfers actually send a data available interrupt.
Therefore, check if the transfer is a read and wait for the data only in
this case.

Signed-off-by: Michael Tretter <m.tret...@pengutronix.de>
---

Hi Michael,

On Tue, 18 May 2021 08:09:47 +0000, Michael Graichen wrote:
> > This looks familiar. I have a similar patch that sets SDHCI_INT_DATA_AVAIL
> > only if the command is a READ, but I didn't yet have time to verify, that 
> > this
> > is the correct fix.
>
> Can you please send it to me?

Here you are. I am not sure, if the fix is correct. I also added another
patch to handle situations where data is NULL, but I am not entirely sure
about that one either.

Michael
---
 drivers/mci/arasan-sdhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mci/arasan-sdhci.c b/drivers/mci/arasan-sdhci.c
index 520bf30ff952..399966e8cf10 100644
--- a/drivers/mci/arasan-sdhci.c
+++ b/drivers/mci/arasan-sdhci.c
@@ -277,7 +277,7 @@ static int arasan_sdhci_send_cmd(struct mci_host *mci, 
struct mci_cmd *cmd,
        sdhci_write32(&host->sdhci, SDHCI_INT_STATUS, ~0);
 
        mask = SDHCI_INT_CMD_COMPLETE;
-       if (data)
+       if (data && data->flags == MMC_DATA_READ)
                mask |= SDHCI_INT_DATA_AVAIL;
 
        sdhci_set_cmd_xfer_mode(&host->sdhci, cmd, data, false, &command, 
&xfer);
-- 
2.29.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to