Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1427812rdb; Mon, 2 Oct 2023 09:10:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCB9cheb1MVrnXjnUWA/QGs800ebumilqfqkunjQ+rzAzjAZof7HOLALEQzJcuUp60YtOH X-Received: by 2002:a05:6870:ea81:b0:1d0:c03c:897e with SMTP id s1-20020a056870ea8100b001d0c03c897emr14655813oap.12.1696263052086; Mon, 02 Oct 2023 09:10:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696263052; cv=none; d=google.com; s=arc-20160816; b=M0L5G/cbj0H4/ZqrG6Ls53z07PV58Sb2kzDYIlg6SW+JTvAlFlKc2dQtVoecOhrzBh RNlP7nwJYziJBgaasxqSedVtn/kQdoPuOIK34mGummvQJOhVC4399Qeru9xbLeAI/Uyv hGDjlGv1xZxux/zA4qvcY6KSMGv824wo6Y2ptCK8Tw3SDBqZsJrofAV9Wj+mL3i69UfN WZNLU2j7i4gGZehhFrlu5sP+afArNYCnz+s96zcpNnabJW0931HPIvT6GuKDjkfsOoHG KoNt1eXN05NeNMlqYsRnItFq5KRDZnF769BxArvz4YBl3GGwQBxut6YKLHVjP5BuYrye 80SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:user-agent:cc:to:references :in-reply-to:from:subject:content-transfer-encoding:mime-version :dkim-signature; bh=2CS8oE3mZ51Fig6PHGwFm/TGFSzKGRYLecnArb3nqEI=; fh=7kiEDUWOFjULWv/hoEKASJj9Ac6wGabOoPKoPCCfFYY=; b=SAntIBECc16Ol+0W3ha1aVVm9bWaBB4rsp5IYJVrUkkDL+Hw0RGUjGh58v7qWMdduo pf3yIUp8g6IqbE4998r5IAF8mTvsizdLXcyFJjHL0hFiQigy8o0QctDUdChmHfAMNCvm CSjwryHxFelVHFJ34oboNU5bt6MOlT+4I9TU1fL687jxf4NAtIhZPu9MYgjWCLlpcKfy IWIaNBcJiK3doRXkCMTHl10ojzLiJ4RVAUxnJY83oCXnNWscIZFyRB/RE5xFnMKM2CSN 6RDx7N/AYXteZTOlNUeKotN1YMDWCLwKNc5ggfr26Zv7RjP5pDc6HTix1uYSb2WSeKky bKlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cmF4nW6K; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id a21-20020a63e855000000b00565dd108fd4si27911007pgk.115.2023.10.02.09.10.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 09:10:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cmF4nW6K; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 458D58088A69; Mon, 2 Oct 2023 08:51:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237474AbjJBPvj (ORCPT + 53 others); Mon, 2 Oct 2023 11:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238340AbjJBPvh (ORCPT ); Mon, 2 Oct 2023 11:51:37 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74E8ABD for ; Mon, 2 Oct 2023 08:51:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5772C433C7; Mon, 2 Oct 2023 15:51:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696261894; bh=+B2SrbBWimw4oqZWFj446YyLdZVqab4fu390vSjipXE=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=cmF4nW6KN3sxUzXq7xYa30rVRyLbSOnGwAq72bTNiDYBrZVs7qpy4oY0ME769Ioiy yChmcl4c1azo/n5lIuafEqv7dzXm96y4WAi8EWFDRUQZ1qL8K7eSsz1b3F8w9hpm/t KwViVDPmfHejgFha0OKEjE2z1JPVMryqiCj+0GrTTH+3y1m85d/M/SGbj7hDLZwYrz 7h3XLdAla0qUF7ZlegtDk66QlCSM7aesgHlC2XwuPJdryiMSk/81IzZoiobE1LUUHs DL/XqntkA+LWu5RZE7C0y2Vq76bfGpokcrFJPohdBH+FLRHz7msMDOdHw931xYga3R pXuKm2S34kQvg== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH v6 03/13] wifi: ath11k: fix a possible dead lock caused by ab->base_lock From: Kalle Valo In-Reply-To: <20230920082349.29111-4-quic_wgong@quicinc.com> References: <20230920082349.29111-4-quic_wgong@quicinc.com> To: Wen Gong Cc: , , , , Baochen Qiang User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169626189059.3911795.14308656119733371331.kvalo@kernel.org> Date: Mon, 2 Oct 2023 15:51:32 +0000 (UTC) X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 02 Oct 2023 08:51:39 -0700 (PDT) Wen Gong wrote: > spin_lock/spin_unlock are used in ath11k_reg_chan_list_event to > acquire/release ab->base_lock, for now this is safe because that > function is only called in soft IRQ context. > > But ath11k_reg_chan_list_event() will be called from process > context in an upcoming patch, and this can result in a deadlock if > ab->base_lock is acquired in process context and then soft IRQ occurs > on the same CPU and tries to acquire that lock. > > Fix it by using spin_lock_bh and spin_unlock_bh instead. > > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23 > > Fixes: 69a0fcf8a9f2 ("ath11k: Avoid reg rules update during firmware recovery") > Signed-off-by: Baochen Qiang > Signed-off-by: Wen Gong > Acked-by: Jeff Johnson > Signed-off-by: Kalle Valo This patch seems to leak memory: unreferenced object 0xffff8881110f5840 (size 64): comm "softirq", pid 0, jiffies 4295335213 (age 79.445s) hex dump (first 32 bytes): 32 14 82 14 50 00 17 00 00 02 00 00 82 14 d2 14 2...P........... 50 00 17 00 08 02 00 00 72 15 62 16 a0 00 1e 00 P.......r.b..... backtrace: [] __kmem_cache_alloc_node+0x1ca/0x2d0 [] __kmalloc+0x50/0x1a0 [] create_ext_reg_rules_from_wmi+0x2e/0x430 [ath11k] [] ath11k_pull_reg_chan_list_ext_update_ev+0x1d24/0x4f30 [ath11k] [] ath11k_reg_chan_list_event.isra.0+0x64/0xd0 [ath11k] [] ath11k_wmi_tlv_op_rx+0xb7f/0x27e0 [ath11k] [] ath11k_htc_rx_completion_handler+0x3b4/0x6f0 [ath11k] [] ath11k_ce_recv_process_cb+0x5da/0x920 [ath11k] [] ath11k_ce_per_engine_service+0xe8/0x130 [ath11k] [] ath11k_pcic_ce_tasklet+0x65/0x120 [ath11k] [] tasklet_action_common.isra.0+0x24c/0x3d0 [] tasklet_action+0x4f/0x70 [] __do_softirq+0x1c5/0x867 unreferenced object 0xffff8881110f5f40 (size 64): comm "softirq", pid 0, jiffies 4295335238 (age 79.439s) hex dump (first 32 bytes): 32 14 82 14 50 00 17 00 00 02 00 00 82 14 d2 14 2...P........... 50 00 17 00 08 02 00 00 72 15 62 16 a0 00 1e 00 P.......r.b..... backtrace: [] __kmem_cache_alloc_node+0x1ca/0x2d0 [] __kmalloc+0x50/0x1a0 [] create_ext_reg_rules_from_wmi+0x2e/0x430 [ath11k] [] ath11k_pull_reg_chan_list_ext_update_ev+0x1d24/0x4f30 [ath11k] [] ath11k_reg_chan_list_event.isra.0+0x64/0xd0 [ath11k] [] ath11k_wmi_tlv_op_rx+0xb7f/0x27e0 [ath11k] [] ath11k_htc_rx_completion_handler+0x3b4/0x6f0 [ath11k] [] ath11k_ce_recv_process_cb+0x5da/0x920 [ath11k] [] ath11k_ce_per_engine_service+0xe8/0x130 [ath11k] [] ath11k_pcic_ce_tasklet+0x65/0x120 [ath11k] [] tasklet_action_common.isra.0+0x24c/0x3d0 [] tasklet_action+0x4f/0x70 [] __do_softirq+0x1c5/0x867 -- https://patchwork.kernel.org/project/linux-wireless/patch/20230920082349.29111-4-quic_wgong@quicinc.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches