Commit fa0daa02 authored by Christophe Ricard's avatar Christophe Ricard Committed by Samuel Ortiz

NFC: st21nfcb: Fix improper ndlc T2 management

T2 was never started when sending a command.
Start it when sending a command for the first attempt
and stop it once we receive the answer.
Signed-off-by: default avatarChristophe Ricard <christophe-h.ricard@st.com>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 4294e320
...@@ -112,6 +112,10 @@ static void llt_ndlc_send_queue(struct llt_ndlc *ndlc) ...@@ -112,6 +112,10 @@ static void llt_ndlc_send_queue(struct llt_ndlc *ndlc)
ndlc->t1_active = true; ndlc->t1_active = true;
mod_timer(&ndlc->t1_timer, time_sent + mod_timer(&ndlc->t1_timer, time_sent +
msecs_to_jiffies(NDLC_TIMER_T1)); msecs_to_jiffies(NDLC_TIMER_T1));
/* start timer t2 for chip availability */
ndlc->t2_active = true;
mod_timer(&ndlc->t2_timer, time_sent +
msecs_to_jiffies(NDLC_TIMER_T2));
} }
} }
...@@ -207,7 +211,7 @@ static void llt_ndlc_sm_work(struct work_struct *work) ...@@ -207,7 +211,7 @@ static void llt_ndlc_sm_work(struct work_struct *work)
ndlc->t2_active = false; ndlc->t2_active = false;
ndlc->t1_active = false; ndlc->t1_active = false;
del_timer_sync(&ndlc->t1_timer); del_timer_sync(&ndlc->t1_timer);
del_timer_sync(&ndlc->t2_timer);
ndlc_close(ndlc); ndlc_close(ndlc);
ndlc->hard_fault = -EREMOTEIO; ndlc->hard_fault = -EREMOTEIO;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment