mmc: mmci: Fixup error handling for dma
Subsystems (2)
PATCH 1/1 mmc: mmci: Fixup error handling for dma
When getting a cmd irq during an ongoing data transfer with dma, the dma job were never terminated. This is now corrected.
--- drivers/mmc/host/mmci.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
drivers/mmc/host/mmci.c +5 -1
@@ -761,8 +761,12 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, }if (!cmd->data || cmd->error) { -if (host->data) +if (host->data) { +/* Terminate the DMA transfer */ +if (dma_inprogress (host)) +mmci_dma_data_error (host);mmci_stop_data (host); + }mmci_request_end (host, cmd->mrq); }else if (!(cmd->data->flags &MMC_DATA_READ )) {mmci_start_data (host, cmd->data);
Signature · 1 line
1.7.5.4
PATCH 1/1 mmc: mmci: Fixup error handling for dma
Quoted 6 lines · Ulf Hansson
When getting a cmd irq during an ongoing data transfer with dma, the dma job were never terminated. This is now corrected.
Signed-off-by Ulf Hansson <[email protected]>Signed-off-by Per Forlin <[email protected]>
Thanks,
Linus Walleij
PATCH 1/1 mmc: mmci: Fixup error handling for dma
In reply to Ulf Hanssondrivers/mmc/host/mmci.c mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, · line 767
Quoted 13 lines · Ulf Hansson
drivers/mmc/host/mmci.c +4
-1@@ -761,8 +761,12 @@ mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, }if (!cmd->data || cmd->error) { -if (host->data) +if (host->data) { +/* Terminate the DMA transfer */ +if (dma_inprogress (host)) +mmci_dma_data_error (host);
Doesn't this leave the DMA buffers mapped?
PATCH 1/1 mmc: mmci: Fixup error handling for dma
Quoted 8 lines · Russell King - ARM Linux
Quoted 6 lines
? ? ? if (!cmd->data ||
cmd->error) {
- ? ? ? ? ? ? if (host->data)
+ ? ? ? ? ? ? if (host->data) {
+ ? ? ? ? ? ? ? ? ? ? /* Terminate the DMA transfer */
+ ? ? ? ? ? ? ? ? ? ? if (dma_inprogress(host))
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ?mmci_dma_data_error(host);Doesn't this leave the DMA buffers mapped?
Yep it needs an mmci_dma_unmap() call too AFAICT,
Ulf will you update?
Yours,
Linus Walleij
PATCH 1/1 mmc: mmci: Fixup error handling for dma
Quoted 10 lines · Linus Walleij
Quoted 7 lines · Russell King - ARM Linux
drivers/mmc/host/mmci.c mmci_cmd_irq(struct mmci_host *host, struct mmc_command *cmd, · line 767
Quoted 6 lines
if (!cmd->data || cmd->error) {drivers/mmc/host/mmci.c +4
-1-if (host->data) +if (host->data) { +/* Terminate the DMA transfer */ +if (dma_inprogress (host)) +mmci_dma_data_error (host);Doesn't this leave the DMA buffers mapped?
Correct, but it will be handled in post_request function.
Quoted 3 lines
Yep it needs an
mmci_dma_unmap()call too AFAICT,
Ulf will you update?
Actually it's needs only dma_unmap_sg, but as stated this should be handled in mmci_post_request.
By, the way - I spoke to Per F?rlin who implemented the pre_request and post_request functions; we will soon push some clean-up patches for improved error handling and how to manage the cookie better. Right now it is kind of hard to follow the error path, I think. We hope this shall be improved then.
Although it should have nothing to do with this patch directly, since this is a bugfix only.
BR
Ulf Hansson