The patch titled lib/swiotlb.c: fix strange panic message selection logic when swiotlb fills up has been removed from the -mm tree. Its filename was lib-swiotlbc-fix-strange-panic-message-selection-logic-when-swiotlb-fills-up.patch This patch was dropped because it was merged into mainline or a subsystem tree The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: lib/swiotlb.c: fix strange panic message selection logic when swiotlb fills up From: Casey Dahlin <cdahlin@xxxxxxxxxx> swiotlb_full in lib/swiotlb.c throws one of two panic messages based on whether the direction of transfer is from the device or to the device. The logic around this is somewhat weird in the case of bidirectional transfers. It appears to want to throw both in succession, but since its a panic only the first makes it. This patch adds a third, separate error for DMA_BIDIRECTIONAL to make things a bit clearer. Signed-off-by: Casey Dahlin <cdahlin@xxxxxxxxxx> Cc: Ingo Molnar <mingo@xxxxxxx> Cc: FUJITA Tomonori <fujita.tomonori@xxxxxxxxxxxxx> Cc: Becky Bruce <beckyb@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- lib/swiotlb.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff -puN lib/swiotlb.c~lib-swiotlbc-fix-strange-panic-message-selection-logic-when-swiotlb-fills-up lib/swiotlb.c --- a/lib/swiotlb.c~lib-swiotlbc-fix-strange-panic-message-selection-logic-when-swiotlb-fills-up +++ a/lib/swiotlb.c @@ -581,12 +581,15 @@ swiotlb_full(struct device *dev, size_t printk(KERN_ERR "DMA: Out of SW-IOMMU space for %zu bytes at " "device %s\n", size, dev ? dev_name(dev) : "?"); - if (size > io_tlb_overflow && do_panic) { - if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) - panic("DMA: Memory would be corrupted\n"); - if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) - panic("DMA: Random memory would be DMAed\n"); - } + if (size <= io_tlb_overflow || !do_panic) + return; + + if (dir == DMA_BIDIRECTIONAL) + panic("DMA: Random memory could be corrupted or DMAed\n"); + if (dir == DMA_FROM_DEVICE) + panic("DMA: Memory would be corrupted\n"); + if (dir == DMA_TO_DEVICE) + panic("DMA: Random memory would be DMAed\n"); } /* _ Patches currently in -mm which might be from cdahlin@xxxxxxxxxx are linux-next.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html