From patchwork Wed May 28 03:07:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Lutomirski X-Patchwork-Id: 4252421 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 72E8F9F336 for ; Wed, 28 May 2014 03:08:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A47C8202C8 for ; Wed, 28 May 2014 03:08:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CD391202A7 for ; Wed, 28 May 2014 03:08:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753895AbaE1DIG (ORCPT ); Tue, 27 May 2014 23:08:06 -0400 Received: from mail-ve0-f181.google.com ([209.85.128.181]:40141 "EHLO mail-ve0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751397AbaE1DID (ORCPT ); Tue, 27 May 2014 23:08:03 -0400 Received: by mail-ve0-f181.google.com with SMTP id pa12so11840549veb.12 for ; Tue, 27 May 2014 20:08:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=WKKQYDcfQlM6jLYWFMEAbCPFb+QtXTPlPLm8HrGHLYc=; b=emhB4HkI4iJW4GZEIARpiM1cdQB0igsj3YIbJjwt/n1+cL/fMvqJpKRqIXD0i7Q6Vi VrlFvidUgAIFjpawo+euIE4cSe9EgTCOtFmZ8hETOK7qn3s+OBbKfnhSUETVMiZCkc82 LnJxOMBFGiftxFKw4MXAzKBWTpROpcf78cwjh3vtOT3+LkyXwzizcu3d55xuznJbM4lF hjGjNYppn95LiPZJgpZ74wEOytqiIGRGsA2eVYsY5TAsA20w/E2+yVLOKfttzOrPmX09 2jW5Pv6qdwvnx3U7oL1AmcxILMoi9mwXZXosdq7fFNjbMmhZexPw13Cpuz+amEeAJSBc moSA== X-Gm-Message-State: ALoCoQkqiRzBKiV6IGKUyD5tBDpBVe7pzT3Eqbg027E7L9R2wzuQ7oFYf1eMDW5lwHwhw91HFBCV X-Received: by 10.53.0.135 with SMTP id ay7mr26494064vdd.11.1401246481765; Tue, 27 May 2014 20:08:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.246.39 with HTTP; Tue, 27 May 2014 20:07:41 -0700 (PDT) In-Reply-To: References: From: Andy Lutomirski Date: Tue, 27 May 2014 20:07:41 -0700 Message-ID: Subject: Re: Help debugging iwldvm / ath10k stalls To: Emmanuel Grumbach Cc: Linux Wireless List Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_TVD_MIME_EPI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Tue, May 27, 2014 at 1:30 PM, Emmanuel Grumbach wrote: >>> >>> It looks like your patch allows both: >>> >>> iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper); >>> >>> and >>> >>> iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); >>> >>> I don't know whether that's a problem. > > I'd expect enable to be false... But I might have got lost in > mac80211's PS code... Can you check the value of enable? Thanks > Anyway - I want to call the cam one. IOW, I want to disable power save > completely. This is what is causing trouble. > We want to add a frame on the ring, and since the NIC is asleep, we > schedule a wakeup of the NIC so that it can fetch the packet when it > wakes up... But it doesn't wake up... > Now - This is firmware / hardware related... which means that there > isn't much I can do for this old device. > Bottom line, I guess we want to disable power save here. > If you can bisect this, this can be really helpful. This might allow > us to keep the feature. I doubt I can bisect -- the trigger was a new AP, not a new kernel. I can't exactly cut the AP in half :) Pre-suspend, i.e., working: [ 20.949900] enabled = 1, wowlan = 0 [ 20.950177] enabled = 1, wowlan = 0 [ 21.614016] enabled = 1, wowlan = 0 [ 21.614658] enabled = 1, wowlan = 0 [ 42.667586] enabled = 0, wowlan = 0 [ 42.672514] enabled = 1, wowlan = 0 [ 53.088165] fuse init (API version 7.23) [ 53.102082] SELinux: initialized (dev fuse, type fuse), uses genfs_contexts [ 53.130945] SELinux: initialized (dev fusectl, type fusectl), uses genfs_contexts [ 85.627558] enabled = 0, wowlan = 0 [ 85.631686] enabled = 1, wowlan = 0 [ 134.649346] e1000e: em1 NIC Link is Down [ 137.682277] wlan0: deauthenticating from 02:c6:26:cc:b4:c7 by local choice (Reason: 3=DEAUTH_LEAVING) [ 137.682780] enabled = 0, wowlan = 0 [ 137.693889] enabled = 0, wowlan = 0 Post-suspend, i.e., not working: [ 144.406303] enabled = 1, wowlan = 0 [ 144.406496] enabled = 1, wowlan = 0 [ 145.026827] enabled = 1, wowlan = 0 [ 145.028211] enabled = 1, wowlan = 0 [ 165.688632] enabled = 0, wowlan = 0 [ 165.689960] enabled = 0, wowlan = 0 [ 165.693988] enabled = 1, wowlan = 0 [ 165.694245] enabled = 1, wowlan = 0 [ 208.641426] enabled = 0, wowlan = 0 [ 208.641786] enabled = 0, wowlan = 0 [ 208.647499] enabled = 1, wowlan = 0 [ 208.647639] enabled = 1, wowlan = 0 [ 271.435558] enabled = 0, wowlan = 0 [ 271.435767] enabled = 0, wowlan = 0 [ 271.440125] enabled = 1, wowlan = 0 [ 271.440405] enabled = 1, wowlan = 0 With even more instrumentation added, I did get a glitch before suspend/resume, but it came with more than two power setting updates. Logs and patch attached, complete with call stacks. Is it possible that part of the problem is that the firmware doesn't like being spammed with power config changes so frequently? --Andy commit 5225b6b3256c399d29de1e0db1915e07005516e7 Author: Andy Lutomirski Date: Tue May 27 10:06:09 2014 -0700 iwlwifi pm hack diff --git a/drivers/net/wireless/iwlwifi/dvm/power.c b/drivers/net/wireless/iwlwifi/dvm/power.c index b4e6141..5d94162 100644 --- a/drivers/net/wireless/iwlwifi/dvm/power.c +++ b/drivers/net/wireless/iwlwifi/dvm/power.c @@ -288,10 +288,15 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, bool enabled = priv->hw->conf.flags & IEEE80211_CONF_PS; int dtimper; + printk(KERN_INFO "enabled = %d, wowlan = %d\n", (int)enabled, (int)priv->wowlan); + dump_stack(); + dtimper = priv->hw->conf.ps_dtim_period ?: 1; if (priv->wowlan) iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, dtimper); + if (!enabled) + iwl_power_sleep_cam_cmd(priv, cmd); else if (!priv->lib->no_idle_support && priv->hw->conf.flags & IEEE80211_CONF_IDLE) iwl_static_sleep_cmd(priv, cmd, IWL_POWER_INDEX_5, 20); @@ -299,9 +304,7 @@ static void iwl_power_build_cmd(struct iwl_priv *priv, /* in thermal throttling low power state */ iwl_static_sleep_cmd(priv, cmd, iwl_tt_current_power_mode(priv), dtimper); - } else if (!enabled) - iwl_power_sleep_cam_cmd(priv, cmd); - else if (priv->power_data.debug_sleep_level_override >= 0) + } else if (priv->power_data.debug_sleep_level_override >= 0) iwl_static_sleep_cmd(priv, cmd, priv->power_data.debug_sleep_level_override, dtimper);