[PATCH 0/2] Address issues in dma-debug API

From: Alexander Duyck
Date: Mon Mar 18 2013 - 18:14:57 EST


Christoph Paasch recently reported a "device driver failed to check map
error" on igb. However after reviewing the code there was no possibility of
that. On closer inspection there was a bug in the DMA debug API that was
causing the issue. These two patches address the issues I found.

The first issue I found while trying to implement a workaround. Specifically
the problem is a locking bug which is triggered if a multiple mapped buffer
exists and there is not an exact match for the unmap. This results in the CPU
becoming deadlocked.

The second issue, which was the original problem, is resolved by guaranteeing
that if we call dma_mapping_error we set a matching entry to MAP_ERR_CHECKED
that was not previously set.

I'm not sure if these are critical enough to go into one of the upcoming RC
kernels or if these can wait until the merge since this is in a debugging API.
I'm leaving that for the sub-maintainers to decide.

---

Alexander Duyck (2):
dma-debug: Fix locking bug in check_unmap
dma-debug: Update DMA debug API to better handle multiple mappings of a buffer


lib/dma-debug.c | 42 ++++++++++++++++++++++++++++--------------
1 files changed, 28 insertions(+), 14 deletions(-)

--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/