hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/powerpc/platforms/pseries/suspend.c
....@@ -1,19 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright (C) 2010 Brian King IBM Corporation
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License as published by
6
- * the Free Software Foundation; either version 2 of the License, or
7
- * (at your option) any later version.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program; if not, write to the Free Software
16
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
174 */
185
196 #include <linux/cpu.h>
....@@ -142,14 +129,10 @@
142129 struct device_attribute *attr,
143130 const char *buf, size_t count)
144131 {
145
- cpumask_var_t offline_mask;
146132 int rc;
147133
148134 if (!capable(CAP_SYS_ADMIN))
149135 return -EPERM;
150
-
151
- if (!alloc_cpumask_var(&offline_mask, GFP_KERNEL))
152
- return -ENOMEM;
153136
154137 stream_id = simple_strtoul(buf, NULL, 16);
155138
....@@ -159,33 +142,14 @@
159142 ssleep(1);
160143 } while (rc == -EAGAIN);
161144
162
- if (!rc) {
163
- /* All present CPUs must be online */
164
- cpumask_andnot(offline_mask, cpu_present_mask,
165
- cpu_online_mask);
166
- rc = rtas_online_cpus_mask(offline_mask);
167
- if (rc) {
168
- pr_err("%s: Could not bring present CPUs online.\n",
169
- __func__);
170
- goto out;
171
- }
172
-
173
- stop_topology_update();
145
+ if (!rc)
174146 rc = pm_suspend(PM_SUSPEND_MEM);
175
- start_topology_update();
176
-
177
- /* Take down CPUs not online prior to suspend */
178
- if (!rtas_offline_cpus_mask(offline_mask))
179
- pr_warn("%s: Could not restore CPUs to offline "
180
- "state.\n", __func__);
181
- }
182147
183148 stream_id = 0;
184149
185150 if (!rc)
186151 rc = count;
187
-out:
188
- free_cpumask_var(offline_mask);
152
+
189153 return rc;
190154 }
191155