Commit 230c7623 authored by Tony Luck's avatar Tony Luck

Merge intel.com:/data/home/aegl/BK/Linus

into intel.com:/data/home/aegl/BK/linux-ia64-release-2.6.10
parents 1c854f6f bbc48478
...@@ -42,8 +42,7 @@ $(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad cod ...@@ -42,8 +42,7 @@ $(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad cod
endif endif
ifeq ($(GCC_VERSION),0304) ifeq ($(GCC_VERSION),0304)
# Workaround Itanium 1 bugs in gcc 3.4. cflags-$(CONFIG_ITANIUM) += -mtune=merced
# cflags-$(CONFIG_ITANIUM) += -mtune=merced
cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley cflags-$(CONFIG_MCKINLEY) += -mtune=mckinley
endif endif
......
...@@ -559,6 +559,10 @@ struct user_regs_struct32 { ...@@ -559,6 +559,10 @@ struct user_regs_struct32 {
extern int save_ia32_fpstate (struct task_struct *, struct ia32_user_i387_struct __user *); extern int save_ia32_fpstate (struct task_struct *, struct ia32_user_i387_struct __user *);
extern int save_ia32_fpxstate (struct task_struct *, struct ia32_user_fxsr_struct __user *); extern int save_ia32_fpxstate (struct task_struct *, struct ia32_user_fxsr_struct __user *);
/* Prototypes for use in sys_ia32.c */
int copy_siginfo_to_user32 (siginfo_t32 __user *to, siginfo_t *from);
int copy_siginfo_from_user32 (siginfo_t *to, siginfo_t32 __user *from);
#endif /* !CONFIG_IA32_SUPPORT */ #endif /* !CONFIG_IA32_SUPPORT */
#endif /* _ASM_IA64_IA32_PRIV_H */ #endif /* _ASM_IA64_IA32_PRIV_H */
...@@ -1269,7 +1269,6 @@ script_new (unsigned long ip) ...@@ -1269,7 +1269,6 @@ script_new (unsigned long ip)
{ {
struct unw_script *script, *prev, *tmp; struct unw_script *script, *prev, *tmp;
unw_hash_index_t index; unw_hash_index_t index;
unsigned long flags;
unsigned short head; unsigned short head;
STAT(++unw.stat.script.news); STAT(++unw.stat.script.news);
...@@ -1278,13 +1277,9 @@ script_new (unsigned long ip) ...@@ -1278,13 +1277,9 @@ script_new (unsigned long ip)
* Can't (easily) use cmpxchg() here because of ABA problem * Can't (easily) use cmpxchg() here because of ABA problem
* that is intrinsic in cmpxchg()... * that is intrinsic in cmpxchg()...
*/ */
spin_lock_irqsave(&unw.lock, flags); head = unw.lru_head;
{ script = unw.cache + head;
head = unw.lru_head; unw.lru_head = script->lru_chain;
script = unw.cache + head;
unw.lru_head = script->lru_chain;
}
spin_unlock(&unw.lock);
/* /*
* We'd deadlock here if we interrupted a thread that is holding a read lock on * We'd deadlock here if we interrupted a thread that is holding a read lock on
...@@ -1295,43 +1290,39 @@ script_new (unsigned long ip) ...@@ -1295,43 +1290,39 @@ script_new (unsigned long ip)
if (!write_trylock(&script->lock)) if (!write_trylock(&script->lock))
return NULL; return NULL;
spin_lock(&unw.lock); /* re-insert script at the tail of the LRU chain: */
{ unw.cache[unw.lru_tail].lru_chain = head;
/* re-insert script at the tail of the LRU chain: */ unw.lru_tail = head;
unw.cache[unw.lru_tail].lru_chain = head;
unw.lru_tail = head; /* remove the old script from the hash table (if it's there): */
if (script->ip) {
/* remove the old script from the hash table (if it's there): */ index = hash(script->ip);
if (script->ip) { tmp = unw.cache + unw.hash[index];
index = hash(script->ip); prev = NULL;
tmp = unw.cache + unw.hash[index]; while (1) {
prev = NULL; if (tmp == script) {
while (1) { if (prev)
if (tmp == script) { prev->coll_chain = tmp->coll_chain;
if (prev) else
prev->coll_chain = tmp->coll_chain; unw.hash[index] = tmp->coll_chain;
else break;
unw.hash[index] = tmp->coll_chain; } else
break; prev = tmp;
} else if (tmp->coll_chain >= UNW_CACHE_SIZE)
prev = tmp; /* old script wasn't in the hash-table */
if (tmp->coll_chain >= UNW_CACHE_SIZE) break;
/* old script wasn't in the hash-table */ tmp = unw.cache + tmp->coll_chain;
break;
tmp = unw.cache + tmp->coll_chain;
}
} }
}
/* enter new script in the hash table */ /* enter new script in the hash table */
index = hash(ip); index = hash(ip);
script->coll_chain = unw.hash[index]; script->coll_chain = unw.hash[index];
unw.hash[index] = script - unw.cache; unw.hash[index] = script - unw.cache;
script->ip = ip; /* set new IP while we're holding the locks */ script->ip = ip; /* set new IP while we're holding the locks */
STAT(if (script->coll_chain < UNW_CACHE_SIZE) ++unw.stat.script.collisions); STAT(if (script->coll_chain < UNW_CACHE_SIZE) ++unw.stat.script.collisions);
}
spin_unlock_irqrestore(&unw.lock, flags);
script->flags = 0; script->flags = 0;
script->hint = 0; script->hint = 0;
...@@ -1830,6 +1821,7 @@ find_save_locs (struct unw_frame_info *info) ...@@ -1830,6 +1821,7 @@ find_save_locs (struct unw_frame_info *info)
{ {
int have_write_lock = 0; int have_write_lock = 0;
struct unw_script *scr; struct unw_script *scr;
unsigned long flags = 0;
if ((info->ip & (local_cpu_data->unimpl_va_mask | 0xf)) || info->ip < TASK_SIZE) { if ((info->ip & (local_cpu_data->unimpl_va_mask | 0xf)) || info->ip < TASK_SIZE) {
/* don't let obviously bad addresses pollute the cache */ /* don't let obviously bad addresses pollute the cache */
...@@ -1841,8 +1833,10 @@ find_save_locs (struct unw_frame_info *info) ...@@ -1841,8 +1833,10 @@ find_save_locs (struct unw_frame_info *info)
scr = script_lookup(info); scr = script_lookup(info);
if (!scr) { if (!scr) {
spin_lock_irqsave(&unw.lock, flags);
scr = build_script(info); scr = build_script(info);
if (!scr) { if (!scr) {
spin_unlock_irqrestore(&unw.lock, flags);
UNW_DPRINT(0, UNW_DPRINT(0,
"unwind.%s: failed to locate/build unwind script for ip %lx\n", "unwind.%s: failed to locate/build unwind script for ip %lx\n",
__FUNCTION__, info->ip); __FUNCTION__, info->ip);
...@@ -1855,9 +1849,10 @@ find_save_locs (struct unw_frame_info *info) ...@@ -1855,9 +1849,10 @@ find_save_locs (struct unw_frame_info *info)
run_script(scr, info); run_script(scr, info);
if (have_write_lock) if (have_write_lock) {
write_unlock(&scr->lock); write_unlock(&scr->lock);
else spin_unlock_irqrestore(&unw.lock, flags);
} else
read_unlock(&scr->lock); read_unlock(&scr->lock);
return 0; return 0;
} }
......
...@@ -305,8 +305,15 @@ swiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handl ...@@ -305,8 +305,15 @@ swiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handl
flags |= GFP_DMA; flags |= GFP_DMA;
ret = (void *)__get_free_pages(flags, get_order(size)); ret = (void *)__get_free_pages(flags, get_order(size));
if (!ret) if (!ret) {
return NULL; /* DMA_FROM_DEVICE is to avoid the memcpy in map_single */
dma_addr_t handle;
handle = swiotlb_map_single(NULL, NULL, size, DMA_FROM_DEVICE);
if (dma_mapping_error(handle))
return NULL;
ret = phys_to_virt(handle);
}
memset(ret, 0, size); memset(ret, 0, size);
dev_addr = virt_to_phys(ret); dev_addr = virt_to_phys(ret);
...@@ -319,7 +326,12 @@ swiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handl ...@@ -319,7 +326,12 @@ swiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handl
void void
swiotlb_free_coherent (struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle) swiotlb_free_coherent (struct device *hwdev, size_t size, void *vaddr, dma_addr_t dma_handle)
{ {
free_pages((unsigned long) vaddr, get_order(size)); if (!(vaddr >= (void *)io_tlb_start
&& vaddr < (void *)io_tlb_end))
free_pages((unsigned long) vaddr, get_order(size));
else
/* DMA_TO_DEVICE to avoid memcpy in unmap_single */
swiotlb_unmap_single (hwdev, dma_handle, size, DMA_TO_DEVICE);
} }
static void swiotlb_full(struct device *dev, size_t size, int dir, int do_panic) static void swiotlb_full(struct device *dev, size_t size, int dir, int do_panic)
......
...@@ -275,7 +275,7 @@ add_window (struct acpi_resource *res, void *data) ...@@ -275,7 +275,7 @@ add_window (struct acpi_resource *res, void *data)
return AE_OK; return AE_OK;
window = &info->controller->window[info->controller->windows++]; window = &info->controller->window[info->controller->windows++];
window->resource.flags |= flags; window->resource.flags = flags;
window->resource.start = addr.min_address_range; window->resource.start = addr.min_address_range;
window->resource.end = addr.max_address_range; window->resource.end = addr.max_address_range;
window->offset = offset; window->offset = offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment