Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1766950pxp; Mon, 21 Mar 2022 04:48:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRRMwSV08VYTBFnrW91h0HsRMUbecj0Y/RjGW0LQZnUYz/tUfM32iJEPiyDpj5fZPAprTz X-Received: by 2002:a17:903:11c9:b0:151:9521:d5c7 with SMTP id q9-20020a17090311c900b001519521d5c7mr12450879plh.73.1647863337144; Mon, 21 Mar 2022 04:48:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647863337; cv=none; d=google.com; s=arc-20160816; b=xKyYEBrdD1XW9ayEF4LPcVIT8eXKBpEMEKkEnAwg8YPZ2EmVRLsafjy9/VeAvr7nUH /s0Tk3l5EWgsq28D/MqR5u+6OQ7xofqVAxvKN9wdEwiXGBXr1qEDraZRcqTy6wuKEb6B 21MK3y3JRij3eJKga9sbKEFGVYSKWnxpx5xn5X3hjis5k50NMYWNfxNF00d3zr+GBGr8 GTbHoXEIkJ0GLQqaO1V/gV9fYciYyyfOEIBaXhgsZeo6a9Td0qn6fIfbRDQfTt7Snhgc OvENKEYIcoeMPit+His53NQtJkqzNsl84V1M8AvyVcU0s9Enh8S6Yyzjuq+PmEMwgM70 Ozng== 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=T9kPb16qOQfiE85xdiSODyB9YRkLnv+/stxXz7pu+zg=; b=Hxwz5oqBDAcdCOFMKzDlnf5gNHdN+YBRNVodyzwHt/PR7mm4B8jjOitLT/juEcR7E7 7xY54Lqrd0cJRUE9Gv8z0Fd2DQMuu0YBJ9/GiG7pIrNTH3TuMmFCb0HrL69G6Xh85GwO K631fcM/il4GNRqwnh5/Q5YhCZR5ffLTjaSBmg4qu554lfJvXF9FM4wZHMcq/FU7ezsM TRrZ04kB4Y8Po430pn5zmWgRsptzyrtpOdDSbYMm9IF9RfzaStduF8+sJ6ACXvIU2+R8 5LhPcwZQ8yUBk87v75RBd6/yy8Ai+oCZrQH7NlQzfpkIGE75MVX62taRSeD1KVxSsr6h lOYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aGCs8tge; 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 q6-20020a656846000000b0038228eaa3fdsi10497179pgt.648.2022.03.21.04.48.46; Mon, 21 Mar 2022 04:48:57 -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=aGCs8tge; 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 S242182AbiCULSO (ORCPT + 70 others); Mon, 21 Mar 2022 07:18:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346728AbiCULR6 (ORCPT ); Mon, 21 Mar 2022 07:17:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F3CF13CA07 for ; Mon, 21 Mar 2022 04:16:33 -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 E111E60AD8 for ; Mon, 21 Mar 2022 11:16:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7FEA0C340E8; Mon, 21 Mar 2022 11:16:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1647861392; bh=Gc6w4SyLoHH7rLdsaBZnS+Z+NN6F7MssyEh57+LkU58=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=aGCs8tge8UXsglO3CyQJailDbuinA7+UO5mFHhzkyL0xQN21r9FCCWBP0ORn/YePE o1ygco3RTWA6/QkvyRM6oPUNapXR03amq7WhNT8QgDH5/d1w2E4zlkO30yxSr3M3hq LDWdNJ/haMFZSQzF0RbvJCJIXCKjjeuwISZFwLjDcafopaw2Uc0oAxoqyUZWY0vhPt mT4G7i2ljWSMrN6EK2KCjV/J/PZE0zJZa6W25C5EXy+YvyjkWA7DUUpsFwOMi3oq7g taaGUMYt2aZR+pMQEWCTK4zMcYmvsGS3NtfBm7W0SYAst1dr+90mXSLitqQK2HbzrS iNu36E2cbvplA== From: Kalle Valo To: Wen Gong Cc: , Subject: Re: [PATCH v8 1/4] ath11k: add support for device recovery for QCA6390/WCN6855 References: <20220228064606.8981-1-quic_wgong@quicinc.com> <20220228064606.8981-2-quic_wgong@quicinc.com> Date: Mon, 21 Mar 2022 13:16:29 +0200 In-Reply-To: <20220228064606.8981-2-quic_wgong@quicinc.com> (Wen Gong's message of "Mon, 28 Feb 2022 01:46:03 -0500") Message-ID: <87pmmfmu7m.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=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 writes: > Currently ath11k has device recovery logic, it is introduced by this > patch "ath11k: Add support for subsystem recovery" which is upstream > by https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=ath11k-bringup&id=3a7b4838b6f6f234239f263ef3dc02e612a083ad. > > The patch is for AHB devices such as IPQ8074, it has remote proc module > which is used to download the firmware and boots the processor which > firmware is running on. If firmware crashed, remote proc module will > detect it and download and boot firmware again. Below command will > trigger a firmware crash, and then user can test feature of device > recovery. > > Test command: > echo assert > /sys/kernel/debug/ath11k/qca6390\ hw2.0/simulate_fw_crash > echo assert > /sys/kernel/debug/ath11k/wcn6855\ hw2.0/simulate_fw_crash > > Unfortunately, QCA6390 is PCIe bus, it does not have the remote proc > module, it use mhi module to communicate between firmware and ath11k. > So ath11k does not support device recovery for QCA6390 currently. > > This patch is to add the extra logic which is different for QCA6390. > When firmware crashed, MHI_CB_EE_RDDM event will be indicate by > firmware and then ath11k_mhi_op_status_cb which is the callback of > mhi_controller will receive the MHI_CB_EE_RDDM event, then ath11k > will start to do recovery process, ath11k_core_reset() calls > ath11k_hif_power_down()/ath11k_hif_power_up(), then the mhi/ath11k > will start to download and boot firmware. There are some logic to > avoid deadloop recovery and two simultaneous recovery operations. > And because it has muti-radios for the soc, so it add some logic > in ath11k_mac_op_reconfig_complete() to make sure all radios has > reconfig complete and then complete the device recovery. > > Also it add workqueue_aux, because ab->workqueue is used when receive > ATH11K_QMI_EVENT_FW_READY in recovery process(queue_work(ab->workqueue, > &ab->restart_work)), and ath11k_core_reset will wait for max > ATH11K_RESET_TIMEOUT_HZ for the previous restart_work finished, if > ath11k_core_reset also queued in ab->workqueue, then it will delay > restart_work of previous recovery and lead previous recovery fail. > > ath11k recovery success for QCA6390/WCN6855 after apply this patch. > > Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-01740-QCAHSTSWPLZ_V2_TO_X86-1 > Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03003-QCAHSPSWPL_V1_V2_SILICONZ_LITE-2 > > Signed-off-by: Wen Gong [...] > void ath11k_core_free(struct ath11k_base *ab) > { > + flush_workqueue(ab->workqueue_aux); > + destroy_workqueue(ab->workqueue_aux); > + > flush_workqueue(ab->workqueue); > destroy_workqueue(ab->workqueue); This had a conflict and in the pending branch I removed flush_workqueue(ab->workqueue_aux). Flush is not needed before destroy. -- https://patchwork.kernel.org/project/linux-wireless/list/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches