diff options
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/hp/common/sba_iommu.c | 38 | ||||
-rw-r--r-- | arch/ia64/include/asm/hw_irq.h | 6 | ||||
-rw-r--r-- | arch/ia64/include/asm/mca.h | 5 | ||||
-rw-r--r-- | arch/ia64/include/asm/rwsem.h | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/irq_ia64.c | 6 | ||||
-rw-r--r-- | arch/ia64/kernel/mca.c | 11 |
6 files changed, 50 insertions, 18 deletions
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index f332e3fe4237..e14c492a8a93 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -677,12 +677,19 @@ sba_alloc_range(struct ioc *ioc, struct device *dev, size_t size) | |||
677 | spin_unlock_irqrestore(&ioc->saved_lock, flags); | 677 | spin_unlock_irqrestore(&ioc->saved_lock, flags); |
678 | 678 | ||
679 | pide = sba_search_bitmap(ioc, dev, pages_needed, 0); | 679 | pide = sba_search_bitmap(ioc, dev, pages_needed, 0); |
680 | if (unlikely(pide >= (ioc->res_size << 3))) | 680 | if (unlikely(pide >= (ioc->res_size << 3))) { |
681 | panic(__FILE__ ": I/O MMU @ %p is out of mapping resources\n", | 681 | printk(KERN_WARNING "%s: I/O MMU @ %p is" |
682 | ioc->ioc_hpa); | 682 | "out of mapping resources, %u %u %lx\n", |
683 | __func__, ioc->ioc_hpa, ioc->res_size, | ||
684 | pages_needed, dma_get_seg_boundary(dev)); | ||
685 | return -1; | ||
686 | } | ||
683 | #else | 687 | #else |
684 | panic(__FILE__ ": I/O MMU @ %p is out of mapping resources\n", | 688 | printk(KERN_WARNING "%s: I/O MMU @ %p is" |
685 | ioc->ioc_hpa); | 689 | "out of mapping resources, %u %u %lx\n", |
690 | __func__, ioc->ioc_hpa, ioc->res_size, | ||
691 | pages_needed, dma_get_seg_boundary(dev)); | ||
692 | return -1; | ||
686 | #endif | 693 | #endif |
687 | } | 694 | } |
688 | } | 695 | } |
@@ -965,6 +972,8 @@ static dma_addr_t sba_map_page(struct device *dev, struct page *page, | |||
965 | #endif | 972 | #endif |
966 | 973 | ||
967 | pide = sba_alloc_range(ioc, dev, size); | 974 | pide = sba_alloc_range(ioc, dev, size); |
975 | if (pide < 0) | ||
976 | return 0; | ||
968 | 977 | ||
969 | iovp = (dma_addr_t) pide << iovp_shift; | 978 | iovp = (dma_addr_t) pide << iovp_shift; |
970 | 979 | ||
@@ -1320,6 +1329,7 @@ sba_coalesce_chunks(struct ioc *ioc, struct device *dev, | |||
1320 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ | 1329 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ |
1321 | int n_mappings = 0; | 1330 | int n_mappings = 0; |
1322 | unsigned int max_seg_size = dma_get_max_seg_size(dev); | 1331 | unsigned int max_seg_size = dma_get_max_seg_size(dev); |
1332 | int idx; | ||
1323 | 1333 | ||
1324 | while (nents > 0) { | 1334 | while (nents > 0) { |
1325 | unsigned long vaddr = (unsigned long) sba_sg_address(startsg); | 1335 | unsigned long vaddr = (unsigned long) sba_sg_address(startsg); |
@@ -1418,16 +1428,22 @@ sba_coalesce_chunks(struct ioc *ioc, struct device *dev, | |||
1418 | vcontig_sg->dma_length = vcontig_len; | 1428 | vcontig_sg->dma_length = vcontig_len; |
1419 | dma_len = (dma_len + dma_offset + ~iovp_mask) & iovp_mask; | 1429 | dma_len = (dma_len + dma_offset + ~iovp_mask) & iovp_mask; |
1420 | ASSERT(dma_len <= DMA_CHUNK_SIZE); | 1430 | ASSERT(dma_len <= DMA_CHUNK_SIZE); |
1421 | dma_sg->dma_address = (dma_addr_t) (PIDE_FLAG | 1431 | idx = sba_alloc_range(ioc, dev, dma_len); |
1422 | | (sba_alloc_range(ioc, dev, dma_len) << iovp_shift) | 1432 | if (idx < 0) { |
1423 | | dma_offset); | 1433 | dma_sg->dma_length = 0; |
1434 | return -1; | ||
1435 | } | ||
1436 | dma_sg->dma_address = (dma_addr_t)(PIDE_FLAG | (idx << iovp_shift) | ||
1437 | | dma_offset); | ||
1424 | n_mappings++; | 1438 | n_mappings++; |
1425 | } | 1439 | } |
1426 | 1440 | ||
1427 | return n_mappings; | 1441 | return n_mappings; |
1428 | } | 1442 | } |
1429 | 1443 | ||
1430 | 1444 | static void sba_unmap_sg_attrs(struct device *dev, struct scatterlist *sglist, | |
1445 | int nents, enum dma_data_direction dir, | ||
1446 | struct dma_attrs *attrs); | ||
1431 | /** | 1447 | /** |
1432 | * sba_map_sg - map Scatter/Gather list | 1448 | * sba_map_sg - map Scatter/Gather list |
1433 | * @dev: instance of PCI owned by the driver that's asking. | 1449 | * @dev: instance of PCI owned by the driver that's asking. |
@@ -1493,6 +1509,10 @@ static int sba_map_sg_attrs(struct device *dev, struct scatterlist *sglist, | |||
1493 | ** Access to the virtual address is what forces a two pass algorithm. | 1509 | ** Access to the virtual address is what forces a two pass algorithm. |
1494 | */ | 1510 | */ |
1495 | coalesced = sba_coalesce_chunks(ioc, dev, sglist, nents); | 1511 | coalesced = sba_coalesce_chunks(ioc, dev, sglist, nents); |
1512 | if (coalesced < 0) { | ||
1513 | sba_unmap_sg_attrs(dev, sglist, nents, dir, attrs); | ||
1514 | return 0; | ||
1515 | } | ||
1496 | 1516 | ||
1497 | /* | 1517 | /* |
1498 | ** Program the I/O Pdir | 1518 | ** Program the I/O Pdir |
diff --git a/arch/ia64/include/asm/hw_irq.h b/arch/ia64/include/asm/hw_irq.h index 91619b31dbf5..bf2e37493e04 100644 --- a/arch/ia64/include/asm/hw_irq.h +++ b/arch/ia64/include/asm/hw_irq.h | |||
@@ -59,7 +59,13 @@ typedef u16 ia64_vector; | |||
59 | extern int ia64_first_device_vector; | 59 | extern int ia64_first_device_vector; |
60 | extern int ia64_last_device_vector; | 60 | extern int ia64_last_device_vector; |
61 | 61 | ||
62 | #if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined (CONFIG_IA64_DIG)) | ||
63 | /* Reserve the lower priority vector than device vectors for "move IRQ" IPI */ | ||
64 | #define IA64_IRQ_MOVE_VECTOR 0x30 /* "move IRQ" IPI */ | ||
65 | #define IA64_DEF_FIRST_DEVICE_VECTOR 0x31 | ||
66 | #else | ||
62 | #define IA64_DEF_FIRST_DEVICE_VECTOR 0x30 | 67 | #define IA64_DEF_FIRST_DEVICE_VECTOR 0x30 |
68 | #endif | ||
63 | #define IA64_DEF_LAST_DEVICE_VECTOR 0xe7 | 69 | #define IA64_DEF_LAST_DEVICE_VECTOR 0xe7 |
64 | #define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector | 70 | #define IA64_FIRST_DEVICE_VECTOR ia64_first_device_vector |
65 | #define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector | 71 | #define IA64_LAST_DEVICE_VECTOR ia64_last_device_vector |
diff --git a/arch/ia64/include/asm/mca.h b/arch/ia64/include/asm/mca.h index c171cdf0a789..43f96ab18fa0 100644 --- a/arch/ia64/include/asm/mca.h +++ b/arch/ia64/include/asm/mca.h | |||
@@ -106,6 +106,11 @@ struct ia64_sal_os_state { | |||
106 | unsigned long os_status; /* OS status to SAL, enum below */ | 106 | unsigned long os_status; /* OS status to SAL, enum below */ |
107 | unsigned long context; /* 0 if return to same context | 107 | unsigned long context; /* 0 if return to same context |
108 | 1 if return to new context */ | 108 | 1 if return to new context */ |
109 | |||
110 | /* I-resources */ | ||
111 | unsigned long iip; | ||
112 | unsigned long ipsr; | ||
113 | unsigned long ifs; | ||
109 | }; | 114 | }; |
110 | 115 | ||
111 | enum { | 116 | enum { |
diff --git a/arch/ia64/include/asm/rwsem.h b/arch/ia64/include/asm/rwsem.h index fbee74b15782..e8762688e8e3 100644 --- a/arch/ia64/include/asm/rwsem.h +++ b/arch/ia64/include/asm/rwsem.h | |||
@@ -47,7 +47,7 @@ struct rw_semaphore { | |||
47 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) | 47 | #define RWSEM_ACTIVE_WRITE_BIAS (RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS) |
48 | 48 | ||
49 | #define __RWSEM_INITIALIZER(name) \ | 49 | #define __RWSEM_INITIALIZER(name) \ |
50 | { RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, \ | 50 | { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED((name).wait_lock), \ |
51 | LIST_HEAD_INIT((name).wait_list) } | 51 | LIST_HEAD_INIT((name).wait_list) } |
52 | 52 | ||
53 | #define DECLARE_RWSEM(name) \ | 53 | #define DECLARE_RWSEM(name) \ |
diff --git a/arch/ia64/kernel/irq_ia64.c b/arch/ia64/kernel/irq_ia64.c index 70e4bad23432..d4093a173a3e 100644 --- a/arch/ia64/kernel/irq_ia64.c +++ b/arch/ia64/kernel/irq_ia64.c | |||
@@ -260,7 +260,6 @@ void __setup_vector_irq(int cpu) | |||
260 | } | 260 | } |
261 | 261 | ||
262 | #if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG)) | 262 | #if defined(CONFIG_SMP) && (defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG)) |
263 | #define IA64_IRQ_MOVE_VECTOR IA64_DEF_FIRST_DEVICE_VECTOR | ||
264 | 263 | ||
265 | static enum vector_domain_type { | 264 | static enum vector_domain_type { |
266 | VECTOR_DOMAIN_NONE, | 265 | VECTOR_DOMAIN_NONE, |
@@ -659,11 +658,8 @@ init_IRQ (void) | |||
659 | register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL); | 658 | register_percpu_irq(IA64_SPURIOUS_INT_VECTOR, NULL); |
660 | #ifdef CONFIG_SMP | 659 | #ifdef CONFIG_SMP |
661 | #if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG) | 660 | #if defined(CONFIG_IA64_GENERIC) || defined(CONFIG_IA64_DIG) |
662 | if (vector_domain_type != VECTOR_DOMAIN_NONE) { | 661 | if (vector_domain_type != VECTOR_DOMAIN_NONE) |
663 | BUG_ON(IA64_FIRST_DEVICE_VECTOR != IA64_IRQ_MOVE_VECTOR); | ||
664 | IA64_FIRST_DEVICE_VECTOR++; | ||
665 | register_percpu_irq(IA64_IRQ_MOVE_VECTOR, &irq_move_irqaction); | 662 | register_percpu_irq(IA64_IRQ_MOVE_VECTOR, &irq_move_irqaction); |
666 | } | ||
667 | #endif | 663 | #endif |
668 | #endif | 664 | #endif |
669 | #ifdef CONFIG_PERFMON | 665 | #ifdef CONFIG_PERFMON |
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 496ac7a99488..32f2639e9b0a 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
@@ -888,9 +888,10 @@ ia64_mca_modify_comm(const struct task_struct *previous_current) | |||
888 | } | 888 | } |
889 | 889 | ||
890 | static void | 890 | static void |
891 | finish_pt_regs(struct pt_regs *regs, const pal_min_state_area_t *ms, | 891 | finish_pt_regs(struct pt_regs *regs, struct ia64_sal_os_state *sos, |
892 | unsigned long *nat) | 892 | unsigned long *nat) |
893 | { | 893 | { |
894 | const pal_min_state_area_t *ms = sos->pal_min_state; | ||
894 | const u64 *bank; | 895 | const u64 *bank; |
895 | 896 | ||
896 | /* If ipsr.ic then use pmsa_{iip,ipsr,ifs}, else use | 897 | /* If ipsr.ic then use pmsa_{iip,ipsr,ifs}, else use |
@@ -904,6 +905,10 @@ finish_pt_regs(struct pt_regs *regs, const pal_min_state_area_t *ms, | |||
904 | regs->cr_iip = ms->pmsa_xip; | 905 | regs->cr_iip = ms->pmsa_xip; |
905 | regs->cr_ipsr = ms->pmsa_xpsr; | 906 | regs->cr_ipsr = ms->pmsa_xpsr; |
906 | regs->cr_ifs = ms->pmsa_xfs; | 907 | regs->cr_ifs = ms->pmsa_xfs; |
908 | |||
909 | sos->iip = ms->pmsa_iip; | ||
910 | sos->ipsr = ms->pmsa_ipsr; | ||
911 | sos->ifs = ms->pmsa_ifs; | ||
907 | } | 912 | } |
908 | regs->pr = ms->pmsa_pr; | 913 | regs->pr = ms->pmsa_pr; |
909 | regs->b0 = ms->pmsa_br0; | 914 | regs->b0 = ms->pmsa_br0; |
@@ -1079,7 +1084,7 @@ ia64_mca_modify_original_stack(struct pt_regs *regs, | |||
1079 | memcpy(old_regs, regs, sizeof(*regs)); | 1084 | memcpy(old_regs, regs, sizeof(*regs)); |
1080 | old_regs->loadrs = loadrs; | 1085 | old_regs->loadrs = loadrs; |
1081 | old_unat = old_regs->ar_unat; | 1086 | old_unat = old_regs->ar_unat; |
1082 | finish_pt_regs(old_regs, ms, &old_unat); | 1087 | finish_pt_regs(old_regs, sos, &old_unat); |
1083 | 1088 | ||
1084 | /* Next stack a struct switch_stack. mca_asm.S built a partial | 1089 | /* Next stack a struct switch_stack. mca_asm.S built a partial |
1085 | * switch_stack, copy it and fill in the blanks using pt_regs and | 1090 | * switch_stack, copy it and fill in the blanks using pt_regs and |
@@ -1150,7 +1155,7 @@ no_mod: | |||
1150 | mprintk(KERN_INFO "cpu %d, %s %s, original stack not modified\n", | 1155 | mprintk(KERN_INFO "cpu %d, %s %s, original stack not modified\n", |
1151 | smp_processor_id(), type, msg); | 1156 | smp_processor_id(), type, msg); |
1152 | old_unat = regs->ar_unat; | 1157 | old_unat = regs->ar_unat; |
1153 | finish_pt_regs(regs, ms, &old_unat); | 1158 | finish_pt_regs(regs, sos, &old_unat); |
1154 | return previous_current; | 1159 | return previous_current; |
1155 | } | 1160 | } |
1156 | 1161 | ||