Skip to content

soc: sensry: fix irq enable/disable #91235

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

Merged
merged 2 commits into from
Jun 13, 2025
Merged

Conversation

kartben
Copy link
Contributor

@kartben kartben commented Jun 7, 2025

SET/CLR registers are write-only so trying to read/modify/write is inefficient & illegal

@tswaehn just curious if this fix is correct - it was a suggestion I got while experimenting with LLMs on the codebase, but since it doesn't seem the ganymed documentation is public, it's hard to tell if it's correct :)

@kartben kartben force-pushed the sensryint branch 2 times, most recently from 2b9e608 to 40cf7fb Compare June 7, 2025 19:55
@kartben
Copy link
Contributor Author

kartben commented Jun 10, 2025

@tswaehn can you comment here? Or maybe share the relevant portion of the reference manual? thanks!

@tswaehn
Copy link
Contributor

tswaehn commented Jun 11, 2025

To be honest, from documentation point of view - your fix is 100% correct. the registers are both write-only. So the reading before writing is absolutely non-sense. I m running the changes on hardware and update comments here, ...

@kartben
Copy link
Contributor Author

kartben commented Jun 11, 2025

@tswaehn thanks! Let me put this out of draft then, since at least it doesn't look to be complete nonsense :)

@kartben kartben marked this pull request as ready for review June 11, 2025 08:53
@tswaehn
Copy link
Contributor

tswaehn commented Jun 11, 2025

moreover, the inversion for clear is incorrect and that should also fix with your commit.

tswaehn
tswaehn previously approved these changes Jun 11, 2025
@kartben kartben requested a review from fabiobaltieri June 11, 2025 09:01
@kartben
Copy link
Contributor Author

kartben commented Jun 11, 2025

@tswaehn it looks like you might need to ask to be added as a collaborator in the GH organization, your +1 should be counting towards approval and showing up as green, but it doesn't.
https://github.com/zephyrproject-rtos/zephyr/issues/new?template=006_nomination.yml

fabiobaltieri
fabiobaltieri previously approved these changes Jun 11, 2025
uint32_t current = sys_read32(SY1XX_ARCHI_FC_ITC_ADDR + SY1XX_ARCHI_ITC_MASK_SET_OFFSET);

sys_write32(current | (1 << (idx & 0x1f)),
sys_write32(BIT(idx & 0x1f),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not for this PR but this mask should have a define, also the parenthesis on SY1XX_ARCHI_REF_CLOCK and SY1XX_ARCHI_PER_CLOCK and redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there you go

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you.

kartben added 2 commits June 11, 2025 11:09
removed redundant parentheses

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
SET/CLR registers are write-only so trying to
read/modify/write is inefficient & illegal

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
Copy link

@kartben kartben merged commit 4cac658 into zephyrproject-rtos:main Jun 13, 2025
33 of 35 checks passed
@kartben kartben deleted the sensryint branch June 13, 2025 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants