Commit 559ac491 authored by Danilo Krummrich's avatar Danilo Krummrich
Browse files

Merge tag 'driver-core-6.19-rc7-deferred' into driver-core-next

Driver core fixes deferred from 6.19-rc7

[1, 2] were originally intended for -rc7. Patch [1] uncovered potential
deadlocks that require a few driver fixes; [2] is one such fix.

[1] https://patch.msgid.link/20260113162843.12712-1-hanguidong02@gmail.com
[2] https://patch.msgid.link/20260121141215.29658-1-dakr@kernel.org



Signed-off-by: default avatarDanilo Krummrich <dakr@kernel.org>
parents eb3dad51 ed1ac3c9
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -182,9 +182,18 @@ void device_set_deferred_probe_reason(const struct device *dev, struct va_format
static inline int driver_match_device(const struct device_driver *drv,
				      struct device *dev)
{
	device_lock_assert(dev);

	return drv->bus->match ? drv->bus->match(dev, drv) : 1;
}

static inline int driver_match_device_locked(const struct device_driver *drv,
					     struct device *dev)
{
	guard(device)(dev);
	return driver_match_device(drv, dev);
}

static inline void dev_sync_state(struct device *dev)
{
	if (dev->bus->sync_state)
+1 −1
Original line number Diff line number Diff line
@@ -263,7 +263,7 @@ static ssize_t bind_store(struct device_driver *drv, const char *buf,
	int err = -ENODEV;

	dev = bus_find_device_by_name(bus, NULL, buf);
	if (dev && driver_match_device(drv, dev)) {
	if (dev && driver_match_device_locked(drv, dev)) {
		err = device_driver_attach(drv, dev);
		if (!err) {
			/* success */
+1 −1
Original line number Diff line number Diff line
@@ -1180,7 +1180,7 @@ static int __driver_attach(struct device *dev, void *data)
	 * is an error.
	 */

	ret = driver_match_device(drv, dev);
	ret = driver_match_device_locked(drv, dev);
	if (ret == 0) {
		/* no match */
		return 0;
+14 −0
Original line number Diff line number Diff line
@@ -228,3 +228,17 @@ struct arm_smmu_device *arm_smmu_impl_init(struct arm_smmu_device *smmu)

	return smmu;
}

int __init arm_smmu_impl_module_init(void)
{
	if (IS_ENABLED(CONFIG_ARM_SMMU_QCOM))
		return qcom_smmu_module_init();

	return 0;
}

void __exit arm_smmu_impl_module_exit(void)
{
	if (IS_ENABLED(CONFIG_ARM_SMMU_QCOM))
		qcom_smmu_module_exit();
}
+10 −4
Original line number Diff line number Diff line
@@ -774,10 +774,6 @@ struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu)
{
	const struct device_node *np = smmu->dev->of_node;
	const struct of_device_id *match;
	static u8 tbu_registered;

	if (!tbu_registered++)
		platform_driver_register(&qcom_smmu_tbu_driver);

#ifdef CONFIG_ACPI
	if (np == NULL) {
@@ -802,3 +798,13 @@ struct arm_smmu_device *qcom_smmu_impl_init(struct arm_smmu_device *smmu)

	return smmu;
}

int __init qcom_smmu_module_init(void)
{
	return platform_driver_register(&qcom_smmu_tbu_driver);
}

void __exit qcom_smmu_module_exit(void)
{
	platform_driver_unregister(&qcom_smmu_tbu_driver);
}
Loading