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

Fix grabbing lock from atomic context in i2c driver #780

Merged
merged 1 commit into from
Feb 6, 2015
Merged

Fix grabbing lock from atomic context in i2c driver #780

merged 1 commit into from
Feb 6, 2015

Conversation

jeanlemotan
Copy link

2 main changes:

  • check for timeouts in the bcm2708_bsc_setup function as indicated by this comment:
    /* poll for transfer start bit (should only take 1-20 polls) */
    This implies that the setup function can now fail so account for this everywhere it's called
  • Removed the clk_get_rate call from inside the setup function as it locks a mutex and that's not ok since we call it from under a spin lock.

@popcornmix
Copy link
Collaborator

Would be nice if first line of commit message was more descriptive.
Update i2c-bcm2708.c doesn't really describe the commit.
"Fix grabbing lock from atomic context in i2c driver" would be clearer.

@jeanlemotan jeanlemotan changed the title Update i2c-bcm2708.c Fix grabbing lock from atomic context in i2c driver Feb 1, 2015
@jeanlemotan
Copy link
Author

Apologies for the commit message. I was so focused not to mess up the commit that the message slipped.

Anyway, you are right about the whitespace changes. I will separate the commit in 3 parts - one for cosmetics and 2 for each of the issues (timeouts and clk_get_rate).

Now the main problem is that I'm a complete rookie when it comes to git (I usually download the zip from github) so squashing the commits will keep me busy for a few evenings. I guess it's time I figure git out.

@popcornmix
Copy link
Collaborator

Basically just concentrate on making your local patch-2 branch look correct.
Use:
git rebase -i HEAD~2
and follow the suggestions. Once done:
git push -f
will update this PR.

2 main changes:
- check for timeouts in the bcm2708_bsc_setup function as indicated by this comment:
      /* poll for transfer start bit (should only take 1-20 polls) */
  This implies that the setup function can now fail so account for this everywhere it's called
- Removed the clk_get_rate call from inside the setup function as it locks a mutex and that's not ok since we call it from under a spin lock.

removed dead code and update comment

fixed typo in comment
@jeanlemotan
Copy link
Author

Done. Updated the comment, removed commented code, fixed a typo and squashed the commits.

popcornmix added a commit that referenced this pull request Feb 6, 2015
Fix grabbing lock from atomic context in i2c driver
@popcornmix popcornmix merged commit ee9b8c7 into raspberrypi:rpi-3.12.y Feb 6, 2015
@popcornmix popcornmix mentioned this pull request Feb 6, 2015
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Feb 8, 2015
See: raspberrypi/linux#782

kernel: i2c: Fix grabbing lock from atomic context in i2c driver
See: raspberrypi/linux#780

kernel: Add Add ENC28J60 SPI ethernet module
See: raspberrypi/linux#795
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Feb 8, 2015
See: raspberrypi/linux#782

kernel: i2c: Fix grabbing lock from atomic context in i2c driver
See: raspberrypi/linux#780

kernel: Add Add ENC28J60 SPI ethernet module
See: raspberrypi/linux#795
@jeanlemotan jeanlemotan deleted the patch-2 branch February 12, 2015 19:45
pfpacket pushed a commit to pfpacket/linux-rpi-rust that referenced this pull request Apr 7, 2023
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.

2 participants