aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
diff options
context:
space:
mode:
authorFrank Rowand <frank.rowand@sony.com>2017-10-17 19:36:26 -0400
committerRob Herring <robh@kernel.org>2017-10-17 21:47:14 -0400
commit24789c5ce5a373dd55640f9cd79117fcc3ccc46d (patch)
tree74f46e8ace25e756c8b26b9fa0b89907b21a78c6 /drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
parent61b4de4e0b384f4a22c55c3bada604da49cec4e1 (diff)
of: overlay: detect cases where device tree may become corrupt
When an attempt to apply an overlay changeset fails, an effort is made to revert any partial application of the changeset. When an attempt to remove an overlay changeset fails, an effort is made to re-apply any partial reversion of the changeset. The existing code does not check for failure to recover a failed overlay changeset application or overlay changeset revert. Add the missing checks and flag the devicetree as corrupt if the state of the devicetree can not be determined. Improve and expand the returned errors to more fully reflect the result of the effort to undo the partial effects of a failed attempt to apply or remove an overlay changeset. If the device tree might be corrupt, do not allow further attempts to apply or remove an overlay changeset. When creating an overlay changeset from an overlay device tree, add some additional warnings if the state of the overlay device tree is not as expected. Signed-off-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c')
-rw-r--r--drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
index 5f5b7ba35f1d..7a7be0515bfd 100644
--- a/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
+++ b/drivers/gpu/drm/tilcdc/tilcdc_slave_compat.c
@@ -204,7 +204,7 @@ static void __init tilcdc_convert_slave_node(void)
204 /* For all memory needed for the overlay tree. This memory can 204 /* For all memory needed for the overlay tree. This memory can
205 be freed after the overlay has been applied. */ 205 be freed after the overlay has been applied. */
206 struct kfree_table kft; 206 struct kfree_table kft;
207 int ret; 207 int ovcs_id, ret;
208 208
209 if (kfree_table_init(&kft)) 209 if (kfree_table_init(&kft))
210 return; 210 return;
@@ -247,7 +247,8 @@ static void __init tilcdc_convert_slave_node(void)
247 247
248 tilcdc_node_disable(slave); 248 tilcdc_node_disable(slave);
249 249
250 ret = of_overlay_apply(overlay); 250 ovcs_id = 0;
251 ret = of_overlay_apply(overlay, &ovcs_id);
251 if (ret) 252 if (ret)
252 pr_err("%s: Applying overlay changeset failed: %d\n", 253 pr_err("%s: Applying overlay changeset failed: %d\n",
253 __func__, ret); 254 __func__, ret);