Devicetree fixes for v6.5, part 2:
- Fix DT node refcount when creating platform devices - Fix deadlock in changeset code due to printing with devtree_lock held - Fix unittest EXPECT strings for parse_phandle_with_args_map() test - Fix IMA kexec memblock freeing -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEktVUI4SxYhzZyEuo+vtdtY28YcMFAmTk6g4ACgkQ+vtdtY28 YcO/bQ//Qm+de3ZnsL9iCxY9MqLgdjuxFkt1n5RrhoQLcjne4zW0Ln42hWZxKnhl ezY//FrzUV766iU2u4IKLLKPAKzmka47G/aRuHGymBk8mxcd6Qf/3Ezlz1erv3S1 lk7JdmpNpo/ilwBCIvUG0AkoSqPDYtFmHdd/j7tasDDlsc+rZCvub+j3TMlrFSqP F8KxAdoSzti+V8bsk0ob1Wq+IeRlCyLYvvVatdkJpo2qabYD/v3EbC6vbtPEVm0N QMtkeAWVaOuPz0CCnM5r3wtdMD0Nj76ti0fR3NRm3kQnXHmFzq0wKlAcE7N1BNpy dKxelaMOrWN7B3kbYjTptyVx6/Kc309C0nHirWDazRPVrT4Mt6kfrjXbHHPjE7+F La5DcnBm5vitpc5OFoyhUQKO5JnBDsOgywIOjyGuf3JbBo6PI85zWa1brv06i6a3 o7XfjOyH2dt541c5qjg+geGoDMeIn5BSRIPorpydEmUMuWgjL5f4cf+btcpGHaiD ZPKcv7zF7o0LP8y/rGGCfAE1UwhSDUKJvrCfjUsz7Js6VTHnQ494HLDdzhiQYUR+ Svqi8SEqovCkpSfuWq/EnDKwLj33MIWU3JdsnXQYbF4Dbq2IPDC1pcw4Adax/RVJ XFxMa84NHTwbHVv/3JySS8KgCrJQh+JfReMTpggKw3XZyUvwWn4= =J8E5 -----END PGP SIGNATURE----- Merge tag 'devicetree-fixes-for-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree fixes from Rob Herring: - Fix DT node refcount when creating platform devices - Fix deadlock in changeset code due to printing with devtree_lock held - Fix unittest EXPECT strings for parse_phandle_with_args_map() test - Fix IMA kexec memblock freeing * tag 'devicetree-fixes-for-6.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: of/platform: increase refcount of fwnode of: dynamic: Refactor action prints to not use "%pOF" inside devtree_lock of: unittest: Fix EXPECT for parse_phandle_with_args_map() test mm,ima,kexec,of: use memblock_free_late from ima_free_kexec_buffer
This commit is contained in:
commit
89bf6209ca
@ -63,15 +63,14 @@ int of_reconfig_notifier_unregister(struct notifier_block *nb)
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(of_reconfig_notifier_unregister);
|
||||
|
||||
#ifdef DEBUG
|
||||
const char *action_names[] = {
|
||||
static const char *action_names[] = {
|
||||
[0] = "INVALID",
|
||||
[OF_RECONFIG_ATTACH_NODE] = "ATTACH_NODE",
|
||||
[OF_RECONFIG_DETACH_NODE] = "DETACH_NODE",
|
||||
[OF_RECONFIG_ADD_PROPERTY] = "ADD_PROPERTY",
|
||||
[OF_RECONFIG_REMOVE_PROPERTY] = "REMOVE_PROPERTY",
|
||||
[OF_RECONFIG_UPDATE_PROPERTY] = "UPDATE_PROPERTY",
|
||||
};
|
||||
#endif
|
||||
|
||||
int of_reconfig_notify(unsigned long action, struct of_reconfig_data *p)
|
||||
{
|
||||
@ -620,21 +619,9 @@ static int __of_changeset_entry_apply(struct of_changeset_entry *ce)
|
||||
}
|
||||
|
||||
ret = __of_add_property(ce->np, ce->prop);
|
||||
if (ret) {
|
||||
pr_err("changeset: add_property failed @%pOF/%s\n",
|
||||
ce->np,
|
||||
ce->prop->name);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case OF_RECONFIG_REMOVE_PROPERTY:
|
||||
ret = __of_remove_property(ce->np, ce->prop);
|
||||
if (ret) {
|
||||
pr_err("changeset: remove_property failed @%pOF/%s\n",
|
||||
ce->np,
|
||||
ce->prop->name);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case OF_RECONFIG_UPDATE_PROPERTY:
|
||||
@ -648,20 +635,17 @@ static int __of_changeset_entry_apply(struct of_changeset_entry *ce)
|
||||
}
|
||||
|
||||
ret = __of_update_property(ce->np, ce->prop, &old_prop);
|
||||
if (ret) {
|
||||
pr_err("changeset: update_property failed @%pOF/%s\n",
|
||||
ce->np,
|
||||
ce->prop->name);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
raw_spin_unlock_irqrestore(&devtree_lock, flags);
|
||||
|
||||
if (ret)
|
||||
if (ret) {
|
||||
pr_err("changeset: apply failed: %-15s %pOF:%s\n",
|
||||
action_names[ce->action], ce->np, ce->prop->name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
switch (ce->action) {
|
||||
case OF_RECONFIG_ATTACH_NODE:
|
||||
@ -947,6 +931,9 @@ int of_changeset_action(struct of_changeset *ocs, unsigned long action,
|
||||
if (!ce)
|
||||
return -ENOMEM;
|
||||
|
||||
if (WARN_ON(action >= ARRAY_SIZE(action_names)))
|
||||
return -EINVAL;
|
||||
|
||||
/* get a reference to the node */
|
||||
ce->action = action;
|
||||
ce->np = of_node_get(np);
|
||||
|
@ -184,7 +184,8 @@ int __init ima_free_kexec_buffer(void)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return memblock_phys_free(addr, size);
|
||||
memblock_free_late(addr, size);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -141,7 +141,7 @@ struct platform_device *of_device_alloc(struct device_node *np,
|
||||
}
|
||||
|
||||
/* setup generic device info */
|
||||
device_set_node(&dev->dev, of_fwnode_handle(np));
|
||||
device_set_node(&dev->dev, of_fwnode_handle(of_node_get(np)));
|
||||
dev->dev.parent = parent ? : &platform_bus;
|
||||
|
||||
if (bus_id)
|
||||
@ -239,7 +239,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
|
||||
dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
|
||||
|
||||
/* setup generic device info */
|
||||
device_set_node(&dev->dev, of_fwnode_handle(node));
|
||||
device_set_node(&dev->dev, of_fwnode_handle(of_node_get(node)));
|
||||
dev->dev.parent = parent ? : &platform_bus;
|
||||
dev->dev.platform_data = platform_data;
|
||||
if (bus_id)
|
||||
|
@ -664,12 +664,12 @@ static void __init of_unittest_parse_phandle_with_args_map(void)
|
||||
memset(&args, 0, sizeof(args));
|
||||
|
||||
EXPECT_BEGIN(KERN_INFO,
|
||||
"OF: /testcase-data/phandle-tests/consumer-b: could not find phandle");
|
||||
"OF: /testcase-data/phandle-tests/consumer-b: could not find phandle 12345678");
|
||||
|
||||
rc = of_parse_phandle_with_args_map(np, "phandle-list-bad-phandle",
|
||||
"phandle", 0, &args);
|
||||
EXPECT_END(KERN_INFO,
|
||||
"OF: /testcase-data/phandle-tests/consumer-b: could not find phandle");
|
||||
"OF: /testcase-data/phandle-tests/consumer-b: could not find phandle 12345678");
|
||||
|
||||
unittest(rc == -EINVAL, "expected:%i got:%i\n", -EINVAL, rc);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user