Skip to content

Commit

Permalink
V4L/DVB (4241): Fix faulty encoder error recovery in pvrusb2
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Jun 27, 2006
1 parent a761f43 commit eb8e0ee
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/media/video/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1098,12 +1098,13 @@ void pvr2_hdw_subsys_bit_chg_no_lock(struct pvr2_hdw *hdw,
if (!hdw->flag_ok) return;

msk &= PVR2_SUBSYS_ALL;
nmsk = (hdw->subsys_enabled_mask & ~msk) | (val & msk);
nmsk &= PVR2_SUBSYS_ALL;

for (;;) {
tryCount++;
vmsk = hdw->subsys_enabled_mask & PVR2_SUBSYS_ALL;
nmsk = (vmsk & ~msk) | (val & msk);
if (!(nmsk ^ vmsk)) break;
if (!((nmsk ^ hdw->subsys_enabled_mask) &
PVR2_SUBSYS_ALL)) break;
if (tryCount > 4) {
pvr2_trace(PVR2_TRACE_ERROR_LEGS,
"Too many retries when configuring device;"
Expand Down

0 comments on commit eb8e0ee

Please sign in to comment.