hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/arch/powerpc/kernel/rtasd.c
....@@ -1,10 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2001 Anton Blanchard <anton@au.ibm.com>, IBM
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; either version
7
- * 2 of the License, or (at your option) any later version.
84 *
95 * Communication to userspace based on kernel/printk.c
106 */
....@@ -91,6 +87,8 @@
9187 return "Dump Notification Event";
9288 case RTAS_TYPE_PRRN:
9389 return "Platform Resource Reassignment Event";
90
+ case RTAS_TYPE_HOTPLUG:
91
+ return "Hotplug Event";
9492 }
9593
9694 return rtas_type[0];
....@@ -150,8 +148,10 @@
150148 } else {
151149 struct rtas_error_log *errlog = (struct rtas_error_log *)buf;
152150
153
- printk(RTAS_DEBUG "event: %d, Type: %s, Severity: %d\n",
154
- error_log_cnt, rtas_event_type(rtas_error_type(errlog)),
151
+ printk(RTAS_DEBUG "event: %d, Type: %s (%d), Severity: %d\n",
152
+ error_log_cnt,
153
+ rtas_event_type(rtas_error_type(errlog)),
154
+ rtas_error_type(errlog),
155155 rtas_error_severity(errlog));
156156 }
157157 }
....@@ -273,36 +273,14 @@
273273 }
274274 }
275275
276
-#ifdef CONFIG_PPC_PSERIES
277
-static void handle_prrn_event(s32 scope)
278
-{
279
- /*
280
- * For PRRN, we must pass the negative of the scope value in
281
- * the RTAS event.
282
- */
283
- pseries_devicetree_update(-scope);
284
- numa_update_cpu_topology(false);
285
-}
286
-
287276 static void handle_rtas_event(const struct rtas_error_log *log)
288277 {
289
- if (rtas_error_type(log) != RTAS_TYPE_PRRN || !prrn_is_enabled())
278
+ if (!machine_is(pseries))
290279 return;
291280
292
- /* For PRRN Events the extended log length is used to denote
293
- * the scope for calling rtas update-nodes.
294
- */
295
- handle_prrn_event(rtas_error_extended_log_length(log));
281
+ if (rtas_error_type(log) == RTAS_TYPE_PRRN)
282
+ pr_info_ratelimited("Platform resource reassignment ignored.\n");
296283 }
297
-
298
-#else
299
-
300
-static void handle_rtas_event(const struct rtas_error_log *log)
301
-{
302
- return;
303
-}
304
-
305
-#endif
306284
307285 static int rtas_log_open(struct inode * inode, struct file * file)
308286 {
....@@ -331,7 +309,7 @@
331309
332310 count = rtas_error_log_buffer_max;
333311
334
- if (!access_ok(VERIFY_WRITE, buf, count))
312
+ if (!access_ok(buf, count))
335313 return -EFAULT;
336314
337315 tmp = kmalloc(count, GFP_KERNEL);
....@@ -385,12 +363,12 @@
385363 return 0;
386364 }
387365
388
-static const struct file_operations proc_rtas_log_operations = {
389
- .read = rtas_log_read,
390
- .poll = rtas_log_poll,
391
- .open = rtas_log_open,
392
- .release = rtas_log_release,
393
- .llseek = noop_llseek,
366
+static const struct proc_ops rtas_log_proc_ops = {
367
+ .proc_read = rtas_log_read,
368
+ .proc_poll = rtas_log_poll,
369
+ .proc_open = rtas_log_open,
370
+ .proc_release = rtas_log_release,
371
+ .proc_lseek = noop_llseek,
394372 };
395373
396374 static int enable_surveillance(int timeout)
....@@ -572,7 +550,7 @@
572550 return -ENODEV;
573551
574552 entry = proc_create("powerpc/rtas/error_log", 0400, NULL,
575
- &proc_rtas_log_operations);
553
+ &rtas_log_proc_ops);
576554 if (!entry)
577555 printk(KERN_ERR "Failed to create error_log proc entry\n");
578556