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: i2c: stm32: Disable suspend to idle during the transaction #62988

Merged

Conversation

coran21
Copy link
Contributor

@coran21 coran21 commented Sep 22, 2023

Suspend-to-idle stops I2C module clocks, which must remain active during the transaction.

Waiting for semaphore inside stm32_i2c_msg_write and stm32_i2c_msg_read triggers suspend to idle when pm is enabled, which results in disabled clocks, timeout, and error.

Copy link
Member

@erwango erwango left a comment

Choose a reason for hiding this comment

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

I think the proposal is correct, but highlights the complexity of PM subsystem.
I'd like PM subsystem maintainer to comment on this case.

drivers/i2c/i2c_ll_stm32.c Show resolved Hide resolved
@coran21
Copy link
Contributor Author

coran21 commented Oct 1, 2023

@ceolin
Could you look at the suggested change?

Copy link

github-actions bot commented Dec 1, 2023

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Dec 1, 2023
@erwango erwango removed the Stale label Dec 1, 2023
@coran21 coran21 requested a review from erwango December 13, 2023 12:10
@coran21 coran21 force-pushed the fix_stm32_i2c_disable_suspend branch from b8f98cc to 6b86ccc Compare December 14, 2023 10:56
@coran21 coran21 force-pushed the fix_stm32_i2c_disable_suspend branch from ab22637 to 6b86ccc Compare January 2, 2024 08:10
@ceolin
Copy link
Member

ceolin commented Jan 28, 2024

@coran21 @erwango Sorry for the late reply, I think I was not in the review list and have missed the notification. I tend to go over prs that have me listed as reviewer.

erwango
erwango previously approved these changes Jan 29, 2024
@erwango
Copy link
Member

erwango commented Jan 29, 2024

@coran21 Please rebase

@coran21
Copy link
Contributor Author

coran21 commented Jan 29, 2024

@coran21 Please rebase

@erwango
I want to rebase, but I'm unsure how to do that correctly because the last time I rebased the code from Zephyr:main into my local branch, it pushed all the new commits into the PR, and I had to close it.

I wrote you a couple messages asking for help:

It looks like there were some changes in the actual file which resulted in conflict. Could you help me how I can update my local branch fix_stm32_i2c_disable_suspend with these changes so that I can push the changes again? I know that I should do some kind of rebase, but it happened to me a few times that I did a rebase and force-pushed all the previous commits, which were rebased into the pull request, and it was a mess.
In Zephyr documentation is that I should do this while I have checked out my branch with changes:

git fetch --all
git rebase --ignore-whitespace upstream/main
And do interactive rebase of my commit, is that true? I'm really not sure what to do if there is a conflict in my commit.

@erwango, Could you help me with that? How could I update my local branch, which has conflicts with Zephyr:main, so that it won't push all the Zephyr commits that were merged after this commit after I do force-push to this PR branch?

I would really appreciate any help with this.

@erwango
Copy link
Member

erwango commented Jan 29, 2024

I would really appreciate any help with this.

If there is only one commit, what you can do is:

  • create a new branch temp_i2c_rebase
  • check it out on top of current main
  • cherry pick your commit from branch fix_stm32_i2c_disable_suspend to the new branch
  • resolve the conflict
  • once you're done, rename fix_stm32_i2c_disable_suspend to fix_stm32_i2c_disable_suspend_old
  • rename temp_i2c_rebase to fix_stm32_i2c_disable_suspend
  • force push the new stuff

Suspend-to-idle stops I2C module clocks, which must remain active during
transaction

Signed-off-by: Petr Hlineny <development@hlineny.cz>
@coran21
Copy link
Contributor Author

coran21 commented Jan 29, 2024

@erwango That was exactly what I was looking for, than you!

@erwango erwango added this to the v3.6.0 milestone Feb 2, 2024
@carlescufi carlescufi merged commit a97c825 into zephyrproject-rtos:main Feb 2, 2024
17 checks passed
@Oleh-Kravchenko
Copy link

Oleh-Kravchenko commented Jul 4, 2024

Doesn't fix issue for STM32F1X.
This patch works for me #58929 (comment)

*not really work, but reduce reproducibility a lot :-/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants