From patchwork Sun Jan 18 10:55:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arend van Spriel X-Patchwork-Id: 5653081 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 16D579F358 for ; Sun, 18 Jan 2015 10:56:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5337220373 for ; Sun, 18 Jan 2015 10:56:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 67AF120306 for ; Sun, 18 Jan 2015 10:56:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752727AbbARKzp (ORCPT ); Sun, 18 Jan 2015 05:55:45 -0500 Received: from mail-gw2-out.broadcom.com ([216.31.210.63]:64482 "EHLO mail-gw2-out.broadcom.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752642AbbARKzk (ORCPT ); Sun, 18 Jan 2015 05:55:40 -0500 X-IronPort-AV: E=Sophos;i="5.09,420,1418112000"; d="scan'208";a="55045695" Received: from irvexchcas07.broadcom.com (HELO IRVEXCHCAS07.corp.ad.broadcom.com) ([10.9.208.55]) by mail-gw2-out.broadcom.com with ESMTP; 18 Jan 2015 03:31:50 -0800 Received: from IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) by IRVEXCHCAS07.corp.ad.broadcom.com (10.9.208.55) with Microsoft SMTP Server (TLS) id 14.3.174.1; Sun, 18 Jan 2015 02:55:39 -0800 Received: from mail-sj1-12.sj.broadcom.com (10.10.10.20) by IRVEXCHSMTP2.corp.ad.broadcom.com (10.9.207.52) with Microsoft SMTP Server id 14.3.174.1; Sun, 18 Jan 2015 02:55:54 -0800 Received: from [10.176.128.58] (xl-bun-04.bun.broadcom.com [10.176.128.58]) by mail-sj1-12.sj.broadcom.com (Postfix) with ESMTP id 41E8D27A81; Sun, 18 Jan 2015 02:55:38 -0800 (PST) Message-ID: <54BB9129.5010103@broadcom.com> Date: Sun, 18 Jan 2015 11:55:37 +0100 From: Arend van Spriel User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.24) Gecko/20111103 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: Linus Torvalds CC: Johannes Berg , David Miller , Linux Wireless List , Network Development Subject: Re: Wireless scanning while turning off the radio problem.. References: In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 01/18/15 04:25, Linus Torvalds wrote: > So there seems to be some issue with unlucky timing when turning off > wireless while the driver is busy scanning. I can't reproduce this, so > it's a one-off, but it's not just ugly warnings, the kernel woudln't > scan any wireless on that device afterwards and I had to reboot to get > networking back, so there is some long-term damage. > > This is with Intel wireless (iwlwifi, it's a iwl N7260 thing, rev > 0x144 if anybody cares) , but the warning callbacks don't seem to be > iwl-specific. > > This was a recent top-of-git kernel (3.19.0-rc4-00241-gfc7f0dd38172 to > be exact). > > Anybody have any ideas? Anything in particular I should try out to > help possibly get more information? If I am not mistaken the "iwl N7260 thing" is a PCIe device. iwl_pcie_irq_handler iwl_trans_pcie_rf_kill if (iwl_op_mode_hw_rf_kill) iwl_trans_pcie_stop_device The function iwl_trans_pcie_stop_device() put device in low-power and resets the cpu on the device. So iwl_op_mode_hw_rf_kill ends up in iwl_mvm_set_hw_rfkill_state which schedules cfg80211_rfkill_sync_work and returns true if firmware is running. The patch below might work. Regards, Arend in the * middle of the calibrations. --- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/iwlwifi/mvm/ops.c b/drivers/net/wireless/iwlwi index 97dfba5..685217a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/ops.c +++ b/drivers/net/wireless/iwlwifi/mvm/ops.c @@ -779,6 +779,9 @@ static bool iwl_mvm_set_hw_rfkill_state(struct iwl_op_mode * if (calibrating) iwl_abort_notification_waits(&mvm->notif_wait); + /* stop scheduled scan */ + iwl_mvm_scan_offload_stop(mvm, true); + /* * Stop the device if we run OPERATIONAL firmware or if we are