diff options
Diffstat (limited to 'arch/powerpc')
| -rw-r--r-- | arch/powerpc/kernel/setup_64.c | 3 | ||||
| -rw-r--r-- | arch/powerpc/kernel/traps.c | 16 | ||||
| -rw-r--r-- | arch/powerpc/mm/mem.c | 4 | ||||
| -rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 2 | ||||
| -rw-r--r-- | arch/powerpc/platforms/chrp/time.c | 22 | ||||
| -rw-r--r-- | arch/powerpc/platforms/maple/time.c | 24 | ||||
| -rw-r--r-- | arch/powerpc/platforms/pseries/reconfig.c | 10 |
7 files changed, 22 insertions, 59 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index 2f3fdad35594..e20c1fae3423 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
| @@ -579,7 +579,8 @@ void __init setup_arch(char **cmdline_p) | |||
| 579 | panic_timeout = 180; | 579 | panic_timeout = 180; |
| 580 | 580 | ||
| 581 | if (ppc_md.panic) | 581 | if (ppc_md.panic) |
| 582 | notifier_chain_register(&panic_notifier_list, &ppc64_panic_block); | 582 | atomic_notifier_chain_register(&panic_notifier_list, |
| 583 | &ppc64_panic_block); | ||
| 583 | 584 | ||
| 584 | init_mm.start_code = PAGE_OFFSET; | 585 | init_mm.start_code = PAGE_OFFSET; |
| 585 | init_mm.end_code = (unsigned long) _etext; | 586 | init_mm.end_code = (unsigned long) _etext; |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 98660aedeeb7..9763faab6739 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c | |||
| @@ -74,19 +74,19 @@ EXPORT_SYMBOL(__debugger_dabr_match); | |||
| 74 | EXPORT_SYMBOL(__debugger_fault_handler); | 74 | EXPORT_SYMBOL(__debugger_fault_handler); |
| 75 | #endif | 75 | #endif |
| 76 | 76 | ||
| 77 | struct notifier_block *powerpc_die_chain; | 77 | ATOMIC_NOTIFIER_HEAD(powerpc_die_chain); |
| 78 | static DEFINE_SPINLOCK(die_notifier_lock); | ||
| 79 | 78 | ||
| 80 | int register_die_notifier(struct notifier_block *nb) | 79 | int register_die_notifier(struct notifier_block *nb) |
| 81 | { | 80 | { |
| 82 | int err = 0; | 81 | return atomic_notifier_chain_register(&powerpc_die_chain, nb); |
| 83 | unsigned long flags; | 82 | } |
| 83 | EXPORT_SYMBOL(register_die_notifier); | ||
| 84 | 84 | ||
| 85 | spin_lock_irqsave(&die_notifier_lock, flags); | 85 | int unregister_die_notifier(struct notifier_block *nb) |
| 86 | err = notifier_chain_register(&powerpc_die_chain, nb); | 86 | { |
| 87 | spin_unlock_irqrestore(&die_notifier_lock, flags); | 87 | return atomic_notifier_chain_unregister(&powerpc_die_chain, nb); |
| 88 | return err; | ||
| 89 | } | 88 | } |
| 89 | EXPORT_SYMBOL(unregister_die_notifier); | ||
| 90 | 90 | ||
| 91 | /* | 91 | /* |
| 92 | * Trap & Exception support | 92 | * Trap & Exception support |
diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c index badac10d700c..5e435a9c3431 100644 --- a/arch/powerpc/mm/mem.c +++ b/arch/powerpc/mm/mem.c | |||
| @@ -195,7 +195,7 @@ void show_mem(void) | |||
| 195 | printk("Mem-info:\n"); | 195 | printk("Mem-info:\n"); |
| 196 | show_free_areas(); | 196 | show_free_areas(); |
| 197 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); | 197 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); |
| 198 | for_each_pgdat(pgdat) { | 198 | for_each_online_pgdat(pgdat) { |
| 199 | unsigned long flags; | 199 | unsigned long flags; |
| 200 | pgdat_resize_lock(pgdat, &flags); | 200 | pgdat_resize_lock(pgdat, &flags); |
| 201 | for (i = 0; i < pgdat->node_spanned_pages; i++) { | 201 | for (i = 0; i < pgdat->node_spanned_pages; i++) { |
| @@ -351,7 +351,7 @@ void __init mem_init(void) | |||
| 351 | max_mapnr = max_pfn; | 351 | max_mapnr = max_pfn; |
| 352 | totalram_pages += free_all_bootmem(); | 352 | totalram_pages += free_all_bootmem(); |
| 353 | #endif | 353 | #endif |
| 354 | for_each_pgdat(pgdat) { | 354 | for_each_online_pgdat(pgdat) { |
| 355 | for (i = 0; i < pgdat->node_spanned_pages; i++) { | 355 | for (i = 0; i < pgdat->node_spanned_pages; i++) { |
| 356 | if (!pfn_valid(pgdat->node_start_pfn + i)) | 356 | if (!pfn_valid(pgdat->node_start_pfn + i)) |
| 357 | continue; | 357 | continue; |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index b3962c3a0348..5be40aa483fd 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
| @@ -103,7 +103,7 @@ spufs_setattr(struct dentry *dentry, struct iattr *attr) | |||
| 103 | 103 | ||
| 104 | static int | 104 | static int |
| 105 | spufs_new_file(struct super_block *sb, struct dentry *dentry, | 105 | spufs_new_file(struct super_block *sb, struct dentry *dentry, |
| 106 | struct file_operations *fops, int mode, | 106 | const struct file_operations *fops, int mode, |
| 107 | struct spu_context *ctx) | 107 | struct spu_context *ctx) |
| 108 | { | 108 | { |
| 109 | static struct inode_operations spufs_file_iops = { | 109 | static struct inode_operations spufs_file_iops = { |
diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c index 12c6f689b1aa..7d7889026936 100644 --- a/arch/powerpc/platforms/chrp/time.c +++ b/arch/powerpc/platforms/chrp/time.c | |||
| @@ -120,33 +120,15 @@ int chrp_set_rtc_time(struct rtc_time *tmarg) | |||
| 120 | void chrp_get_rtc_time(struct rtc_time *tm) | 120 | void chrp_get_rtc_time(struct rtc_time *tm) |
| 121 | { | 121 | { |
| 122 | unsigned int year, mon, day, hour, min, sec; | 122 | unsigned int year, mon, day, hour, min, sec; |
| 123 | int uip, i; | ||
| 124 | 123 | ||
| 125 | /* The Linux interpretation of the CMOS clock register contents: | 124 | do { |
| 126 | * When the Update-In-Progress (UIP) flag goes from 1 to 0, the | ||
| 127 | * RTC registers show the second which has precisely just started. | ||
| 128 | * Let's hope other operating systems interpret the RTC the same way. | ||
| 129 | */ | ||
| 130 | |||
| 131 | /* Since the UIP flag is set for about 2.2 ms and the clock | ||
| 132 | * is typically written with a precision of 1 jiffy, trying | ||
| 133 | * to obtain a precision better than a few milliseconds is | ||
| 134 | * an illusion. Only consistency is interesting, this also | ||
| 135 | * allows to use the routine for /dev/rtc without a potential | ||
| 136 | * 1 second kernel busy loop triggered by any reader of /dev/rtc. | ||
| 137 | */ | ||
| 138 | |||
| 139 | for ( i = 0; i<1000000; i++) { | ||
| 140 | uip = chrp_cmos_clock_read(RTC_FREQ_SELECT); | ||
| 141 | sec = chrp_cmos_clock_read(RTC_SECONDS); | 125 | sec = chrp_cmos_clock_read(RTC_SECONDS); |
| 142 | min = chrp_cmos_clock_read(RTC_MINUTES); | 126 | min = chrp_cmos_clock_read(RTC_MINUTES); |
| 143 | hour = chrp_cmos_clock_read(RTC_HOURS); | 127 | hour = chrp_cmos_clock_read(RTC_HOURS); |
| 144 | day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH); | 128 | day = chrp_cmos_clock_read(RTC_DAY_OF_MONTH); |
| 145 | mon = chrp_cmos_clock_read(RTC_MONTH); | 129 | mon = chrp_cmos_clock_read(RTC_MONTH); |
| 146 | year = chrp_cmos_clock_read(RTC_YEAR); | 130 | year = chrp_cmos_clock_read(RTC_YEAR); |
| 147 | uip |= chrp_cmos_clock_read(RTC_FREQ_SELECT); | 131 | } while (sec != chrp_cmos_clock_read(RTC_SECONDS)); |
| 148 | if ((uip & RTC_UIP)==0) break; | ||
| 149 | } | ||
| 150 | 132 | ||
| 151 | if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { | 133 | if (!(chrp_cmos_clock_read(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD) { |
| 152 | BCD_TO_BIN(sec); | 134 | BCD_TO_BIN(sec); |
diff --git a/arch/powerpc/platforms/maple/time.c b/arch/powerpc/platforms/maple/time.c index 5e6981d17379..b9a2b3d4bf33 100644 --- a/arch/powerpc/platforms/maple/time.c +++ b/arch/powerpc/platforms/maple/time.c | |||
| @@ -60,34 +60,14 @@ static void maple_clock_write(unsigned long val, int addr) | |||
| 60 | 60 | ||
| 61 | void maple_get_rtc_time(struct rtc_time *tm) | 61 | void maple_get_rtc_time(struct rtc_time *tm) |
| 62 | { | 62 | { |
| 63 | int uip, i; | 63 | do { |
| 64 | |||
| 65 | /* The Linux interpretation of the CMOS clock register contents: | ||
| 66 | * When the Update-In-Progress (UIP) flag goes from 1 to 0, the | ||
| 67 | * RTC registers show the second which has precisely just started. | ||
| 68 | * Let's hope other operating systems interpret the RTC the same way. | ||
| 69 | */ | ||
| 70 | |||
| 71 | /* Since the UIP flag is set for about 2.2 ms and the clock | ||
| 72 | * is typically written with a precision of 1 jiffy, trying | ||
| 73 | * to obtain a precision better than a few milliseconds is | ||
| 74 | * an illusion. Only consistency is interesting, this also | ||
| 75 | * allows to use the routine for /dev/rtc without a potential | ||
| 76 | * 1 second kernel busy loop triggered by any reader of /dev/rtc. | ||
| 77 | */ | ||
| 78 | |||
| 79 | for (i = 0; i<1000000; i++) { | ||
| 80 | uip = maple_clock_read(RTC_FREQ_SELECT); | ||
| 81 | tm->tm_sec = maple_clock_read(RTC_SECONDS); | 64 | tm->tm_sec = maple_clock_read(RTC_SECONDS); |
| 82 | tm->tm_min = maple_clock_read(RTC_MINUTES); | 65 | tm->tm_min = maple_clock_read(RTC_MINUTES); |
| 83 | tm->tm_hour = maple_clock_read(RTC_HOURS); | 66 | tm->tm_hour = maple_clock_read(RTC_HOURS); |
| 84 | tm->tm_mday = maple_clock_read(RTC_DAY_OF_MONTH); | 67 | tm->tm_mday = maple_clock_read(RTC_DAY_OF_MONTH); |
| 85 | tm->tm_mon = maple_clock_read(RTC_MONTH); | 68 | tm->tm_mon = maple_clock_read(RTC_MONTH); |
| 86 | tm->tm_year = maple_clock_read(RTC_YEAR); | 69 | tm->tm_year = maple_clock_read(RTC_YEAR); |
| 87 | uip |= maple_clock_read(RTC_FREQ_SELECT); | 70 | } while (tm->tm_sec != maple_clock_read(RTC_SECONDS)); |
| 88 | if ((uip & RTC_UIP)==0) | ||
| 89 | break; | ||
| 90 | } | ||
| 91 | 71 | ||
| 92 | if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY) | 72 | if (!(maple_clock_read(RTC_CONTROL) & RTC_DM_BINARY) |
| 93 | || RTC_ALWAYS_BCD) { | 73 | || RTC_ALWAYS_BCD) { |
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c index 86cfa6ecdcf3..5ad90676567a 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
| @@ -94,16 +94,16 @@ static struct device_node *derive_parent(const char *path) | |||
| 94 | return parent; | 94 | return parent; |
| 95 | } | 95 | } |
| 96 | 96 | ||
| 97 | static struct notifier_block *pSeries_reconfig_chain; | 97 | static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain); |
| 98 | 98 | ||
| 99 | int pSeries_reconfig_notifier_register(struct notifier_block *nb) | 99 | int pSeries_reconfig_notifier_register(struct notifier_block *nb) |
| 100 | { | 100 | { |
| 101 | return notifier_chain_register(&pSeries_reconfig_chain, nb); | 101 | return blocking_notifier_chain_register(&pSeries_reconfig_chain, nb); |
| 102 | } | 102 | } |
| 103 | 103 | ||
| 104 | void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) | 104 | void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) |
| 105 | { | 105 | { |
| 106 | notifier_chain_unregister(&pSeries_reconfig_chain, nb); | 106 | blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb); |
| 107 | } | 107 | } |
| 108 | 108 | ||
| 109 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) | 109 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) |
| @@ -131,7 +131,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist | |||
| 131 | goto out_err; | 131 | goto out_err; |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | err = notifier_call_chain(&pSeries_reconfig_chain, | 134 | err = blocking_notifier_call_chain(&pSeries_reconfig_chain, |
| 135 | PSERIES_RECONFIG_ADD, np); | 135 | PSERIES_RECONFIG_ADD, np); |
| 136 | if (err == NOTIFY_BAD) { | 136 | if (err == NOTIFY_BAD) { |
| 137 | printk(KERN_ERR "Failed to add device node %s\n", path); | 137 | printk(KERN_ERR "Failed to add device node %s\n", path); |
| @@ -171,7 +171,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np) | |||
| 171 | 171 | ||
| 172 | remove_node_proc_entries(np); | 172 | remove_node_proc_entries(np); |
| 173 | 173 | ||
| 174 | notifier_call_chain(&pSeries_reconfig_chain, | 174 | blocking_notifier_call_chain(&pSeries_reconfig_chain, |
| 175 | PSERIES_RECONFIG_REMOVE, np); | 175 | PSERIES_RECONFIG_REMOVE, np); |
| 176 | of_detach_node(np); | 176 | of_detach_node(np); |
| 177 | 177 | ||
