Skip to content

Commit

Permalink
Merge tag 'driver-core-5.15-rc1' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/gregkh/driver-core

Pull driver core updates from Greg KH:
 "Here is the big set of driver core patches for 5.15-rc1.

  These do change a number of different things across different
  subsystems, and because of that, there were 2 stable tags created that
  might have already come into your tree from different pulls that did
  the following

   - changed the bus remove callback to return void

   - sysfs iomem_get_mapping rework

  Other than those two things, there's only a few small things in here:

   - kernfs performance improvements for huge numbers of sysfs users at
     once

   - tiny api cleanups

   - other minor changes

  All of these have been in linux-next for a while with no reported
  problems, other than the before-mentioned merge issue"

* tag 'driver-core-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (33 commits)
  MAINTAINERS: Add dri-devel for component.[hc]
  driver core: platform: Remove platform_device_add_properties()
  ARM: tegra: paz00: Handle device properties with software node API
  bitmap: extend comment to bitmap_print_bitmask/list_to_buf
  drivers/base/node.c: use bin_attribute to break the size limitation of cpumap ABI
  topology: use bin_attribute to break the size limitation of cpumap ABI
  lib: test_bitmap: add bitmap_print_bitmask/list_to_buf test cases
  cpumask: introduce cpumap_print_list/bitmask_to_buf to support large bitmask and list
  sysfs: Rename struct bin_attribute member to f_mapping
  sysfs: Invoke iomem_get_mapping() from the sysfs open callback
  debugfs: Return error during {full/open}_proxy_open() on rmmod
  zorro: Drop useless (and hardly used) .driver member in struct zorro_dev
  zorro: Simplify remove callback
  sh: superhyway: Simplify check in remove callback
  nubus: Simplify check in remove callback
  nubus: Make struct nubus_driver::remove return void
  kernfs: dont call d_splice_alias() under kernfs node lock
  kernfs: use i_lock to protect concurrent inode updates
  kernfs: switch kernfs to use an rwsem
  kernfs: use VFS negative dentry caching
  ...
  • Loading branch information
torvalds committed Sep 1, 2021
2 parents ba1dc7f + 049d169 commit c6c3c57
Show file tree
Hide file tree
Showing 126 changed files with 729 additions and 512 deletions.
5 changes: 5 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -5725,6 +5725,11 @@ F: Documentation/admin-guide/blockdev/
F: drivers/block/drbd/
F: lib/lru_cache.c

DRIVER COMPONENT FRAMEWORK
L: [email protected]
F: drivers/base/component.c
F: include/linux/component.h

DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS
M: Greg Kroah-Hartman <[email protected]>
R: "Rafael J. Wysocki" <[email protected]>
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/common/locomo.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,14 +834,13 @@ static int locomo_bus_probe(struct device *dev)
return ret;
}

static int locomo_bus_remove(struct device *dev)
static void locomo_bus_remove(struct device *dev)
{
struct locomo_dev *ldev = LOCOMO_DEV(dev);
struct locomo_driver *drv = LOCOMO_DRV(dev->driver);

if (drv->remove)
drv->remove(ldev);
return 0;
}

struct bus_type locomo_bus_type = {
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/common/sa1111.c
Original file line number Diff line number Diff line change
Expand Up @@ -1356,15 +1356,13 @@ static int sa1111_bus_probe(struct device *dev)
return ret;
}

static int sa1111_bus_remove(struct device *dev)
static void sa1111_bus_remove(struct device *dev)
{
struct sa1111_dev *sadev = to_sa1111_device(dev);
struct sa1111_driver *drv = SA1111_DRV(dev->driver);

if (drv->remove)
drv->remove(sadev);

return 0;
}

struct bus_type sa1111_bus_type = {
Expand Down
4 changes: 1 addition & 3 deletions arch/arm/mach-rpc/ecard.c
Original file line number Diff line number Diff line change
Expand Up @@ -1052,7 +1052,7 @@ static int ecard_drv_probe(struct device *dev)
return ret;
}

static int ecard_drv_remove(struct device *dev)
static void ecard_drv_remove(struct device *dev)
{
struct expansion_card *ec = ECARD_DEV(dev);
struct ecard_driver *drv = ECARD_DRV(dev->driver);
Expand All @@ -1067,8 +1067,6 @@ static int ecard_drv_remove(struct device *dev)
ec->ops = &ecard_default_ops;
barrier();
ec->irq_data = NULL;

return 0;
}

