diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/pci_64.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/ppc_ksyms.c | 10 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas-rtc.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/rtas_pci.c | 24 | ||||
-rw-r--r-- | arch/powerpc/kernel/time.c | 48 |
5 files changed, 39 insertions, 50 deletions
diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c index c367520bc1c3..ba92bab7cc2c 100644 --- a/arch/powerpc/kernel/pci_64.c +++ b/arch/powerpc/kernel/pci_64.c | |||
@@ -589,7 +589,6 @@ void __devinit scan_phb(struct pci_controller *hose) | |||
589 | #endif /* CONFIG_PPC_MULTIPLATFORM */ | 589 | #endif /* CONFIG_PPC_MULTIPLATFORM */ |
590 | if (mode == PCI_PROBE_NORMAL) | 590 | if (mode == PCI_PROBE_NORMAL) |
591 | hose->last_busno = bus->subordinate = pci_scan_child_bus(bus); | 591 | hose->last_busno = bus->subordinate = pci_scan_child_bus(bus); |
592 | pci_bus_add_devices(bus); | ||
593 | } | 592 | } |
594 | 593 | ||
595 | static int __init pcibios_init(void) | 594 | static int __init pcibios_init(void) |
@@ -608,8 +607,10 @@ static int __init pcibios_init(void) | |||
608 | printk("PCI: Probing PCI hardware\n"); | 607 | printk("PCI: Probing PCI hardware\n"); |
609 | 608 | ||
610 | /* Scan all of the recorded PCI controllers. */ | 609 | /* Scan all of the recorded PCI controllers. */ |
611 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) | 610 | list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { |
612 | scan_phb(hose); | 611 | scan_phb(hose); |
612 | pci_bus_add_devices(hose->bus); | ||
613 | } | ||
613 | 614 | ||
614 | #ifndef CONFIG_PPC_ISERIES | 615 | #ifndef CONFIG_PPC_ISERIES |
615 | if (pci_probe_only) | 616 | if (pci_probe_only) |
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c index 8a731ea877b7..63ecbec05202 100644 --- a/arch/powerpc/kernel/ppc_ksyms.c +++ b/arch/powerpc/kernel/ppc_ksyms.c | |||
@@ -110,15 +110,6 @@ EXPORT_SYMBOL(_insw_ns); | |||
110 | EXPORT_SYMBOL(_outsw_ns); | 110 | EXPORT_SYMBOL(_outsw_ns); |
111 | EXPORT_SYMBOL(_insl_ns); | 111 | EXPORT_SYMBOL(_insl_ns); |
112 | EXPORT_SYMBOL(_outsl_ns); | 112 | EXPORT_SYMBOL(_outsl_ns); |
113 | EXPORT_SYMBOL(ioremap); | ||
114 | #ifdef CONFIG_44x | ||
115 | EXPORT_SYMBOL(ioremap64); | ||
116 | #endif | ||
117 | EXPORT_SYMBOL(__ioremap); | ||
118 | EXPORT_SYMBOL(iounmap); | ||
119 | #ifdef CONFIG_PPC32 | ||
120 | EXPORT_SYMBOL(ioremap_bot); /* aka VMALLOC_END */ | ||
121 | #endif | ||
122 | 113 | ||
123 | #if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)) | 114 | #if defined(CONFIG_PPC32) && (defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_IDE_MODULE)) |
124 | EXPORT_SYMBOL(ppc_ide_md); | 115 | EXPORT_SYMBOL(ppc_ide_md); |
@@ -161,7 +152,6 @@ EXPORT_SYMBOL(__flush_icache_range); | |||
161 | EXPORT_SYMBOL(flush_dcache_range); | 152 | EXPORT_SYMBOL(flush_dcache_range); |
162 | 153 | ||
163 | #ifdef CONFIG_SMP | 154 | #ifdef CONFIG_SMP |
164 | EXPORT_SYMBOL(smp_call_function); | ||
165 | #ifdef CONFIG_PPC32 | 155 | #ifdef CONFIG_PPC32 |
166 | EXPORT_SYMBOL(smp_hw_index); | 156 | EXPORT_SYMBOL(smp_hw_index); |
167 | #endif | 157 | #endif |
diff --git a/arch/powerpc/kernel/rtas-rtc.c b/arch/powerpc/kernel/rtas-rtc.c index 635d3b9a8811..34d073fb6091 100644 --- a/arch/powerpc/kernel/rtas-rtc.c +++ b/arch/powerpc/kernel/rtas-rtc.c | |||
@@ -52,7 +52,7 @@ void rtas_get_rtc_time(struct rtc_time *rtc_tm) | |||
52 | error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); | 52 | error = rtas_call(rtas_token("get-time-of-day"), 0, 8, ret); |
53 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { | 53 | if (error == RTAS_CLOCK_BUSY || rtas_is_extended_busy(error)) { |
54 | if (in_interrupt() && printk_ratelimit()) { | 54 | if (in_interrupt() && printk_ratelimit()) { |
55 | memset(&rtc_tm, 0, sizeof(struct rtc_time)); | 55 | memset(rtc_tm, 0, sizeof(struct rtc_time)); |
56 | printk(KERN_WARNING "error: reading clock" | 56 | printk(KERN_WARNING "error: reading clock" |
57 | " would delay interrupt\n"); | 57 | " would delay interrupt\n"); |
58 | return; /* delay not allowed */ | 58 | return; /* delay not allowed */ |
diff --git a/arch/powerpc/kernel/rtas_pci.c b/arch/powerpc/kernel/rtas_pci.c index 5579f6559912..7442775ef2a1 100644 --- a/arch/powerpc/kernel/rtas_pci.c +++ b/arch/powerpc/kernel/rtas_pci.c | |||
@@ -280,8 +280,7 @@ static int phb_set_bus_ranges(struct device_node *dev, | |||
280 | return 0; | 280 | return 0; |
281 | } | 281 | } |
282 | 282 | ||
283 | static int __devinit setup_phb(struct device_node *dev, | 283 | int __devinit setup_phb(struct device_node *dev, struct pci_controller *phb) |
284 | struct pci_controller *phb) | ||
285 | { | 284 | { |
286 | if (is_python(dev)) | 285 | if (is_python(dev)) |
287 | python_countermeasures(dev); | 286 | python_countermeasures(dev); |
@@ -359,27 +358,6 @@ unsigned long __init find_and_init_phbs(void) | |||
359 | return 0; | 358 | return 0; |
360 | } | 359 | } |
361 | 360 | ||
362 | struct pci_controller * __devinit init_phb_dynamic(struct device_node *dn) | ||
363 | { | ||
364 | struct pci_controller *phb; | ||
365 | int primary; | ||
366 | |||
367 | primary = list_empty(&hose_list); | ||
368 | phb = pcibios_alloc_controller(dn); | ||
369 | if (!phb) | ||
370 | return NULL; | ||
371 | setup_phb(dn, phb); | ||
372 | pci_process_bridge_OF_ranges(phb, dn, primary); | ||
373 | |||
374 | pci_setup_phb_io_dynamic(phb, primary); | ||
375 | |||
376 | pci_devs_phb_init_dynamic(phb); | ||
377 | scan_phb(phb); | ||
378 | |||
379 | return phb; | ||
380 | } | ||
381 | EXPORT_SYMBOL(init_phb_dynamic); | ||
382 | |||
383 | /* RPA-specific bits for removing PHBs */ | 361 | /* RPA-specific bits for removing PHBs */ |
384 | int pcibios_remove_root_bus(struct pci_controller *phb) | 362 | int pcibios_remove_root_bus(struct pci_controller *phb) |
385 | { | 363 | { |
diff --git a/arch/powerpc/kernel/time.c b/arch/powerpc/kernel/time.c index 2a7ddc579379..86f7e3d154d8 100644 --- a/arch/powerpc/kernel/time.c +++ b/arch/powerpc/kernel/time.c | |||
@@ -283,9 +283,9 @@ static inline void update_gtod(u64 new_tb_stamp, u64 new_stamp_xsec, | |||
283 | * the two values of tb_update_count match and are even then the | 283 | * the two values of tb_update_count match and are even then the |
284 | * tb_to_xs and stamp_xsec values are consistent. If not, then it | 284 | * tb_to_xs and stamp_xsec values are consistent. If not, then it |
285 | * loops back and reads them again until this criteria is met. | 285 | * loops back and reads them again until this criteria is met. |
286 | * We expect the caller to have done the first increment of | ||
287 | * vdso_data->tb_update_count already. | ||
286 | */ | 288 | */ |
287 | ++(vdso_data->tb_update_count); | ||
288 | smp_wmb(); | ||
289 | vdso_data->tb_orig_stamp = new_tb_stamp; | 289 | vdso_data->tb_orig_stamp = new_tb_stamp; |
290 | vdso_data->stamp_xsec = new_stamp_xsec; | 290 | vdso_data->stamp_xsec = new_stamp_xsec; |
291 | vdso_data->tb_to_xs = new_tb_to_xs; | 291 | vdso_data->tb_to_xs = new_tb_to_xs; |
@@ -310,20 +310,15 @@ static __inline__ void timer_recalc_offset(u64 cur_tb) | |||
310 | unsigned long offset; | 310 | unsigned long offset; |
311 | u64 new_stamp_xsec; | 311 | u64 new_stamp_xsec; |
312 | u64 tlen, t2x; | 312 | u64 tlen, t2x; |
313 | u64 tb, xsec_old, xsec_new; | ||
314 | struct gettimeofday_vars *varp; | ||
313 | 315 | ||
314 | if (__USE_RTC()) | 316 | if (__USE_RTC()) |
315 | return; | 317 | return; |
316 | tlen = current_tick_length(); | 318 | tlen = current_tick_length(); |
317 | offset = cur_tb - do_gtod.varp->tb_orig_stamp; | 319 | offset = cur_tb - do_gtod.varp->tb_orig_stamp; |
318 | if (tlen == last_tick_len && offset < 0x80000000u) { | 320 | if (tlen == last_tick_len && offset < 0x80000000u) |
319 | /* check that we're still in sync; if not, resync */ | 321 | return; |
320 | struct timeval tv; | ||
321 | __do_gettimeofday(&tv, cur_tb); | ||
322 | if (tv.tv_sec <= xtime.tv_sec && | ||
323 | (tv.tv_sec < xtime.tv_sec || | ||
324 | tv.tv_usec * 1000 <= xtime.tv_nsec)) | ||
325 | return; | ||
326 | } | ||
327 | if (tlen != last_tick_len) { | 322 | if (tlen != last_tick_len) { |
328 | t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs); | 323 | t2x = mulhdu(tlen << TICKLEN_SHIFT, ticklen_to_xs); |
329 | last_tick_len = tlen; | 324 | last_tick_len = tlen; |
@@ -332,6 +327,21 @@ static __inline__ void timer_recalc_offset(u64 cur_tb) | |||
332 | new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC; | 327 | new_stamp_xsec = (u64) xtime.tv_nsec * XSEC_PER_SEC; |
333 | do_div(new_stamp_xsec, 1000000000); | 328 | do_div(new_stamp_xsec, 1000000000); |
334 | new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC; | 329 | new_stamp_xsec += (u64) xtime.tv_sec * XSEC_PER_SEC; |
330 | |||
331 | ++vdso_data->tb_update_count; | ||
332 | smp_mb(); | ||
333 | |||
334 | /* | ||
335 | * Make sure time doesn't go backwards for userspace gettimeofday. | ||
336 | */ | ||
337 | tb = get_tb(); | ||
338 | varp = do_gtod.varp; | ||
339 | xsec_old = mulhdu(tb - varp->tb_orig_stamp, varp->tb_to_xs) | ||
340 | + varp->stamp_xsec; | ||
341 | xsec_new = mulhdu(tb - cur_tb, t2x) + new_stamp_xsec; | ||
342 | if (xsec_new < xsec_old) | ||
343 | new_stamp_xsec += xsec_old - xsec_new; | ||
344 | |||
335 | update_gtod(cur_tb, new_stamp_xsec, t2x); | 345 | update_gtod(cur_tb, new_stamp_xsec, t2x); |
336 | } | 346 | } |
337 | 347 | ||
@@ -564,6 +574,10 @@ int do_settimeofday(struct timespec *tv) | |||
564 | } | 574 | } |
565 | #endif | 575 | #endif |
566 | 576 | ||
577 | /* Make userspace gettimeofday spin until we're done. */ | ||
578 | ++vdso_data->tb_update_count; | ||
579 | smp_mb(); | ||
580 | |||
567 | /* | 581 | /* |
568 | * Subtract off the number of nanoseconds since the | 582 | * Subtract off the number of nanoseconds since the |
569 | * beginning of the last tick. | 583 | * beginning of the last tick. |
@@ -724,10 +738,16 @@ void __init time_init(void) | |||
724 | * It is computed as: | 738 | * It is computed as: |
725 | * ticklen_to_xs = 2^N / (tb_ticks_per_jiffy * 1e9) | 739 | * ticklen_to_xs = 2^N / (tb_ticks_per_jiffy * 1e9) |
726 | * where N = 64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT | 740 | * where N = 64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT |
727 | * so as to give the result as a 0.64 fixed-point fraction. | 741 | * which turns out to be N = 51 - SHIFT_HZ. |
742 | * This gives the result as a 0.64 fixed-point fraction. | ||
743 | * That value is reduced by an offset amounting to 1 xsec per | ||
744 | * 2^31 timebase ticks to avoid problems with time going backwards | ||
745 | * by 1 xsec when we do timer_recalc_offset due to losing the | ||
746 | * fractional xsec. That offset is equal to ppc_tb_freq/2^51 | ||
747 | * since there are 2^20 xsec in a second. | ||
728 | */ | 748 | */ |
729 | div128_by_32(1ULL << (64 + 20 - TICKLEN_SCALE - TICKLEN_SHIFT), 0, | 749 | div128_by_32((1ULL << 51) - ppc_tb_freq, 0, |
730 | tb_ticks_per_jiffy, &res); | 750 | tb_ticks_per_jiffy << SHIFT_HZ, &res); |
731 | div128_by_32(res.result_high, res.result_low, NSEC_PER_SEC, &res); | 751 | div128_by_32(res.result_high, res.result_low, NSEC_PER_SEC, &res); |
732 | ticklen_to_xs = res.result_low; | 752 | ticklen_to_xs = res.result_low; |
733 | 753 | ||