Commit 607117a1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'driver-core-4.7-rc4' of git://

Pull driver core fixes from Greg KH:
 "Here are a small number of debugfs, ISA, and one driver core fix for

  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://
  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
parents 07b5ca22 5e25db87
......@@ -606,6 +606,9 @@ config HAVE_ARCH_HASH
file which provides platform-specific implementations of some
functions in <linux/hash.h> or fs/namei.c.
config ISA_BUS_API
def_bool ISA
# ABI hall of shame
......@@ -2439,6 +2439,15 @@ config PCI_CNB20LE_QUIRK
source "drivers/pci/Kconfig"
config ISA_BUS
bool "ISA-style bus support on modern systems" if EXPERT
select ISA_BUS_API
Enables ISA-style drivers on modern systems. This is necessary to
support PC/104 devices on X86_64 platforms.
If unsure, say N.
# x86_64 have no ISA slots, but can have ISA-style DMA.
config ISA_DMA_API
bool "ISA-style DMA support" if (X86_64 && EXPERT)
......@@ -10,7 +10,7 @@ obj-$(CONFIG_DMA_CMA) += dma-contiguous.o
obj-y += power/
obj-$(CONFIG_HAS_DMA) += dma-mapping.o
obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
obj-$(CONFIG_ISA) += isa.o
obj-$(CONFIG_ISA_BUS_API) += isa.o
obj-$(CONFIG_FW_LOADER) += firmware_class.o
obj-$(CONFIG_NUMA) += node.o
......@@ -180,4 +180,4 @@ static int __init isa_bus_init(void)
return error;
......@@ -24,10 +24,12 @@ static char *make_driver_name(struct device_driver *drv)
static void module_create_drivers_dir(struct module_kobject *mk)
if (!mk || mk->drivers_dir)
static DEFINE_MUTEX(drivers_dir_mutex);
mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj);
if (mk && !mk->drivers_dir)
mk->drivers_dir = kobject_create_and_add("drivers", &mk->kobj);
void module_add_driver(struct module *mod, struct device_driver *drv)
......@@ -531,7 +531,7 @@ menu "Port-mapped I/O GPIO drivers"
config GPIO_104_DIO_48E
tristate "ACCES 104-DIO-48E GPIO support"
depends on ISA
depends on ISA_BUS_API
Enables GPIO support for the ACCES 104-DIO-48E series (104-DIO-48E,
......@@ -541,7 +541,7 @@ config GPIO_104_DIO_48E
config GPIO_104_IDIO_16
tristate "ACCES 104-IDIO-16 GPIO support"
depends on ISA
depends on ISA_BUS_API
Enables GPIO support for the ACCES 104-IDIO-16 family (104-IDIO-16,
......@@ -552,7 +552,7 @@ config GPIO_104_IDIO_16
config GPIO_104_IDI_48
tristate "ACCES 104-IDI-48 GPIO support"
depends on ISA
depends on ISA_BUS_API
Enables GPIO support for the ACCES 104-IDI-48 family (104-IDI-48A,
......@@ -628,7 +628,7 @@ config GPIO_TS5500
config GPIO_WS16C48
tristate "WinSystems WS16C48 GPIO support"
depends on ISA
depends on ISA_BUS_API
Enables GPIO support for the WinSystems WS16C48. The base port
......@@ -247,7 +247,7 @@ config MCP4922
config STX104
tristate "Apex Embedded Systems STX104 DAC driver"
depends on X86 && ISA
depends on X86 && ISA_BUS_API
Say yes here to build support for the 2-channel DAC on the Apex
Embedded Systems STX104 integrated analog PC/104 card. The base port
......@@ -746,7 +746,7 @@ config ALIM7101_WDT
config EBC_C384_WDT
tristate "WinSystems EBC-C384 Watchdog Timer"
depends on X86 && ISA
depends on X86 && ISA_BUS_API
Enables watchdog timer support for the watchdog timer on the
......@@ -127,7 +127,6 @@ static int open_proxy_open(struct inode *inode, struct file *filp)
r = real_fops->open(inode, filp);
return r;
......@@ -262,8 +261,10 @@ static int full_proxy_open(struct inode *inode, struct file *filp)
if (real_fops->open) {
r = real_fops->open(inode, filp);
if (filp->f_op != proxy_fops) {
if (r) {
replace_fops(filp, d_inode(dentry)->i_fop);
goto free_proxy;
} else if (filp->f_op != proxy_fops) {
/* No protection against file removal anymore. */
WARN(1, "debugfs file owner replaced proxy fops: %pd",
......@@ -6,6 +6,7 @@
#define __LINUX_ISA_H
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/kernel.h>
struct isa_driver {
......@@ -22,13 +23,13 @@ struct isa_driver {
#define to_isa_driver(x) container_of((x), struct isa_driver, driver)
int isa_register_driver(struct isa_driver *, unsigned int);
void isa_unregister_driver(struct isa_driver *);
static inline int isa_register_driver(struct isa_driver *d, unsigned int i)
return 0;
return -ENODEV;
static inline void isa_unregister_driver(struct isa_driver *d)
......@@ -264,7 +264,12 @@ static const struct file_operations kcov_fops = {
static int __init kcov_init(void)
if (!debugfs_create_file("kcov", 0600, NULL, NULL, &kcov_fops)) {
* The kcov debugfs file won't ever get removed and thus,
* there is no need to protect it against removal races. The
* use of debugfs_create_file_unsafe() is actually safe here.
if (!debugfs_create_file_unsafe("kcov", 0600, NULL, NULL, &kcov_fops)) {
pr_err("failed to create kcov in debugfs\n");
return -ENOMEM;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment