This is a note to let you know that I've just added the patch titled mtip32xx: Unmap the DMA segments before completing the IO request to the 3.14-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: mtip32xx-unmap-the-dma-segments-before-completing-the-io-request.patch and it can be found in the queue-3.14 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 368c89d7ac70f937c93cd6f3b65bcfdfb3ba794f Mon Sep 17 00:00:00 2001 From: Felipe Franciosi <felipe@xxxxxxxxxxxx> Date: Thu, 13 Mar 2014 14:34:21 +0000 Subject: mtip32xx: Unmap the DMA segments before completing the IO request From: Felipe Franciosi <felipe@xxxxxxxxxxxx> commit 368c89d7ac70f937c93cd6f3b65bcfdfb3ba794f upstream. If the buffers are unmapped after completing a request, then stale data might be in the request. Signed-off-by: Felipe Franciosi <felipe@xxxxxxxxxxxx> Signed-off-by: Jens Axboe <axboe@xxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- drivers/block/mtip32xx/mtip32xx.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -266,6 +266,12 @@ static void mtip_async_complete(struct m "Command tag %d failed due to TFE\n", tag); } + /* Unmap the DMA scatter list entries */ + dma_unmap_sg(&dd->pdev->dev, + command->sg, + command->scatter_ents, + command->direction); + /* Upper layer callback */ if (likely(command->async_callback)) command->async_callback(command->async_data, cb_status); @@ -273,12 +279,6 @@ static void mtip_async_complete(struct m command->async_callback = NULL; command->comp_func = NULL; - /* Unmap the DMA scatter list entries */ - dma_unmap_sg(&dd->pdev->dev, - command->sg, - command->scatter_ents, - command->direction); - /* Clear the allocated and active bits for the command */ atomic_set(&port->commands[tag].active, 0); release_slot(port, tag); @@ -709,6 +709,12 @@ static void mtip_timeout_function(unsign */ writel(1 << bit, port->completed[group]); + /* Unmap the DMA scatter list entries */ + dma_unmap_sg(&port->dd->pdev->dev, + command->sg, + command->scatter_ents, + command->direction); + /* Call the async completion callback. */ if (likely(command->async_callback)) command->async_callback(command->async_data, @@ -716,12 +722,6 @@ static void mtip_timeout_function(unsign command->async_callback = NULL; command->comp_func = NULL; - /* Unmap the DMA scatter list entries */ - dma_unmap_sg(&port->dd->pdev->dev, - command->sg, - command->scatter_ents, - command->direction); - /* * Clear the allocated bit and active tag for the * command. Patches currently in stable-queue which might be from felipe@xxxxxxxxxxxx are queue-3.14/mtip32xx-set-queue-bounce-limit.patch queue-3.14/mtip32xx-unmap-the-dma-segments-before-completing-the-io-request.patch -- To unsubscribe from this list: send the line "unsubscribe stable" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html