diff options
author | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
commit | bac30d1a78d0f11c613968fc8b351a91ed465386 (patch) | |
tree | e52f3c876522a2f6047a6ec1c27df2e8a79486b8 /arch/powerpc | |
parent | e8222502ee6157e2713da9e0792c21f4ad458d50 (diff) | |
parent | ca9ba4471c1203bb6e759b76e83167fec54fe590 (diff) |
Merge ../linux-2.6
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 6aea1fb74b69..05b152299396 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -537,7 +537,8 @@ void __init setup_arch(char **cmdline_p) | |||
537 | panic_timeout = 180; | 537 | panic_timeout = 180; |
538 | 538 | ||
539 | if (ppc_md.panic) | 539 | if (ppc_md.panic) |
540 | notifier_chain_register(&panic_notifier_list, &ppc64_panic_block); | 540 | atomic_notifier_chain_register(&panic_notifier_list, |
541 | &ppc64_panic_block); | ||
541 | 542 | ||
542 | init_mm.start_code = PAGE_OFFSET; | 543 | init_mm.start_code = PAGE_OFFSET; |
543 | init_mm.end_code = (unsigned long) _etext; | 544 | init_mm.end_code = (unsigned long) _etext; |
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index 27600c9432bc..4cbde211eb69 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 4737f84bb19e..741dd8802d49 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 61e70d35d808..d9554199afa7 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 9a4b592e40bc..1773103354be 100644 --- a/arch/powerpc/platforms/pseries/reconfig.c +++ b/arch/powerpc/platforms/pseries/reconfig.c | |||
@@ -95,16 +95,16 @@ static struct device_node *derive_parent(const char *path) | |||
95 | return parent; | 95 | return parent; |
96 | } | 96 | } |
97 | 97 | ||
98 | static struct notifier_block *pSeries_reconfig_chain; | 98 | static BLOCKING_NOTIFIER_HEAD(pSeries_reconfig_chain); |
99 | 99 | ||
100 | int pSeries_reconfig_notifier_register(struct notifier_block *nb) | 100 | int pSeries_reconfig_notifier_register(struct notifier_block *nb) |
101 | { | 101 | { |
102 | return notifier_chain_register(&pSeries_reconfig_chain, nb); | 102 | return blocking_notifier_chain_register(&pSeries_reconfig_chain, nb); |
103 | } | 103 | } |
104 | 104 | ||
105 | void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) | 105 | void pSeries_reconfig_notifier_unregister(struct notifier_block *nb) |
106 | { | 106 | { |
107 | notifier_chain_unregister(&pSeries_reconfig_chain, nb); | 107 | blocking_notifier_chain_unregister(&pSeries_reconfig_chain, nb); |
108 | } | 108 | } |
109 | 109 | ||
110 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) | 110 | static int pSeries_reconfig_add_node(const char *path, struct property *proplist) |
@@ -132,7 +132,7 @@ static int pSeries_reconfig_add_node(const char *path, struct property *proplist | |||
132 | goto out_err; | 132 | goto out_err; |
133 | } | 133 | } |
134 | 134 | ||
135 | err = notifier_call_chain(&pSeries_reconfig_chain, | 135 | err = blocking_notifier_call_chain(&pSeries_reconfig_chain, |
136 | PSERIES_RECONFIG_ADD, np); | 136 | PSERIES_RECONFIG_ADD, np); |
137 | if (err == NOTIFY_BAD) { | 137 | if (err == NOTIFY_BAD) { |
138 | printk(KERN_ERR "Failed to add device node %s\n", path); | 138 | printk(KERN_ERR "Failed to add device node %s\n", path); |
@@ -172,7 +172,7 @@ static int pSeries_reconfig_remove_node(struct device_node *np) | |||
172 | 172 | ||
173 | remove_node_proc_entries(np); | 173 | remove_node_proc_entries(np); |
174 | 174 | ||
175 | notifier_call_chain(&pSeries_reconfig_chain, | 175 | blocking_notifier_call_chain(&pSeries_reconfig_chain, |
176 | PSERIES_RECONFIG_REMOVE, np); | 176 | PSERIES_RECONFIG_REMOVE, np); |
177 | of_detach_node(np); | 177 | of_detach_node(np); |
178 | 178 | ||