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
2639{2639{
2640 struct device *dev = get_cpu_device(cpu);2640 struct device *dev = get_cpu_device(cpu);
2641 2641
2642 dev->offline = true;2642 dev_set_offline(dev);
2643 /* Tell user space about the state change */2643 /* Tell user space about the state change */
2644 kobject_uevent(&dev->kobj, KOBJ_OFFLINE);2644 kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
2645}2645}
@@ -2648,7 +2648,7 @@ static void cpuhp_online_cpu_device(unsigned int cpu) · 2 unmodified lines
2648{2648{
2649 struct device *dev = get_cpu_device(cpu);2649 struct device *dev = get_cpu_device(cpu);
2650 2650
2651 dev->offline = false;2651 dev_clear_offline(dev);
2652 /* Tell user space about the state change */2652 /* Tell user space about the state change */
2653 kobject_uevent(&dev->kobj, KOBJ_ONLINE);2653 kobject_uevent(&dev->kobj, KOBJ_ONLINE);
2654}2654}
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
126 if (likely(!ops))126 if (likely(!ops))
127 return true;127 return true;
128 128
129#ifdef CONFIG_DMA_OPS_BYPASS129 if (IS_ENABLED(CONFIG_DMA_OPS_BYPASS) && dev_dma_ops_bypass(dev))
130 if (dev->dma_ops_bypass)
131 return min_not_zero(mask, dev->bus_dma_limit) >=130 return min_not_zero(mask, dev->bus_dma_limit) >=
132 dma_direct_get_required_mask(dev);131 dma_direct_get_required_mask(dev);
133#endif
134 return false;132 return false;
135}133}
136 134
@@ -472,7 +470,7 @@ bool dma_need_unmap(struct device *dev) · 335 unmodified lines
472{470{
473 if (!dma_map_direct(dev, get_dma_ops(dev)))471 if (!dma_map_direct(dev, get_dma_ops(dev)))
474 return true;472 return true;
475 if (!dev->dma_skip_sync)473 if (!dev_dma_skip_sync(dev))
476 return true;474 return true;
477 return IS_ENABLED(CONFIG_DMA_API_DEBUG);475 return IS_ENABLED(CONFIG_DMA_API_DEBUG);
478}476}
@@ -488,16 +486,16 @@ static void dma_setup_need_sync(struct device *dev) · 9 unmodified lines
488 * mapping, if any. During the device initialization, it's486 * mapping, if any. During the device initialization, it's
489 * enough to check only for the DMA coherence.487 * enough to check only for the DMA coherence.
490 */488 */
491 dev->dma_skip_sync = dev_is_dma_coherent(dev);489 dev_assign_dma_skip_sync(dev, dev_is_dma_coherent(dev));
492 else if (!ops->sync_single_for_device && !ops->sync_single_for_cpu &&490 else if (!ops->sync_single_for_device && !ops->sync_single_for_cpu &&
493 !ops->sync_sg_for_device && !ops->sync_sg_for_cpu)491 !ops->sync_sg_for_device && !ops->sync_sg_for_cpu)
494 /*492 /*
495 * Synchronization is not possible when none of DMA sync ops493 * Synchronization is not possible when none of DMA sync ops
496 * is set.494 * is set.
497 */495 */
498 dev->dma_skip_sync = true;496 dev_set_dma_skip_sync(dev);
499 else497 else
500 dev->dma_skip_sync = false;498 dev_clear_dma_skip_sync(dev);
501}499}
502#else /* !CONFIG_DMA_NEED_SYNC */500#else /* !CONFIG_DMA_NEED_SYNC */
503static inline void dma_setup_need_sync(struct device *dev) { }501static 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
942/*942/*
943 * param_sysfs_init - create "module" kset943 * param_sysfs_init - create "module" kset
944 *944 *
945 * This must be done before the initramfs is unpacked and945 * This must be done before any driver registration so that when a driver comes
946 * request_module() thus becomes possible, because otherwise the946 * from a built-in module, the driver core can add the module under /sys/module
947 * module load would fail in mod_sysfs_init.947 * and create the associated driver symlinks.
948 */948 */
949static int __init param_sysfs_init(void)949static int __init param_sysfs_init(void)
950{950{
@@ -957,7 +957,7 @@ static int __init param_sysfs_init(void) · 6 unmodified lines
957 957
958 return 0;958 return 0;
959}959}
960subsys_initcall(param_sysfs_init);960pure_initcall(param_sysfs_init);
961 961
962/*962/*
963 * param_sysfs_builtin_init - add sysfs version and parameter963 * param_sysfs_builtin_init - add sysfs version and parameter