diff options
-rw-r--r-- | Documentation/ABI/obsolete/sysfs-firmware-acpi | 8 | ||||
-rw-r--r-- | Documentation/ABI/testing/sysfs-firmware-acpi | 10 | ||||
-rw-r--r-- | drivers/acpi/internal.h | 2 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 16 | ||||
-rw-r--r-- | drivers/acpi/sysfs.c | 9 |
5 files changed, 16 insertions, 29 deletions
diff --git a/Documentation/ABI/obsolete/sysfs-firmware-acpi b/Documentation/ABI/obsolete/sysfs-firmware-acpi new file mode 100644 index 000000000000..6715a71bec3d --- /dev/null +++ b/Documentation/ABI/obsolete/sysfs-firmware-acpi | |||
@@ -0,0 +1,8 @@ | |||
1 | What: /sys/firmware/acpi/hotplug/force_remove | ||
2 | Date: Mar 2017 | ||
3 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
4 | Description: | ||
5 | Since the force_remove is inherently broken and dangerous to | ||
6 | use for some hotplugable resources like memory (because ignoring | ||
7 | the offline failure might lead to memory corruption and crashes) | ||
8 | enabling this knob is not safe and thus unsupported. | ||
diff --git a/Documentation/ABI/testing/sysfs-firmware-acpi b/Documentation/ABI/testing/sysfs-firmware-acpi index c7fc72d4495c..613f42a9d5cd 100644 --- a/Documentation/ABI/testing/sysfs-firmware-acpi +++ b/Documentation/ABI/testing/sysfs-firmware-acpi | |||
@@ -44,16 +44,6 @@ Description: | |||
44 | or 0 (unset). Attempts to write any other values to it will | 44 | or 0 (unset). Attempts to write any other values to it will |
45 | cause -EINVAL to be returned. | 45 | cause -EINVAL to be returned. |
46 | 46 | ||
47 | What: /sys/firmware/acpi/hotplug/force_remove | ||
48 | Date: May 2013 | ||
49 | Contact: Rafael J. Wysocki <rafael.j.wysocki@intel.com> | ||
50 | Description: | ||
51 | The number in this file (0 or 1) determines whether (1) or not | ||
52 | (0) the ACPI subsystem will allow devices to be hot-removed even | ||
53 | if they cannot be put offline gracefully (from the kernel's | ||
54 | viewpoint). That number can be changed by writing a boolean | ||
55 | value to this file. | ||
56 | |||
57 | What: /sys/firmware/acpi/interrupts/ | 47 | What: /sys/firmware/acpi/interrupts/ |
58 | Date: February 2008 | 48 | Date: February 2008 |
59 | Contact: Len Brown <lenb@kernel.org> | 49 | Contact: Len Brown <lenb@kernel.org> |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index f15900132912..66229ffa909b 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -65,8 +65,6 @@ static inline void acpi_cmos_rtc_init(void) {} | |||
65 | #endif | 65 | #endif |
66 | int acpi_rev_override_setup(char *str); | 66 | int acpi_rev_override_setup(char *str); |
67 | 67 | ||
68 | extern bool acpi_force_hot_remove; | ||
69 | |||
70 | void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, | 68 | void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, |
71 | const char *name); | 69 | const char *name); |
72 | int acpi_scan_add_handler_with_hotplug(struct acpi_scan_handler *handler, | 70 | int acpi_scan_add_handler_with_hotplug(struct acpi_scan_handler *handler, |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 192691880d55..e2080b6e54aa 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -30,12 +30,6 @@ extern struct acpi_device *acpi_root; | |||
30 | 30 | ||
31 | #define INVALID_ACPI_HANDLE ((acpi_handle)empty_zero_page) | 31 | #define INVALID_ACPI_HANDLE ((acpi_handle)empty_zero_page) |
32 | 32 | ||
33 | /* | ||
34 | * If set, devices will be hot-removed even if they cannot be put offline | ||
35 | * gracefully (from the kernel's standpoint). | ||
36 | */ | ||
37 | bool acpi_force_hot_remove; | ||
38 | |||
39 | static const char *dummy_hid = "device"; | 33 | static const char *dummy_hid = "device"; |
40 | 34 | ||
41 | static LIST_HEAD(acpi_dep_list); | 35 | static LIST_HEAD(acpi_dep_list); |
@@ -170,9 +164,6 @@ static acpi_status acpi_bus_offline(acpi_handle handle, u32 lvl, void *data, | |||
170 | pn->put_online = false; | 164 | pn->put_online = false; |
171 | } | 165 | } |
172 | ret = device_offline(pn->dev); | 166 | ret = device_offline(pn->dev); |
173 | if (acpi_force_hot_remove) | ||
174 | continue; | ||
175 | |||
176 | if (ret >= 0) { | 167 | if (ret >= 0) { |
177 | pn->put_online = !ret; | 168 | pn->put_online = !ret; |
178 | } else { | 169 | } else { |
@@ -241,11 +232,11 @@ static int acpi_scan_try_to_offline(struct acpi_device *device) | |||
241 | acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, | 232 | acpi_walk_namespace(ACPI_TYPE_ANY, handle, ACPI_UINT32_MAX, |
242 | NULL, acpi_bus_offline, (void *)true, | 233 | NULL, acpi_bus_offline, (void *)true, |
243 | (void **)&errdev); | 234 | (void **)&errdev); |
244 | if (!errdev || acpi_force_hot_remove) | 235 | if (!errdev) |
245 | acpi_bus_offline(handle, 0, (void *)true, | 236 | acpi_bus_offline(handle, 0, (void *)true, |
246 | (void **)&errdev); | 237 | (void **)&errdev); |
247 | 238 | ||
248 | if (errdev && !acpi_force_hot_remove) { | 239 | if (errdev) { |
249 | dev_warn(errdev, "Offline failed.\n"); | 240 | dev_warn(errdev, "Offline failed.\n"); |
250 | acpi_bus_online(handle, 0, NULL, NULL); | 241 | acpi_bus_online(handle, 0, NULL, NULL); |
251 | acpi_walk_namespace(ACPI_TYPE_ANY, handle, | 242 | acpi_walk_namespace(ACPI_TYPE_ANY, handle, |
@@ -263,8 +254,7 @@ static int acpi_scan_hot_remove(struct acpi_device *device) | |||
263 | unsigned long long sta; | 254 | unsigned long long sta; |
264 | acpi_status status; | 255 | acpi_status status; |
265 | 256 | ||
266 | if (device->handler && device->handler->hotplug.demand_offline | 257 | if (device->handler && device->handler->hotplug.demand_offline) { |
267 | && !acpi_force_hot_remove) { | ||
268 | if (!acpi_scan_is_offline(device, true)) | 258 | if (!acpi_scan_is_offline(device, true)) |
269 | return -EBUSY; | 259 | return -EBUSY; |
270 | } else { | 260 | } else { |
diff --git a/drivers/acpi/sysfs.c b/drivers/acpi/sysfs.c index cf05ae973381..1b5ee1e0e5a3 100644 --- a/drivers/acpi/sysfs.c +++ b/drivers/acpi/sysfs.c | |||
@@ -921,7 +921,7 @@ void acpi_sysfs_add_hotplug_profile(struct acpi_hotplug_profile *hotplug, | |||
921 | static ssize_t force_remove_show(struct kobject *kobj, | 921 | static ssize_t force_remove_show(struct kobject *kobj, |
922 | struct kobj_attribute *attr, char *buf) | 922 | struct kobj_attribute *attr, char *buf) |
923 | { | 923 | { |
924 | return sprintf(buf, "%d\n", !!acpi_force_hot_remove); | 924 | return sprintf(buf, "%d\n", 0); |
925 | } | 925 | } |
926 | 926 | ||
927 | static ssize_t force_remove_store(struct kobject *kobj, | 927 | static ssize_t force_remove_store(struct kobject *kobj, |
@@ -935,9 +935,10 @@ static ssize_t force_remove_store(struct kobject *kobj, | |||
935 | if (ret < 0) | 935 | if (ret < 0) |
936 | return ret; | 936 | return ret; |
937 | 937 | ||
938 | lock_device_hotplug(); | 938 | if (val) { |
939 | acpi_force_hot_remove = val; | 939 | pr_err("Enabling force_remove is not supported anymore. Please report to linux-acpi@vger.kernel.org if you depend on this functionality\n"); |
940 | unlock_device_hotplug(); | 940 | return -EINVAL; |
941 | } | ||
941 | return size; | 942 | return size; |
942 | } | 943 | } |
943 | 944 | ||