Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1967118rwo; Thu, 3 Aug 2023 02:42:38 -0700 (PDT) X-Google-Smtp-Source: APBJJlFUEHY2HhvLsab3HE04dSmcm04kCQxt1zr9shdbxwLrryvWX+vrTz5FUeZqjAUBHV/fuasc X-Received: by 2002:a17:907:7711:b0:997:e7d0:e26d with SMTP id kw17-20020a170907771100b00997e7d0e26dmr10048919ejc.4.1691055758488; Thu, 03 Aug 2023 02:42:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691055758; cv=none; d=google.com; s=arc-20160816; b=aKcABj9u0V3tw/iQs9YlM66UqSFwoIe9OpcdOSDGeaO27W5bIwAiSENcs7yWTN6089 inkR7jRc6Y8FSVD3R8ixkDWSStOJkvhQ+c6nzxShvwIedurFQNzC7zBfi32PGOVuTmr2 XXM6IXTsQQkvg1dYhL/7HqhJyxTB7vMiEhl3nk47X8goYylZApRl/I/LWYXjb8wdsEgg bSFP9zGqWzrS1s4NoMccez+iCstxSmv0xLWdNxEni2BQuxLJiC/88QJRsTED6QlnsRkP LT5FQL2E8qyYFoWK/cjyPKF8dc08m1uVFj8fwdXGLRopYa5HTyx7UyajVfRjkCZ6uhLK Qw7g== 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=1cy4ZV0Bg5+4W3+7C2+dQUxkboIJPWTiw5dbOuYrQXw=; fh=ylibOHjZVoRjcus4fpWusyZbCeuRlezp5RqsfwfDtRY=; b=QG4nkWS1Vc0Z56se1eTmaDAp7cmwmwDfzXiP+NzklLNJJT8brKHAwF/DTb7Fnjfuf6 JPOJTmzpTJje4UBBezIIo8LnrEauoSBXJuRTPRjmVvfxM73CJIA1Qs5H1S+af6e1jPI4 1tH1XffTaRUb1K94dMyTGaGvyLf4WTHVSI+q2PfyTJ+Q0KiS+QbOjWXJhmfBJ7vpKsNr QQpGzEVi4ZeMiPt+mKmdKrBrCpELi+PrPhP0c76HKjctbJ8hLSfh1OWhorItNAXUgKch B9QbYLOl4fW+d0kxgtWquF9E/CCaospttudpkZtkb9XuaD1tL6W3GM+P9/+rjTDEXN51 chsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="F/QQkStC"; 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 n12-20020a170906088c00b00992a9bc7432si2942587eje.936.2023.08.03.02.42.23; Thu, 03 Aug 2023 02:42:38 -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="F/QQkStC"; 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 S235071AbjHCJUu (ORCPT + 58 others); Thu, 3 Aug 2023 05:20:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54480 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235072AbjHCJT6 (ORCPT ); Thu, 3 Aug 2023 05:19:58 -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 33B0230EA for ; Thu, 3 Aug 2023 02:19:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A0AD661CDA for ; Thu, 3 Aug 2023 09:19:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1C8DCC433C8; Thu, 3 Aug 2023 09:19:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691054396; bh=ShL7hrHKNKPly01wi1qDkRUwsTVX6toD8afVDWIE21c=; h=Subject:From:In-Reply-To:References:To:Cc:Date:From; b=F/QQkStCbotVXmvBcxARavevCuFoNh97OEFhXYg1+xefLjNksaaz+8xtsjmOSNZaQ bTkst+Qe9jqs1gtuU3AJZRn1EyJ3/D7VCe4RPaV1cYMq/DoXTdiooneCz30s/qOH0g vYyf8QUfWll9pzdilBXYbWkOoWMU9EdSDOixnZ5KNEj4Sq65TkSg2wRkX+wpCLzh+o jfmXvF0NThAVJ31CMwzov8JeOgU0faFeefGiDGS50AfuHhWA/xYq90UI5T53N2bNhY Y5GdaG076u7hR7gIj9qmk66oj+l7N8r2thuZ7UuOqLSwawuU5uOKY5Nf7PFP+hKN4u /mPwxK0OgeHfA== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [PATCH] wifi: ath12k: avoid deadlock by change ieee80211_queue_work for regd_update_work From: Kalle Valo In-Reply-To: <20230718024724.29120-1-quic_wgong@quicinc.com> References: <20230718024724.29120-1-quic_wgong@quicinc.com> To: Wen Gong Cc: , , User-Agent: pwcli/0.1.1-git (https://github.com/kvalo/pwcli/) Python/3.11.2 Message-ID: <169105439308.894438.14073090276070005288.kvalo@kernel.org> Date: Thu, 3 Aug 2023 09:19:54 +0000 (UTC) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 Wen Gong wrote: > Deadlock is easily happened while shutdown wlan interface such as run > "ifconfig wlan0 down". > > The reason is because when ar->regd_update_work is ran, it will > call wiphy_lock(ar->hw->wiphy) in function ath12k_regd_update() which > is running in workqueue of ieee80211_local queued by ieee80211_queue_work(). > Another thread from "ifconfig wlan0 down" will also accuqire the lock > by wiphy_lock(sdata->local->hw.wiphy) in function ieee80211_stop(), and > then it call ieee80211_stop_device() to flush_workqueue(local->workqueue), > this will wait the workqueue of ieee80211_local finished. Then deadlock > will happen easily if the two thread run meanwhile. > > Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0-03427-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.15378.4 > > Signed-off-by: Wen Gong > Signed-off-by: Kalle Valo Patch applied to ath-next branch of ath.git, thanks. 8198950ccb7d wifi: ath12k: avoid deadlock by change ieee80211_queue_work for regd_update_work -- https://patchwork.kernel.org/project/linux-wireless/patch/20230718024724.29120-1-quic_wgong@quicinc.com/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches