locking fixes for cx88
Get series with b4
b4 am 20110405032014.GA4498@elieVersions newest first · linked by author and title
- v1 posting 2/27 patches 6 repliesIn review
- v2 Latest7 patches 2 repliesIn review
- v1 posting 1/23 patches 7 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | cx88: protect per-device driver list with device lockdrivers/ drivers/ drivers/ +1 more | +20 | 0 replies | |
| 2/7 | cx88: fix locking of sub-driver operationsdrivers/ drivers/ drivers/ +1 more | +5 | 0 replies | |
| 3/7 | cx88: hold device lock during sub-driver initializationdrivers/ drivers/ drivers/ | +4 | 0 replies | |
| 4/7 | cx88: use a mutex to protect cx8802_devlistdrivers/ | +17 | 0 replies | |
| 5/7 | cx88: gracefully reject attempts to use unregistered cx88-blackbird driverdrivers/ | +14 | 0 replies | |
| 6/7 | cx88: don't use atomic_t for core->mpeg_usersdrivers/ drivers/ | +7 | 0 replies | |
| 7/7 | cx88: don't use atomic_t for core->usersdrivers/ drivers/ | +4 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [RFC/PATCH v2 0/7] locking fixes for cx88
Hi again,
Quoted 8 lines · Jonathan Nieder
Huber Andreas wrote[1]:
Quoted 1 line
Processes that try to open a cx88-blackbird driven MPEG device will hang up.
Here's a possible fix based on a patch by Ben Hutchings and corrections from Andi Huber. Warning: probably full of mistakes (my fault) since I'm not familiar with any of this stuff. Untested. Review and testing would be welcome.
A reroll. As before, the goals are: (1) eliminate deadlock, (2) eliminate races, (3) introduce some clarity. The same caveats as last time apply --- this is only compile-tested. Thanks again to Andi for testing the previous series and for other useful feedback.
Patch 1 is meant to protect dev->drvlist against data races. Since v1, I removed some clutter in the patch itself and clarified the change description to match.
Patch 2 addresses the original deadlock. The only changes are the description and declared authorship of the patch (at Ben's request).
Patch 3 is new. It fixes the reference count breakage Andi noticed (another race previously protected against by the BKL).
Patch 4 fixes a data race noticed by Ben (also from his patch). It's unchanged.
Patches 5, 6, and 7 are cleanups.
Bugs? Thoughts?
Jonathan Nieder (7):
[media] cx88: protect per-device driver list with device lock [media] cx88: fix locking of sub-driver operations [media] cx88: hold device lock during sub-driver initialization [media] cx88: use a mutex to protect cx8802_devlist [media] cx88: handle attempts to use unregistered cx88-blackbird
driver
[media] cx88: don't use atomic_t for core->mpeg_users [media] cx88: don't use atomic_t for core->users
drivers/media/video/cx88/cx88-blackbird.c | 41 +++++++++++++++------------- drivers/media/video/cx88/cx88-dvb.c | 2 + drivers/media/video/cx88/cx88-mpeg.c | 40 ++++++++++++++++++---------- drivers/media/video/cx88/cx88-video.c | 5 ++- drivers/media/video/cx88/cx88.h | 11 +++++-- 5 files changed, 61 insertions(+), 38 deletions(-)