Message ID | CACRpkdatPkr0Y-FvegwXMJB41nmN-KArXhwpZj0nR9f7SyyvmQ@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> OK that doesn't work. Scratch that patch. What about this instead?
That is working.
I did some quick testing with time and dd again.
#time dd if=/dev/zero of=test bs=1M count=4
real 0m1.898s
user 0m0.002s
sys 0m0.392s
#time dd if=/dev/zero of=test bs=1M count=8
real 0m5.292s
user 0m0.004s
sys 0m0.772s
#time dd if=/dev/zero of=test bs=1M count=16
real 0m10.130s
user 0m0.009s
sys 0m1.479s
#time dd if=/dev/zero of=test bs=1M count=32
real 0m18.752s
user 0m0.001s
sys 0m2.934s
Looks good to me. So far.
Kind regards,
Benjamin Beckmeyer
--
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
On Mon, Jan 22, 2018 at 10:59 AM, Benjamin Beckmeyer <beckmeyer.b@rittal.de> wrote: >> OK that doesn't work. Scratch that patch. What about this instead? > > That is working. OK so it was just my random abuse of the DMA API. Sorry for my shitty code that of course works fine on the DMA-coherent x86... > I did some quick testing with time and dd again. OK :) I'll fold this patch into the original, tag with your Tested-by and send out as non-RFC. Yours, Linus Walleij -- 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
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 25b5e598ee6d..416e94dead4f 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -523,7 +523,7 @@ static int sdhci_pre_dma_transfer(struct sdhci_host *host, dma_sync_single_for_device(host->mmc->parent, host->bounce_addr, host->bounce_buffer_size, - DMA_TO_DEVICE); + mmc_get_dma_dir(data)); /* Just a dummy value */ sg_count = 1; } else { @@ -2422,6 +2422,12 @@ static bool sdhci_request_done(struct sdhci_host *host) data->sg_len, host->bounce_buffer, length); + } else { + dma_sync_single_for_cpu( + host->mmc->parent, + host->bounce_addr, + host->bounce_buffer_size, + mmc_get_dma_dir(data)); } } else { /* Unmap the raw data */