Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'driver-core-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
"Here's the big driver core merge for 3.11-rc1

Lots of little things, and larger firmware subsystem updates, all
described in the shortlog. Nice thing here is that we finally get rid
of CONFIG_HOTPLUG, after 10+ years, thanks to Stephen Rohtwell (it had
been always on for a number of kernel releases, now it's just
removed)"

* tag 'driver-core-3.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (27 commits)
driver core: device.h: fix doc compilation warnings
firmware loader: fix another compile warning with PM_SLEEP unset
build some drivers only when compile-testing
firmware loader: fix compile warning with PM_SLEEP set
kobject: sanitize argument for format string
sysfs_notify is only possible on file attributes
firmware loader: simplify holding module for request_firmware
firmware loader: don't export cache_firmware and uncache_firmware
drivers/base: Use attribute groups to create sysfs memory files
firmware loader: fix compile warning
firmware loader: fix build failure with !CONFIG_FW_LOADER_USER_HELPER
Documentation: Updated broken link in HOWTO
Finally eradicate CONFIG_HOTPLUG
driver core: firmware loader: kill FW_ACTION_NOHOTPLUG requests before suspend
driver core: firmware loader: don't cache FW_ACTION_NOHOTPLUG firmware
Documentation: Tidy up some drivers/base/core.c kerneldoc content.
platform_device: use a macro instead of platform_driver_register
firmware: move EXPORT_SYMBOL annotations
firmware: Avoid deadlock of usermodehelper lock at shutdown
dell_rbu: Select CONFIG_FW_LOADER_USER_HELPER explicitly
...

