Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > ea32411352494358b8d75a78402a4713 > files > 3888

kernel-2.6.18-238.19.1.el5.centos.plus.src.rpm

From: Stanislaw Gruszka <sgruszka@redhat.com>
Date: Wed, 14 Jul 2010 08:13:05 -0400
Subject: Revert: [wireless] rt2x00: fix work cancel race condition
Message-id: <20100714081300.4740.66400.send-patch@dhcp-lab-109.englab.brq.redhat.com>
Patchwork-id: 26877
O-Subject: [RHEL5 PATCH 3/7] Revert "[wireless] rt2x00: fix work cancel race
	conditions"
Bugzilla: 582191
RH-Acked-by: John Linville <linville@redhat.com>
RH-Acked-by: Andy Gospodarek <gospo@redhat.com>
RH-Acked-by: Jiri Pirko <jpirko@redhat.com>
RH-Acked-by: Jarod Wilson <jarod@redhat.com>

This reverts commit 6cb19915092a78200becc89266c8c0a194a551ad, so
it can be fixed properly using cancel_work_sync.


diff --git a/drivers/net/wireless/rt2x00/rt2x00link.c b/drivers/net/wireless/rt2x00/rt2x00link.c
index 408f1fa..910cd13 100644
--- a/drivers/net/wireless/rt2x00/rt2x00link.c
+++ b/drivers/net/wireless/rt2x00/rt2x00link.c
@@ -422,15 +422,10 @@ static void rt2x00link_tuner(void *r)
 
 	/*
 	 * When the radio is shutting down we should
-	 * immediately cease all link tuning ...
+	 * immediately cease all link tuning.
 	 */
-	if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags)) {
-		/* ... but in RHEL5 we have no working cancel_work_sync,
-		   so we are rescheduling here to avoid infinite loop
-		   in cancel_rearming_delayed_work() */
-		ieee80211_queue_delayed_work(rt2x00dev->hw, &link->work, LINK_TUNE_INTERVAL);
+	if (!test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
 		return;
-	}
 
 	/*
 	 * Update statistics.
@@ -480,16 +475,9 @@ static void rt2x00link_tuner(void *r)
 	 */
 	link->count++;
 
-#if 0 /* Not in RHEL5... */
 	if (test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
 		ieee80211_queue_delayed_work(rt2x00dev->hw,
 					     &link->work, LINK_TUNE_INTERVAL);
-#else
-	/* Queue delayed work no matter what, otherwise
-	   cancel_rearming_delayed_work() may hang and live lock the system */
-		ieee80211_queue_delayed_work(rt2x00dev->hw,
-					     &link->work, LINK_TUNE_INTERVAL);
-#endif
 }
 
 void rt2x00link_register(struct rt2x00_dev *rt2x00dev)