Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp4013301pxb; Tue, 7 Sep 2021 12:35:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzyYExLn1JkIdFrGSqgmUp1Bl3nXtoKUnPF03KdoS1JJVd2rSDqmIeBcsPdOq4kf5jDAKFU X-Received: by 2002:aa7:d617:: with SMTP id c23mr1183391edr.206.1631043334075; Tue, 07 Sep 2021 12:35:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631043334; cv=none; d=google.com; s=arc-20160816; b=BBZ4Vw1T+8yCwfW0x/Gb4obL5zWciIC9I8ReKkmMyHBZj0N1i6A995pjTsKEU1RdV2 +BI7+JNMr+ffwGgTzoR6dBZcVmsMN029wORvxDgd3/R9GxPsgRsutF9pS9jA+zyw6WcC EWBznA6yzCjLJwp/AX1mXLONzbAS7d7N6LCtTzJ8nTl1lTRFeLsSxgsS0mc5qzcxg97N 2++lsTBf24bvQ860GljL9HubPtidrmOhwUjU4H3ocM1FnIrem1VTlxB7dbnh5Ts5Jv3N BI0vtjYPuK2OexU9w9CORjWLSOk9QxiDoLVRjlZ5li5SFd2lnokilZ8Em0WgMJFvBTDe yw/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=kM9tVwq7irwTqrJ/Yy0JQrecGes212Y12EN0zEFuULg=; b=fSNx862ZfDjhPVmG6C2cjUywmyM2qH8uKXBzDevqVGdDZJOeoa3bDs97fXDFHN1afa B2ipPCPVJvVLnv3nIjldRXlI+DYQsbWwGH3aYRnkTRAhwYPqvAEy59BPzotRScUVw6Ip jtzMXf8oKxeAHeIASusIiiTovUtc+52fyPTzmrRxjLl99WNdomp5pmouodT79jfQElRv VjfSc9g2kYG7LiDNgpuodMSgG2aIjR86wGmWro/T89glc/AzFufh92JH7bp4OVdy6hgv qC59LN4G7B+NQT6h3NRnDombUUNgmmpixpZRSrH9onAlxnQL96KmCYVtF9LNoXy1X6IY wjsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EbnF+b10; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i2si13028834ejw.120.2021.09.07.12.35.10; Tue, 07 Sep 2021 12:35:34 -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=pass header.i=@chromium.org header.s=google header.b=EbnF+b10; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345184AbhIGTeI (ORCPT + 99 others); Tue, 7 Sep 2021 15:34:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235495AbhIGTeI (ORCPT ); Tue, 7 Sep 2021 15:34:08 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94845C061575 for ; Tue, 7 Sep 2021 12:33:01 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id w19-20020a17090aaf9300b00191e6d10a19so156130pjq.1 for ; Tue, 07 Sep 2021 12:33:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=kM9tVwq7irwTqrJ/Yy0JQrecGes212Y12EN0zEFuULg=; b=EbnF+b103gIkqqpqa+fykmOyLRTxyAdNcKeyO2HFiDbsMFAk2ahSsl++vu7qZpG7Cp ZC40lS2gVLJTvxEHRkJj7LkQuF8yCLE4csed/ETMsUE3QjeZKU3jd5gtgdYiSs1g3zL5 J3Fk3wLm5lUn3141B6KqkJu4v8T/5a7nzLHLE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=kM9tVwq7irwTqrJ/Yy0JQrecGes212Y12EN0zEFuULg=; b=JTNGze7AgEf0o+SaDDOE3TAhtWB33e9Fe9aqjzmCBfGJqKnHeTLtKuGQfr+f5pieFa zvmYNWzlpY8W99Ekbpc2BPgbV/eiWKQLR+pib6KeLIBCZ9W0GLC4E2/ouxe0v7FjSmt8 m0HTeSxs5Lq6+/sjXuNFUxBKdh3rUYISy6fgcOdb6yPPsBlNakob8c8ugJ81FQ2KQhvi onI9/hdnT0FcCC8lgtfEYHASSV8yNcquQ6B3XpCKd47agMNAqfNBsemH8c9R+trycYkJ JMh+L9kzFyRNd8PqombHaVHVEn5LIX9C2PBtvuecd42RoUDlNPy9A3MQqLwUjZDvCiTh 54pg== X-Gm-Message-State: AOAM531iniB/lFfWvsG2cDAg4gihaVRs9t3eCaZJUDCUVdj88f0rF+Sr bHffcGpC0sv4dMz3hhtvsjvZBQ== X-Received: by 2002:a17:90a:9b13:: with SMTP id f19mr31127pjp.224.1631043181149; Tue, 07 Sep 2021 12:33:01 -0700 (PDT) Received: from localhost ([2620:15c:202:201:c6b2:7ae:474d:36f6]) by smtp.gmail.com with UTF8SMTPSA id w11sm11664097pfj.65.2021.09.07.12.33.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 12:33:00 -0700 (PDT) Date: Tue, 7 Sep 2021 12:32:59 -0700 From: Matthias Kaehlcke To: Stephen Boyd Cc: Kalle Valo , linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-arm-msm@vger.kernel.org, netdev@vger.kernel.org, Govind Singh , Youghandhar Chintala , Abhishek Kumar Subject: Re: [PATCH] ath10k: Don't always treat modem stop events as crashes Message-ID: References: <20210905210400.1157870-1-swboyd@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210905210400.1157870-1-swboyd@chromium.org> Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sun, Sep 05, 2021 at 02:04:00PM -0700, Stephen Boyd wrote: > When rebooting on sc7180 Trogdor devices I see the following crash from > the wifi driver. > > ath10k_snoc 18800000.wifi: firmware crashed! (guid 83493570-29a2-4e98-a83e-70048c47669c) > > This is because a modem stop event looks just like a firmware crash to > the driver, the qmi connection is closed in both cases. Use the qcom ssr > notifier block to stop treating the qmi connection close event as a > firmware crash signal when the modem hasn't actually crashed. See > ath10k_qmi_event_server_exit() for more details. > > This silences the crash message seen during every reboot. > > Fixes: 3f14b73c3843 ("ath10k: Enable MSA region dump support for WCN3990") > Cc: Govind Singh > Cc: Youghandhar Chintala > Cc: Abhishek Kumar > Signed-off-by: Stephen Boyd > --- > drivers/net/wireless/ath/ath10k/snoc.c | 75 ++++++++++++++++++++++++++ > drivers/net/wireless/ath/ath10k/snoc.h | 4 ++ > 2 files changed, 79 insertions(+) > > diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c > index ea00fbb15601..fc4970e063f8 100644 > --- a/drivers/net/wireless/ath/ath10k/snoc.c > +++ b/drivers/net/wireless/ath/ath10k/snoc.c > @@ -12,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > > @@ -1477,6 +1478,70 @@ void ath10k_snoc_fw_crashed_dump(struct ath10k *ar) > mutex_unlock(&ar->dump_mutex); > } > > +static int ath10k_snoc_modem_notify(struct notifier_block *nb, unsigned long action, > + void *data) > +{ > + struct ath10k_snoc *ar_snoc = container_of(nb, struct ath10k_snoc, nb); > + struct ath10k *ar = ar_snoc->ar; > + struct qcom_ssr_notify_data *notify_data = data; > + > + switch (action) { > + case QCOM_SSR_BEFORE_POWERUP: > + ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem starting event\n"); > + clear_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags); > + break; > + > + case QCOM_SSR_AFTER_POWERUP: > + ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem running event\n"); > + break; > + > + case QCOM_SSR_BEFORE_SHUTDOWN: > + ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem %s event\n", > + notify_data->crashed ? "crashed" : "stopping"); > + if (!notify_data->crashed) > + set_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags); > + else > + clear_bit(ATH10K_SNOC_FLAG_UNREGISTERING, &ar_snoc->flags); > + break; > + > + case QCOM_SSR_AFTER_SHUTDOWN: > + ath10k_dbg(ar, ATH10K_DBG_SNOC, "received modem offline event\n"); > + break; > + > + default: > + ath10k_err(ar, "received unrecognized event %lu\n", action); > + break; > + } > + > + return NOTIFY_OK; > +} > + > +static int ath10k_modem_init(struct ath10k *ar) > +{ > + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); > + void *notifier; > + > + ar_snoc->nb.notifier_call = ath10k_snoc_modem_notify; > + > + notifier = qcom_register_ssr_notifier("mpss", &ar_snoc->nb); > + if (IS_ERR(notifier)) > + return PTR_ERR(notifier); > + > + ar_snoc->notifier = notifier; > + > + return 0; > +} > + > +static void ath10k_modem_deinit(struct ath10k *ar) > +{ > + int ret; > + struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar); > + > + ret = qcom_unregister_ssr_notifier(ar_snoc->notifier, &ar_snoc->nb); > + if (ret) > + ath10k_err(ar, "error %d unregistering notifier\n", ret); > +} > + > static int ath10k_setup_msa_resources(struct ath10k *ar, u32 msa_size) > { > struct device *dev = ar->dev; > @@ -1740,10 +1805,19 @@ static int ath10k_snoc_probe(struct platform_device *pdev) > goto err_fw_deinit; > } > > + ret = ath10k_modem_init(ar); > + if (ret) { > + ath10k_err(ar, "failed to initialize modem notifier: %d\n", ret); nit: ath10k_modem_init() encapsulates/hides the setup of the notifier, the error message should be inside the function, as for _deinit() Reviewed-by: Matthias Kaehlcke