+316 -265
+1 -4
Documentation/ABI/testing/sysfs-bus-pci
··· 64 64 Writing a non-zero value to this attribute will 65 65 force a rescan of all PCI buses in the system, and 66 66 re-discover previously removed devices. 67 - Depends on CONFIG_HOTPLUG. 68 67 69 68 What: /sys/bus/pci/devices/.../msi_irqs/ 70 69 Date: September, 2011 ··· 89 90 Description: 90 91 Writing a non-zero value to this attribute will 91 92 hot-remove the PCI device and any of its children. 92 - Depends on CONFIG_HOTPLUG. 93 93 94 94 What: /sys/bus/pci/devices/.../pci_bus/.../rescan 95 95 Date: May 2011 ··· 97 99 Writing a non-zero value to this attribute will 98 100 force a rescan of the bus and all child buses, 99 101 and re-discover devices removed earlier from this 100 - part of the device tree. Depends on CONFIG_HOTPLUG. 102 + part of the device tree. 101 103 102 104 What: /sys/bus/pci/devices/.../rescan 103 105 Date: January 2009 ··· 107 109 force a rescan of the device's parent bus and all 108 110 child buses, and re-discover devices removed earlier 109 111 from this part of the device tree. 110 - Depends on CONFIG_HOTPLUG. 111 112 112 113 What: /sys/bus/pci/devices/.../reset 113 114 Date: July 2009
+1 -1
Documentation/HOWTO
··· 112 112 113 113 Other excellent descriptions of how to create patches properly are: 114 114 "The Perfect Patch" 115 - http://userweb.kernel.org/~akpm/stuff/tpp.txt 115 + http://kerneltrap.org/node/3737 116 116 "Linux kernel patch submission format" 117 117 http://linux.yyz.us/patch-format.html 118 118
+1 -1
Documentation/SubmitChecklist
··· 105 105 same time, just various/random combinations of them]: 106 106 107 107 CONFIG_SMP, CONFIG_SYSFS, CONFIG_PROC_FS, CONFIG_INPUT, CONFIG_PCI, 108 - CONFIG_BLOCK, CONFIG_PM, CONFIG_HOTPLUG, CONFIG_MAGIC_SYSRQ, 108 + CONFIG_BLOCK, CONFIG_PM, CONFIG_MAGIC_SYSRQ, 109 109 CONFIG_NET, CONFIG_INET=n (but latter with CONFIG_NET=y)
+1 -1
Documentation/cpu-hotplug.txt
··· 128 128 129 129 "Processor type and Features" -> Support for Hotpluggable CPUs 130 130 131 - Make sure that you have CONFIG_HOTPLUG, and CONFIG_SMP turned on as well. 131 + Make sure that you have CONFIG_SMP turned on as well. 132 132 133 133 You would need to enable CONFIG_HOTPLUG_CPU for SMP suspend/resume support 134 134 as well.
+1 -2
Documentation/hwmon/submitting-patches
··· 27 27 explicitly below the patch header. 28 28 29 29 * If your patch (or the driver) is affected by configuration options such as 30 - CONFIG_SMP or CONFIG_HOTPLUG, make sure it compiles for all configuration 31 - variants. 30 + CONFIG_SMP, make sure it compiles for all configuration variants. 32 31 33 32 34 33 2. Adding functionality to existing drivers
+1 -1
Documentation/kbuild/kconfig.txt
··· 165 165 Example: 166 166 /hotplug 167 167 This lists all config symbols that contain "hotplug", 168 - e.g., HOTPLUG, HOTPLUG_CPU, MEMORY_HOTPLUG. 168 + e.g., HOTPLUG_CPU, MEMORY_HOTPLUG. 169 169 170 170 For search help, enter / followed TAB-TAB-TAB (to highlight 171 171 <Help>) and Enter. This will tell you that you can also use
+3 -3
Documentation/usb/hotplug.txt
··· 33 33 34 34 KERNEL HOTPLUG HELPER (/sbin/hotplug) 35 35 36 - When you compile with CONFIG_HOTPLUG, you get a new kernel parameter: 37 - /proc/sys/kernel/hotplug, which normally holds the pathname "/sbin/hotplug". 38 - That parameter names a program which the kernel may invoke at various times. 36 + There is a kernel parameter: /proc/sys/kernel/hotplug, which normally 37 + holds the pathname "/sbin/hotplug". That parameter names a program 38 + which the kernel may invoke at various times. 39 39 40 40 The /sbin/hotplug program can be invoked by any subsystem as part of its 41 41 reaction to a configuration change, from a thread in that subsystem.
+1 -1
arch/arm/Kconfig
··· 1552 1552 1553 1553 config HOTPLUG_CPU 1554 1554 bool "Support for hot-pluggable CPUs" 1555 - depends on SMP && HOTPLUG 1555 + depends on SMP 1556 1556 help 1557 1557 Say Y here to experiment with turning CPUs off and on. CPUs 1558 1558 can be controlled through /sys/devices/system/cpu.
-8
arch/arm/kernel/module.c
··· 288 288 289 289 if (strcmp(".ARM.exidx.init.text", secname) == 0) 290 290 maps[ARM_SEC_INIT].unw_sec = s; 291 - else if (strcmp(".ARM.exidx.devinit.text", secname) == 0) 292 - maps[ARM_SEC_DEVINIT].unw_sec = s; 293 291 else if (strcmp(".ARM.exidx", secname) == 0) 294 292 maps[ARM_SEC_CORE].unw_sec = s; 295 293 else if (strcmp(".ARM.exidx.exit.text", secname) == 0) 296 294 maps[ARM_SEC_EXIT].unw_sec = s; 297 - else if (strcmp(".ARM.exidx.devexit.text", secname) == 0) 298 - maps[ARM_SEC_DEVEXIT].unw_sec = s; 299 295 else if (strcmp(".init.text", secname) == 0) 300 296 maps[ARM_SEC_INIT].txt_sec = s; 301 - else if (strcmp(".devinit.text", secname) == 0) 302 - maps[ARM_SEC_DEVINIT].txt_sec = s; 303 297 else if (strcmp(".text", secname) == 0) 304 298 maps[ARM_SEC_CORE].txt_sec = s; 305 299 else if (strcmp(".exit.text", secname) == 0) 306 300 maps[ARM_SEC_EXIT].txt_sec = s; 307 - else if (strcmp(".devexit.text", secname) == 0) 308 - maps[ARM_SEC_DEVEXIT].txt_sec = s; 309 301 } 310 302 311 303 for (i = 0; i < ARM_SEC_MAX; i++)
-4
arch/arm/kernel/vmlinux.lds.S
··· 70 70 ARM_EXIT_DISCARD(EXIT_TEXT) 71 71 ARM_EXIT_DISCARD(EXIT_DATA) 72 72 EXIT_CALL 73 - #ifndef CONFIG_HOTPLUG 74 - *(.ARM.exidx.devexit.text) 75 - *(.ARM.extab.devexit.text) 76 - #endif 77 73 #ifndef CONFIG_MMU 78 74 *(.fixup) 79 75 *(__ex_table)
-1
arch/arm/mach-ixp4xx/Kconfig
··· 235 235 config IXP4XX_NPE 236 236 tristate "IXP4xx Network Processor Engine support" 237 237 select FW_LOADER 238 - select HOTPLUG 239 238 help 240 239 This driver supports IXP4xx built-in network coprocessors 241 240 and is automatically selected by Ethernet and HSS drivers.
+1 -1
arch/blackfin/Kconfig
··· 253 253 254 254 config HOTPLUG_CPU 255 255 bool "Support for hot-pluggable CPUs" 256 - depends on SMP && HOTPLUG 256 + depends on SMP 257 257 default y 258 258 259 259 config BF_REV_MIN
-1
arch/cris/arch-v32/drivers/Kconfig
··· 617 617 config ETRAX_CARDBUS 618 618 bool "Cardbus support" 619 619 depends on ETRAX_ARCH_V32 620 - select HOTPLUG 621 620 help 622 621 Enabled the ETRAX Cardbus driver. 623 622
-1
arch/ia64/Kconfig
··· 376 376 config HOTPLUG_CPU 377 377 bool "Support for hot-pluggable CPUs" 378 378 depends on SMP 379 - select HOTPLUG 380 379 default n 381 380 ---help--- 382 381 Say Y here to experiment with turning CPUs off and on. CPUs
+1 -1
arch/mips/Kconfig
··· 962 962 963 963 config HOTPLUG_CPU 964 964 bool "Support for hot-pluggable CPUs" 965 - depends on SMP && HOTPLUG && SYS_SUPPORTS_HOTPLUG_CPU 965 + depends on SMP && SYS_SUPPORTS_HOTPLUG_CPU 966 966 help 967 967 Say Y here to allow turning CPUs off and on. CPUs can be 968 968 controlled through /sys/devices/system/cpu.
-1
arch/parisc/Kconfig
··· 254 254 config HOTPLUG_CPU 255 255 bool 256 256 default y if SMP 257 - select HOTPLUG 258 257 259 258 config ARCH_SELECT_MEMORY_MODEL 260 259 def_bool y
+1 -1
arch/powerpc/Kconfig
··· 341 341 342 342 config HOTPLUG_CPU 343 343 bool "Support for enabling/disabling CPUs" 344 - depends on SMP && HOTPLUG && (PPC_PSERIES || \ 344 + depends on SMP && (PPC_PSERIES || \ 345 345 PPC_PMAC || PPC_POWERNV || (PPC_85xx && !PPC_E500MC)) 346 346 ---help--- 347 347 Say Y here to be able to disable and re-enable individual
+2 -2
arch/powerpc/mm/tlb_hash64.c
··· 183 183 * since 64K pages may overlap with other bridges when using 64K pages 184 184 * with 4K HW pages on IO space. 185 185 * 186 - * Because of that usage pattern, it's only available with CONFIG_HOTPLUG 187 - * and is implemented for small size rather than speed. 186 + * Because of that usage pattern, it is implemented for small size rather 187 + * than speed. 188 188 */ 189 189 void __flush_hash_table_range(struct mm_struct *mm, unsigned long start, 190 190 unsigned long end)
-1
arch/s390/Kconfig
··· 301 301 def_bool y 302 302 prompt "Support for hot-pluggable CPUs" 303 303 depends on SMP 304 - select HOTPLUG 305 304 help 306 305 Say Y here to be able to turn CPUs off and on. CPUs 307 306 can be controlled through /sys/devices/system/cpu/cpu#.
+1 -1
arch/sh/Kconfig
··· 748 748 749 749 config HOTPLUG_CPU 750 750 bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" 751 - depends on SMP && HOTPLUG 751 + depends on SMP 752 752 help 753 753 Say Y here to experiment with turning CPUs off and on. CPUs 754 754 can be controlled through /sys/devices/system/cpu.
-1
arch/sparc/Kconfig
··· 243 243 config HOTPLUG_CPU 244 244 bool "Support for hot-pluggable CPUs" 245 245 depends on SPARC64 && SMP 246 - select HOTPLUG 247 246 help 248 247 Say Y here to experiment with turning CPUs off and on. CPUs 249 248 can be controlled through /sys/devices/system/cpu/cpu#.
+1 -1
arch/x86/Kconfig
··· 1725 1725 1726 1726 config HOTPLUG_CPU 1727 1727 bool "Support for hot-pluggable CPUs" 1728 - depends on SMP && HOTPLUG 1728 + depends on SMP 1729 1729 ---help--- 1730 1730 Say Y here to allow turning CPUs off and on. CPUs can be 1731 1731 controlled through /sys/devices/system/cpu.
-2
drivers/base/Kconfig
··· 2 2 3 3 config UEVENT_HELPER_PATH 4 4 string "path to uevent helper" 5 - depends on HOTPLUG 6 5 default "" 7 6 help 8 7 Path to uevent helper program forked by the kernel for ··· 22 23 23 24 config DEVTMPFS 24 25 bool "Maintain a devtmpfs filesystem to mount at /dev" 25 - depends on HOTPLUG 26 26 help 27 27 This creates a tmpfs/ramfs filesystem instance early at bootup. 28 28 In this filesystem, the kernel driver core maintains device
+9 -7
drivers/base/core.c
··· 193 193 EXPORT_SYMBOL_GPL(device_show_bool); 194 194 195 195 /** 196 - * device_release - free device structure. 197 - * @kobj: device's kobject. 196 + * device_release - free device structure. 197 + * @kobj: device's kobject. 198 198 * 199 - * This is called once the reference count for the object 200 - * reaches 0. We forward the call to the device's release 201 - * method, which should handle actually freeing the structure. 199 + * This is called once the reference count for the object 200 + * reaches 0. We forward the call to the device's release 201 + * method, which should handle actually freeing the structure. 202 202 */ 203 203 static void device_release(struct kobject *kobj) 204 204 { ··· 1334 1334 /** 1335 1335 * device_for_each_child - device child iterator. 1336 1336 * @parent: parent struct device. 1337 - * @data: data for the callback. 1338 1337 * @fn: function to be called for each device. 1338 + * @data: data for the callback. 1339 1339 * 1340 1340 * Iterate over @parent's child devices, and call @fn for each, 1341 1341 * passing it @data. ··· 1363 1363 /** 1364 1364 * device_find_child - device iterator for locating a particular device. 1365 1365 * @parent: parent struct device 1366 - * @data: Data to pass to match function 1367 1366 * @match: Callback function to check device 1367 + * @data: Data to pass to match function 1368 1368 * 1369 1369 * This is similar to the device_for_each_child() function above, but it 1370 1370 * returns a reference to a device that is 'found' for later use, as ··· 1374 1374 * if it does. If the callback returns non-zero and a reference to the 1375 1375 * current device can be obtained, this function will return to the caller 1376 1376 * and not iterate over any more devices. 1377 + * 1378 + * NOTE: you will need to drop the reference with put_device() after use. 1377 1379 */ 1378 1380 struct device *device_find_child(struct device *parent, void *data, 1379 1381 int (*match)(struct device *dev, void *data))
+39 -20
drivers/base/cpu.c
··· 85 85 } 86 86 static DEVICE_ATTR(online, 0644, show_online, store_online); 87 87 88 - static void __cpuinit register_cpu_control(struct cpu *cpu) 89 - { 90 - device_create_file(&cpu->dev, &dev_attr_online); 91 - } 88 + static struct attribute *hotplug_cpu_attrs[] = { 89 + &dev_attr_online.attr, 90 + NULL 91 + }; 92 + 93 + static struct attribute_group hotplug_cpu_attr_group = { 94 + .attrs = hotplug_cpu_attrs, 95 + }; 96 + 92 97 void unregister_cpu(struct cpu *cpu) 93 98 { 94 99 int logical_cpu = cpu->dev.id; 95 100 96 101 unregister_cpu_under_node(logical_cpu, cpu_to_node(logical_cpu)); 97 - 98 - device_remove_file(&cpu->dev, &dev_attr_online); 99 102 100 103 device_unregister(&cpu->dev); 101 104 per_cpu(cpu_sys_devices, logical_cpu) = NULL; ··· 125 122 static DEVICE_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); 126 123 static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store); 127 124 #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ 128 - 129 - #else /* ... !CONFIG_HOTPLUG_CPU */ 130 - static inline void register_cpu_control(struct cpu *cpu) 131 - { 132 - } 133 125 #endif /* CONFIG_HOTPLUG_CPU */ 134 126 135 127 #ifdef CONFIG_KEXEC ··· 162 164 return rc; 163 165 } 164 166 static DEVICE_ATTR(crash_notes_size, 0400, show_crash_notes_size, NULL); 167 + 168 + static struct attribute *crash_note_cpu_attrs[] = { 169 + &dev_attr_crash_notes.attr, 170 + &dev_attr_crash_notes_size.attr, 171 + NULL 172 + }; 173 + 174 + static struct attribute_group crash_note_cpu_attr_group = { 175 + .attrs = crash_note_cpu_attrs, 176 + }; 165 177 #endif 178 + 179 + static const struct attribute_group *common_cpu_attr_groups[] = { 180 + #ifdef CONFIG_KEXEC 181 + &crash_note_cpu_attr_group, 182 + #endif 183 + NULL 184 + }; 185 + 186 + static const struct attribute_group *hotplugable_cpu_attr_groups[] = { 187 + #ifdef CONFIG_KEXEC 188 + &crash_note_cpu_attr_group, 189 + #endif 190 + #ifdef CONFIG_HOTPLUG_CPU 191 + &hotplug_cpu_attr_group, 192 + #endif 193 + NULL 194 + }; 166 195 167 196 /* 168 197 * Print cpu online, possible, present, and system maps ··· 305 280 #ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE 306 281 cpu->dev.bus->uevent = arch_cpu_uevent; 307 282 #endif 283 + cpu->dev.groups = common_cpu_attr_groups; 284 + if (cpu->hotpluggable) 285 + cpu->dev.groups = hotplugable_cpu_attr_groups; 308 286 error = device_register(&cpu->dev); 309 - if (!error && cpu->hotpluggable) 310 - register_cpu_control(cpu); 311 287 if (!error) 312 288 per_cpu(cpu_sys_devices, num) = &cpu->dev; 313 289 if (!error) 314 290 register_cpu_under_node(num, cpu_to_node(num)); 315 291 316 - #ifdef CONFIG_KEXEC 317 - if (!error) 318 - error = device_create_file(&cpu->dev, &dev_attr_crash_notes); 319 - if (!error) 320 - error = device_create_file(&cpu->dev, 321 - &dev_attr_crash_notes_size); 322 - #endif 323 292 return error; 324 293 } 325 294
+97 -35
drivers/base/firmware_class.c
··· 27 27 #include <linux/pm.h> 28 28 #include <linux/suspend.h> 29 29 #include <linux/syscore_ops.h> 30 + #include <linux/reboot.h> 30 31 31 32 #include <generated/utsrelease.h> 32 33 ··· 128 127 size_t size; 129 128 #ifdef CONFIG_FW_LOADER_USER_HELPER 130 129 bool is_paged_buf; 130 + bool need_uevent; 131 131 struct page **pages; 132 132 int nr_pages; 133 133 int page_array_size; 134 + struct list_head pending_list; 134 135 #endif 135 136 char fw_id[]; 136 137 }; ··· 174 171 strcpy(buf->fw_id, fw_name); 175 172 buf->fwc = fwc; 176 173 init_completion(&buf->completion); 174 + #ifdef CONFIG_FW_LOADER_USER_HELPER 175 + INIT_LIST_HEAD(&buf->pending_list); 176 + #endif 177 177 178 178 pr_debug("%s: fw-%s buf=%p\n", __func__, fw_name, buf); 179 179 ··· 216 210 *buf = tmp; 217 211 218 212 return tmp ? 0 : -ENOMEM; 219 - } 220 - 221 - static struct firmware_buf *fw_lookup_buf(const char *fw_name) 222 - { 223 - struct firmware_buf *tmp; 224 - struct firmware_cache *fwc = &fw_cache; 225 - 226 - spin_lock(&fwc->lock); 227 - tmp = __fw_lookup_buf(fw_name); 228 - spin_unlock(&fwc->lock); 229 - 230 - return tmp; 231 213 } 232 214 233 215 static void __fw_free_buf(struct kref *ref) ··· 440 446 return container_of(dev, struct firmware_priv, dev); 441 447 } 442 448 443 - static void fw_load_abort(struct firmware_priv *fw_priv) 449 + static void __fw_load_abort(struct firmware_buf *buf) 444 450 { 445 - struct firmware_buf *buf = fw_priv->buf; 446 - 447 451 /* 448 452 * There is a small window in which user can write to 'loading' 449 453 * between loading done and disappearance of 'loading' ··· 449 457 if (test_bit(FW_STATUS_DONE, &buf->status)) 450 458 return; 451 459 460 + list_del_init(&buf->pending_list); 452 461 set_bit(FW_STATUS_ABORT, &buf->status); 453 462 complete_all(&buf->completion); 463 + } 464 + 465 + static void fw_load_abort(struct firmware_priv *fw_priv) 466 + { 467 + struct firmware_buf *buf = fw_priv->buf; 468 + 469 + __fw_load_abort(buf); 454 470 455 471 /* avoid user action after loading abort */ 456 472 fw_priv->buf = NULL; ··· 466 466 467 467 #define is_fw_load_aborted(buf) \ 468 468 test_bit(FW_STATUS_ABORT, &(buf)->status) 469 + 470 + static LIST_HEAD(pending_fw_head); 471 + 472 + /* reboot notifier for avoid deadlock with usermode_lock */ 473 + static int fw_shutdown_notify(struct notifier_block *unused1, 474 + unsigned long unused2, void *unused3) 475 + { 476 + mutex_lock(&fw_lock); 477 + while (!list_empty(&pending_fw_head)) 478 + __fw_load_abort(list_first_entry(&pending_fw_head, 479 + struct firmware_buf, 480 + pending_list)); 481 + mutex_unlock(&fw_lock); 482 + return NOTIFY_DONE; 483 + } 484 + 485 + static struct notifier_block fw_shutdown_nb = { 486 + .notifier_call = fw_shutdown_notify, 487 + }; 469 488 470 489 static ssize_t firmware_timeout_show(struct class *class, 471 490 struct class_attribute *attr, ··· 528 509 struct firmware_priv *fw_priv = to_firmware_priv(dev); 529 510 530 511 kfree(fw_priv); 531 - 532 - module_put(THIS_MODULE); 533 512 } 534 513 535 514 static int firmware_uevent(struct device *dev, struct kobj_uevent_env *env) ··· 636 619 * is completed. 637 620 * */ 638 621 fw_map_pages_buf(fw_buf); 622 + list_del_init(&fw_buf->pending_list); 639 623 complete_all(&fw_buf->completion); 640 624 break; 641 625 } ··· 856 838 857 839 dev_set_uevent_suppress(f_dev, true); 858 840 859 - /* Need to pin this module until class device is destroyed */ 860 - __module_get(THIS_MODULE); 861 - 862 841 retval = device_add(f_dev); 863 842 if (retval) { 864 843 dev_err(f_dev, "%s: device_register failed\n", __func__); ··· 875 860 } 876 861 877 862 if (uevent) { 863 + buf->need_uevent = true; 878 864 dev_set_uevent_suppress(f_dev, false); 879 865 dev_dbg(f_dev, "firmware: requesting %s\n", buf->fw_id); 880 866 if (timeout != MAX_SCHEDULE_TIMEOUT) ··· 883 867 884 868 kobject_uevent(&fw_priv->dev.kobj, KOBJ_ADD); 885 869 } 870 + 871 + mutex_lock(&fw_lock); 872 + list_add(&buf->pending_list, &pending_fw_head); 873 + mutex_unlock(&fw_lock); 886 874 887 875 wait_for_completion(&buf->completion); 888 876 ··· 915 895 fw_priv->buf = firmware->priv; 916 896 return _request_firmware_load(fw_priv, uevent, timeout); 917 897 } 898 + 899 + #ifdef CONFIG_PM_SLEEP 900 + /* kill pending requests without uevent to avoid blocking suspend */ 901 + static void kill_requests_without_uevent(void) 902 + { 903 + struct firmware_buf *buf; 904 + struct firmware_buf *next; 905 + 906 + mutex_lock(&fw_lock); 907 + list_for_each_entry_safe(buf, next, &pending_fw_head, pending_list) { 908 + if (!buf->need_uevent) 909 + __fw_load_abort(buf); 910 + } 911 + mutex_unlock(&fw_lock); 912 + } 913 + #endif 914 + 918 915 #else /* CONFIG_FW_LOADER_USER_HELPER */ 919 916 static inline int 920 917 fw_load_from_user_helper(struct firmware *firmware, const char *name, ··· 943 906 944 907 /* No abort during direct loading */ 945 908 #define is_fw_load_aborted(buf) false 909 + 910 + #ifdef CONFIG_PM_SLEEP 911 + static inline void kill_requests_without_uevent(void) { } 912 + #endif 946 913 947 914 #endif /* CONFIG_FW_LOADER_USER_HELPER */ 948 915 ··· 1015 974 return 1; /* need to load */ 1016 975 } 1017 976 1018 - static int assign_firmware_buf(struct firmware *fw, struct device *device) 977 + static int assign_firmware_buf(struct firmware *fw, struct device *device, 978 + bool skip_cache) 1019 979 { 1020 980 struct firmware_buf *buf = fw->priv; 1021 981 ··· 1033 991 * device may has been deleted already, but the problem 1034 992 * should be fixed in devres or driver core. 1035 993 */ 1036 - if (device) 994 + if (device && !skip_cache) 1037 995 fw_add_devm_name(device, buf->fw_id); 1038 996 1039 997 /* ··· 1089 1047 if (!fw_get_filesystem_firmware(device, fw->priv)) 1090 1048 ret = fw_load_from_user_helper(fw, name, device, 1091 1049 uevent, nowait, timeout); 1050 + 1051 + /* don't cache firmware handled without uevent */ 1092 1052 if (!ret) 1093 - ret = assign_firmware_buf(fw, device); 1053 + ret = assign_firmware_buf(fw, device, !uevent); 1094 1054 1095 1055 usermodehelper_read_unlock(); 1096 1056 ··· 1130 1086 request_firmware(const struct firmware **firmware_p, const char *name, 1131 1087 struct device *device) 1132 1088 { 1133 - return _request_firmware(firmware_p, name, device, true, false); 1089 + int ret; 1090 + 1091 + /* Need to pin this module until return */ 1092 + __module_get(THIS_MODULE); 1093 + ret = _request_firmware(firmware_p, name, device, true, false); 1094 + module_put(THIS_MODULE); 1095 + return ret; 1134 1096 } 1097 + EXPORT_SYMBOL(request_firmware); 1135 1098 1136 1099 /** 1137 1100 * release_firmware: - release the resource associated with a firmware image ··· 1152 1101 kfree(fw); 1153 1102 } 1154 1103 } 1104 + EXPORT_SYMBOL(release_firmware); 1155 1105 1156 1106 /* Async support */ 1157 1107 struct firmware_work { ··· 1233 1181 schedule_work(&fw_work->work); 1234 1182 return 0; 1235 1183 } 1184 + EXPORT_SYMBOL(request_firmware_nowait); 1185 + 1186 + #ifdef CONFIG_PM_SLEEP 1187 + static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain); 1236 1188 1237 1189 /** 1238 1190 * cache_firmware - cache one firmware image in kernel memory space ··· 1252 1196 * Return !0 otherwise 1253 1197 * 1254 1198 */ 1255 - int cache_firmware(const char *fw_name) 1199 + static int cache_firmware(const char *fw_name) 1256 1200 { 1257 1201 int ret; 1258 1202 const struct firmware *fw; ··· 1268 1212 return ret; 1269 1213 } 1270 1214 1215 + static struct firmware_buf *fw_lookup_buf(const char *fw_name) 1216 + { 1217 + struct firmware_buf *tmp; 1218 + struct firmware_cache *fwc = &fw_cache; 1219 + 1220 + spin_lock(&fwc->lock); 1221 + tmp = __fw_lookup_buf(fw_name); 1222 + spin_unlock(&fwc->lock); 1223 + 1224 + return tmp; 1225 + } 1226 + 1271 1227 /** 1272 1228 * uncache_firmware - remove one cached firmware image 1273 1229 * @fw_name: the firmware image name ··· 1291 1223 * Return !0 otherwise 1292 1224 * 1293 1225 */ 1294 - int uncache_firmware(const char *fw_name) 1226 + static int uncache_firmware(const char *fw_name) 1295 1227 { 1296 1228 struct firmware_buf *buf; 1297 1229 struct firmware fw; ··· 1309 1241 1310 1242 return -EINVAL; 1311 1243 } 1312 - 1313 - #ifdef CONFIG_PM_SLEEP 1314 - static ASYNC_DOMAIN_EXCLUSIVE(fw_cache_domain); 1315 1244 1316 1245 static struct fw_cache_entry *alloc_fw_cache_entry(const char *name) 1317 1246 { ··· 1529 1464 switch (mode) { 1530 1465 case PM_HIBERNATION_PREPARE: 1531 1466 case PM_SUSPEND_PREPARE: 1467 + kill_requests_without_uevent(); 1532 1468 device_cache_fw_images(); 1533 1469 break; 1534 1470 ··· 1592 1526 { 1593 1527 fw_cache_init(); 1594 1528 #ifdef CONFIG_FW_LOADER_USER_HELPER 1529 + register_reboot_notifier(&fw_shutdown_nb); 1595 1530 return class_register(&firmware_class); 1596 1531 #else 1597 1532 return 0; ··· 1606 1539 unregister_pm_notifier(&fw_cache.pm_notify); 1607 1540 #endif 1608 1541 #ifdef CONFIG_FW_LOADER_USER_HELPER 1542 + unregister_reboot_notifier(&fw_shutdown_nb); 1609 1543 class_unregister(&firmware_class); 1610 1544 #endif 1611 1545 } 1612 1546 1613 1547 fs_initcall(firmware_class_init); 1614 1548 module_exit(firmware_class_exit); 1615 - 1616 - EXPORT_SYMBOL(release_firmware); 1617 - EXPORT_SYMBOL(request_firmware); 1618 - EXPORT_SYMBOL(request_firmware_nowait); 1619 - EXPORT_SYMBOL_GPL(cache_firmware); 1620 - EXPORT_SYMBOL_GPL(uncache_firmware);
+62 -81
drivers/base/memory.c
··· 77 77 kfree(mem); 78 78 } 79 79 80 - /* 81 - * register_memory - Setup a sysfs device for a memory block 82 - */ 83 - static 84 - int register_memory(struct memory_block *memory) 85 - { 86 - int error; 87 - 88 - memory->dev.bus = &memory_subsys; 89 - memory->dev.id = memory->start_section_nr / sections_per_block; 90 - memory->dev.release = memory_block_release; 91 - 92 - error = device_register(&memory->dev); 93 - return error; 94 - } 95 - 96 80 unsigned long __weak memory_block_size_bytes(void) 97 81 { 98 82 return MIN_MEMORY_BLOCK_SIZE; ··· 355 371 static DEVICE_ATTR(phys_device, 0444, show_phys_device, NULL); 356 372 static DEVICE_ATTR(removable, 0444, show_mem_removable, NULL); 357 373 358 - #define mem_create_simple_file(mem, attr_name) \ 359 - device_create_file(&mem->dev, &dev_attr_##attr_name) 360 - #define mem_remove_simple_file(mem, attr_name) \ 361 - device_remove_file(&mem->dev, &dev_attr_##attr_name) 362 - 363 374 /* 364 375 * Block size attribute stuff 365 376 */ ··· 366 387 } 367 388 368 389 static DEVICE_ATTR(block_size_bytes, 0444, print_block_size, NULL); 369 - 370 - static int block_size_init(void) 371 - { 372 - return device_create_file(memory_subsys.dev_root, 373 - &dev_attr_block_size_bytes); 374 - } 375 390 376 391 /* 377 392 * Some architectures will have custom drivers to do this, and ··· 402 429 out: 403 430 return ret; 404 431 } 405 - static DEVICE_ATTR(probe, S_IWUSR, NULL, memory_probe_store); 406 432 407 - static int memory_probe_init(void) 408 - { 409 - return device_create_file(memory_subsys.dev_root, &dev_attr_probe); 410 - } 411 - #else 412 - static inline int memory_probe_init(void) 413 - { 414 - return 0; 415 - } 433 + static DEVICE_ATTR(probe, S_IWUSR, NULL, memory_probe_store); 416 434 #endif 417 435 418 436 #ifdef CONFIG_MEMORY_FAILURE ··· 449 485 450 486 static DEVICE_ATTR(soft_offline_page, S_IWUSR, NULL, store_soft_offline_page); 451 487 static DEVICE_ATTR(hard_offline_page, S_IWUSR, NULL, store_hard_offline_page); 452 - 453 - static __init int memory_fail_init(void) 454 - { 455 - int err; 456 - 457 - err = device_create_file(memory_subsys.dev_root, 458 - &dev_attr_soft_offline_page); 459 - if (!err) 460 - err = device_create_file(memory_subsys.dev_root, 461 - &dev_attr_hard_offline_page); 462 - return err; 463 - } 464 - #else 465 - static inline int memory_fail_init(void) 466 - { 467 - return 0; 468 - } 469 488 #endif 470 489 471 490 /* ··· 493 546 return find_memory_block_hinted(section, NULL); 494 547 } 495 548 549 + static struct attribute *memory_memblk_attrs[] = { 550 + &dev_attr_phys_index.attr, 551 + &dev_attr_end_phys_index.attr, 552 + &dev_attr_state.attr, 553 + &dev_attr_phys_device.attr, 554 + &dev_attr_removable.attr, 555 + NULL 556 + }; 557 + 558 + static struct attribute_group memory_memblk_attr_group = { 559 + .attrs = memory_memblk_attrs, 560 + }; 561 + 562 + static const struct attribute_group *memory_memblk_attr_groups[] = { 563 + &memory_memblk_attr_group, 564 + NULL, 565 + }; 566 + 567 + /* 568 + * register_memory - Setup a sysfs device for a memory block 569 + */ 570 + static 571 + int register_memory(struct memory_block *memory) 572 + { 573 + int error; 574 + 575 + memory->dev.bus = &memory_subsys; 576 + memory->dev.id = memory->start_section_nr / sections_per_block; 577 + memory->dev.release = memory_block_release; 578 + memory->dev.groups = memory_memblk_attr_groups; 579 + 580 + error = device_register(&memory->dev); 581 + return error; 582 + } 583 + 496 584 static int init_memory_block(struct memory_block **memory, 497 585 struct mem_section *section, unsigned long state) 498 586 { ··· 551 569 mem->phys_device = arch_get_memory_phys_device(start_pfn); 552 570 553 571 ret = register_memory(mem); 554 - if (!ret) 555 - ret = mem_create_simple_file(mem, phys_index); 556 - if (!ret) 557 - ret = mem_create_simple_file(mem, end_phys_index); 558 - if (!ret) 559 - ret = mem_create_simple_file(mem, state); 560 - if (!ret) 561 - ret = mem_create_simple_file(mem, phys_device); 562 - if (!ret) 563 - ret = mem_create_simple_file(mem, removable); 564 572 565 573 *memory = mem; 566 574 return ret; ··· 628 656 unregister_mem_sect_under_nodes(mem, __section_nr(section)); 629 657 630 658 mem->section_count--; 631 - if (mem->section_count == 0) { 632 - mem_remove_simple_file(mem, phys_index); 633 - mem_remove_simple_file(mem, end_phys_index); 634 - mem_remove_simple_file(mem, state); 635 - mem_remove_simple_file(mem, phys_device); 636 - mem_remove_simple_file(mem, removable); 659 + if (mem->section_count == 0) 637 660 unregister_memory(mem); 638 - } else 661 + else 639 662 kobject_put(&mem->dev.kobj); 640 663 641 664 mutex_unlock(&mem_sysfs_mutex); ··· 667 700 return mem->state == MEM_OFFLINE; 668 701 } 669 702 703 + static struct attribute *memory_root_attrs[] = { 704 + #ifdef CONFIG_ARCH_MEMORY_PROBE 705 + &dev_attr_probe.attr, 706 + #endif 707 + 708 + #ifdef CONFIG_MEMORY_FAILURE 709 + &dev_attr_soft_offline_page.attr, 710 + &dev_attr_hard_offline_page.attr, 711 + #endif 712 + 713 + &dev_attr_block_size_bytes.attr, 714 + NULL 715 + }; 716 + 717 + static struct attribute_group memory_root_attr_group = { 718 + .attrs = memory_root_attrs, 719 + }; 720 + 721 + static const struct attribute_group *memory_root_attr_groups[] = { 722 + &memory_root_attr_group, 723 + NULL, 724 + }; 725 + 670 726 /* 671 727 * Initialize the sysfs support for memory devices... 672 728 */ ··· 701 711 unsigned long block_sz; 702 712 struct memory_block *mem = NULL; 703 713 704 - ret = subsys_system_register(&memory_subsys, NULL); 714 + ret = subsys_system_register(&memory_subsys, memory_root_attr_groups); 705 715 if (ret) 706 716 goto out; 707 717 ··· 724 734 ret = err; 725 735 } 726 736 727 - err = memory_probe_init(); 728 - if (!ret) 729 - ret = err; 730 - err = memory_fail_init(); 731 - if (!ret) 732 - ret = err; 733 - err = block_size_init(); 734 - if (!ret) 735 - ret = err; 736 737 out: 737 738 if (ret) 738 739 printk(KERN_ERR "%s() failed: %d\n", __func__, ret);
+5 -3
drivers/base/platform.c
··· 523 523 } 524 524 525 525 /** 526 - * platform_driver_register - register a driver for platform-level devices 526 + * __platform_driver_register - register a driver for platform-level devices 527 527 * @drv: platform driver structure 528 528 */ 529 - int platform_driver_register(struct platform_driver *drv) 529 + int __platform_driver_register(struct platform_driver *drv, 530 + struct module *owner) 530 531 { 532 + drv->driver.owner = owner; 531 533 drv->driver.bus = &platform_bus_type; 532 534 if (drv->probe) 533 535 drv->driver.probe = platform_drv_probe; ··· 540 538 541 539 return driver_register(&drv->driver); 542 540 } 543 - EXPORT_SYMBOL_GPL(platform_driver_register); 541 + EXPORT_SYMBOL_GPL(__platform_driver_register); 544 542 545 543 /** 546 544 * platform_driver_unregister - unregister a driver for platform-level devices
+1 -1
drivers/char/pcmcia/Kconfig
··· 3 3 # 4 4 5 5 menu "PCMCIA character devices" 6 - depends on HOTPLUG && PCMCIA!=n 6 + depends on PCMCIA!=n 7 7 8 8 config SYNCLINK_CS 9 9 tristate "SyncLink PC Card support"
+1 -1
drivers/edac/Kconfig
··· 145 145 146 146 config EDAC_E752X 147 147 tristate "Intel e752x (e7520, e7525, e7320) and 3100" 148 - depends on EDAC_MM_EDAC && PCI && X86 && HOTPLUG 148 + depends on EDAC_MM_EDAC && PCI && X86 149 149 help 150 150 Support for error detection and correction on the Intel 151 151 E7520, E7525, E7320 server chipsets.
+1
drivers/firmware/Kconfig
··· 64 64 tristate "BIOS update support for DELL systems via sysfs" 65 65 depends on X86 66 66 select FW_LOADER 67 + select FW_LOADER_USER_HELPER 67 68 help 68 69 Say m if you want to have the option of updating the BIOS for your 69 70 DELL system. Note you need a Dell OpenManage or Dell Update package (DUP)
+1 -1
drivers/misc/Kconfig
··· 135 135 136 136 config INTEL_MID_PTI 137 137 tristate "Parallel Trace Interface for MIPI P1149.7 cJTAG standard" 138 - depends on PCI && TTY 138 + depends on PCI && TTY && (X86_INTEL_MID || COMPILE_TEST) 139 139 default n 140 140 help 141 141 The PTI (Parallel Trace Interface) driver directs
-2
drivers/pci/Kconfig
··· 55 55 config XEN_PCIDEV_FRONTEND 56 56 tristate "Xen PCI Frontend" 57 57 depends on PCI && X86 && XEN 58 - select HOTPLUG 59 58 select PCI_XEN 60 59 select XEN_XENBUS_FRONTEND 61 60 default y ··· 112 113 tristate "PCI IO-APIC hotplug support" if X86 113 114 depends on PCI 114 115 depends on ACPI 115 - depends on HOTPLUG 116 116 default !X86 117 117 118 118 config PCI_LABEL
+1 -1
drivers/pci/hotplug/Kconfig
··· 4 4 5 5 menuconfig HOTPLUG_PCI 6 6 tristate "Support for PCI Hotplug" 7 - depends on PCI && HOTPLUG && SYSFS 7 + depends on PCI && SYSFS 8 8 ---help--- 9 9 Say Y here if you have a motherboard with a PCI Hotplug controller. 10 10 This allows you to add and remove PCI cards while the machine is
-1
drivers/pcmcia/Kconfig
··· 4 4 5 5 menuconfig PCCARD 6 6 tristate "PCCard (PCMCIA/CardBus) support" 7 - depends on HOTPLUG 8 7 ---help--- 9 8 Say Y here if you want to attach PCMCIA- or PC-cards to your Linux 10 9 computer. These are credit-card size devices such as network cards,
+1
drivers/ptp/Kconfig
··· 72 72 73 73 config PTP_1588_CLOCK_PCH 74 74 tristate "Intel PCH EG20T as PTP clock" 75 + depends on X86 || COMPILE_TEST 75 76 select PTP_1588_CLOCK 76 77 help 77 78 This driver adds support for using the PCH EG20T as a PTP
-1
drivers/staging/media/go7007/go7007.txt
··· 78 78 for custom-built kernels, the following options need to be enabled in the 79 79 kernel as built-in or modules: 80 80 81 - CONFIG_HOTPLUG - Support for hot-pluggable devices 82 81 CONFIG_MODULES - Enable loadable module support 83 82 CONFIG_KMOD - Automatic kernel module loading 84 83 CONFIG_FW_LOADER - Hotplug firmware loading support
+1 -1
drivers/video/geode/Kconfig
··· 3 3 # 4 4 config FB_GEODE 5 5 bool "AMD Geode family framebuffer support" 6 - depends on FB && PCI && X86 6 + depends on FB && PCI && (X86_32 || (X86 && COMPILE_TEST)) 7 7 ---help--- 8 8 Say 'Y' here to allow you to select framebuffer drivers for 9 9 the AMD Geode family of processors.
+43
fs/debugfs/file.c
··· 21 21 #include <linux/debugfs.h> 22 22 #include <linux/io.h> 23 23 #include <linux/slab.h> 24 + #include <linux/atomic.h> 24 25 25 26 static ssize_t default_read_file(struct file *file, char __user *buf, 26 27 size_t count, loff_t *ppos) ··· 404 403 } 405 404 EXPORT_SYMBOL_GPL(debugfs_create_size_t); 406 405 406 + static int debugfs_atomic_t_set(void *data, u64 val) 407 + { 408 + atomic_set((atomic_t *)data, val); 409 + return 0; 410 + } 411 + static int debugfs_atomic_t_get(void *data, u64 *val) 412 + { 413 + *val = atomic_read((atomic_t *)data); 414 + return 0; 415 + } 416 + DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get, 417 + debugfs_atomic_t_set, "%lld\n"); 418 + DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t_ro, debugfs_atomic_t_get, NULL, "%lld\n"); 419 + DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t_wo, NULL, debugfs_atomic_t_set, "%lld\n"); 420 + 421 + /** 422 + * debugfs_create_atomic_t - create a debugfs file that is used to read and 423 + * write an atomic_t value 424 + * @name: a pointer to a string containing the name of the file to create. 425 + * @mode: the permission that the file should have 426 + * @parent: a pointer to the parent dentry for this file. This should be a 427 + * directory dentry if set. If this parameter is %NULL, then the 428 + * file will be created in the root of the debugfs filesystem. 429 + * @value: a pointer to the variable that the file should read to and write 430 + * from. 431 + */ 432 + struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, 433 + struct dentry *parent, atomic_t *value) 434 + { 435 + /* if there are no write bits set, make read only */ 436 + if (!(mode & S_IWUGO)) 437 + return debugfs_create_file(name, mode, parent, value, 438 + &fops_atomic_t_ro); 439 + /* if there are no read bits set, make write only */ 440 + if (!(mode & S_IRUGO)) 441 + return debugfs_create_file(name, mode, parent, value, 442 + &fops_atomic_t_wo); 443 + 444 + return debugfs_create_file(name, mode, parent, value, &fops_atomic_t); 445 + } 446 + EXPORT_SYMBOL_GPL(debugfs_create_atomic_t); 407 447 408 448 static ssize_t read_file_bool(struct file *file, char __user *user_buf, 409 449 size_t count, loff_t *ppos) ··· 473 431 if (copy_from_user(buf, user_buf, buf_size)) 474 432 return -EFAULT; 475 433 434 + buf[buf_size] = '\0'; 476 435 if (strtobool(buf, &bv) == 0) 477 436 *val = bv; 478 437
+2 -3
fs/gfs2/Kconfig
··· 20 20 be found here: http://sources.redhat.com/cluster 21 21 22 22 The "nolock" lock module is now built in to GFS2 by default. If 23 - you want to use the DLM, be sure to enable HOTPLUG and IPv4/6 24 - networking. 23 + you want to use the DLM, be sure to enable IPv4/6 networking. 25 24 26 25 config GFS2_FS_LOCKING_DLM 27 26 bool "GFS2 DLM locking" 28 27 depends on (GFS2_FS!=n) && NET && INET && (IPV6 || IPV6=n) && \ 29 - HOTPLUG && CONFIGFS_FS && SYSFS && (DLM=y || DLM=GFS2_FS) 28 + CONFIGFS_FS && SYSFS && (DLM=y || DLM=GFS2_FS) 30 29 help 31 30 Multiple node locking module for GFS2 32 31
+1 -1
fs/sysfs/dir.c
··· 74 74 } 75 75 76 76 /** 77 - * sysfs_link_subling - link sysfs_dirent into sibling rbtree 77 + * sysfs_link_sibling - link sysfs_dirent into sibling rbtree 78 78 * @sd: sysfs_dirent of interest 79 79 * 80 80 * Link @sd into its sibling rbtree which starts from
+6 -4
fs/sysfs/file.c
··· 449 449 450 450 spin_lock_irqsave(&sysfs_open_dirent_lock, flags); 451 451 452 - od = sd->s_attr.open; 453 - if (od) { 454 - atomic_inc(&od->event); 455 - wake_up_interruptible(&od->poll); 452 + if (!WARN_ON(sysfs_type(sd) != SYSFS_KOBJ_ATTR)) { 453 + od = sd->s_attr.open; 454 + if (od) { 455 + atomic_inc(&od->event); 456 + wake_up_interruptible(&od->poll); 457 + } 456 458 } 457 459 458 460 spin_unlock_irqrestore(&sysfs_open_dirent_lock, flags);
-2
fs/sysfs/inode.c
··· 24 24 #include <linux/security.h> 25 25 #include "sysfs.h" 26 26 27 - extern struct super_block * sysfs_sb; 28 - 29 27 static const struct address_space_operations sysfs_aops = { 30 28 .readpage = simple_readpage, 31 29 .write_begin = simple_write_begin,
-20
include/asm-generic/vmlinux.lds.h
··· 68 68 * are handled as text/data or they can be discarded (which 69 69 * often happens at runtime) 70 70 */ 71 - #ifdef CONFIG_HOTPLUG 72 - #define DEV_KEEP(sec) *(.dev##sec) 73 - #define DEV_DISCARD(sec) 74 - #else 75 - #define DEV_KEEP(sec) 76 - #define DEV_DISCARD(sec) *(.dev##sec) 77 - #endif 78 - 79 71 #ifdef CONFIG_HOTPLUG_CPU 80 72 #define CPU_KEEP(sec) *(.cpu##sec) 81 73 #define CPU_DISCARD(sec) ··· 174 182 *(.data) \ 175 183 *(.ref.data) \ 176 184 *(.data..shared_aligned) /* percpu related */ \ 177 - DEV_KEEP(init.data) \ 178 - DEV_KEEP(exit.data) \ 179 185 CPU_KEEP(init.data) \ 180 186 CPU_KEEP(exit.data) \ 181 187 MEM_KEEP(init.data) \ ··· 362 372 /* __*init sections */ \ 363 373 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \ 364 374 *(.ref.rodata) \ 365 - DEV_KEEP(init.rodata) \ 366 - DEV_KEEP(exit.rodata) \ 367 375 CPU_KEEP(init.rodata) \ 368 376 CPU_KEEP(exit.rodata) \ 369 377 MEM_KEEP(init.rodata) \ ··· 404 416 *(.text.hot) \ 405 417 *(.text) \ 406 418 *(.ref.text) \ 407 - DEV_KEEP(init.text) \ 408 - DEV_KEEP(exit.text) \ 409 419 CPU_KEEP(init.text) \ 410 420 CPU_KEEP(exit.text) \ 411 421 MEM_KEEP(init.text) \ ··· 489 503 /* init and exit section handling */ 490 504 #define INIT_DATA \ 491 505 *(.init.data) \ 492 - DEV_DISCARD(init.data) \ 493 506 CPU_DISCARD(init.data) \ 494 507 MEM_DISCARD(init.data) \ 495 508 KERNEL_CTORS() \ ··· 496 511 *(.init.rodata) \ 497 512 FTRACE_EVENTS() \ 498 513 TRACE_SYSCALLS() \ 499 - DEV_DISCARD(init.rodata) \ 500 514 CPU_DISCARD(init.rodata) \ 501 515 MEM_DISCARD(init.rodata) \ 502 516 CLK_OF_TABLES() \ ··· 505 521 506 522 #define INIT_TEXT \ 507 523 *(.init.text) \ 508 - DEV_DISCARD(init.text) \ 509 524 CPU_DISCARD(init.text) \ 510 525 MEM_DISCARD(init.text) 511 526 512 527 #define EXIT_DATA \ 513 528 *(.exit.data) \ 514 - DEV_DISCARD(exit.data) \ 515 - DEV_DISCARD(exit.rodata) \ 516 529 CPU_DISCARD(exit.data) \ 517 530 CPU_DISCARD(exit.rodata) \ 518 531 MEM_DISCARD(exit.data) \ ··· 517 536 518 537 #define EXIT_TEXT \ 519 538 *(.exit.text) \ 520 - DEV_DISCARD(exit.text) \ 521 539 CPU_DISCARD(exit.text) \ 522 540 MEM_DISCARD(exit.text) 523 541
+2
include/linux/debugfs.h
··· 79 79 struct dentry *parent, u64 *value); 80 80 struct dentry *debugfs_create_size_t(const char *name, umode_t mode, 81 81 struct dentry *parent, size_t *value); 82 + struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, 83 + struct dentry *parent, atomic_t *value); 82 84 struct dentry *debugfs_create_bool(const char *name, umode_t mode, 83 85 struct dentry *parent, u32 *value); 84 86
+3
include/linux/device.h
··· 80 80 * bus-specific setup 81 81 * @p: The private data of the driver core, only the driver core can 82 82 * touch this. 83 + * @lock_key: Lock class key for use by the lock validator 83 84 * 84 85 * A bus is a channel between the processor and one or more devices. For the 85 86 * purposes of the device model, all devices are connected via a bus, even if ··· 636 635 * segment limitations. 637 636 * @dma_pools: Dma pools (if dma'ble device). 638 637 * @dma_mem: Internal for coherent mem override. 638 + * @cma_area: Contiguous memory area for dma allocations 639 639 * @archdata: For arch-specific additions. 640 640 * @of_node: Associated device tree node. 641 641 * @acpi_node: Associated ACPI device node. ··· 650 648 * @release: Callback to free the device after all references have 651 649 * gone away. This should be set by the allocator of the 652 650 * device (i.e. the bus driver that discovered the device). 651 + * @iommu_group: IOMMU group the device belongs to. 653 652 * 654 653 * At the lowest level, every device in a Linux system is represented by an 655 654 * instance of struct device. The device structure contains the information
-11
include/linux/firmware.h
··· 47 47 void (*cont)(const struct firmware *fw, void *context)); 48 48 49 49 void release_firmware(const struct firmware *fw); 50 - int cache_firmware(const char *name); 51 - int uncache_firmware(const char *name); 52 50 #else 53 51 static inline int request_firmware(const struct firmware **fw, 54 52 const char *name, ··· 66 68 { 67 69 } 68 70 69 - static inline int cache_firmware(const char *name) 70 - { 71 - return -ENOENT; 72 - } 73 - 74 - static inline int uncache_firmware(const char *name) 75 - { 76 - return -EINVAL; 77 - } 78 71 #endif 79 72 80 73 #endif
+7 -1
include/linux/platform_device.h
··· 180 180 const struct platform_device_id *id_table; 181 181 }; 182 182 183 - extern int platform_driver_register(struct platform_driver *); 183 + /* 184 + * use a macro to avoid include chaining to get THIS_MODULE 185 + */ 186 + #define platform_driver_register(drv) \ 187 + __platform_driver_register(drv, THIS_MODULE) 188 + extern int __platform_driver_register(struct platform_driver *, 189 + struct module *); 184 190 extern void platform_driver_unregister(struct platform_driver *); 185 191 186 192 /* non-hotpluggable platform devices may use this so that probe() and
+14 -3
init/Kconfig
··· 53 53 need to set this unless you want the configured kernel build 54 54 directory to select the cross-compiler automatically. 55 55 56 + config COMPILE_TEST 57 + bool "Compile also drivers which will not load" 58 + default n 59 + help 60 + Some drivers can be compiled on a different platform than they are 61 + intended to be run on. Despite they cannot be loaded there (or even 62 + when they load they cannot be used due to missing HW support), 63 + developers still, opposing to distributors, might want to build such 64 + drivers to compile-test them. 65 + 66 + If you are a developer and want to build everything available, say Y 67 + here. If you are a user/distributor, say N here to exclude useless 68 + drivers to be distributed. 69 + 56 70 config LOCALVERSION 57 71 string "Local version - append to kernel release" 58 72 help ··· 1258 1244 Allows arches to define/use @unaligned_enabled to runtime toggle 1259 1245 the unaligned access emulation. 1260 1246 see arch/parisc/kernel/unaligned.c for reference 1261 - 1262 - config HOTPLUG 1263 - def_bool y 1264 1247 1265 1248 config HAVE_PCSPKR_PLATFORM 1266 1249 bool
-1
kernel/power/Kconfig
··· 100 100 depends on SMP 101 101 depends on ARCH_SUSPEND_POSSIBLE || ARCH_HIBERNATION_POSSIBLE 102 102 depends on PM_SLEEP 103 - select HOTPLUG 104 103 select HOTPLUG_CPU 105 104 106 105 config PM_AUTOSLEEP
-21
lib/fault-inject.c
··· 182 182 183 183 #endif /* CONFIG_FAULT_INJECTION_STACKTRACE_FILTER */ 184 184 185 - static int debugfs_atomic_t_set(void *data, u64 val) 186 - { 187 - atomic_set((atomic_t *)data, val); 188 - return 0; 189 - } 190 - 191 - static int debugfs_atomic_t_get(void *data, u64 *val) 192 - { 193 - *val = atomic_read((atomic_t *)data); 194 - return 0; 195 - } 196 - 197 - DEFINE_SIMPLE_ATTRIBUTE(fops_atomic_t, debugfs_atomic_t_get, 198 - debugfs_atomic_t_set, "%lld\n"); 199 - 200 - static struct dentry *debugfs_create_atomic_t(const char *name, umode_t mode, 201 - struct dentry *parent, atomic_t *value) 202 - { 203 - return debugfs_create_file(name, mode, parent, value, &fops_atomic_t); 204 - } 205 - 206 185 struct dentry *fault_create_debugfs_attr(const char *name, 207 186 struct dentry *parent, struct fault_attr *attr) 208 187 {
+1 -1
lib/kobject.c
··· 805 805 kset = kzalloc(sizeof(*kset), GFP_KERNEL); 806 806 if (!kset) 807 807 return NULL; 808 - retval = kobject_set_name(&kset->kobj, name); 808 + retval = kobject_set_name(&kset->kobj, "%s", name); 809 809 if (retval) { 810 810 kfree(kset); 811 811 return NULL;
+1 -1
mm/Kconfig
··· 173 173 config MEMORY_HOTPLUG 174 174 bool "Allow for memory hot-add" 175 175 depends on SPARSEMEM || X86_64_ACPI_NUMA 176 - depends on HOTPLUG && ARCH_ENABLE_MEMORY_HOTPLUG 176 + depends on ARCH_ENABLE_MEMORY_HOTPLUG 177 177 depends on (IA64 || X86 || PPC_BOOK3S_64 || SUPERH || S390) 178 178 179 179 config MEMORY_HOTPLUG_SPARSE