linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: haim.dreyfuss@intel.com
Cc: linux-wireless@vger.kernel.org
Subject: [bug report] wifi: iwlwifi: mvm: trigger resume flow before wait for notifications
Date: Fri, 14 Oct 2022 12:37:56 +0300	[thread overview]
Message-ID: <Y0kt9GZ92v6Jjtsm@kili> (raw)

Hello Haim, Dreyfuss,

The patch b75dac847c94: "wifi: iwlwifi: mvm: trigger resume flow
before wait for notifications" from Sep 6, 2022, leads to the
following Smatch static checker warning:

	drivers/net/wireless/intel/iwlwifi/mvm/d3.c:2791 iwl_mvm_resume_firmware()
	error: uninitialized symbol 'd3_status'.

drivers/net/wireless/intel/iwlwifi/mvm/d3.c
    2776 static int iwl_mvm_resume_firmware(struct iwl_mvm *mvm, bool test)
    2777 {
    2778         int ret;
    2779         enum iwl_d3_status d3_status;
    2780         struct iwl_host_cmd cmd = {
    2781                         .id = D0I3_END_CMD,
    2782                         .flags = CMD_WANT_SKB | CMD_SEND_IN_D3,
    2783                 };
    2784         bool reset = fw_has_capa(&mvm->fw->ucode_capa,
    2785                                  IWL_UCODE_TLV_CAPA_CNSLDTD_D3_D0_IMG);
    2786 
    2787         ret = iwl_trans_d3_resume(mvm->trans, &d3_status, test, !reset);

Drivers are not required to impliment a ->d3_resume op and if they don't
then d3_status is not initialized.

    2788         if (ret)
    2789                 return ret;
    2790 
--> 2791         if (d3_status != IWL_D3_STATUS_ALIVE) {
                     ^^^^^^^^^
Uninitialized

    2792                 IWL_INFO(mvm, "Device was reset during suspend\n");
    2793                 return -ENOENT;
    2794         }
    2795 
    2796         /*
    2797          * We should trigger resume flow using command only for 22000 family
    2798          * AX210 and above don't need the command since they have
    2799          * the doorbell interrupt.
    2800          */
    2801         if (mvm->trans->trans_cfg->device_family <= IWL_DEVICE_FAMILY_22000 &&
    2802             fw_has_capa(&mvm->fw->ucode_capa, IWL_UCODE_TLV_CAPA_D0I3_END_FIRST)) {
    2803                 ret = iwl_mvm_send_cmd(mvm, &cmd);
    2804                 if (ret < 0)
    2805                         IWL_ERR(mvm, "Failed to send D0I3_END_CMD first (%d)\n",
    2806                                 ret);
    2807         }
    2808 
    2809         return ret;
    2810 }

regards,
dan carpenter

                 reply	other threads:[~2022-10-14  9:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y0kt9GZ92v6Jjtsm@kili \
    --to=dan.carpenter@oracle.com \
    --cc=haim.dreyfuss@intel.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).