From patchwork Sun Mar 6 17:23:37 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 613831 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p26HNplG029661 for ; Sun, 6 Mar 2011 17:23:51 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752811Ab1CFRXt (ORCPT ); Sun, 6 Mar 2011 12:23:49 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:61362 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726Ab1CFRXs (ORCPT ); Sun, 6 Mar 2011 12:23:48 -0500 Received: by wwb22 with SMTP id 22so4390109wwb.1 for ; Sun, 06 Mar 2011 09:23:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=+f5VnVqRWqLFk+IyOtMHIOaGZv1smIOIwLeFSHx71Hs=; b=BN60MlJjycHlwH2Tdqp3zkpLv7jxNf7qdEj6ZdKwUW623XFWb0JBX9V8tgjTyvulQK pB1Xsi1L4x82j44/lPWZHEWNuEt3nzlcWuj9oPmPDwI1O4soxcy8cDAnL4X69hZCoPB5 JRbLlUv1xFLoO/YQhvSgoHw1sWsVGgsDONI6U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=av8QW/xVPo/UtAxWauUxH6v63TRtDnrOJTBND4qn6gsMFdFOVbeds64nuzuWOgbL7V c/S/2nVzK9WlpEpmve+2aHHoCYvezL4QRCQfMRNy5ERPn3aY8nFKsBpdvrFufdF77b7I mFQRta3bhlQhHukUBj1L80dYtzp7Yqzss41fQ= Received: by 10.227.154.12 with SMTP id m12mr2634029wbw.193.1299432227111; Sun, 06 Mar 2011 09:23:47 -0800 (PST) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt [88.119.226.136]) by mx.google.com with ESMTPS id x1sm1402161wbh.8.2011.03.06.09.23.45 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 06 Mar 2011 09:23:46 -0800 (PST) From: Grazvydas Ignotas To: "John W. Linville" Cc: Kalle Valo , linux-wireless@vger.kernel.org, David Gnedt , Grazvydas Ignotas Subject: [PATCH 2/2] wl1251: fix elp_work race condition Date: Sun, 6 Mar 2011 19:23:37 +0200 Message-Id: <1299432217-32139-3-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1299432217-32139-1-git-send-email-notasas@gmail.com> References: <1299432217-32139-1-git-send-email-notasas@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sun, 06 Mar 2011 17:23:51 +0000 (UTC) diff --git a/drivers/net/wireless/wl1251/ps.c b/drivers/net/wireless/wl1251/ps.c index 842155e..9cc5147 100644 --- a/drivers/net/wireless/wl1251/ps.c +++ b/drivers/net/wireless/wl1251/ps.c @@ -58,7 +58,6 @@ void wl1251_ps_elp_sleep(struct wl1251 *wl) unsigned long delay; if (wl->psm) { - cancel_delayed_work(&wl->elp_work); delay = msecs_to_jiffies(ELP_ENTRY_DELAY); ieee80211_queue_delayed_work(wl->hw, &wl->elp_work, delay); } @@ -69,6 +68,9 @@ int wl1251_ps_elp_wakeup(struct wl1251 *wl) unsigned long timeout, start; u32 elp_reg; + if (delayed_work_pending(&wl->elp_work)) + cancel_delayed_work(&wl->elp_work); + if (!wl->elp) return 0;