clk: at91: check pmc node status before registering syscore ops
Subsystems (2)
PATCH 1/1 clk: at91: check pmc node status before registering syscore ops
Currently, at91 pmc driver always register the syscore_ops whatever the status of the pmc node that has been found. When set as secure and disabled, the pmc should not be accessed or this will generate abort exceptions.
To avoid this, add a check on node availability before registering the syscore operations.
--- drivers/clk/at91/pmc.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/clk/at91/pmc.c +5 -0
@@ -267,6 +267,11 @@ static int __init pmc_register_ops(void)if (!np)return -ENODEV ; +if (!of_device_is_available (np)) { +of_node_put (np); +return -ENODEV ; + } + pmcreg =device_node_to_regmap (np);of_node_put (np);if (IS_ERR (pmcreg))
Signature · 1 line
2.33.0
Quoted 8 lines · Clément Léger
Currently, at91 pmc driver always register the
syscore_opswhatever the status of the pmc node that has been found. When set as secure and disabled, the pmc should not be accessed or this will generate abort exceptions.
To avoid this, add a check on node availability before registering the syscore operations.Signed-off-by Clément Léger <[email protected]>
Yes, indeed,
Thanks, best regards,
Nicolas
Quoted 23 lines
--- drivers/clk/at91/pmc.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/clk/at91/pmc.c +5
-1@@ -267,6 +267,11 @@ static int __init pmc_register_ops(void)if (!np)return -ENODEV ; +if (!of_device_is_available (np)) { +of_node_put (np); +return -ENODEV ; + } + pmcreg =device_node_to_regmap (np);of_node_put (np);if (IS_ERR (pmcreg)) --2.33.0
Signature · 1 line
Nicolas Ferre
Quoted 10 lines · Clément Léger
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Currently, at91 pmc driver always register the
syscore_opswhatever the status of the pmc node that has been found. When set as secure and disabled, the pmc should not be accessed or this will generate abort exceptions.
To avoid this, add a check on node availability before registering the syscore operations.Signed-off-by Clément Léger <[email protected]>
Quoted 21 lines
--- drivers/clk/at91/pmc.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/clk/at91/pmc.c +5
-1@@ -267,6 +267,11 @@ static int __init pmc_register_ops(void)if (!np)return -ENODEV ; +if (!of_device_is_available (np)) { +of_node_put (np); +return -ENODEV ; + } + pmcreg =device_node_to_regmap (np);of_node_put (np);if (IS_ERR (pmcreg)) --
Quoted 2 lines
2.33.0
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Stephen Boyd
maintainerQuoting Clement Leger (2021-09-13 01:26:33)
Quoted 8 lines
Currently, at91 pmc driver always register the
syscore_opswhatever the status of the pmc node that has been found. When set as secure and disabled, the pmc should not be accessed or this will generate abort exceptions.
To avoid this, add a check on node availability before registering the syscore operations.Signed-off-by Clement Leger <[email protected]>
Any Fixes tag?
Quoted 11 lines · Stephen Boyd
Quoting Clement Leger (2021-09-13 01:26:33)
Quoted 8 lines
Currently, at91 pmc driver always register the
syscore_opswhatever the status of the pmc node that has been found. When set as secure and disabled, the pmc should not be accessed or this will generate abort exceptions.
To avoid this, add a check on node availability before registering the syscore operations.Signed-off-by Clement Leger <[email protected]>Any Fixes tag?
Since this was present from the start of the implementation, I think it should be the following:
Quoting Clément Léger (2021-09-13 01:26:33)
Quoted 9 lines
Currently, at91 pmc driver always register the
syscore_opswhatever the status of the pmc node that has been found. When set as secure and disabled, the pmc should not be accessed or this will generate abort exceptions.
To avoid this, add a check on node availability before registering the syscore operations.Signed-off-by Clément Léger <[email protected]>---
Applied to clk-next