diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-18 12:04:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-06-18 12:04:01 -0400 |
commit | 607117a1533d8ef41b34aa170363ae4415b3d524 (patch) | |
tree | 5799681a8626908d81d2413c305c567201b88164 | |
parent | 07b5ca22a1e6268c5193f9606ad5b746853ace40 (diff) | |
parent | 5e25db870ec983be138b343a3d04c79a5c1f1703 (diff) |
Merge tag 'driver-core-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg KH:
"Here are a small number of debugfs, ISA, and one driver core fix for
4.7-rc4.
All of these resolve reported issues. The ISA ones have spent the
least amount of time in linux-next, sorry about that, I didn't realize
they were regressions that needed to get in now (thanks to Thorsten
for the prodding!) but they do all pass the 0-day bot tests. The
others have been in linux-next for a while now.
Full details about them are in the shortlog below"
* tag 'driver-core-4.7-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
isa: Dummy isa_register_driver should return error code
isa: Call isa_bus_init before dependent ISA bus drivers register
watchdog: ebc-c384_wdt: Allow build for X86_64
iio: stx104: Allow build for X86_64
gpio: Allow PC/104 devices on X86_64
isa: Allow ISA-style drivers on modern systems
base: make module_create_drivers_dir race-free
debugfs: open_proxy_open(): avoid double fops release
debugfs: full_proxy_open(): free proxy on ->open() failure
kernel/kcov: unproxify debugfs file's fops
-rw-r--r-- | arch/Kconfig | 3 | ||||
-rw-r--r-- | arch/x86/Kconfig | 9 | ||||
-rw-r--r-- | drivers/base/Makefile | 2 | ||||
-rw-r--r-- | drivers/base/isa.c | 2 | ||||
-rw-r--r-- | drivers/base/module.c | 8 | ||||
-rw-r--r-- | drivers/gpio/Kconfig | 8 | ||||
-rw-r--r-- | drivers/iio/dac/Kconfig | 2 | ||||
-rw-r--r-- | drivers/watchdog/Kconfig | 2 | ||||
-rw-r--r-- | fs/debugfs/file.c | 7 | ||||
-rw-r--r-- | include/linux/isa.h | 5 | ||||
-rw-r--r-- | kernel/kcov.c | 7 |
11 files changed, 38 insertions, 17 deletions
diff --git a/arch/Kconfig b/arch/Kconfig index d794384a0404..e9734796531f 100644 --- a/arch/Kconfig +++ b/arch/Kconfig | |||
@@ -606,6 +606,9 @@ config HAVE_ARCH_HASH | |||
606 | file which provides platform-specific implementations of some | 606 | file which provides platform-specific implementations of some |
607 | functions in <linux/hash.h> or fs/namei.c. | 607 | functions in <linux/hash.h> or fs/namei.c. |
608 | 608 | ||
609 | config ISA_BUS_API | ||
610 | def_bool ISA | ||
611 | |||
609 | # | 612 | # |
610 | # ABI hall of shame | 613 | # ABI hall of shame |
611 | # | 614 | # |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 0a7b885964ba..d9a94da0c29f 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -2439,6 +2439,15 @@ config PCI_CNB20LE_QUIRK | |||
2439 | 2439 | ||
2440 | source "drivers/pci/Kconfig" | 2440 | source "drivers/pci/Kconfig" |
2441 | 2441 | ||
2442 | config ISA_BUS | ||
2443 | bool "ISA-style bus support on modern systems" if EXPERT | ||
2444 | select ISA_BUS_API | ||
2445 | help | ||
2446 | Enables ISA-style drivers on modern systems. This is necessary to | ||
2447 | support PC/104 devices on X86_64 platforms. | ||
2448 | |||
2449 | If unsure, say N. | ||
2450 | |||
2442 | # x86_64 have no ISA slots, but can have ISA-style DMA. | 2451 | # x86_64 have no ISA slots, but can have ISA-style DMA. |
2443 | config ISA_DMA_API | 2452 | config ISA_DMA_API |
2444 | bool "ISA-style DMA support" if (X86_64 && EXPERT) | 2453 | bool "ISA-style DMA support" if (X86_64 && EXPERT) |
diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 6b2a84e7f2be..2609ba20b396 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile | |||
@@ -10,7 +10,7 @@ obj-$(CONFIG_DMA_CMA) += dma-contiguous.o | |||
10 | obj-y += power/ | 10 | obj-y += power/ |
11 | obj-$(CONFIG_HAS_DMA) += dma-mapping.o | 11 | obj-$(CONFIG_HAS_DMA) += dma-mapping.o |
12 | obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o | 12 | obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o |
13 | obj-$(CONFIG_ISA) += isa.o | 13 | obj-$(CONFIG_ISA_BUS_API) += isa.o |
14 | obj-$(CONFIG_FW_LOADER) += firmware_class.o | 14 | obj-$(CONFIG_FW_LOADER) += firmware_class.o |
15 | obj-$(CONFIG_NUMA) += node.o | 15 | obj-$(CONFIG_NUMA) += node.o |
16 | obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o | 16 | obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o |
diff --git a/drivers/base/isa.c b/drivers/base/isa.c index 91dba65d7264..cd6ccdcf9df0 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c | |||
@@ -180,4 +180,4 @@ static int __init isa_bus_init(void) | |||
180 | return error; | 180 | return error; |
181 | } | 181 | } |
182 | 182 | ||
183 | device_initcall(isa_bus_init); | 183 | postcore_initcall(isa_bus_init); |
diff --git a/drivers/base/module.c b/drivers/base/module.c index db930d3ee312..2a215780eda2 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c | |||
@@ -24,10 +24,12 @@ static char *make_driver_name(struct device_driver *drv) | |||
24 | 24 | ||
25 | static void module_create_drivers_dir(struct module_kobject *mk) | 25 | static void module_create_drivers_dir(struct module_kobject *mk) |
26 | { | 26 | { |
27 | if (!mk || mk->drivers_dir) | 27 | static DEFINE_MUTEX(drivers_dir_mutex); |
28 | return; | ||
29 | 28 | ||
30 | mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj); | 29 | mutex_lock(&drivers_dir_mutex); |
30 | if (mk && !mk->drivers_dir) | ||
31 | mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj); | ||
32 | mutex_unlock(&drivers_dir_mutex); | ||
31 | } | 33 | } |
32 | 34 | ||
33 | void module_add_driver(struct module *mod, struct device_driver *drv) | 35 | void module_add_driver(struct module *mod, struct device_driver *drv) |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index a116609b1914..cebcb405812e 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -531,7 +531,7 @@ menu "Port-mapped I/O GPIO drivers" | |||
531 | 531 | ||
532 | config GPIO_104_DIO_48E | 532 | config GPIO_104_DIO_48E |
533 | tristate "ACCES 104-DIO-48E GPIO support" | 533 | tristate "ACCES 104-DIO-48E GPIO support" |
534 | depends on ISA | 534 | depends on ISA_BUS_API |
535 | select GPIOLIB_IRQCHIP | 535 | select GPIOLIB_IRQCHIP |
536 | help | 536 | help |
537 | Enables GPIO support for the ACCES 104-DIO-48E series (104-DIO-48E, | 537 | Enables GPIO support for the ACCES 104-DIO-48E series (104-DIO-48E, |
@@ -541,7 +541,7 @@ config GPIO_104_DIO_48E | |||
541 | 541 | ||
542 | config GPIO_104_IDIO_16 | 542 | config GPIO_104_IDIO_16 |
543 | tristate "ACCES 104-IDIO-16 GPIO support" | 543 | tristate "ACCES 104-IDIO-16 GPIO support" |
544 | depends on ISA | 544 | depends on ISA_BUS_API |
545 | select GPIOLIB_IRQCHIP | 545 | select GPIOLIB_IRQCHIP |
546 | help | 546 | help |
547 | Enables GPIO support for the ACCES 104-IDIO-16 family (104-IDIO-16, | 547 | Enables GPIO support for the ACCES 104-IDIO-16 family (104-IDIO-16, |
@@ -552,7 +552,7 @@ config GPIO_104_IDIO_16 | |||
552 | 552 | ||
553 | config GPIO_104_IDI_48 | 553 | config GPIO_104_IDI_48 |
554 | tristate "ACCES 104-IDI-48 GPIO support" | 554 | tristate "ACCES 104-IDI-48 GPIO support" |
555 | depends on ISA | 555 | depends on ISA_BUS_API |
556 | select GPIOLIB_IRQCHIP | 556 | select GPIOLIB_IRQCHIP |
557 | help | 557 | help |
558 | Enables GPIO support for the ACCES 104-IDI-48 family (104-IDI-48A, | 558 | Enables GPIO support for the ACCES 104-IDI-48 family (104-IDI-48A, |
@@ -628,7 +628,7 @@ config GPIO_TS5500 | |||
628 | 628 | ||
629 | config GPIO_WS16C48 | 629 | config GPIO_WS16C48 |
630 | tristate "WinSystems WS16C48 GPIO support" | 630 | tristate "WinSystems WS16C48 GPIO support" |
631 | depends on ISA | 631 | depends on ISA_BUS_API |
632 | select GPIOLIB_IRQCHIP | 632 | select GPIOLIB_IRQCHIP |
633 | help | 633 | help |
634 | Enables GPIO support for the WinSystems WS16C48. The base port | 634 | Enables GPIO support for the WinSystems WS16C48. The base port |
diff --git a/drivers/iio/dac/Kconfig b/drivers/iio/dac/Kconfig index e63b957c985f..f7c71da42f15 100644 --- a/drivers/iio/dac/Kconfig +++ b/drivers/iio/dac/Kconfig | |||
@@ -247,7 +247,7 @@ config MCP4922 | |||
247 | 247 | ||
248 | config STX104 | 248 | config STX104 |
249 | tristate "Apex Embedded Systems STX104 DAC driver" | 249 | tristate "Apex Embedded Systems STX104 DAC driver" |
250 | depends on X86 && ISA | 250 | depends on X86 && ISA_BUS_API |
251 | help | 251 | help |
252 | Say yes here to build support for the 2-channel DAC on the Apex | 252 | Say yes here to build support for the 2-channel DAC on the Apex |
253 | Embedded Systems STX104 integrated analog PC/104 card. The base port | 253 | Embedded Systems STX104 integrated analog PC/104 card. The base port |
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index b54f26c55dfd..b4b3e256491b 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
@@ -746,7 +746,7 @@ config ALIM7101_WDT | |||
746 | 746 | ||
747 | config EBC_C384_WDT | 747 | config EBC_C384_WDT |
748 | tristate "WinSystems EBC-C384 Watchdog Timer" | 748 | tristate "WinSystems EBC-C384 Watchdog Timer" |
749 | depends on X86 && ISA | 749 | depends on X86 && ISA_BUS_API |
750 | select WATCHDOG_CORE | 750 | select WATCHDOG_CORE |
751 | help | 751 | help |
752 | Enables watchdog timer support for the watchdog timer on the | 752 | Enables watchdog timer support for the watchdog timer on the |
diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c index 9c1c9a01b7e5..592059f88e04 100644 --- a/fs/debugfs/file.c +++ b/fs/debugfs/file.c | |||
@@ -127,7 +127,6 @@ static int open_proxy_open(struct inode *inode, struct file *filp) | |||
127 | r = real_fops->open(inode, filp); | 127 | r = real_fops->open(inode, filp); |
128 | 128 | ||
129 | out: | 129 | out: |
130 | fops_put(real_fops); | ||
131 | debugfs_use_file_finish(srcu_idx); | 130 | debugfs_use_file_finish(srcu_idx); |
132 | return r; | 131 | return r; |
133 | } | 132 | } |
@@ -262,8 +261,10 @@ static int full_proxy_open(struct inode *inode, struct file *filp) | |||
262 | 261 | ||
263 | if (real_fops->open) { | 262 | if (real_fops->open) { |
264 | r = real_fops->open(inode, filp); | 263 | r = real_fops->open(inode, filp); |
265 | 264 | if (r) { | |
266 | if (filp->f_op != proxy_fops) { | 265 | replace_fops(filp, d_inode(dentry)->i_fop); |
266 | goto free_proxy; | ||
267 | } else if (filp->f_op != proxy_fops) { | ||
267 | /* No protection against file removal anymore. */ | 268 | /* No protection against file removal anymore. */ |
268 | WARN(1, "debugfs file owner replaced proxy fops: %pd", | 269 | WARN(1, "debugfs file owner replaced proxy fops: %pd", |
269 | dentry); | 270 | dentry); |
diff --git a/include/linux/isa.h b/include/linux/isa.h index 5ab85281230b..f2d0258414cf 100644 --- a/include/linux/isa.h +++ b/include/linux/isa.h | |||
@@ -6,6 +6,7 @@ | |||
6 | #define __LINUX_ISA_H | 6 | #define __LINUX_ISA_H |
7 | 7 | ||
8 | #include <linux/device.h> | 8 | #include <linux/device.h> |
9 | #include <linux/errno.h> | ||
9 | #include <linux/kernel.h> | 10 | #include <linux/kernel.h> |
10 | 11 | ||
11 | struct isa_driver { | 12 | struct isa_driver { |
@@ -22,13 +23,13 @@ struct isa_driver { | |||
22 | 23 | ||
23 | #define to_isa_driver(x) container_of((x), struct isa_driver, driver) | 24 | #define to_isa_driver(x) container_of((x), struct isa_driver, driver) |
24 | 25 | ||
25 | #ifdef CONFIG_ISA | 26 | #ifdef CONFIG_ISA_BUS_API |
26 | int isa_register_driver(struct isa_driver *, unsigned int); | 27 | int isa_register_driver(struct isa_driver *, unsigned int); |
27 | void isa_unregister_driver(struct isa_driver *); | 28 | void isa_unregister_driver(struct isa_driver *); |
28 | #else | 29 | #else |
29 | static inline int isa_register_driver(struct isa_driver *d, unsigned int i) | 30 | static inline int isa_register_driver(struct isa_driver *d, unsigned int i) |
30 | { | 31 | { |
31 | return 0; | 32 | return -ENODEV; |
32 | } | 33 | } |
33 | 34 | ||
34 | static inline void isa_unregister_driver(struct isa_driver *d) | 35 | static inline void isa_unregister_driver(struct isa_driver *d) |
diff --git a/kernel/kcov.c b/kernel/kcov.c index a02f2dddd1d7..8d44b3fea9d0 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c | |||
@@ -264,7 +264,12 @@ static const struct file_operations kcov_fops = { | |||
264 | 264 | ||
265 | static int __init kcov_init(void) | 265 | static int __init kcov_init(void) |
266 | { | 266 | { |
267 | if (!debugfs_create_file("kcov", 0600, NULL, NULL, &kcov_fops)) { | 267 | /* |
268 | * The kcov debugfs file won't ever get removed and thus, | ||
269 | * there is no need to protect it against removal races. The | ||
270 | * use of debugfs_create_file_unsafe() is actually safe here. | ||
271 | */ | ||
272 | if (!debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops)) { | ||
268 | pr_err("failed to create kcov in debugfs\n"); | 273 | pr_err("failed to create kcov in debugfs\n"); |
269 | return -ENOMEM; | 274 | return -ENOMEM; |
270 | } | 275 | } |