Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Support for Partition Mobility/Migration |
| 3 | * |
| 4 | * Copyright (C) 2010 Nathan Fontenot |
| 5 | * Copyright (C) 2010 IBM Corporation |
| 6 | * |
| 7 | * This program is free software; you can redistribute it and/or |
| 8 | * modify it under the terms of the GNU General Public License version |
| 9 | * 2 as published by the Free Software Foundation. |
| 10 | */ |
| 11 | |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/kobject.h> |
| 14 | #include <linux/smp.h> |
Paul Gortmaker | b56eade | 2011-05-27 13:27:45 -0400 | [diff] [blame] | 15 | #include <linux/stat.h> |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 16 | #include <linux/completion.h> |
| 17 | #include <linux/device.h> |
| 18 | #include <linux/delay.h> |
| 19 | #include <linux/slab.h> |
| 20 | |
Michael Ellerman | 8e83e90 | 2014-07-16 12:02:43 +1000 | [diff] [blame] | 21 | #include <asm/machdep.h> |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 22 | #include <asm/rtas.h> |
| 23 | #include "pseries.h" |
| 24 | |
| 25 | static struct kobject *mobility_kobj; |
| 26 | |
| 27 | struct update_props_workarea { |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 28 | __be32 phandle; |
| 29 | __be32 state; |
| 30 | __be64 reserved; |
| 31 | __be32 nprops; |
Tyrel Datwyler | d0ef440 | 2013-08-14 22:23:47 -0700 | [diff] [blame] | 32 | } __packed; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 33 | |
| 34 | #define NODE_ACTION_MASK 0xff000000 |
| 35 | #define NODE_COUNT_MASK 0x00ffffff |
| 36 | |
| 37 | #define DELETE_DT_NODE 0x01000000 |
| 38 | #define UPDATE_DT_NODE 0x02000000 |
| 39 | #define ADD_DT_NODE 0x03000000 |
| 40 | |
Nathan Fontenot | 762ec15 | 2013-04-24 05:47:11 +0000 | [diff] [blame] | 41 | #define MIGRATION_SCOPE (1) |
| 42 | |
| 43 | static int mobility_rtas_call(int token, char *buf, s32 scope) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 44 | { |
| 45 | int rc; |
| 46 | |
| 47 | spin_lock(&rtas_data_buf_lock); |
| 48 | |
| 49 | memcpy(rtas_data_buf, buf, RTAS_DATA_BUF_SIZE); |
Nathan Fontenot | 762ec15 | 2013-04-24 05:47:11 +0000 | [diff] [blame] | 50 | rc = rtas_call(token, 2, 1, NULL, rtas_data_buf, scope); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 51 | memcpy(buf, rtas_data_buf, RTAS_DATA_BUF_SIZE); |
| 52 | |
| 53 | spin_unlock(&rtas_data_buf_lock); |
| 54 | return rc; |
| 55 | } |
| 56 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 57 | static int delete_dt_node(__be32 phandle) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 58 | { |
| 59 | struct device_node *dn; |
| 60 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 61 | dn = of_find_node_by_phandle(be32_to_cpu(phandle)); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 62 | if (!dn) |
| 63 | return -ENOENT; |
| 64 | |
| 65 | dlpar_detach_node(dn); |
Tyrel Datwyler | 14cd820 | 2013-08-14 22:23:51 -0700 | [diff] [blame] | 66 | of_node_put(dn); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 67 | return 0; |
| 68 | } |
| 69 | |
| 70 | static int update_dt_property(struct device_node *dn, struct property **prop, |
| 71 | const char *name, u32 vd, char *value) |
| 72 | { |
| 73 | struct property *new_prop = *prop; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 74 | int more = 0; |
| 75 | |
| 76 | /* A negative 'vd' value indicates that only part of the new property |
| 77 | * value is contained in the buffer and we need to call |
| 78 | * ibm,update-properties again to get the rest of the value. |
| 79 | * |
| 80 | * A negative value is also the two's compliment of the actual value. |
| 81 | */ |
| 82 | if (vd & 0x80000000) { |
| 83 | vd = ~vd + 1; |
| 84 | more = 1; |
| 85 | } |
| 86 | |
| 87 | if (new_prop) { |
| 88 | /* partial property fixup */ |
| 89 | char *new_data = kzalloc(new_prop->length + vd, GFP_KERNEL); |
| 90 | if (!new_data) |
| 91 | return -ENOMEM; |
| 92 | |
| 93 | memcpy(new_data, new_prop->value, new_prop->length); |
| 94 | memcpy(new_data + new_prop->length, value, vd); |
| 95 | |
| 96 | kfree(new_prop->value); |
| 97 | new_prop->value = new_data; |
| 98 | new_prop->length += vd; |
| 99 | } else { |
| 100 | new_prop = kzalloc(sizeof(*new_prop), GFP_KERNEL); |
| 101 | if (!new_prop) |
| 102 | return -ENOMEM; |
| 103 | |
| 104 | new_prop->name = kstrdup(name, GFP_KERNEL); |
| 105 | if (!new_prop->name) { |
| 106 | kfree(new_prop); |
| 107 | return -ENOMEM; |
| 108 | } |
| 109 | |
| 110 | new_prop->length = vd; |
| 111 | new_prop->value = kzalloc(new_prop->length, GFP_KERNEL); |
| 112 | if (!new_prop->value) { |
| 113 | kfree(new_prop->name); |
| 114 | kfree(new_prop); |
| 115 | return -ENOMEM; |
| 116 | } |
| 117 | |
| 118 | memcpy(new_prop->value, value, vd); |
| 119 | *prop = new_prop; |
| 120 | } |
| 121 | |
| 122 | if (!more) { |
Nathan Fontenot | 79d1c71 | 2012-10-02 16:58:46 +0000 | [diff] [blame] | 123 | of_update_property(dn, new_prop); |
Tyrel Datwyler | d8e533b | 2013-08-14 22:23:45 -0700 | [diff] [blame] | 124 | *prop = NULL; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | return 0; |
| 128 | } |
| 129 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 130 | static int update_dt_node(__be32 phandle, s32 scope) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 131 | { |
| 132 | struct update_props_workarea *upwa; |
| 133 | struct device_node *dn; |
| 134 | struct property *prop = NULL; |
Tyrel Datwyler | 638a405 | 2013-08-14 22:23:46 -0700 | [diff] [blame] | 135 | int i, rc, rtas_rc; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 136 | char *prop_data; |
| 137 | char *rtas_buf; |
| 138 | int update_properties_token; |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 139 | u32 nprops; |
Nathan Fontenot | 2e9b7b0 | 2013-04-24 05:49:36 +0000 | [diff] [blame] | 140 | u32 vd; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 141 | |
| 142 | update_properties_token = rtas_token("ibm,update-properties"); |
| 143 | if (update_properties_token == RTAS_UNKNOWN_SERVICE) |
| 144 | return -EINVAL; |
| 145 | |
| 146 | rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL); |
| 147 | if (!rtas_buf) |
| 148 | return -ENOMEM; |
| 149 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 150 | dn = of_find_node_by_phandle(be32_to_cpu(phandle)); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 151 | if (!dn) { |
| 152 | kfree(rtas_buf); |
| 153 | return -ENOENT; |
| 154 | } |
| 155 | |
| 156 | upwa = (struct update_props_workarea *)&rtas_buf[0]; |
| 157 | upwa->phandle = phandle; |
| 158 | |
| 159 | do { |
Tyrel Datwyler | 638a405 | 2013-08-14 22:23:46 -0700 | [diff] [blame] | 160 | rtas_rc = mobility_rtas_call(update_properties_token, rtas_buf, |
Nathan Fontenot | 762ec15 | 2013-04-24 05:47:11 +0000 | [diff] [blame] | 161 | scope); |
Tyrel Datwyler | 638a405 | 2013-08-14 22:23:46 -0700 | [diff] [blame] | 162 | if (rtas_rc < 0) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 163 | break; |
| 164 | |
| 165 | prop_data = rtas_buf + sizeof(*upwa); |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 166 | nprops = be32_to_cpu(upwa->nprops); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 167 | |
Tyrel Datwyler | c8f5a57 | 2013-08-14 22:23:48 -0700 | [diff] [blame] | 168 | /* On the first call to ibm,update-properties for a node the |
| 169 | * the first property value descriptor contains an empty |
| 170 | * property name, the property value length encoded as u32, |
| 171 | * and the property value is the node path being updated. |
Nathan Fontenot | 2e9b7b0 | 2013-04-24 05:49:36 +0000 | [diff] [blame] | 172 | */ |
Tyrel Datwyler | c8f5a57 | 2013-08-14 22:23:48 -0700 | [diff] [blame] | 173 | if (*prop_data == 0) { |
| 174 | prop_data++; |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 175 | vd = be32_to_cpu(*(__be32 *)prop_data); |
Tyrel Datwyler | c8f5a57 | 2013-08-14 22:23:48 -0700 | [diff] [blame] | 176 | prop_data += vd + sizeof(vd); |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 177 | nprops--; |
Tyrel Datwyler | c8f5a57 | 2013-08-14 22:23:48 -0700 | [diff] [blame] | 178 | } |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 179 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 180 | for (i = 0; i < nprops; i++) { |
Nathan Fontenot | 2e9b7b0 | 2013-04-24 05:49:36 +0000 | [diff] [blame] | 181 | char *prop_name; |
| 182 | |
| 183 | prop_name = prop_data; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 184 | prop_data += strlen(prop_name) + 1; |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 185 | vd = be32_to_cpu(*(__be32 *)prop_data); |
Nathan Fontenot | 2e9b7b0 | 2013-04-24 05:49:36 +0000 | [diff] [blame] | 186 | prop_data += sizeof(vd); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 187 | |
| 188 | switch (vd) { |
| 189 | case 0x00000000: |
| 190 | /* name only property, nothing to do */ |
| 191 | break; |
| 192 | |
| 193 | case 0x80000000: |
| 194 | prop = of_find_property(dn, prop_name, NULL); |
Nathan Fontenot | 79d1c71 | 2012-10-02 16:58:46 +0000 | [diff] [blame] | 195 | of_remove_property(dn, prop); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 196 | prop = NULL; |
| 197 | break; |
| 198 | |
| 199 | default: |
| 200 | rc = update_dt_property(dn, &prop, prop_name, |
| 201 | vd, prop_data); |
| 202 | if (rc) { |
| 203 | printk(KERN_ERR "Could not update %s" |
| 204 | " property\n", prop_name); |
| 205 | } |
| 206 | |
| 207 | prop_data += vd; |
| 208 | } |
| 209 | } |
Tyrel Datwyler | 638a405 | 2013-08-14 22:23:46 -0700 | [diff] [blame] | 210 | } while (rtas_rc == 1); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 211 | |
| 212 | of_node_put(dn); |
| 213 | kfree(rtas_buf); |
| 214 | return 0; |
| 215 | } |
| 216 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 217 | static int add_dt_node(__be32 parent_phandle, __be32 drc_index) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 218 | { |
| 219 | struct device_node *dn; |
| 220 | struct device_node *parent_dn; |
| 221 | int rc; |
| 222 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 223 | parent_dn = of_find_node_by_phandle(be32_to_cpu(parent_phandle)); |
Tyrel Datwyler | 8d5ff32 | 2013-08-14 22:23:50 -0700 | [diff] [blame] | 224 | if (!parent_dn) |
| 225 | return -ENOENT; |
| 226 | |
| 227 | dn = dlpar_configure_connector(drc_index, parent_dn); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 228 | if (!dn) |
| 229 | return -ENOENT; |
| 230 | |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 231 | rc = dlpar_attach_node(dn); |
| 232 | if (rc) |
| 233 | dlpar_free_cc_nodes(dn); |
| 234 | |
| 235 | of_node_put(parent_dn); |
| 236 | return rc; |
| 237 | } |
| 238 | |
Nathan Fontenot | 762ec15 | 2013-04-24 05:47:11 +0000 | [diff] [blame] | 239 | int pseries_devicetree_update(s32 scope) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 240 | { |
| 241 | char *rtas_buf; |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 242 | __be32 *data; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 243 | int update_nodes_token; |
| 244 | int rc; |
| 245 | |
| 246 | update_nodes_token = rtas_token("ibm,update-nodes"); |
| 247 | if (update_nodes_token == RTAS_UNKNOWN_SERVICE) |
| 248 | return -EINVAL; |
| 249 | |
| 250 | rtas_buf = kzalloc(RTAS_DATA_BUF_SIZE, GFP_KERNEL); |
| 251 | if (!rtas_buf) |
| 252 | return -ENOMEM; |
| 253 | |
| 254 | do { |
Nathan Fontenot | 762ec15 | 2013-04-24 05:47:11 +0000 | [diff] [blame] | 255 | rc = mobility_rtas_call(update_nodes_token, rtas_buf, scope); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 256 | if (rc && rc != 1) |
| 257 | break; |
| 258 | |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 259 | data = (__be32 *)rtas_buf + 4; |
| 260 | while (be32_to_cpu(*data) & NODE_ACTION_MASK) { |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 261 | int i; |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 262 | u32 action = be32_to_cpu(*data) & NODE_ACTION_MASK; |
| 263 | u32 node_count = be32_to_cpu(*data) & NODE_COUNT_MASK; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 264 | |
| 265 | data++; |
| 266 | |
| 267 | for (i = 0; i < node_count; i++) { |
Tyrel Datwyler | f6ff041 | 2015-03-04 11:59:33 -0800 | [diff] [blame] | 268 | __be32 phandle = *data++; |
| 269 | __be32 drc_index; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 270 | |
| 271 | switch (action) { |
| 272 | case DELETE_DT_NODE: |
| 273 | delete_dt_node(phandle); |
| 274 | break; |
| 275 | case UPDATE_DT_NODE: |
Nathan Fontenot | 762ec15 | 2013-04-24 05:47:11 +0000 | [diff] [blame] | 276 | update_dt_node(phandle, scope); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 277 | break; |
| 278 | case ADD_DT_NODE: |
| 279 | drc_index = *data++; |
| 280 | add_dt_node(phandle, drc_index); |
| 281 | break; |
| 282 | } |
| 283 | } |
| 284 | } |
| 285 | } while (rc == 1); |
| 286 | |
| 287 | kfree(rtas_buf); |
| 288 | return rc; |
| 289 | } |
| 290 | |
| 291 | void post_mobility_fixup(void) |
| 292 | { |
| 293 | int rc; |
| 294 | int activate_fw_token; |
| 295 | |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 296 | activate_fw_token = rtas_token("ibm,activate-firmware"); |
| 297 | if (activate_fw_token == RTAS_UNKNOWN_SERVICE) { |
| 298 | printk(KERN_ERR "Could not make post-mobility " |
| 299 | "activate-fw call.\n"); |
| 300 | return; |
| 301 | } |
| 302 | |
Haren Myneni | 39a33b5 | 2014-02-19 12:56:52 -0800 | [diff] [blame] | 303 | do { |
| 304 | rc = rtas_call(activate_fw_token, 0, 1, NULL); |
| 305 | } while (rtas_busy_delay(rc)); |
| 306 | |
| 307 | if (rc) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 308 | printk(KERN_ERR "Post-mobility activate-fw failed: %d\n", rc); |
Haren Myneni | 39a33b5 | 2014-02-19 12:56:52 -0800 | [diff] [blame] | 309 | |
| 310 | rc = pseries_devicetree_update(MIGRATION_SCOPE); |
| 311 | if (rc) |
| 312 | printk(KERN_ERR "Post-mobility device tree update " |
| 313 | "failed: %d\n", rc); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 314 | |
| 315 | return; |
| 316 | } |
| 317 | |
| 318 | static ssize_t migrate_store(struct class *class, struct class_attribute *attr, |
| 319 | const char *buf, size_t count) |
| 320 | { |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 321 | u64 streamid; |
| 322 | int rc; |
| 323 | |
Daniel Walter | 1618bd5 | 2014-08-08 14:24:01 -0700 | [diff] [blame] | 324 | rc = kstrtou64(buf, 0, &streamid); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 325 | if (rc) |
| 326 | return rc; |
| 327 | |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 328 | do { |
Tyrel Datwyler | c03e737 | 2015-03-27 12:47:25 -0700 | [diff] [blame] | 329 | rc = rtas_ibm_suspend_me(streamid); |
| 330 | if (rc == -EAGAIN) |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 331 | ssleep(1); |
Tyrel Datwyler | c03e737 | 2015-03-27 12:47:25 -0700 | [diff] [blame] | 332 | } while (rc == -EAGAIN); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 333 | |
| 334 | if (rc) |
| 335 | return rc; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 336 | |
| 337 | post_mobility_fixup(); |
| 338 | return count; |
| 339 | } |
| 340 | |
Tyrel Datwyler | 288a298 | 2015-03-04 18:25:38 -0800 | [diff] [blame] | 341 | /* |
| 342 | * Used by drmgr to determine the kernel behavior of the migration interface. |
| 343 | * |
| 344 | * Version 1: Performs all PAPR requirements for migration including |
| 345 | * firmware activation and device tree update. |
| 346 | */ |
| 347 | #define MIGRATION_API_VERSION 1 |
| 348 | |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 349 | static CLASS_ATTR(migration, S_IWUSR, NULL, migrate_store); |
Tyrel Datwyler | 288a298 | 2015-03-04 18:25:38 -0800 | [diff] [blame] | 350 | static CLASS_ATTR_STRING(api_version, S_IRUGO, __stringify(MIGRATION_API_VERSION)); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 351 | |
| 352 | static int __init mobility_sysfs_init(void) |
| 353 | { |
| 354 | int rc; |
| 355 | |
| 356 | mobility_kobj = kobject_create_and_add("mobility", kernel_kobj); |
| 357 | if (!mobility_kobj) |
| 358 | return -ENOMEM; |
| 359 | |
| 360 | rc = sysfs_create_file(mobility_kobj, &class_attr_migration.attr); |
Tyrel Datwyler | 288a298 | 2015-03-04 18:25:38 -0800 | [diff] [blame] | 361 | if (rc) |
| 362 | pr_err("mobility: unable to create migration sysfs file (%d)\n", rc); |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 363 | |
Tyrel Datwyler | 288a298 | 2015-03-04 18:25:38 -0800 | [diff] [blame] | 364 | rc = sysfs_create_file(mobility_kobj, &class_attr_api_version.attr.attr); |
| 365 | if (rc) |
| 366 | pr_err("mobility: unable to create api_version sysfs file (%d)\n", rc); |
| 367 | |
| 368 | return 0; |
Nathan Fontenot | 410bccf | 2010-09-10 09:42:36 +0000 | [diff] [blame] | 369 | } |
Michael Ellerman | 8e83e90 | 2014-07-16 12:02:43 +1000 | [diff] [blame] | 370 | machine_device_initcall(pseries, mobility_sysfs_init); |