/*
Expand Down
2 changes: 1 addition & 1 deletion arch/arm/mach-tegra/board-paz00.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static struct gpiod_lookup_table wifi_gpio_lookup = {

void __init tegra_paz00_wifikill_init(void)
{
platform_device_add_properties(&wifi_rfkill_device, wifi_rfkill_prop);
device_create_managed_software_node(&wifi_rfkill_device.dev, wifi_rfkill_prop, NULL);
gpiod_add_lookup_table(&wifi_gpio_lookup);
platform_device_register(&wifi_rfkill_device);
}
3 changes: 1 addition & 2 deletions arch/mips/sgi-ip22/ip22-gio.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,13 @@ static int gio_device_probe(struct device *dev)
return error;
}

static int gio_device_remove(struct device *dev)
static void gio_device_remove(struct device *dev)
{
struct gio_device *gio_dev = to_gio_device(dev);
struct gio_driver *drv = to_gio_driver(dev->driver);

if (dev->driver && drv->remove)
drv->remove(gio_dev);
return 0;
}

static void gio_device_shutdown(struct device *dev)
Expand Down
5 changes: 2 additions & 3 deletions arch/parisc/kernel/drivers.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,13 @@ static int parisc_driver_probe(struct device *dev)
return rc;
}

static int __exit parisc_driver_remove(struct device *dev)
static void __exit parisc_driver_remove(struct device *dev)
{
struct parisc_device *pa_dev = to_parisc_device(dev);
struct parisc_driver *pa_drv = to_parisc_driver(dev->driver);

if (pa_drv->remove)
pa_drv->remove(pa_dev);

return 0;
}


Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/ps3/system-bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static int ps3_system_bus_probe(struct device *_dev)
return result;
}

static int ps3_system_bus_remove(struct device *_dev)
static void ps3_system_bus_remove(struct device *_dev)
{
struct ps3_system_bus_device *dev = ps3_dev_to_system_bus_dev(_dev);
struct ps3_system_bus_driver *drv;
Expand All @@ -399,7 +399,6 @@ static int ps3_system_bus_remove(struct device *_dev)
__func__, __LINE__, drv->core.name);

pr_debug(" <- %s:%d: %s\n", __func__, __LINE__, dev_name(&dev->core));
return 0;
}

static void ps3_system_bus_shutdown(struct device *_dev)
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/pseries/ibmebus.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,14 +366,13 @@ static int ibmebus_bus_device_probe(struct device *dev)
return error;
}

static int ibmebus_bus_device_remove(struct device *dev)
static void ibmebus_bus_device_remove(struct device *dev)
{
struct platform_device *of_dev = to_platform_device(dev);
struct platform_driver *drv = to_platform_driver(dev->driver);

if (dev->driver && drv->remove)
drv->remove(of_dev);
return 0;
}

static void ibmebus_bus_device_shutdown(struct device *dev)
Expand Down
3 changes: 1 addition & 2 deletions arch/powerpc/platforms/pseries/vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ static int vio_bus_probe(struct device *dev)
}

/* convert from struct device to struct vio_dev and pass to driver. */
static int vio_bus_remove(struct device *dev)
static void vio_bus_remove(struct device *dev)
{
struct vio_dev *viodev = to_vio_dev(dev);
struct vio_driver *viodrv = to_vio_driver(dev->driver);
Expand All @@ -1276,7 +1276,6 @@ static int vio_bus_remove(struct device *dev)
vio_cmo_bus_remove(viodev);

put_device(devptr);
return 0;
}

static void vio_bus_shutdown(struct device *dev)
Expand Down
2 changes: 1 addition & 1 deletion arch/s390/include/asm/eadm.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ enum scm_event {SCM_CHANGE, SCM_AVAIL};
struct scm_driver {
struct device_driver drv;
int (*probe) (struct scm_device *scmdev);
int (*remove) (struct scm_device *scmdev);
void (*remove) (struct scm_device *scmdev);
void (*notify) (struct scm_device *scmdev, enum scm_event event);
void (*handler) (struct scm_device *scmdev, void *data,
blk_status_t error);
Expand Down
4 changes: 1 addition & 3 deletions arch/sparc/kernel/vio.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static int vio_device_probe(struct device *dev)
return drv->probe(vdev, id);
}

static int vio_device_remove(struct device *dev)
static void vio_device_remove(struct device *dev)
{
struct vio_dev *vdev = to_vio_dev(dev);
struct vio_driver *drv = to_vio_driver(dev->driver);
Expand All @@ -107,8 +107,6 @@ static int vio_device_remove(struct device *dev)

drv->remove(vdev);
}

return 0;
}

static ssize_t devspec_show(struct device *dev,
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -1019,7 +1019,7 @@ static int acpi_device_probe(struct device *dev)
return 0;
}

static int acpi_device_remove(struct device *dev)
static void acpi_device_remove(struct device *dev)
{
struct acpi_device *acpi_dev = to_acpi_device(dev);
struct acpi_driver *acpi_drv = acpi_dev->driver;
Expand All @@ -1034,7 +1034,6 @@ static int acpi_device_remove(struct device *dev)
acpi_dev->driver_data = NULL;

put_device(dev);
return 0;
}

struct bus_type acpi_bus_type = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/amba/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int amba_probe(struct device *dev)
return ret;
}

static int amba_remove(struct device *dev)
static void amba_remove(struct device *dev)
{
struct amba_device *pcdev = to_amba_device(dev);
struct amba_driver *drv = to_amba_driver(dev->driver);
Expand All @@ -236,8 +236,6 @@ static int amba_remove(struct device *dev)

amba_put_disable_pclk(pcdev);
dev_pm_domain_detach(dev, true);

return 0;
}

static void amba_shutdown(struct device *dev)
Expand Down
4 changes: 1 addition & 3 deletions drivers/base/auxiliary.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,14 @@ static int auxiliary_bus_probe(struct device *dev)
return ret;
}

static int auxiliary_bus_remove(struct device *dev)
static void auxiliary_bus_remove(struct device *dev)
{
struct auxiliary_driver *auxdrv = to_auxiliary_drv(dev->driver);
struct auxiliary_device *auxdev = to_auxiliary_dev(dev);

if (auxdrv->remove)
auxdrv->remove(auxdev);
dev_pm_domain_detach(dev, true);

return 0;
}

static void auxiliary_bus_shutdown(struct device *dev)
Expand Down
6 changes: 3 additions & 3 deletions drivers/base/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static ssize_t unbind_store(struct device_driver *drv, const char *buf,
bus_put(bus);
return err;
}
static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, S_IWUSR, NULL, unbind_store);
static DRIVER_ATTR_IGNORE_LOCKDEP(unbind, 0200, NULL, unbind_store);

/*
* Manually attach a device to a driver.
Expand All @@ -221,7 +221,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf,
bus_put(bus);
return err;
}
static DRIVER_ATTR_IGNORE_LOCKDEP(bind, S_IWUSR, NULL, bind_store);
static DRIVER_ATTR_IGNORE_LOCKDEP(bind, 0200, NULL, bind_store);

static ssize_t drivers_autoprobe_show(struct bus_type *bus, char *buf)
{
Expand Down Expand Up @@ -767,7 +767,7 @@ static ssize_t bus_uevent_store(struct bus_type *bus,
* DEVICE_ATTR_WO(uevent), which would cause a clash with the with the store
* function name.
*/
static struct bus_attribute bus_attr_uevent = __ATTR(uevent, S_IWUSR, NULL,
static struct bus_attribute bus_attr_uevent = __ATTR(uevent, 0200, NULL,
bus_uevent_store);

/**
Expand Down
1 change: 1 addition & 0 deletions drivers/base/cacheinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ static void free_cache_attributes(unsigned int cpu)

kfree(per_cpu_cacheinfo(cpu));
per_cpu_cacheinfo(cpu) = NULL;
cache_leaves(cpu) = 0;
}

int __weak init_cache_level(unsigned int cpu)
Expand Down
4 changes: 2 additions & 2 deletions drivers/base/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ int register_cpu(struct cpu *cpu, int num)
return 0;
}

struct device *get_cpu_device(unsigned cpu)
struct device *get_cpu_device(unsigned int cpu)
{
if (cpu < nr_cpu_ids && cpu_possible(cpu))
return per_cpu(cpu_sys_devices, cpu);
Expand Down Expand Up @@ -484,7 +484,7 @@ static const struct attribute_group *cpu_root_attr_groups[] = {
NULL,
};

bool cpu_is_hotpluggable(unsigned cpu)
bool cpu_is_hotpluggable(unsigned int cpu)
{
struct device *dev = get_cpu_device(cpu);
return dev && container_of(dev, struct cpu, dev)->hotpluggable;
Expand Down
16 changes: 10 additions & 6 deletions drivers/base/dd.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,8 @@ static int really_probe(struct device *dev, struct device_driver *drv)
goto probe_failed;
}

if (driver_sysfs_add(dev)) {
ret = driver_sysfs_add(dev);
if (ret) {
pr_err("%s: driver_sysfs_add(%s) failed\n",
__func__, dev_name(dev));
goto probe_failed;
Expand All @@ -602,15 +603,18 @@ static int really_probe(struct device *dev, struct device_driver *drv)
goto probe_failed;
}

if (device_add_groups(dev, drv->dev_groups)) {
ret = device_add_groups(dev, drv->dev_groups);
if (ret) {
dev_err(dev, "device_add_groups() failed\n");
goto dev_groups_failed;
}

if (dev_has_sync_state(dev) &&
device_create_file(dev, &dev_attr_state_synced)) {
dev_err(dev, "state_synced sysfs add failed\n");
goto dev_sysfs_state_synced_failed;
if (dev_has_sync_state(dev)) {
ret = device_create_file(dev, &dev_attr_state_synced);
if (ret) {
dev_err(dev, "state_synced sysfs add failed\n");
goto dev_sysfs_state_synced_failed;
}
}

if (test_remove) {
Expand Down
20 changes: 8 additions & 12 deletions drivers/base/firmware_loader/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static inline int fw_state_wait(struct fw_priv *fw_priv)
return __fw_state_wait_common(fw_priv, MAX_SCHEDULE_TIMEOUT);
}

static int fw_cache_piggyback_on_request(const char *name);
static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv);

static struct fw_priv *__allocate_fw_priv(const char *fw_name,
struct firmware_cache *fwc,
Expand Down Expand Up @@ -707,10 +707,8 @@ int assign_fw(struct firmware *fw, struct device *device)
* on request firmware.
*/
if (!(fw_priv->opt_flags & FW_OPT_NOCACHE) &&
fw_priv->fwc->state == FW_LOADER_START_CACHE) {
if (fw_cache_piggyback_on_request(fw_priv->fw_name))
kref_get(&fw_priv->ref);
}
fw_priv->fwc->state == FW_LOADER_START_CACHE)
fw_cache_piggyback_on_request(fw_priv);

/* pass the pages buffer to driver at the last minute */
fw_set_page_data(fw_priv, fw);
Expand Down Expand Up @@ -1259,25 +1257,24 @@ static int __fw_entry_found(const char *name)
return 0;
}

static int fw_cache_piggyback_on_request(const char *name)
static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv)
{
struct firmware_cache *fwc = &fw_cache;
const char *name = fw_priv->fw_name;
struct firmware_cache *fwc = fw_priv->fwc;
struct fw_cache_entry *fce;
int ret = 0;

spin_lock(&fwc->name_lock);
if (__fw_entry_found(name))
goto found;

fce = alloc_fw_cache_entry(name);
if (fce) {
ret = 1;
list_add(&fce->list, &fwc->fw_names);
kref_get(&fw_priv->ref);
pr_debug("%s: fw: %s\n", __func__, name);
}
found:
spin_unlock(&fwc->name_lock);
return ret;
}

static void free_fw_cache_entry(struct fw_cache_entry *fce)
Expand Down Expand Up @@ -1508,9 +1505,8 @@ static inline void unregister_fw_pm_ops(void)
unregister_pm_notifier(&fw_cache.pm_notify);
}
#else
static int fw_cache_piggyback_on_request(const char *name)
static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv)
{
return 0;
}
static inline int register_fw_pm_ops(void)
{
Expand Down
Loading

0 comments on commit c6c3c57

Please sign in to comment.