From patchwork Wed Oct 2 00:15:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Greear X-Patchwork-Id: 2972881 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 332009F245 for ; Wed, 2 Oct 2013 00:17:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 35A82203DC for ; Wed, 2 Oct 2013 00:17:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F2C2F203DF for ; Wed, 2 Oct 2013 00:17:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753513Ab3JBAQd (ORCPT ); Tue, 1 Oct 2013 20:16:33 -0400 Received: from mail.candelatech.com ([208.74.158.172]:51951 "EHLO ns3.lanforge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752562Ab3JBAQb (ORCPT ); Tue, 1 Oct 2013 20:16:31 -0400 Received: from fs3.candelatech.com (firewall.candelatech.com [70.89.124.249]) by ns3.lanforge.com (8.14.2/8.14.2) with ESMTP id r920G35X023609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 1 Oct 2013 17:16:04 -0700 From: greearb@candelatech.com To: linux-wireless@vger.kernel.org Cc: ath9k-devel@venema.h4ckr.net, Ben Greear Subject: [RFC] ath9k: Don't let rx tasklet run forever. Date: Tue, 1 Oct 2013 17:15:52 -0700 Message-Id: <1380672952-5749-1-git-send-email-greearb@candelatech.com> X-Mailer: git-send-email 1.7.3.4 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.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, 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 From: Ben Greear I saw this splat below on a 3.9.11+ kernel system configured to receive a UDP flood using wpa2 encryption and software-crypt. This patch attempts to fix this by returning after processing a max of 1000 packets. BUG: soft lockup - CPU#0 stuck for 22s! [btserver:32646] Modules linked in: nfsv4 auth_rpcgss nfs fscache nf_nat_ipv4 nf_nat 8021q garp stp mrp llc macvlan wanlink(O) pktgen lockd sunrpc f71882fg snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep cdc_acm joydev snd_seq snd_seq_device snd_pcm coretemp ath9k hwmon ath9k_common mperf ath9k_hw intel_powerclamp ath kvm_intel mac80211 kvm cfg80211 iTCO_wdt microcode iTCO_vendor_support snd_page_alloc e1000e i2c_i801 snd_timer mos7840 pcspkr serio_raw snd soundcore ptp pps_core lpc_ich uinput ipv6 i915 video i2c_algo_bit drm_kms_helper drm i2c_core [last unloaded: iptable_nat] CPU 0 Pid: 32646, comm: btserver Tainted: G C O 3.9.11+ #126 To be filled by O.E.M. To be filled by O.E.M./HURONRIVER RIP: 0010:[] [] __kernel_fpu_begin+0x48/0x8b RSP: 0000:ffff88021fa03918 EFLAGS: 00000286 RAX: 00000000ffffffff RBX: ffffffff81549567 RCX: ffff88020bc48000 RDX: 00000000ffffffff RSI: ffff88021fa03a28 RDI: ffff88020f8d5a00 RBP: ffff88021fa03918 R08: ffff8801b54a1978 R09: 0000000000000010 R10: ffff88020c5cb490 R11: 0000000000000200 R12: ffff88021fa03888 R13: ffffffff815d235d R14: ffff88021fa03918 R15: ffff88020c5cb400 FS: 00007f02f9605740(0000) GS:ffff88021fa00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000023b4c60 CR3: 000000020b754000 CR4: 00000000000407f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process btserver (pid: 32646, threadinfo ffff880210666000, task ffff88020bc48000) Stack: ffff88021fa03928 ffffffff8108b1f2 ffff88021fa03958 ffffffff8108c05d ffff88021fa03a28 ffff88021fa03a28 ffff88020c5c9c00 ffff88021fa03a08 ffff88021fa039d8 ffffffffa05be460 ffff880200000010 ffff8801b54a1978 Call Trace: [] kernel_fpu_begin+0x42/0x44 [] aes_encrypt+0x46/0x62 [] ieee80211_aes_ccm_decrypt+0xcf/0x108 [mac80211] [] ieee80211_crypto_ccmp_decrypt+0x1c7/0x247 [mac80211] [] ieee80211_rx_handlers+0x305/0x18c9 [mac80211] [] ? apic_timer_interrupt+0x6d/0x80 [] ieee80211_prepare_and_rx_handle+0x8fe/0x96a [mac80211] [] ieee80211_rx+0x6e9/0x759 [mac80211] [] ath_rx_tasklet+0xff8/0x10d1 [ath9k] [] ath9k_tasklet+0xf9/0x150 [ath9k] [] tasklet_action+0x7d/0xcc [] __do_softirq+0x114/0x254 [] ? _raw_spin_unlock_irqrestore+0x31/0x3c [] ? _raw_spin_unlock+0x24/0x2f [] irq_exit+0x4b/0xa8 [] do_IRQ+0x9d/0xb4 [] common_interrupt+0x6d/0x6d Code: 4c 05 00 00 00 00 00 00 65 48 c7 04 25 b0 c6 00 00 00 00 00 00 b0 01 84 c0 48 8b b9 50 05 00 00 74 1b 83 c8 ff 89 c2 48 0f ae 37 <48> 8b 81 50 05 00 00 f6 80 00 02 00 00 01 75 06 eb 2f 48 0f ae Signed-off-by: Ben Greear --- drivers/net/wireless/ath/ath9k/recv.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index a1b0ec2..b3511c8 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c @@ -1162,6 +1162,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) u64 tsf = 0; u32 tsf_lower = 0; unsigned long flags; + int max_per_round = 1000; /* max of 1000 per call if not flushing */ if (edma) dma_type = DMA_BIDIRECTIONAL; @@ -1176,6 +1177,11 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp) do { bool decrypt_error = false; + if (!flush) { + if (--max_per_round == 0) + break; + } + memset(&rs, 0, sizeof(rs)); if (edma) bf = ath_edma_get_next_rx_buf(sc, &rs, qtype);