aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parisc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parisc')
-rw-r--r--drivers/parisc/ccio-dma.c43
-rw-r--r--drivers/parisc/dino.c6
-rw-r--r--drivers/parisc/eisa.c4
-rw-r--r--drivers/parisc/gsc.c12
-rw-r--r--drivers/parisc/iosapic.c4
-rw-r--r--drivers/parisc/superio.c4
6 files changed, 37 insertions, 36 deletions
diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c
index b30e38f3a50d..dcc1e9958d2f 100644
--- a/drivers/parisc/ccio-dma.c
+++ b/drivers/parisc/ccio-dma.c
@@ -66,15 +66,8 @@
66#undef DEBUG_CCIO_RUN_SG 66#undef DEBUG_CCIO_RUN_SG
67 67
68#ifdef CONFIG_PROC_FS 68#ifdef CONFIG_PROC_FS
69/* 69/* depends on proc fs support. But costs CPU performance. */
70 * CCIO_SEARCH_TIME can help measure how fast the bitmap search is. 70#undef CCIO_COLLECT_STATS
71 * impacts performance though - ditch it if you don't use it.
72 */
73#define CCIO_SEARCH_TIME
74#undef CCIO_MAP_STATS
75#else
76#undef CCIO_SEARCH_TIME
77#undef CCIO_MAP_STATS
78#endif 71#endif
79 72
80#include <linux/proc_fs.h> 73#include <linux/proc_fs.h>
@@ -239,12 +232,10 @@ struct ioc {
239 u32 res_size; /* size of resource map in bytes */ 232 u32 res_size; /* size of resource map in bytes */
240 spinlock_t res_lock; 233 spinlock_t res_lock;
241 234
242#ifdef CCIO_SEARCH_TIME 235#ifdef CCIO_COLLECT_STATS
243#define CCIO_SEARCH_SAMPLE 0x100 236#define CCIO_SEARCH_SAMPLE 0x100
244 unsigned long avg_search[CCIO_SEARCH_SAMPLE]; 237 unsigned long avg_search[CCIO_SEARCH_SAMPLE];
245 unsigned long avg_idx; /* current index into avg_search */ 238 unsigned long avg_idx; /* current index into avg_search */
246#endif
247#ifdef CCIO_MAP_STATS
248 unsigned long used_pages; 239 unsigned long used_pages;
249 unsigned long msingle_calls; 240 unsigned long msingle_calls;
250 unsigned long msingle_pages; 241 unsigned long msingle_pages;
@@ -351,7 +342,7 @@ ccio_alloc_range(struct ioc *ioc, struct device *dev, size_t size)
351 unsigned int pages_needed = size >> IOVP_SHIFT; 342 unsigned int pages_needed = size >> IOVP_SHIFT;
352 unsigned int res_idx; 343 unsigned int res_idx;
353 unsigned long boundary_size; 344 unsigned long boundary_size;
354#ifdef CCIO_SEARCH_TIME 345#ifdef CCIO_COLLECT_STATS
355 unsigned long cr_start = mfctl(16); 346 unsigned long cr_start = mfctl(16);
356#endif 347#endif
357 348
@@ -406,7 +397,7 @@ resource_found:
406 DBG_RES("%s() res_idx %d res_hint: %d\n", 397 DBG_RES("%s() res_idx %d res_hint: %d\n",
407 __func__, res_idx, ioc->res_hint); 398 __func__, res_idx, ioc->res_hint);
408 399
409#ifdef CCIO_SEARCH_TIME 400#ifdef CCIO_COLLECT_STATS
410 { 401 {
411 unsigned long cr_end = mfctl(16); 402 unsigned long cr_end = mfctl(16);
412 unsigned long tmp = cr_end - cr_start; 403 unsigned long tmp = cr_end - cr_start;
@@ -416,7 +407,7 @@ resource_found:
416 ioc->avg_search[ioc->avg_idx++] = cr_start; 407 ioc->avg_search[ioc->avg_idx++] = cr_start;
417 ioc->avg_idx &= CCIO_SEARCH_SAMPLE - 1; 408 ioc->avg_idx &= CCIO_SEARCH_SAMPLE - 1;
418#endif 409#endif
419#ifdef CCIO_MAP_STATS 410#ifdef CCIO_COLLECT_STATS
420 ioc->used_pages += pages_needed; 411 ioc->used_pages += pages_needed;
421#endif 412#endif
422 /* 413 /*
@@ -452,7 +443,7 @@ ccio_free_range(struct ioc *ioc, dma_addr_t iova, unsigned long pages_mapped)
452 DBG_RES("%s(): res_idx: %d pages_mapped %d\n", 443 DBG_RES("%s(): res_idx: %d pages_mapped %d\n",
453 __func__, res_idx, pages_mapped); 444 __func__, res_idx, pages_mapped);
454 445
455#ifdef CCIO_MAP_STATS 446#ifdef CCIO_COLLECT_STATS
456 ioc->used_pages -= pages_mapped; 447 ioc->used_pages -= pages_mapped;
457#endif 448#endif
458 449
@@ -764,7 +755,7 @@ ccio_map_single(struct device *dev, void *addr, size_t size,
764 size = ALIGN(size + offset, IOVP_SIZE); 755 size = ALIGN(size + offset, IOVP_SIZE);
765 spin_lock_irqsave(&ioc->res_lock, flags); 756 spin_lock_irqsave(&ioc->res_lock, flags);
766 757
767#ifdef CCIO_MAP_STATS 758#ifdef CCIO_COLLECT_STATS
768 ioc->msingle_calls++; 759 ioc->msingle_calls++;
769 ioc->msingle_pages += size >> IOVP_SHIFT; 760 ioc->msingle_pages += size >> IOVP_SHIFT;
770#endif 761#endif
@@ -828,7 +819,7 @@ ccio_unmap_single(struct device *dev, dma_addr_t iova, size_t size,
828 819
829 spin_lock_irqsave(&ioc->res_lock, flags); 820 spin_lock_irqsave(&ioc->res_lock, flags);
830 821
831#ifdef CCIO_MAP_STATS 822#ifdef CCIO_COLLECT_STATS
832 ioc->usingle_calls++; 823 ioc->usingle_calls++;
833 ioc->usingle_pages += size >> IOVP_SHIFT; 824 ioc->usingle_pages += size >> IOVP_SHIFT;
834#endif 825#endif
@@ -894,7 +885,7 @@ ccio_free_consistent(struct device *dev, size_t size, void *cpu_addr,
894*/ 885*/
895#define PIDE_FLAG 0x80000000UL 886#define PIDE_FLAG 0x80000000UL
896 887
897#ifdef CCIO_MAP_STATS 888#ifdef CCIO_COLLECT_STATS
898#define IOMMU_MAP_STATS 889#define IOMMU_MAP_STATS
899#endif 890#endif
900#include "iommu-helpers.h" 891#include "iommu-helpers.h"
@@ -938,7 +929,7 @@ ccio_map_sg(struct device *dev, struct scatterlist *sglist, int nents,
938 929
939 spin_lock_irqsave(&ioc->res_lock, flags); 930 spin_lock_irqsave(&ioc->res_lock, flags);
940 931
941#ifdef CCIO_MAP_STATS 932#ifdef CCIO_COLLECT_STATS
942 ioc->msg_calls++; 933 ioc->msg_calls++;
943#endif 934#endif
944 935
@@ -997,13 +988,13 @@ ccio_unmap_sg(struct device *dev, struct scatterlist *sglist, int nents,
997 DBG_RUN_SG("%s() START %d entries, %08lx,%x\n", 988 DBG_RUN_SG("%s() START %d entries, %08lx,%x\n",
998 __func__, nents, sg_virt_addr(sglist), sglist->length); 989 __func__, nents, sg_virt_addr(sglist), sglist->length);
999 990
1000#ifdef CCIO_MAP_STATS 991#ifdef CCIO_COLLECT_STATS
1001 ioc->usg_calls++; 992 ioc->usg_calls++;
1002#endif 993#endif
1003 994
1004 while(sg_dma_len(sglist) && nents--) { 995 while(sg_dma_len(sglist) && nents--) {
1005 996
1006#ifdef CCIO_MAP_STATS 997#ifdef CCIO_COLLECT_STATS
1007 ioc->usg_pages += sg_dma_len(sglist) >> PAGE_SHIFT; 998 ioc->usg_pages += sg_dma_len(sglist) >> PAGE_SHIFT;
1008#endif 999#endif
1009 ccio_unmap_single(dev, sg_dma_address(sglist), 1000 ccio_unmap_single(dev, sg_dma_address(sglist),
@@ -1048,7 +1039,7 @@ static int ccio_proc_info(struct seq_file *m, void *p)
1048 len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n", 1039 len += seq_printf(m, "IO PDIR size : %d bytes (%d entries)\n",
1049 total_pages * 8, total_pages); 1040 total_pages * 8, total_pages);
1050 1041
1051#ifdef CCIO_MAP_STATS 1042#ifdef CCIO_COLLECT_STATS
1052 len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n", 1043 len += seq_printf(m, "IO PDIR entries : %ld free %ld used (%d%%)\n",
1053 total_pages - ioc->used_pages, ioc->used_pages, 1044 total_pages - ioc->used_pages, ioc->used_pages,
1054 (int)(ioc->used_pages * 100 / total_pages)); 1045 (int)(ioc->used_pages * 100 / total_pages));
@@ -1057,7 +1048,7 @@ static int ccio_proc_info(struct seq_file *m, void *p)
1057 len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n", 1048 len += seq_printf(m, "Resource bitmap : %d bytes (%d pages)\n",
1058 ioc->res_size, total_pages); 1049 ioc->res_size, total_pages);
1059 1050
1060#ifdef CCIO_SEARCH_TIME 1051#ifdef CCIO_COLLECT_STATS
1061 min = max = ioc->avg_search[0]; 1052 min = max = ioc->avg_search[0];
1062 for(j = 0; j < CCIO_SEARCH_SAMPLE; ++j) { 1053 for(j = 0; j < CCIO_SEARCH_SAMPLE; ++j) {
1063 avg += ioc->avg_search[j]; 1054 avg += ioc->avg_search[j];
@@ -1070,7 +1061,7 @@ static int ccio_proc_info(struct seq_file *m, void *p)
1070 len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n", 1061 len += seq_printf(m, " Bitmap search : %ld/%ld/%ld (min/avg/max CPU Cycles)\n",
1071 min, avg, max); 1062 min, avg, max);
1072#endif 1063#endif
1073#ifdef CCIO_MAP_STATS 1064#ifdef CCIO_COLLECT_STATS
1074 len += seq_printf(m, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n", 1065 len += seq_printf(m, "pci_map_single(): %8ld calls %8ld pages (avg %d/1000)\n",
1075 ioc->msingle_calls, ioc->msingle_pages, 1066 ioc->msingle_calls, ioc->msingle_pages,
1076 (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls)); 1067 (int)((ioc->msingle_pages * 1000)/ioc->msingle_calls));
@@ -1088,7 +1079,7 @@ static int ccio_proc_info(struct seq_file *m, void *p)
1088 len += seq_printf(m, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n", 1079 len += seq_printf(m, "pci_unmap_sg() : %8ld calls %8ld pages (avg %d/1000)\n\n\n",
1089 ioc->usg_calls, ioc->usg_pages, 1080 ioc->usg_calls, ioc->usg_pages,
1090 (int)((ioc->usg_pages * 1000)/ioc->usg_calls)); 1081 (int)((ioc->usg_pages * 1000)/ioc->usg_calls));
1091#endif /* CCIO_MAP_STATS */ 1082#endif /* CCIO_COLLECT_STATS */
1092 1083
1093 ioc = ioc->next; 1084 ioc = ioc->next;
1094 } 1085 }
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c
index fd56128525d1..3bc54b30c3a1 100644
--- a/drivers/parisc/dino.c
+++ b/drivers/parisc/dino.c
@@ -298,7 +298,8 @@ struct pci_port_ops dino_port_ops = {
298 298
299static void dino_disable_irq(unsigned int irq) 299static void dino_disable_irq(unsigned int irq)
300{ 300{
301 struct dino_device *dino_dev = irq_desc[irq].chip_data; 301 struct irq_desc *desc = irq_to_desc(irq);
302 struct dino_device *dino_dev = desc->chip_data;
302 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); 303 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
303 304
304 DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, irq); 305 DBG(KERN_WARNING "%s(0x%p, %d)\n", __func__, dino_dev, irq);
@@ -310,7 +311,8 @@ static void dino_disable_irq(unsigned int irq)
310 311
311static void dino_enable_irq(unsigned int irq) 312static void dino_enable_irq(unsigned int irq)
312{ 313{
313 struct dino_device *dino_dev = irq_desc[irq].chip_data; 314 struct irq_desc *desc = irq_to_desc(irq);
315 struct dino_device *dino_dev = desc->chip_data;
314 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS); 316 int local_irq = gsc_find_local_irq(irq, dino_dev->global_irq, DINO_LOCAL_IRQS);
315 u32 tmp; 317 u32 tmp;
316 318
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c
index 771cef592542..7891db50c483 100644
--- a/drivers/parisc/eisa.c
+++ b/drivers/parisc/eisa.c
@@ -346,10 +346,10 @@ static int __init eisa_probe(struct parisc_device *dev)
346 } 346 }
347 347
348 /* Reserve IRQ2 */ 348 /* Reserve IRQ2 */
349 irq_desc[2].action = &irq2_action; 349 irq_to_desc(2)->action = &irq2_action;
350 350
351 for (i = 0; i < 16; i++) { 351 for (i = 0; i < 16; i++) {
352 irq_desc[i].chip = &eisa_interrupt_type; 352 irq_to_desc(i)->chip = &eisa_interrupt_type;
353 } 353 }
354 354
355 EISA_bus = 1; 355 EISA_bus = 1;
diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c
index f7d088b897ee..e76db9e4d504 100644
--- a/drivers/parisc/gsc.c
+++ b/drivers/parisc/gsc.c
@@ -108,7 +108,8 @@ int gsc_find_local_irq(unsigned int irq, int *global_irqs, int limit)
108 108
109static void gsc_asic_disable_irq(unsigned int irq) 109static void gsc_asic_disable_irq(unsigned int irq)
110{ 110{
111 struct gsc_asic *irq_dev = irq_desc[irq].chip_data; 111 struct irq_desc *desc = irq_to_desc(irq);
112 struct gsc_asic *irq_dev = desc->chip_data;
112 int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); 113 int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32);
113 u32 imr; 114 u32 imr;
114 115
@@ -123,7 +124,8 @@ static void gsc_asic_disable_irq(unsigned int irq)
123 124
124static void gsc_asic_enable_irq(unsigned int irq) 125static void gsc_asic_enable_irq(unsigned int irq)
125{ 126{
126 struct gsc_asic *irq_dev = irq_desc[irq].chip_data; 127 struct irq_desc *desc = irq_to_desc(irq);
128 struct gsc_asic *irq_dev = desc->chip_data;
127 int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32); 129 int local_irq = gsc_find_local_irq(irq, irq_dev->global_irq, 32);
128 u32 imr; 130 u32 imr;
129 131
@@ -159,12 +161,14 @@ static struct hw_interrupt_type gsc_asic_interrupt_type = {
159int gsc_assign_irq(struct hw_interrupt_type *type, void *data) 161int gsc_assign_irq(struct hw_interrupt_type *type, void *data)
160{ 162{
161 static int irq = GSC_IRQ_BASE; 163 static int irq = GSC_IRQ_BASE;
164 struct irq_desc *desc;
162 165
163 if (irq > GSC_IRQ_MAX) 166 if (irq > GSC_IRQ_MAX)
164 return NO_IRQ; 167 return NO_IRQ;
165 168
166 irq_desc[irq].chip = type; 169 desc = irq_to_desc(irq);
167 irq_desc[irq].chip_data = data; 170 desc->chip = type;
171 desc->chip_data = data;
168 return irq++; 172 return irq++;
169} 173}
170 174
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c
index 6fb3f7979f21..7beffcab2745 100644
--- a/drivers/parisc/iosapic.c
+++ b/drivers/parisc/iosapic.c
@@ -619,7 +619,9 @@ iosapic_set_irt_data( struct vector_info *vi, u32 *dp0, u32 *dp1)
619 619
620static struct vector_info *iosapic_get_vector(unsigned int irq) 620static struct vector_info *iosapic_get_vector(unsigned int irq)
621{ 621{
622 return irq_desc[irq].chip_data; 622 struct irq_desc *desc = irq_to_desc(irq);
623
624 return desc->chip_data;
623} 625}
624 626
625static void iosapic_disable_irq(unsigned int irq) 627static void iosapic_disable_irq(unsigned int irq)
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c
index 1e8d2d17f04c..1e93c837514f 100644
--- a/drivers/parisc/superio.c
+++ b/drivers/parisc/superio.c
@@ -363,7 +363,9 @@ int superio_fixup_irq(struct pci_dev *pcidev)
363#endif 363#endif
364 364
365 for (i = 0; i < 16; i++) { 365 for (i = 0; i < 16; i++) {
366 irq_desc[i].chip = &superio_interrupt_type; 366 struct irq_desc *desc = irq_to_desc(i);
367
368 desc->chip = &superio_interrupt_type;
367 } 369 }
368 370
369 /* 371 /*