Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1873577rwd; Fri, 9 Jun 2023 03:34:14 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69CHVdT6WfVMGd0+vwlFuZXol4C9kGwUOKLr6W/7R5u8HjgGOJyAtljpWAUx3p4/tcw1oi X-Received: by 2002:a05:6a20:3cab:b0:10b:7400:cef7 with SMTP id b43-20020a056a203cab00b0010b7400cef7mr1059362pzj.17.1686306853906; Fri, 09 Jun 2023 03:34:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686306853; cv=none; d=google.com; s=arc-20160816; b=iQkLHVALu5Wdk9KZ+yiogN5qgOZZJQGb0tJTKsW8DXf6Tbj2r/8jbp6+tLn926MOBj AgcTQZ3xS7g+YIgOyio0YOAa7KW2RMWyzcU0i6q23jX5BsGoMlkAtS41GGNbOdW6xJVx t6Noy5GhiqsrfGnG/3NmM5LgEDIJbaYZJmtP/g2GDkt9lvH3W2I6ngW30JqdBgRTJirV Wd2EZwev4D8ERg2P+k5uDQoNPCTj2j9r5u4nQRONx3Dt1lHDmPpwBON+tSKGAmQ3GGwN nSw5Tmv5GSssQkExbFLtNq6E9+h5iufo97QqMf9FRAXe1/YEjWbZbVCcr/DHvX667U/r bzTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=rWcKJIfbUo6mERo+CPBp0K4qOUJYClSpATKPhBVa8X8=; b=mH9m+5aNm3XQKx5eH3bHQ3dfjxsJdZQVYhrKpUcRBepnFDupJ51C8xo1X3WIEtT+93 uFBIe2wF/r64dUEaqCX1Ogbd/QzyxFx7iKP3Why4R4Jhf9sRwalh9X1EGiLAhclinDl5 o9kF/6ery7a08GdJVfJFvzdFq/9jggVrRYQ2IE63NJSoNg40lX0ov/ohaMdonwIco0Zv icv3o3hBhkcHOpglrwJsMbgR1EDYcvHjXOsQnotxcyRF/L0qmM5Ts/7N2fGGUISlfqAk vTiVWo9WyYJ5uoe8CDMXT83WdGNsXIAQoMPtrjVe6VP8Vvo/TKiRcwl8RTVCLihifSkl YNNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cg6IWFux; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a633749000000b005344b60f7ddsi2418000pgn.117.2023.06.09.03.34.00; Fri, 09 Jun 2023 03:34:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cg6IWFux; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230257AbjFIKZ1 (ORCPT + 61 others); Fri, 9 Jun 2023 06:25:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241616AbjFIKZA (ORCPT ); Fri, 9 Jun 2023 06:25:00 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494108A6B; Fri, 9 Jun 2023 03:15:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 150BD65674; Fri, 9 Jun 2023 10:15:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89486C433EF; Fri, 9 Jun 2023 10:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686305735; bh=69i66ox8ltEgL7P8307OpSEFPOK7ge4DxS4uiN/dP78=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=cg6IWFuxqv09zXT72fguVqtyCBgiTwtFNBa8tvGamnt4MY4ymz+ncSpIeKky8SqPv pW+TE/qUpmBjmEY6XQl+sPzBlcZjXD4NQRm+DdI14BFVhdnzZ4riUaMdpMmkbxGj1d XnXGKBC8R+qpA8CFqn1MXSahpTr4+P3M7/9sAyERl8JeRK2yf+Ve6qi00dNeuiyUiW pXqds5te6TQVBcuJYpR04MMRf1bt+Mtba/79ghQbLQirBu0NuOFqNe+syHsVFF4sbq Gx3W/R5cELcFGcm7taPUhLdAxcQSraloLhTlrtJJobj2+tuG6a+GfParBHAnneyuuF eEbfxTq8Bg7kg== From: Kalle Valo To: Remi Pommarel Cc: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= , linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ath9k: Fix possible stall on ath9k_txq_list_has_key() References: <20230609093744.1985-1-repk@triplefau.lt> Date: Fri, 09 Jun 2023 13:15:32 +0300 In-Reply-To: <20230609093744.1985-1-repk@triplefau.lt> (Remi Pommarel's message of "Fri, 9 Jun 2023 11:37:44 +0200") Message-ID: <87sfb1gcvv.fsf@kernel.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Remi Pommarel writes: > On EDMA capable hardware, ath9k_txq_list_has_key() can enter infinite > loop if it is called while all txq_fifos have packets that use different > key that the one we are looking for. Fix it by exiting the loop if all > txq_fifos have been checked already. > > Because this loop is called under spin_lock_bh() (see ath_txq_lock) it > causes the following rcu stall: > > rcu: INFO: rcu_sched self-detected stall on CPU > ath10k_pci 0000:01:00.0: failed to read temperature -11 > rcu: 1-....: (5254 ticks this GP) idle=189/1/0x4000000000000002 softirq=8442983/8442984 fqs=2579 > (t=5257 jiffies g=17983297 q=334) > Task dump for CPU 1: > task:hostapd state:R running task stack: 0 pid: 297 ppid: 289 flags:0x0000000a > Call trace: > dump_backtrace+0x0/0x170 > show_stack+0x1c/0x24 > sched_show_task+0x140/0x170 > dump_cpu_task+0x48/0x54 > rcu_dump_cpu_stacks+0xf0/0x134 > rcu_sched_clock_irq+0x8d8/0x9fc > update_process_times+0xa0/0xec > tick_sched_timer+0x5c/0xd0 > __hrtimer_run_queues+0x154/0x320 > hrtimer_interrupt+0x120/0x2f0 > arch_timer_handler_virt+0x38/0x44 > handle_percpu_devid_irq+0x9c/0x1e0 > handle_domain_irq+0x64/0x90 > gic_handle_irq+0x78/0xb0 > call_on_irq_stack+0x28/0x38 > do_interrupt_handler+0x54/0x5c > el1_interrupt+0x2c/0x4c > el1h_64_irq_handler+0x14/0x1c > el1h_64_irq+0x74/0x78 > ath9k_txq_has_key+0x1bc/0x250 [ath9k] > ath9k_set_key+0x1cc/0x3dc [ath9k] > drv_set_key+0x78/0x170 > ieee80211_key_replace+0x564/0x6cc > ieee80211_key_link+0x174/0x220 > ieee80211_add_key+0x11c/0x300 > nl80211_new_key+0x12c/0x330 > genl_family_rcv_msg_doit+0xbc/0x11c > genl_rcv_msg+0xd8/0x1c4 > netlink_rcv_skb+0x40/0x100 > genl_rcv+0x3c/0x50 > netlink_unicast+0x1ec/0x2c0 > netlink_sendmsg+0x198/0x3c0 > ____sys_sendmsg+0x210/0x250 > ___sys_sendmsg+0x78/0xc4 > __sys_sendmsg+0x4c/0x90 > __arm64_sys_sendmsg+0x28/0x30 > invoke_syscall.constprop.0+0x60/0x100 > do_el0_svc+0x48/0xd0 > el0_svc+0x14/0x50 > el0t_64_sync_handler+0xa8/0xb0 > el0t_64_sync+0x158/0x15c > > This rcu stall is hard to reproduce as is, but changing ATH_TXFIFO_DEPTH > from 8 to 2 makes it reasonably easy to reproduce. > > Fixes: ca2848022c12 ("ath9k: Postpone key cache entry deletion for TXQ frames reference it") > Signed-off-by: Remi Pommarel Title is missing "wifi:" but I can add that. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches