History

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

Pull driver core updates from Danilo Krummrich: "Deferred probe: - Fix race where deferred probe timeout work could be permanently canceled by using mod_delayed_work() - Fix missing jiffies conversion in deferred_probe_extend_timeout() - Guard timeout extension with delayed_work_pending() to prevent premature firing - Use system_percpu_wq instead of the deprecated system_wq - Update deferred_probe_timeout documentation device: - Replace direct struct device bitfield access (can_match, dma_iommu, dma_skip_sync, dma_ops_bypass, state_synced, dma_coherent, of_node_reused, offline, offline_disabled) with flag-based accessors using bit operations - Reject devices with unregistered buses - Delete unused DEVICE_ATTR_PREALLOC() - Add low-level device attribute macros with const show/store callbacks, allowing device attributes to reside in read-only memory - Move core device attributes to read-only memory - Constify group array pointers in driver_add_groups() / driver_remove_groups(), struct bus_type, and struct device_driver device property: - Fix fwnode reference leak in fwnode_graph_get_endpoint_by_id() - Initialize all fields of fwnode_handle in fwnode_init() - Provide swnode_get()/swnode_put() wrappers around kobject_get/put() - Allow passing struct software_node_ref_args pointers directly to PROPERTY_ENTRY_REF() driver_override: - Migrate amba, cdx, vmbus, and rpmsg to the generic driver_override infrastructure, fixing a UAF from unsynchronized access to driver_override in bus match() callbacks - Remove the now-unused driver_set_override() firmware loader: - Fix recursive lock deadlock in device_cache_fw_images() when async work falls back to synchronous execution - Fix device reference leak in firmware_upload_register() platform: - Pass KBUILD_MODNAME through the platform driver registration macro to create module symlinks in sysfs for built-in drivers; move module_kset initialization to a pure_initcall and tegra cbb registration to core_initcall to ensure correct ordering - Pass THIS_MODULE implicitly through a coresight_init_driver() macro sysfs: - Upgrade OOB write detection in sysfs_kf_seq_show() from printk to WARN - Add return value clamping to sysfs_kf_read() Rust: - ACPI: Fix missing match data for PRP0001 by exporting acpi_of_match_device() - Auxiliary: Replace drvdata() with dedicated registration data on auxiliary_device. drvdata() exposed the driver's bus device private data beyond the driver's own scope, creating ordering constraints and forcing the data to outlive all registrations that access it. Registration data is instead scoped structurally to the Registration object, making lifecycle ordering enforced by construction rather than convention. - Rust-native device driver lifetimes (HRT): Allow Rust device drivers to carry a lifetime parameter on their bus device private data, tied to the device binding scope -- the interval during which a bus device is bound to a driver. Device resources like pci::Bar<'a> and IoMem<'a> can be stored directly in the driver's bus device private data with a lifetime bounded by the binding scope, so the compiler enforces at build time that they do not outlive the binding. This removes Devres indirection from every access site and eliminates try_access() failure paths in destructors. Bus driver traits use a Generic Associated Type (GAT) Data<'bound> to introduce the lifetime on the private data, rather than parameterizing the Driver trait itself. Auxiliary registration data, where the lifetime is not introduced by a trait callback but must be threaded through Registration, uses the ForLt trait (a type-level abstraction for types generic over a lifetime). Misc: - Fix DT overlayed devices not probing by reverting the broken treewide overlay fix and re-running fw_devlink consumer pickup when an overlay is applied to a bound device - Use root_device_register() for faux bus root device; add sanity check for failed bus init - Fix dev_has_sync_state() data race with READ_ONCE() and move it to base.h - Avoid spurious device_links warning when removing a device while its supplier is unbinding - Switch ISA bus to dynamic root device - Fix suspicious RCU usage in kernfs_put() - Remove devcoredump exit callback - Constify devfreq_event_class" * tag 'driver-core-7.2-rc1' of gitolite.kernel.org:pub/scm/linux/kernel/git/driver-core/driver-core: (81 commits) software node: allow passing reference args to PROPERTY_ENTRY_REF() driver core: platform: set mod_name in driver registration coresight: pass THIS_MODULE implicitly through a macro kernel: param: initialize module_kset in a pure_initcall soc/tegra: cbb: Move driver registration from pure_initcall to core_initcall firmware_loader: Fix recursive lock in device_cache_fw_images() driver core: Use system_percpu_wq instead of system_wq driver core: remove driver_set_override() rpmsg: use generic driver_override infrastructure Drivers: hv: vmbus: use generic driver_override infrastructure cdx: use generic driver_override infrastructure amba: use generic driver_override infrastructure rust: devres: add 'static bound to Devres<T> samples: rust: rust_driver_auxiliary: showcase lifetime-bound registration data rust: auxiliary: generalize Registration over ForLt rust: types: add `ForLt` trait for higher-ranked lifetime support gpu: nova-core: separate driver type from driver data samples: rust: rust_driver_pci: use HRT lifetime for Bar rust: io: make IoMem and ExclusiveIoMem lifetime-parameterized rust: pci: make Bar lifetime-parameterized ...

