diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spinlock_debug.c | 18 | ||||
-rw-r--r-- | lib/swiotlb.c | 5 |
2 files changed, 13 insertions, 10 deletions
diff --git a/lib/spinlock_debug.c b/lib/spinlock_debug.c index 906ad101eab3..dcd4be9bd4e5 100644 --- a/lib/spinlock_debug.c +++ b/lib/spinlock_debug.c | |||
@@ -20,7 +20,8 @@ static void spin_bug(spinlock_t *lock, const char *msg) | |||
20 | if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT) | 20 | if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT) |
21 | owner = lock->owner; | 21 | owner = lock->owner; |
22 | printk("BUG: spinlock %s on CPU#%d, %s/%d\n", | 22 | printk("BUG: spinlock %s on CPU#%d, %s/%d\n", |
23 | msg, smp_processor_id(), current->comm, current->pid); | 23 | msg, raw_smp_processor_id(), |
24 | current->comm, current->pid); | ||
24 | printk(" lock: %p, .magic: %08x, .owner: %s/%d, .owner_cpu: %d\n", | 25 | printk(" lock: %p, .magic: %08x, .owner: %s/%d, .owner_cpu: %d\n", |
25 | lock, lock->magic, | 26 | lock, lock->magic, |
26 | owner ? owner->comm : "<none>", | 27 | owner ? owner->comm : "<none>", |
@@ -78,8 +79,8 @@ static void __spin_lock_debug(spinlock_t *lock) | |||
78 | if (print_once) { | 79 | if (print_once) { |
79 | print_once = 0; | 80 | print_once = 0; |
80 | printk("BUG: spinlock lockup on CPU#%d, %s/%d, %p\n", | 81 | printk("BUG: spinlock lockup on CPU#%d, %s/%d, %p\n", |
81 | smp_processor_id(), current->comm, current->pid, | 82 | raw_smp_processor_id(), current->comm, |
82 | lock); | 83 | current->pid, lock); |
83 | dump_stack(); | 84 | dump_stack(); |
84 | } | 85 | } |
85 | } | 86 | } |
@@ -120,7 +121,8 @@ static void rwlock_bug(rwlock_t *lock, const char *msg) | |||
120 | 121 | ||
121 | if (xchg(&print_once, 0)) { | 122 | if (xchg(&print_once, 0)) { |
122 | printk("BUG: rwlock %s on CPU#%d, %s/%d, %p\n", msg, | 123 | printk("BUG: rwlock %s on CPU#%d, %s/%d, %p\n", msg, |
123 | smp_processor_id(), current->comm, current->pid, lock); | 124 | raw_smp_processor_id(), current->comm, |
125 | current->pid, lock); | ||
124 | dump_stack(); | 126 | dump_stack(); |
125 | #ifdef CONFIG_SMP | 127 | #ifdef CONFIG_SMP |
126 | /* | 128 | /* |
@@ -148,8 +150,8 @@ static void __read_lock_debug(rwlock_t *lock) | |||
148 | if (print_once) { | 150 | if (print_once) { |
149 | print_once = 0; | 151 | print_once = 0; |
150 | printk("BUG: read-lock lockup on CPU#%d, %s/%d, %p\n", | 152 | printk("BUG: read-lock lockup on CPU#%d, %s/%d, %p\n", |
151 | smp_processor_id(), current->comm, current->pid, | 153 | raw_smp_processor_id(), current->comm, |
152 | lock); | 154 | current->pid, lock); |
153 | dump_stack(); | 155 | dump_stack(); |
154 | } | 156 | } |
155 | } | 157 | } |
@@ -220,8 +222,8 @@ static void __write_lock_debug(rwlock_t *lock) | |||
220 | if (print_once) { | 222 | if (print_once) { |
221 | print_once = 0; | 223 | print_once = 0; |
222 | printk("BUG: write-lock lockup on CPU#%d, %s/%d, %p\n", | 224 | printk("BUG: write-lock lockup on CPU#%d, %s/%d, %p\n", |
223 | smp_processor_id(), current->comm, current->pid, | 225 | raw_smp_processor_id(), current->comm, |
224 | lock); | 226 | current->pid, lock); |
225 | dump_stack(); | 227 | dump_stack(); |
226 | } | 228 | } |
227 | } | 229 | } |
diff --git a/lib/swiotlb.c b/lib/swiotlb.c index 57216f3544ca..1ff8dcebf7c6 100644 --- a/lib/swiotlb.c +++ b/lib/swiotlb.c | |||
@@ -704,8 +704,9 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sg, int nelems, | |||
704 | addr = SG_ENT_VIRT_ADDRESS(sg); | 704 | addr = SG_ENT_VIRT_ADDRESS(sg); |
705 | dev_addr = virt_to_phys(addr); | 705 | dev_addr = virt_to_phys(addr); |
706 | if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) { | 706 | if (swiotlb_force || address_needs_mapping(hwdev, dev_addr)) { |
707 | sg->dma_address = (dma_addr_t) virt_to_phys(map_single(hwdev, addr, sg->length, dir)); | 707 | void *map = map_single(hwdev, addr, sg->length, dir); |
708 | if (!sg->dma_address) { | 708 | sg->dma_address = virt_to_bus(map); |
709 | if (!map) { | ||
709 | /* Don't panic here, we expect map_sg users | 710 | /* Don't panic here, we expect map_sg users |
710 | to do proper error handling. */ | 711 | to do proper error handling. */ |
711 | swiotlb_full(hwdev, sg->length, dir, 0); | 712 | swiotlb_full(hwdev, sg->length, dir, 0); |