From patchwork Tue Dec 20 08:05:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mohammed Shafi Shajakhan X-Patchwork-Id: 9481249 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50AD1606DB for ; Tue, 20 Dec 2016 08:05:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4268628475 for ; Tue, 20 Dec 2016 08:05:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 352542849F; Tue, 20 Dec 2016 08:05:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4A9D28475 for ; Tue, 20 Dec 2016 08:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933535AbcLTIEb (ORCPT ); Tue, 20 Dec 2016 03:04:31 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:31864 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbcLTIEa (ORCPT ); Tue, 20 Dec 2016 03:04:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1482221070; x=1513757070; h=from:to:cc:subject:date:message-id:mime-version; bh=FYs96/5z5hcsJKetG+D8l7xr6E751dDlxQfGVHUvcw4=; b=J4XZCXRhiKfgM0IyId/Wvx2vjYPVEBWLErb7JGnBxFO9LKe4xEvejd1F sND/urV8Ooph36YIB9RAjiImoKUYGFubVzkg/Rz4bnR63pHzAIHW3YPZg 1euFzBoq45xSv+4zYTskhFF5cb8yL5dZEo7XdgTdmdQmFuUeGQGeCXfy4 I=; X-IronPort-AV: E=Sophos;i="5.33,377,1477983600"; d="scan'208";a="344997553" Received: from unknown (HELO Ironmsg04-R.qualcomm.com) ([10.53.140.108]) by wolverine02.qualcomm.com with ESMTP; 20 Dec 2016 00:04:29 -0800 From: Mohammed Shafi Shajakhan X-IronPort-AV: E=McAfee;i="5700,7163,8384"; a="1331724914" X-Amp-Result: CLEAN Received: from nasanexm02h.na.qualcomm.com ([10.85.0.89]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 20 Dec 2016 00:04:29 -0800 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by nasanexm02h.na.qualcomm.com (10.85.0.89) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 20 Dec 2016 00:04:28 -0800 Received: from qcmail1.qualcomm.com (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 20 Dec 2016 13:34:20 +0530 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Tue, 20 Dec 2016 13:35:37 +0530 To: CC: , , "Mohammed Shafi Shajakhan" Subject: [PATCH v2] ath10k: Fix crash during rmmod when probe firmware fails Date: Tue, 20 Dec 2016 13:35:35 +0530 Message-ID: <1482221135-23960-1-git-send-email-mohammed@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01F.na.qualcomm.com (10.85.0.32) To aphydexm01b.ap.qualcomm.com (10.252.127.11) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mohammed Shafi Shajakhan This fixes the below crash when ath10k probe firmware fails, NAPI polling tries to access a rx ring resource which was never allocated, fix this by disabling NAPI right away once the probe firmware fails by calling 'ath10k_hif_stop'. Its good to note that the error is never propogated to 'ath10k_pci_probe' when ath10k_core_register fails, so calling 'ath10k_hif_stop' to cleanup PCI related things seems to be ok BUG: unable to handle kernel NULL pointer dereference at (null) IP: __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core] __ath10k_htt_rx_ring_fill_n+0x19/0x230 [ath10k_core] Call Trace: [] ath10k_htt_rx_msdu_buff_replenish+0x42/0x90 [ath10k_core] [] ath10k_htt_txrx_compl_task+0x433/0x17d0 [ath10k_core] [] ? __wake_up_common+0x4d/0x80 [] ? cpu_load_update+0xdc/0x150 [] ? ath10k_pci_read32+0xd/0x10 [ath10k_pci] [] ath10k_pci_napi_poll+0x47/0x110 [ath10k_pci] [] net_rx_action+0x20f/0x370 Reported-by: Ben Greear Fixes: 3c97f5de1f28 ("ath10k: implement NAPI support") Signed-off-by: Mohammed Shafi Shajakhan --- drivers/net/wireless/ath/ath10k/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index f7ea4de..15bccc9 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -2164,6 +2164,7 @@ static int ath10k_core_probe_fw(struct ath10k *ar) ath10k_core_free_firmware_files(ar); err_power_down: + ath10k_hif_stop(ar); ath10k_hif_power_down(ar); return ret;