Commit b7e773b869f49bbd69e9dad76b34d3552627fac5
Committed by
David S. Miller
1 parent
c0cfe7faa1
Exists in
master
and in
7 other branches
[IrDA]: f-timer reloading when sending rejected frames.
Jean II was right: you have to re-charge the final timer when resending rejected frames. Otherwise it triggers at a wrong time and can break the currently running communication. Reproducible under rt-preempt. Signed-off-by: G. Liakhovetski <gl@dsa-ac.de> Signed-off-by: Samuel Ortiz <samuel@sortiz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 4 additions and 6 deletions Side-by-side Diff
net/irda/irlap_event.c
... | ... | @@ -1418,14 +1418,14 @@ |
1418 | 1418 | */ |
1419 | 1419 | self->remote_busy = FALSE; |
1420 | 1420 | |
1421 | + /* Stop final timer */ | |
1422 | + del_timer(&self->final_timer); | |
1423 | + | |
1421 | 1424 | /* |
1422 | 1425 | * Nr as expected? |
1423 | 1426 | */ |
1424 | 1427 | ret = irlap_validate_nr_received(self, info->nr); |
1425 | 1428 | if (ret == NR_EXPECTED) { |
1426 | - /* Stop final timer */ | |
1427 | - del_timer(&self->final_timer); | |
1428 | - | |
1429 | 1429 | /* Update Nr received */ |
1430 | 1430 | irlap_update_nr_received(self, info->nr); |
1431 | 1431 | |
1432 | 1432 | |
1433 | 1433 | |
... | ... | @@ -1457,14 +1457,12 @@ |
1457 | 1457 | |
1458 | 1458 | /* Resend rejected frames */ |
1459 | 1459 | irlap_resend_rejected_frames(self, CMD_FRAME); |
1460 | + irlap_start_final_timer(self, self->final_timeout * 2); | |
1460 | 1461 | |
1461 | - /* Final timer ??? Jean II */ | |
1462 | - | |
1463 | 1462 | irlap_next_state(self, LAP_NRM_P); |
1464 | 1463 | } else if (ret == NR_INVALID) { |
1465 | 1464 | IRDA_DEBUG(1, "%s(), Received RR with " |
1466 | 1465 | "invalid nr !\n", __FUNCTION__); |
1467 | - del_timer(&self->final_timer); | |
1468 | 1466 | |
1469 | 1467 | irlap_next_state(self, LAP_RESET_WAIT); |
1470 | 1468 |