Skip to contentSkip to conversation

race between rtl8187_stop and rtl8187_rx_cb?

DISCUSSION Oliver Neukum 2 participants 2 messages May 16, 2008 – May 30, 2008 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

rtl8187_stop() works by emptying a queue and unlinking urbs. But an urb finishing will be taken from the queue in rtl8187_rx_cb until it is resubmitted. Am I overlooking something or is there a window?

Regards
Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 200805162201.07634.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org

#2 lore raw
Quoted 4 lines · On Friday 16 May 2008 16:01:06 Oliver Neukum wrote:

rtl8187_stop() works by emptying a queue and unlinking urbs. But an urb finishing will be taken from the queue in rtl8187_rx_cb until it is resubmitted. Am I overlooking something or is there a window?

It appears that if you're unlucky, a rx urb can end up getting requeued after the dequeue loop in rtl8187_stop on a SMP system. Good catch. Doesn't look like it'll cause much trouble other than leaving urbs/skbs unfreed when the interface is down, but it's worth fixing. This requires information about whether or not the interface is started or stopped. Preferred way would be to set priv->mode = IEEE80211_IF_TYPE_INVALID in rtl8187_stop and priv->mode = IEEE80211_IF_TYPE_MNTR in rtl8187_start, so we can check for priv->mode == IEEE80211_IF_TYPE_INVALID before requeueing the urb in rtl8187_rx_cb.

Thanks,
-Michael Wu