diff options
| author | Tony Luck <tony.luck@intel.com> | 2004-10-20 18:16:51 +0000 |
|---|---|---|
| committer | Tony Luck <tony.luck@intel.com> | 2004-10-20 18:16:51 +0000 |
| commit | 230c76230d0ee3696385f53d226ec562ec6c8a6c (patch) | |
| tree | 21dd8971aaf8f74653f287d6c3acf0b26c4fd18a | |
| parent | 1c854f6f64e327b63d3e0814e705ac2c4f5d9052 (diff) | |
| parent | bbc484783623ad02df84bff2587725d43ec1f99e (diff) | |
Merge intel.com:/data/home/aegl/BK/Linus
into intel.com:/data/home/aegl/BK/linux-ia64-release-2.6.10
| -rw-r--r-- | arch/ia64/Makefile | 3 | ||||
| -rw-r--r-- | arch/ia64/ia32/ia32priv.h | 4 | ||||
| -rw-r--r-- | arch/ia64/kernel/unwind.c | 81 | ||||
| -rw-r--r-- | arch/ia64/lib/swiotlb.c | 18 | ||||
| -rw-r--r-- | arch/ia64/pci/pci.c | 2 |
5 files changed, 59 insertions, 49 deletions
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index a32ebd61af94..21162f032ec3 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile @@ -42,8 +42,7 @@ $(error Sorry, your compiler is too old. GCC v2.96 is known to generate bad cod endif 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 endif diff --git a/arch/ia64/ia32/ia32priv.h b/arch/ia64/ia32/ia32priv.h index 59c500b23d1d..8012513e0160 100644 --- a/arch/ia64/ia32/ia32priv.h +++ b/arch/ia64/ia32/ia32priv.h @@ -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_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 /* _ASM_IA64_IA32_PRIV_H */ diff --git a/arch/ia64/kernel/unwind.c b/arch/ia64/kernel/unwind.c index 69e095abedf6..050ae0554d5c 100644 --- a/arch/ia64/kernel/unwind.c +++ b/arch/ia64/kernel/unwind.c @@ -1269,7 +1269,6 @@ script_new (unsigned long ip) { struct unw_script *script, *prev, *tmp; unw_hash_index_t index; - unsigned long flags; unsigned short head; STAT(++unw.stat.script.news); @@ -1278,13 +1277,9 @@ script_new (unsigned long ip) * Can't (easily) use cmpxchg() here because of ABA problem * that is intrinsic in cmpxchg()... */ - spin_lock_irqsave(&unw.lock, flags); - { - head = unw.lru_head; - script = unw.cache + head; - unw.lru_head = script->lru_chain; - } - spin_unlock(&unw.lock); + head = unw.lru_head; + script = unw.cache + head; + unw.lru_head = script->lru_chain; /* * 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) if (!write_trylock(&script->lock)) return NULL; - spin_lock(&unw.lock); - { - /* re-insert script at the tail of the LRU chain: */ - 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) { - index = hash(script->ip); - tmp = unw.cache + unw.hash[index]; - prev = NULL; - while (1) { - if (tmp == script) { - if (prev) - prev->coll_chain = tmp->coll_chain; - else - unw.hash[index] = tmp->coll_chain; - break; - } else - prev = tmp; - if (tmp->coll_chain >= UNW_CACHE_SIZE) - /* old script wasn't in the hash-table */ - break; - tmp = unw.cache + tmp->coll_chain; - } + /* re-insert script at the tail of the LRU chain: */ + 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) { + index = hash(script->ip); + tmp = unw.cache + unw.hash[index]; + prev = NULL; + while (1) { + if (tmp == script) { + if (prev) + prev->coll_chain = tmp->coll_chain; + else + unw.hash[index] = tmp->coll_chain; + break; + } else + prev = tmp; + if (tmp->coll_chain >= UNW_CACHE_SIZE) + /* old script wasn't in the hash-table */ + break; + tmp = unw.cache + tmp->coll_chain; } + } - /* enter new script in the hash table */ - index = hash(ip); - script->coll_chain = unw.hash[index]; - unw.hash[index] = script - unw.cache; + /* enter new script in the hash table */ + index = hash(ip); + script->coll_chain = unw.hash[index]; + 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); - } - spin_unlock_irqrestore(&unw.lock, flags); + STAT(if (script->coll_chain < UNW_CACHE_SIZE) ++unw.stat.script.collisions); script->flags = 0; script->hint = 0; @@ -1830,6 +1821,7 @@ find_save_locs (struct unw_frame_info *info) { int have_write_lock = 0; struct unw_script *scr; + unsigned long flags = 0; if ((info->ip & (local_cpu_data->unimpl_va_mask | 0xf)) || info->ip < TASK_SIZE) { /* don't let obviously bad addresses pollute the cache */ @@ -1841,8 +1833,10 @@ find_save_locs (struct unw_frame_info *info) scr = script_lookup(info); if (!scr) { + spin_lock_irqsave(&unw.lock, flags); scr = build_script(info); if (!scr) { + spin_unlock_irqrestore(&unw.lock, flags); UNW_DPRINT(0, "unwind.%s: failed to locate/build unwind script for ip %lx\n", __FUNCTION__, info->ip); @@ -1855,9 +1849,10 @@ find_save_locs (struct unw_frame_info *info) run_script(scr, info); - if (have_write_lock) + if (have_write_lock) { write_unlock(&scr->lock); - else + spin_unlock_irqrestore(&unw.lock, flags); + } else read_unlock(&scr->lock); return 0; } diff --git a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c index 9d4486f872e6..b7467a989f19 100644 --- a/arch/ia64/lib/swiotlb.c +++ b/arch/ia64/lib/swiotlb.c @@ -305,8 +305,15 @@ swiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handl flags |= GFP_DMA; ret = (void *)__get_free_pages(flags, get_order(size)); - if (!ret) - return NULL; + if (!ret) { + /* 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); dev_addr = virt_to_phys(ret); @@ -319,7 +326,12 @@ swiotlb_alloc_coherent (struct device *hwdev, size_t size, dma_addr_t *dma_handl void 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) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 65950d60c344..f33992722225 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -275,7 +275,7 @@ add_window (struct acpi_resource *res, void *data) return AE_OK; window = &info->controller->window[info->controller->windows++]; - window->resource.flags |= flags; + window->resource.flags = flags; window->resource.start = addr.min_address_range; window->resource.end = addr.max_address_range; window->offset = offset; |
