From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.bufferbloat.net (Postfix) with ESMTPS id 589CE3B2A3 for ; Sun, 18 Dec 2016 11:07:37 -0500 (EST) Received: by mail-qt0-x244.google.com with SMTP id n6so16424049qtd.0 for ; Sun, 18 Dec 2016 08:07:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=MIoXXZaO0BJjPM3AJdM04f982L7tHMdXli41q63zFpQ=; b=TtobYGcVWp4h6C8SGjvQNbFspF9A7iE1BiC0YigLDPvMx1gHAj0lHzs1tpRFu346hV 3ocMW+IeHG7ywyFuG9H48tOEGs0m7wiujxDMKKYGwa71E4wD73XYf8xP3hTMkKvYP/KY CSKZWhBGVo0tBzDK5i4qPawQqNYBbBb143svTypywWUkkohwTLY4djHSYKhRpTF6XYeM LCD/Rb+I8pIQiRq1DYVv0VlejmfhhESqzeIMrsIPXTrACOOEyvsmQy2vjwt33eKabO1M eWL21cczsU+yOzxJJZnzHZPqJhKRyy4R4gSE5g+GfPJnyUBhZT8Wdx7DSFzAfUR/do0B GbVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=MIoXXZaO0BJjPM3AJdM04f982L7tHMdXli41q63zFpQ=; b=GoT20pVN4eKqGqZIBVlUubB5edFoV6dRC+A+aKEARUaSyKVpcA2HyOUFE/O5VabMfX mF4HLJKMKRBwPog9XLJaP7YCZ76EV11iDc502AmN467UnTu6TZ4WA3fGz9vDjJErfjsH RQHaiUgHm9xuqvu7qrlpKbrPX8EM2YBH2Ri59SBy3ojUYkW36lnLitv5KaJ/bUvo8ijk TvyC18PUyqQWEyf/AHTxmEU6hoeP4wvEEtMwfedfj3zfByHqImWTU6rZ4GgLZiLrZ/78 Y7axdBhuPpZ557fjuLNhNh5hOkCQ7GMjxUDLTDbISO5aFUEIR9PIxj2XtNCzNmuvUKFE owAA== X-Gm-Message-State: AIkVDXLQF2WZ5xmfJyEKZ7NlY+dRklE/sQwAa7d0D/GWSy1XO/TM2xEjgewCLtqWmxFhvYsMJeJqgViVLhC0MA== X-Received: by 10.200.34.73 with SMTP id p9mr12990974qtp.25.1482077256707; Sun, 18 Dec 2016 08:07:36 -0800 (PST) MIME-Version: 1.0 Received: by 10.12.152.197 with HTTP; Sun, 18 Dec 2016 08:07:36 -0800 (PST) In-Reply-To: <20161218155938.GP3924@linux.vnet.ibm.com> References: <23a2a3ab-974a-ed26-6afa-aafab9bb972e@gmail.com> <20161218155938.GP3924@linux.vnet.ibm.com> From: Dave Taht Date: Sun, 18 Dec 2016 08:07:36 -0800 Message-ID: To: make-wifi-fast@lists.bufferbloat.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Make-wifi-fast] Fwd: regression: ath_tx_edma_tasklet() Illegal idle entry in RCU read-side critical section X-BeenThere: make-wifi-fast@lists.bufferbloat.net X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2016 16:07:37 -0000 rcu makes my head spin. ---------- Forwarded message ---------- From: Paul E. McKenney Date: Sun, Dec 18, 2016 at 7:59 AM Subject: Re: regression: ath_tx_edma_tasklet() Illegal idle entry in RCU read-side critical section To: Gabriel C Cc: lkml , ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, netdev@vger.kernel.org, nbd@nbd.name, kvalo@qca.qualcomm.com On Sun, Dec 18, 2016 at 02:52:48PM +0100, Gabriel C wrote: > Hello, > > while testing kernel 4.9 I run into a weird issue with the ath9k driver. > > I can boot the box in console mode and it stay up sometime but is not usa= ble. Looks to me like someone forgot an rcu_read_unlock() somewhere. Given that the unmatched rcu_read_lock() appears in ath_tx_edma_tasklet(), perhaps that is also where the missing rcu_read_unlock() is. And sure enough, in the middle of this function we have the following: fifo_list =3D &txq->txq_fifo[txq->txq_tailidx]; if (list_empty(fifo_list)) { ath_txq_unlock(sc, txq); return; } This will of course return while still in an RCU read-side critical section. The caller cannot tell the difference between a return here and falling off the end of the function, so this is likely the bug. Or one of the bugs, anyway. Copying the author and committer for their thoughts. Please try the patch at the end of this email. Thanx, Paul > from dmesg : > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D > [ INFO: suspicious RCU usage. ] > 4.9-fw1 #1 Tainted: G I > ------------------------------- > kernel/rcu/tree.c:705 Illegal idle entry in RCU read-side critical sectio= n.! > > other info that might help us debug this: > > > RCU used illegally from idle CPU! > rcu_scheduler_active =3D 1, debug_locks =3D 1 > RCU used illegally from extended quiescent state! > 1 lock held by swapper/0/0: > #0: (rcu_read_lock){......}, at: [] ath_tx_edma_taskl= et+0x0/0x460 [ath9k] > > stack backtrace: > CPU: 0 PID: 0 Comm: swapper/0 Tainted: G I 4.9-fw1 #1 > Hardware name: FUJITSU PRIMERGY TX200 S5 = /D2709, BIOS 6.00 Rev. 1.14.2709 02/04/2013 > ffff88043ee03f38 ffffffff812cf0f3 ffffffff81a11540 0000000000000001 > ffff88043ee03f68 ffffffff810b7865 ffffffff81a55d58 ffff88043efcedc0 > ffff88083cb1ca00 00000000000000d1 ffff88043ee03f88 ffffffff810dbfe8 > Call Trace: > > [] dump_stack+0x86/0xc3 > [] lockdep_rcu_suspicious+0xc5/0x100 > [] rcu_eqs_enter_common.constprop.62+0x128/0x130 > [] rcu_irq_exit+0x38/0x70 > [] irq_exit+0x74/0xd0 > [] do_IRQ+0x71/0x130 > [] common_interrupt+0x8c/0x8c > > [] ? cpuidle_enter_state+0x156/0x220 > [] cpuidle_enter+0x12/0x20 > [] call_cpuidle+0x1e/0x40 > [] cpu_startup_entry+0x11d/0x210 > [] rest_init+0x12c/0x140 > [] start_kernel+0x40f/0x41c > [] ? early_idt_handler_array+0x120/0x120 > [] x86_64_start_reservations+0x2a/0x2c > [] x86_64_start_kernel+0xeb/0xf8 ------------------------------------------------------------------------ commit 5a16fed76936184a7ac22e466cf39bd8bb5ee65e Author: Paul E. McKenney Date: Sun Dec 18 07:49:00 2016 -0800 drivers/ath: Add missing rcu_read_unlock() to ath_tx_edma_tasklet() Commit d94a461d7a7d ("ath9k: use ieee80211_tx_status_noskb where possib= le") added rcu_read_lock() and rcu_read_unlock() around the body of ath_tx_edma_tasklet(), but failed to add the needed rcu_read_unlock() before a "return" in the middle of this function. This commit therefor= e adds the missing rcu_read_unlock(). Reported-by: Gabriel C Signed-off-by: Paul E. McKenney Cc: Felix Fietkau Cc: Kalle Valo Cc: QCA ath9k Development Cc: diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 52bfbb988611..857d5ae09a1d 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c @@ -2787,6 +2787,7 @@ void ath_tx_edma_tasklet(struct ath_softc *sc) fifo_list =3D &txq->txq_fifo[txq->txq_tailidx]; if (list_empty(fifo_list)) { ath_txq_unlock(sc, txq); + rcu_read_unlock(); return; } --=20 Dave T=C3=A4ht Let's go make home routers and wifi faster! With better software! http://blog.cerowrt.org