Linus Torvalds committed 5 months ago

Commit 36808d52 parents 5504ce0 fe22174128 files · +1814 −1134Browse files

Showing the changes to kernel (3 of 128 files). Show all

Unified · Split

3 files
  1. kernel/cpu.c +2 −2
  2. kernel/dma/mapping.c +5 −7
  3. kernel/params.c +4 −4
kernel/cpu.c+2−2
@@ -2639,7 +2639,7 @@ static void cpuhp_offline_cpu_device(unsigned int cpu) · 2638 unmodified lines
26392639 {
26402640 struct device *dev = get_cpu_device(cpu);
26412641
2642− dev->offline = true;
2642+ dev_set_offline(dev);
26432643 /* Tell user space about the state change */
26442644 kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
26452645 }
@@ -2648,7 +2648,7 @@ static void cpuhp_online_cpu_device(unsigned int cpu) · 2 unmodified lines
26482648 {
26492649 struct device *dev = get_cpu_device(cpu);
26502650
2651− dev->offline = false;
2651+ dev_clear_offline(dev);
26522652 /* Tell user space about the state change */
26532653 kobject_uevent(&dev->kobj, KOBJ_ONLINE);
26542654 }
kernel/dma/mapping.c+5−7
@@ -126,11 +126,9 @@ static bool dma_go_direct(struct device *dev, dma_addr_t mask, · 125 unmodified lines
126126 if (likely(!ops))
127127 return true;
128128
129−#ifdef CONFIG_DMA_OPS_BYPASS
130− if (dev->dma_ops_bypass)
129+ if (IS_ENABLED(CONFIG_DMA_OPS_BYPASS) && dev_dma_ops_bypass(dev))
131130 return min_not_zero(mask, dev->bus_dma_limit) >=
132131 dma_direct_get_required_mask(dev);
133−#endif
134132 return false;
135133 }
136134
@@ -472,7 +470,7 @@ bool dma_need_unmap(struct device *dev) · 335 unmodified lines
472470 {
473471 if (!dma_map_direct(dev, get_dma_ops(dev)))
474472 return true;
475− if (!dev->dma_skip_sync)
473+ if (!dev_dma_skip_sync(dev))
476474 return true;
477475 return IS_ENABLED(CONFIG_DMA_API_DEBUG);
478476 }
@@ -488,16 +486,16 @@ static void dma_setup_need_sync(struct device *dev) · 9 unmodified lines
488486 * mapping, if any. During the device initialization, it's
489487 * enough to check only for the DMA coherence.
490488 */
491− dev->dma_skip_sync = dev_is_dma_coherent(dev);
489+ dev_assign_dma_skip_sync(dev, dev_is_dma_coherent(dev));
492490 else if (!ops->sync_single_for_device && !ops->sync_single_for_cpu &&
493491 !ops->sync_sg_for_device && !ops->sync_sg_for_cpu)
494492 /*
495493 * Synchronization is not possible when none of DMA sync ops
496494 * is set.
497495 */
498− dev->dma_skip_sync = true;
496+ dev_set_dma_skip_sync(dev);
499497 else
500− dev->dma_skip_sync = false;
498+ dev_clear_dma_skip_sync(dev);
501499 }
502500 #else /* !CONFIG_DMA_NEED_SYNC */
503501 static inline void dma_setup_need_sync(struct device *dev) { }
kernel/params.c+4−4
@@ -942,9 +942,9 @@ const struct kobj_type module_ktype = { · 941 unmodified lines
942942 /*
943943 * param_sysfs_init - create "module" kset
944944 *
945− * This must be done before the initramfs is unpacked and
946− * request_module() thus becomes possible, because otherwise the
947− * module load would fail in mod_sysfs_init.
945+ * This must be done before any driver registration so that when a driver comes
946+ * from a built-in module, the driver core can add the module under /sys/module
947+ * and create the associated driver symlinks.
948948 */
949949 static int __init param_sysfs_init(void)
950950 {
@@ -957,7 +957,7 @@ static int __init param_sysfs_init(void) · 6 unmodified lines
957957
958958 return 0;
959959 }
960−subsys_initcall(param_sysfs_init);
960+pure_initcall(param_sysfs_init);
961961
962962 /*
963963 * param_sysfs_builtin_init - add sysfs version and parameter