Skip to content

fix(freertos): use xSemaphoreTakeRecursive - #6803

Merged
FASTSHIFT merged 2 commits into
lvgl:masterfrom
kisvegabor:fix/freerots-mutex
Sep 24, 2024
Merged

FASTSHIFT merged 2 commits into
lvgl:masterfrom
kisvegabor:fix/freerots-mutex

Conversation

@kisvegabor

Copy link
Copy Markdown
Member

A clear and concise description of what the bug or new feature is.

Notes

FASTSHIFT
FASTSHIFT previously approved these changes Sep 6, 2024
@kisvegabor

Copy link
Copy Markdown
Member Author

Don't merge yet. I still need to add something.

@kisvegabor
kisvegabor marked this pull request as draft September 6, 2024 04:48

@liamHowatt liamHowatt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Look into xSemaphoreGiveRecursive to see if it applies here. I think it may.

@liamHowatt

Copy link
Copy Markdown
Contributor

Fixes #6808

@kisvegabor

Copy link
Copy Markdown
Member Author

Just added xSemaphoreGiveRecursive too. It's working my end, but @espzav please test it to make sure that it work well on ESP too.

@kissa96 kissa96 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@kisvegabor
kisvegabor marked this pull request as ready for review September 12, 2024 07:47

@tore-espressif tore-espressif left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@espzav

espzav commented Sep 13, 2024

Copy link
Copy Markdown

I tested it now and it seems there is something more. I only changed this in LVGL port:
image
and it is stucked somewhere. I will continue to find the place, where is the problem.

@espzav

espzav commented Sep 13, 2024

Copy link
Copy Markdown

Sorry, my fault, there must be return true. Now it is working properly :-) LGTM

@liamHowatt liamHowatt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I hope xSemaphoreTakeFromISR is compatible with recursive mutexes. It's not clear from the documentation. The mutexes are already recursive and there have been no issues so it may be fine.

@kisvegabor

Copy link
Copy Markdown
Member Author

I hope xSemaphoreTakeFromISR is compatible with recursive mutexes. It's not clear from the documentation. The mutexes are already recursive and there have been no issues so it may be fine.

lv_lock() uses xSemaphoreTakeRecursive so it can't be used from an interrupt anyway. So the users can't call LVGL functions from an interrupt. Even if they could, the "mutex taking" could not give back the control to the normal task to finish its job.

@liamHowatt

Copy link
Copy Markdown
Contributor

I agree. Unrelated to this PR, I mainly meant that lv_mutex_lock_isr locks a mutex that was created with xSemaphoreCreateRecursiveMutex. I hope code that uses lv_mutex_lock_isr (nothing in LVGL uses it) will be ok.

@kisvegabor

Copy link
Copy Markdown
Member Author

Good question. However as there is no xSemaphoreTakeRecursiveFormISR (both ISR and recursive) I also hope it's ok. 🙂

@kisvegabor

Copy link
Copy Markdown
Member Author

cc @XuNeo @FASTSHIFT could you take look at this issue?

@FASTSHIFT
FASTSHIFT merged commit 55faa53 into lvgl:master Sep 24, 2024
@kisvegabor
kisvegabor deleted the fix/freerots-mutex branch September 24, 2024 11:35
kisvegabor added a commit to kisvegabor/lvgl_fork that referenced this pull request Sep 26, 2024
kisvegabor added a commit to kisvegabor/lvgl_fork that referenced this pull request Oct 1, 2024
XuNeo added a commit that referenced this pull request Oct 16, 2024
kisvegabor added a commit that referenced this pull request Oct 23, 2024
It causes performance issues in some cases
See #6981 (comment)

This reverts commit 53c846f.
rodb70 pushed a commit to rodb70/lvgl that referenced this pull request Nov 8, 2024
pnb990 pushed a commit to pnb990/lvgl that referenced this pull request Dec 10, 2024
…nt_code_get_name

* origin/release/v9.2: (77 commits)
  fix docs exemple
  chore(cmsis-pack): update the cmsis-pack for the v9.2.2 patch (lvgl#7177)
  docs(CHANGLOG): add link to v9.2.1 changelog
  chore: update versions and CHANGELOG
  fix(changelog): fix the version number
  fix(nuttx): fix assert when release LCD draw buffer (lvgl#7159)
  Revert "fix(kconfig): add LV_ATTRIBUTE_MEM_ALIGN, LV_ATTRIBUTE_LARGE_CONST and LV_SYSMON_GET_IDLE configs (lvgl#7131)"
  docs(CHANGELOG): update the CHANGELOG
  fix(kconfig): add LV_ATTRIBUTE_MEM_ALIGN, LV_ATTRIBUTE_LARGE_CONST and LV_SYSMON_GET_IDLE configs (lvgl#7131)
  fix(sysmon) disable all performance banners from screen with serial redirect
  Revert "fix(freertos): use xSemaphoreTakeRecursive (lvgl#6803)"
  fix(display): remove lv_display_set_buffers_with_stride function (lvgl#7087)
  chore(cmsis-pack): create cmsis-pack for v9.2.1 patch (lvgl#7092)
  fix(pxp): sync rotation direction with SW render (lvgl#7063)
  fix(vglite) triangle gradient areas fix
  fix(conf) Remove empty line to make comment more condens.
  docs(PXP): update PXP for rotation only feature
  fix(pxp) invalidate cache for the whole frame buffer
  fix(vglite) invalidate cache for the whole frame buffer
  fix(vglite) Small cleanup.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐞 Bug 👀 Review needed Anyone can review a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants