* [PATCH 2.4] ir241_lmp_timer_race-2.diff
@ 2003-06-17 2:05 Jean Tourrilhes
0 siblings, 0 replies; only message in thread
From: Jean Tourrilhes @ 2003-06-17 2:05 UTC (permalink / raw)
To: Marcelo Tosatti, Jeff Garzik, Linux kernel mailing list
ir241_lmp_timer_race-2.diff :
o [CORRECT] Start timer before sending event to fix race condition
o [FEATURE] Improve the IrLMP event debugging messages.
diff -u -p linux/net/irda/irlmp_event.d3.c linux/net/irda/irlmp_event.c
--- linux/net/irda/irlmp_event.d3.c Thu Sep 12 11:47:45 2002
+++ linux/net/irda/irlmp_event.c Thu Sep 12 11:54:22 2002
@@ -515,10 +515,10 @@ static int irlmp_state_disconnected(stru
irlmp_next_lsap_state(self, LSAP_SETUP_PEND);
- irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
-
/* Start watchdog timer (5 secs for now) */
irlmp_start_watchdog_timer(self, 5*HZ);
+
+ irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
break;
case LM_CONNECT_INDICATION:
if (self->conn_skb) {
@@ -529,8 +529,6 @@ static int irlmp_state_disconnected(stru
irlmp_next_lsap_state(self, LSAP_CONNECT_PEND);
- irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
-
/* Start watchdog timer
* This is not mentionned in the spec, but there is a rare
* race condition that can get the socket stuck.
@@ -543,10 +541,12 @@ static int irlmp_state_disconnected(stru
* a backup plan. 1 second is plenty (should be immediate).
* Jean II */
irlmp_start_watchdog_timer(self, 1*HZ);
+
+ irlmp_do_lap_event(self->lap, LM_LAP_CONNECT_REQUEST, NULL);
break;
default:
- IRDA_DEBUG(2, "%s(), Unknown event %s\n",
- __FUNCTION__, irlmp_event[event]);
+ IRDA_DEBUG(1, "%s(), Unknown event %s on LSAP %#02x\n",
+ __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb)
dev_kfree_skb(skb);
break;
@@ -604,8 +604,8 @@ static int irlmp_state_connect(struct ls
irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
break;
default:
- IRDA_DEBUG(0, "%s(), Unknown event %s\n",
- __FUNCTION__, irlmp_event[event]);
+ IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
+ __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb)
dev_kfree_skb(skb);
break;
@@ -666,8 +666,8 @@ static int irlmp_state_connect_pend(stru
irlmp_next_lsap_state(self, LSAP_DISCONNECTED);
break;
default:
- IRDA_DEBUG(0, "%s() Unknown event %s\n",
- __FUNCTION__, irlmp_event[event]);
+ IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
+ __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb)
dev_kfree_skb(skb);
break;
@@ -756,8 +756,8 @@ static int irlmp_state_dtr(struct lsap_c
irlmp_disconnect_indication(self, reason, skb);
break;
default:
- IRDA_DEBUG(0, "%s(), Unknown event %s\n",
- __FUNCTION__, irlmp_event[event]);
+ IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
+ __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb)
dev_kfree_skb(skb);
break;
@@ -829,8 +829,8 @@ static int irlmp_state_setup(struct lsap
irlmp_disconnect_indication(self, LM_CONNECT_FAILURE, NULL);
break;
default:
- IRDA_DEBUG(0, "%s(), Unknown event %s\n",
- __FUNCTION__, irlmp_event[event]);
+ IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
+ __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb)
dev_kfree_skb(skb);
break;
@@ -888,8 +888,8 @@ static int irlmp_state_setup_pend(struct
irlmp_disconnect_indication(self, reason, NULL);
break;
default:
- IRDA_DEBUG(0, "%s(), Unknown event %s\n",
- __FUNCTION__, irlmp_event[event]);
+ IRDA_DEBUG(0, "%s(), Unknown event %s on LSAP %#02x\n",
+ __FUNCTION__, irlmp_event[event], self->slsap_sel);
if (skb)
dev_kfree_skb(skb);
break;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-06-17 1:53 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-17 2:05 [PATCH 2.4] ir241_lmp_timer_race-2.diff Jean Tourrilhes
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®