Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp411058pxa; Wed, 19 Aug 2020 05:05:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCP0ORsGVofjiIW33TIGjcJK4lfCG2svFO+KnBeEX9nlp/KTHKNHXYGdoVd5sb/rpBiNI5 X-Received: by 2002:a17:906:8748:: with SMTP id hj8mr25616258ejb.477.1597838748094; Wed, 19 Aug 2020 05:05:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597838748; cv=none; d=google.com; s=arc-20160816; b=sqv5pKqpgqTaSVDK20AB0vvGfx21fQF28r0s/6FiABI31iyBoy9z2p64GJwZSbghS2 gnHXdo/M+oPH4I2KlHjWvzqIEEZPDJkZlfYvT9vc3HFIERGa9RMHDBBIO5KFPJZstHZM RVeIhjStRdRNhjm5kWCJqubN1ixrA1oUxV+62JLb4JhWZcTYKdpocdmZ3VomwAAsNwAb 6R9FSUECGLGK/h9sfHPbDR0gF0m8Ef8cEgBq9wmvBIPG+4Zm5gD+qm/7XrWAT52Ho8+d vP4jVy4qU7jfO55yeInTycWIMCv4sgeTgA10hK61Ai9jIbYHyxwaEsA7esdory3dD6PR Nzdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=iBqC1WAz0kJBE3b1DZscOOX0VcQG3yjHQ9f1eDs35ls=; b=pxKJa3FyvJWjTy4Un0wajo/tjBzeX6RPwZXuuuzk9M0t9NnWJhq852j8kZsDodq6mo k6iR6R6JuMSUYTRq6i49ZyV0C0h6SheMNbu9N6nK8Hs0ql23auA2fHU/Zgw/kjLBDG4c xK0oMSZjQnxvw8K7OIaOrT0XG0bqeW9tracofMEpPiPosx8Ia6ulbx+luERqS+Z0WnnV ZPMWNqz6EtrU2IMpSKZakaIZesr+9E0JPzJobKc0OukuQuuOSjVVKiotaYbaXWY3K/jC HDvpenyoaLjrAxMnlQTxlpZQBxbBJRJJzWX08gVSqE7qaXwgTJ4bs34Vfc2rcXaJTmE3 VPPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=CmsHcnDg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s15si15136653ejx.745.2020.08.19.05.05.20; Wed, 19 Aug 2020 05:05:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=CmsHcnDg; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728122AbgHSMDK (ORCPT + 99 others); Wed, 19 Aug 2020 08:03:10 -0400 Received: from mail29.static.mailgun.info ([104.130.122.29]:22453 "EHLO mail29.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728381AbgHSMDB (ORCPT ); Wed, 19 Aug 2020 08:03:01 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1597838578; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=iBqC1WAz0kJBE3b1DZscOOX0VcQG3yjHQ9f1eDs35ls=; b=CmsHcnDgo0beW9+aNYqaLiLjn7F/QTjtTozT8KZ9TM/jwBRNbDpNWB53paMeCyKVRnNesi/A jvjtPKQdsHU3fUaNNsDbTM75fTngxx/5a6eQVdNHvO1cwVW30pkmf0PBTdHjZ8FKNUcPv4BR Z1uDSMcJ67RlTYok4DKzHOh9ECY= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyI3YTAwOSIsICJsaW51eC13aXJlbGVzc0B2Z2VyLmtlcm5lbC5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n02.prod.us-east-1.postgun.com with SMTP id 5f3d14a7f2b697637a1bcf39 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 19 Aug 2020 12:01:43 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 50A0BC433C6; Wed, 19 Aug 2020 12:01:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: wgong) by smtp.codeaurora.org (Postfix) with ESMTPSA id F0EBFC433CA; Wed, 19 Aug 2020 12:01:40 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 19 Aug 2020 20:01:40 +0800 From: Wen Gong To: Kalle Valo Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org Subject: Re: [PATCH v4 1/2] ath10k: add refcount for ath10k_core_restart In-Reply-To: <87imdlkuw8.fsf@codeaurora.org> References: <20200108031957.22308-1-wgong@codeaurora.org> <20200108031957.22308-2-wgong@codeaurora.org> <87imdlkuw8.fsf@codeaurora.org> Message-ID: <35a24f0d901be76266f6c9ab020d2acc@codeaurora.org> X-Sender: wgong@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-08-15 01:19, Kalle Valo wrote: ... > > I have been thinking a different approach for this. I think another > option is to have a function like this: > > ath10k_core_firmware_crashed() > { > queue_work(ar->workqueue, &ar->restart_work); > } > > In patch 1 we would convert all existing callers to call that > function instead of queue_work() directly. > > In patch 2 we would add a new flag to enum ath10k_dev_flags, or maybe > should actually use existing ATH10K_FLAG_CRASH_FLUSH? Don't know yet > which one is better. Now the function would do: > > ath10k_core_firmware_crashed() > { > if (test_bit(flag)) > return > > set_bit(flag) > queue_work(ar->workqueue, &ar->restart_work); > } > It is better to clear_bit ATH10K_FLAG_CRASH_FLUSH/new flag in ath10k_reconfig_complete instead of ath10k_core_start because ieee80211_reconfig(called by ieee80211_restart_work) of mac80211 do many things and drv_start is 1st thing and drv_reconfig_complete is last thing. > That way restart_work queue would be called only one time. > > Though I'm not sure how ATH10K_STATE_WEDGED would behave after this > change, it might get broken. Ah, actually I think even this patch > breaks > the WEDGED state. This firmware restart is tricky, difficult to say > what > is the best approach. Michal, are you reading? :) Any ideas? > > And after looking more about this patch I don't see the need for the > new > ar->restart_count atomic variable. Checking for ATH10K_FLAG_CRASH_FLUSH > would do the same thing AFAICS. > > And related to this, (in a separate patch) I think we should utilise > ATH10K_FLAG_CRASH_FLUSH more. For example in ath10k_wmi_cmd_send() to > not even try to send a WMI command if the flag is set. Basically all > hardware access should be disabled except what is needed to restart the > firmware.