Skip to content

Commit 38047d5

Browse files
committed
Merge tag 'driver-core-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core updates from Greg KH: "Here is the "big" set of driver core patches for 4.17-rc1. There's really not much here, just a bunch of firmware code refactoring from Luis as he attempts to wrangle that codebase into something that is managable, along with a bunch of userspace tests for it. Other than that, a handful of small bugfixes and reverts of things that didn't work out. Full details are in the shortlog, it's not all that much. All of these have been in linux-next for a while with no reported issues" * tag 'driver-core-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (30 commits) drivers: base: remove check for callback in coredump_store() mt7601u: use firmware_request_cache() to address cache on reboot firmware: add firmware_request_cache() to help with cache on reboot firmware: fix typo on pr_info_once() when ignore_sysfs_fallback is used firmware: explicitly include vmalloc.h firmware: ensure the firmware cache is not used on incompatible calls test_firmware: modify custom fallback tests to use unique files firmware: add helper to check to see if fw cache is setup firmware: fix checking for return values for fw_add_devm_name() rename: _request_firmware_load() fw_load_sysfs_fallback() test_firmware: test three firmware kernel configs using a proc knob test_firmware: expand on library with shared helpers firmware: enable to force disable the fallback mechanism at run time firmware: enable run time change of forcing fallback loader firmware: move firmware loader into its own directory firmware: split firmware fallback functionality into its own file firmware: move loading timeout under struct firmware_fallback_config firmware: use helpers for setting up a temporary cache timeout firmware: simplify CONFIG_FW_LOADER_USER_HELPER_FALLBACK further drivers: base: add description for .coredump() callback ...
2 parents df34df4 + 1fe56e0 commit 38047d5

File tree

27 files changed

+1370
-894
lines changed

27 files changed

+1370
-894
lines changed

Documentation/driver-api/firmware/fallback-mechanisms.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Since a device is created for the sysfs interface to help load firmware as a
112112
fallback mechanism userspace can be informed of the addition of the device by
113113
relying on kobject uevents. The addition of the device into the device
114114
hierarchy means the fallback mechanism for firmware loading has been initiated.
115-
For details of implementation refer to _request_firmware_load(), in particular
115+
For details of implementation refer to fw_load_sysfs_fallback(), in particular
116116
on the use of dev_set_uevent_suppress() and kobject_uevent().
117117

118118
The kernel's kobject uevent mechanism is implemented in lib/kobject_uevent.c,

Documentation/driver-api/firmware/request_firmware.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ request_firmware_nowait
4444
.. kernel-doc:: drivers/base/firmware_class.c
4545
:functions: request_firmware_nowait
4646

47+
Special optimizations on reboot
48+
===============================
49+
50+
Some devices have an optimization in place to enable the firmware to be
51+
retained during system reboot. When such optimizations are used the driver
52+
author must ensure the firmware is still available on resume from suspend,
53+
this can be done with firmware_request_cache() insted of requesting for the
54+
firmare to be loaded.
55+
56+
firmware_request_cache()
57+
-----------------------
58+
.. kernel-doc:: drivers/base/firmware_class.c
59+
:functions: firmware_request_cache
60+
4761
request firmware API expected driver use
4862
========================================
4963

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5524,7 +5524,7 @@ M: Luis R. Rodriguez <[email protected]>
55245524
55255525
S: Maintained
55265526
F: Documentation/firmware_class/
5527-
F: drivers/base/firmware*.c
5527+
F: drivers/base/firmware_loader/
55285528
F: include/linux/firmware.h
55295529

55305530
FLASH ADAPTER DRIVER (IBM Flash Adapter 900GB Full Height PCI Flash Card)

drivers/base/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ obj-y += power/
1313
obj-$(CONFIG_HAS_DMA) += dma-mapping.o
1414
obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o
1515
obj-$(CONFIG_ISA_BUS_API) += isa.o
16-
obj-$(CONFIG_FW_LOADER) += firmware_class.o
16+
obj-y += firmware_loader/
1717
obj-$(CONFIG_NUMA) += node.o
1818
obj-$(CONFIG_MEMORY_HOTPLUG_SPARSE) += memory.o
1919
ifeq ($(CONFIG_SYSFS),y)

drivers/base/arch_topology.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,11 @@ bool __init topology_parse_cpu_capacity(struct device_node *cpu_node, int cpu)
169169
}
170170

171171
#ifdef CONFIG_CPU_FREQ
172-
static cpumask_var_t cpus_to_visit __initdata;
173-
static void __init parsing_done_workfn(struct work_struct *work);
174-
static __initdata DECLARE_WORK(parsing_done_work, parsing_done_workfn);
172+
static cpumask_var_t cpus_to_visit;
173+
static void parsing_done_workfn(struct work_struct *work);
174+
static DECLARE_WORK(parsing_done_work, parsing_done_workfn);
175175

176-
static int __init
176+
static int
177177
init_cpu_capacity_callback(struct notifier_block *nb,
178178
unsigned long val,
179179
void *data)
@@ -209,7 +209,7 @@ init_cpu_capacity_callback(struct notifier_block *nb,
209209
return 0;
210210
}
211211

212-
static struct notifier_block init_cpu_capacity_notifier __initdata = {
212+
static struct notifier_block init_cpu_capacity_notifier = {
213213
.notifier_call = init_cpu_capacity_callback,
214214
};
215215

@@ -242,7 +242,7 @@ static int __init register_cpufreq_notifier(void)
242242
}
243243
core_initcall(register_cpufreq_notifier);
244244

245-
static void __init parsing_done_workfn(struct work_struct *work)
245+
static void parsing_done_workfn(struct work_struct *work)
246246
{
247247
cpufreq_unregister_notifier(&init_cpu_capacity_notifier,
248248
CPUFREQ_POLICY_NOTIFIER);

drivers/base/cpu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,10 @@ int register_cpu(struct cpu *cpu, int num)
382382
if (cpu->hotpluggable)
383383
cpu->dev.groups = hotplugable_cpu_attr_groups;
384384
error = device_register(&cpu->dev);
385-
if (error)
385+
if (error) {
386+
put_device(&cpu->dev);
386387
return error;
388+
}
387389

388390
per_cpu(cpu_sys_devices, num) = &cpu->dev;
389391
register_cpu_under_node(num, cpu_to_node(num));

drivers/base/dd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,7 @@ static ssize_t coredump_store(struct device *dev, struct device_attribute *attr,
292292
const char *buf, size_t count)
293293
{
294294
device_lock(dev);
295-
if (dev->driver->coredump)
296-
dev->driver->coredump(dev);
295+
dev->driver->coredump(dev);
297296
device_unlock(dev);
298297

299298
return count;

drivers/base/firmware_loader/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
# Makefile for the Linux firmware loader
3+
4+
obj-y := fallback_table.o
5+
obj-$(CONFIG_FW_LOADER) += firmware_class.o
6+
firmware_class-objs := main.o
7+
firmware_class-$(CONFIG_FW_LOADER_USER_HELPER) += fallback.o

0 commit comments

Comments
 (0)