Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: clk: stm32: fix stm32mp13 clock gates initialization #7068

Merged
merged 1 commit into from
Oct 11, 2024

Conversation

etienne-lms
Copy link
Contributor

Correct STM32MP13 clock gates initialization regarding the enable reference counting. The fixed commit introduced side effect where clock gates with a disable init state overflow the gate refcount to -1 and clock gates with a enable init state take a refcount that is never released.

For this purpose, add stm32_gate_set_init_state() function in stm32 clock core driver for STM32MP13 gate clocks initialization expects to set some clock gate hardware state (enabled or disabled) before any refcount is considered.

Fixes: 2b028a2 ("clk: implement multi-gate management at core level")

@Gabriel-Fernandz
Copy link
Contributor

Hi you can add my
Reviewed-by: Gabriel Fernandez gabriel.fernandez@foss.st.com.

@etienne-lms
Copy link
Contributor Author

Review tag applied.

@jforissier
Copy link
Contributor

@GseoC thanks for approving. Would you like to post an Acked-by: or Reviewed-by:? That's what remains for the posterity in Git ;)

@GseoC
Copy link
Contributor

GseoC commented Oct 7, 2024

Sure :) Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>

One more to add then @etienne-lms 👀

Correct STM32MP13 clock gates initialization regarding the enable
reference counting. The fixed commit introduced side effect where
clock gates with a disable init state overflow the gate refcount to -1
and clock gates with a enable init state take a refcount that is never
released.

For this purpose, add stm32_gate_set_init_state() function in
stm32 clock core driver for STM32MP13 gate clocks initialization
expects to set some clock gate hardware state (enabled or disabled)
before any refcount is considered.

Fixes: 2b028a2 ("clk: implement multi-gate management at core level")
Signed-off-by: Etienne Carriere <etienne.carriere@foss.st.com>
Reviewed-by: Gabriel Fernandez <gabriel.fernandez@foss.st.com>
Acked-by: Gatien Chevallier <gatien.chevallier@foss.st.com>
@jforissier jforissier merged commit 6a977fc into OP-TEE:master Oct 11, 2024
9 checks passed
@etienne-lms etienne-lms deleted the stm32-fix branch October 14, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants