diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/list_debug.c | 39 | ||||
| -rw-r--r-- | lib/swiotlb.c | 6 |
2 files changed, 30 insertions, 15 deletions
diff --git a/lib/list_debug.c b/lib/list_debug.c index 344c710d16c..b8029a5583f 100644 --- a/lib/list_debug.c +++ b/lib/list_debug.c | |||
| @@ -35,6 +35,31 @@ void __list_add(struct list_head *new, | |||
| 35 | } | 35 | } |
| 36 | EXPORT_SYMBOL(__list_add); | 36 | EXPORT_SYMBOL(__list_add); |
| 37 | 37 | ||
| 38 | void __list_del_entry(struct list_head *entry) | ||
| 39 | { | ||
| 40 | struct list_head *prev, *next; | ||
| 41 | |||
| 42 | prev = entry->prev; | ||
| 43 | next = entry->next; | ||
| 44 | |||
| 45 | if (WARN(next == LIST_POISON1, | ||
| 46 | "list_del corruption, %p->next is LIST_POISON1 (%p)\n", | ||
| 47 | entry, LIST_POISON1) || | ||
| 48 | WARN(prev == LIST_POISON2, | ||
| 49 | "list_del corruption, %p->prev is LIST_POISON2 (%p)\n", | ||
| 50 | entry, LIST_POISON2) || | ||
| 51 | WARN(prev->next != entry, | ||
| 52 | "list_del corruption. prev->next should be %p, " | ||
| 53 | "but was %p\n", entry, prev->next) || | ||
| 54 | WARN(next->prev != entry, | ||
| 55 | "list_del corruption. next->prev should be %p, " | ||
| 56 | "but was %p\n", entry, next->prev)) | ||
| 57 | return; | ||
| 58 | |||
| 59 | __list_del(prev, next); | ||
| 60 | } | ||
| 61 | EXPORT_SYMBOL(__list_del_entry); | ||
| 62 | |||
| 38 | /** | 63 | /** |
| 39 | * list_del - deletes entry from list. | 64 | * list_del - deletes entry from list. |
| 40 | * @entry: the element to delete from the list. | 65 | * @entry: the element to delete from the list. |
| @@ -43,19 +68,7 @@ EXPORT_SYMBOL(__list_add); | |||
| 43 | */ | 68 | */ |
| 44 | void list_del(struct list_head *entry) | 69 | void list_del(struct list_head *entry) |
| 45 | { | 70 | { |
| 46 | WARN(entry->next == LIST_POISON1, | 71 | __list_del_entry(entry); |
| 47 | "list_del corruption, next is LIST_POISON1 (%p)\n", | ||
| 48 | LIST_POISON1); | ||
| 49 | WARN(entry->next != LIST_POISON1 && entry->prev == LIST_POISON2, | ||
| 50 | "list_del corruption, prev is LIST_POISON2 (%p)\n", | ||
| 51 | LIST_POISON2); | ||
| 52 | WARN(entry->prev->next != entry, | ||
| 53 | "list_del corruption. prev->next should be %p, " | ||
| 54 | "but was %p\n", entry, entry->prev->next); | ||
| 55 | WARN(entry->next->prev != entry, | ||
| 56 | "list_del corruption. next->prev should be %p, " | ||
| 57 | "but was %p\n", entry, entry->next->prev); | ||
| 58 | __list_del(entry->prev, entry->next); | ||
| 59 | entry->next = LIST_POISON1; | 72 | entry->next = LIST_POISON1; |
| 60 | entry->prev = LIST_POISON2; | 73 | entry->prev = LIST_POISON2; |
| 61 | } | 74 | } |
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index c47bbe11b80..93ca08b8a45 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
| @@ -686,8 +686,10 @@ dma_addr_t swiotlb_map_page(struct device *dev, struct page *page, | |||
| 686 | /* | 686 | /* |
| 687 | * Ensure that the address returned is DMA'ble | 687 | * Ensure that the address returned is DMA'ble |
| 688 | */ | 688 | */ |
| 689 | if (!dma_capable(dev, dev_addr, size)) | 689 | if (!dma_capable(dev, dev_addr, size)) { |
| 690 | panic("map_single: bounce buffer is not DMA'ble"); | 690 | swiotlb_tbl_unmap_single(dev, map, size, dir); |
| 691 | dev_addr = swiotlb_virt_to_bus(dev, io_tlb_overflow_buffer); | ||
| 692 | } | ||
| 691 | 693 | ||
| 692 | return dev_addr; | 694 | return dev_addr; |
| 693 | } | 695 | } |
