On Tue, 2010-10-26 at 13:40 +0200, ext Johannes Berg wrote: > On Tue, 2010-10-26 at 14:24 +0300, juuso.oikarinen@xxxxxxxxx wrote: > > > mutex_lock(&wl->mutex); > > > > + if (wl->state == WL1271_STATE_OFF) { > > + /* > > + * We cannot return -EBUSY here because mac80211 will expect > > + * a call to ieee80211_scan_completed if we do - in this case > > + * there won't be any call. > > + */ > > ??? > > johannes > I'll try explain what this is about. In net/wireless/sme.c you'll find this: } else { /* otherwise we'll need to scan for the AP first */ err = cfg80211_conn_scan(wdev); /* * If we can't scan right now, then we need to scan again * after the current scan finished, since the parameters * changed (unless we find a good AP anyway). */ if (err == -EBUSY) { err = 0; wdev->conn->state = CFG80211_CONN_SCAN_AGAIN; } } In this code, if the driver ends up returning -EBUSY, the cfg80211 ends up waiting for a ieee80211_scan_complete call from the driver to proceed in the connection setting. If the scan is invoked while the driver is not ready, returning -EBUSY in this scenario will cause the cfg80211 to wait forever. Obviously, cfg80211 would normally never call scan while the driver is not initialized. This patch is about a corner case - if the wl1271 hardware crashes just before user-space requests a connection, hardware recovery can be running while the connection is set up. To recover the hardware, it is powered down and then mac80211 is asked to reconfigure it. This is the window in which the connection setup may stall. Returning an error code other than -EBUSY for this corner case causes the error code to be retruned to user-space, and user-space can retry the connection. -Juuso -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html