linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@codeaurora.org>
To: Jouni Malinen <jouni@codeaurora.org>
Cc: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
	Seevalamuthu Mariappan <seevalam@codeaurora.org>,
	Miles Hu <milehu@codeaurora.org>,
	Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
Subject: Re: [PATCH 2/3] ath11k: add separate APIs for monitor mode
Date: Tue, 21 Sep 2021 18:55:49 +0300	[thread overview]
Message-ID: <87tuidudmi.fsf@codeaurora.org> (raw)
In-Reply-To: <877dfaukjq.fsf@codeaurora.org> (Kalle Valo's message of "Tue, 21 Sep 2021 16:26:17 +0300")

Kalle Valo <kvalo@codeaurora.org> writes:

>> +vdev_stop:
>> +	reinit_completion(&ar->vdev_setup_done);
>> +
>> +	ret = ath11k_wmi_vdev_stop(ar, vdev_id);
>> +	if (ret) {
>> +		ath11k_warn(ar->ab, "failed to stop monitor vdev %i after start failure: %d\n",
>> +			    vdev_id, ret);
>> +		return ret;
>> +	}
>> +
>> +	ret = ath11k_mac_vdev_setup_sync(ar);
>> +	if (ret)
>> +		ath11k_warn(ar->ab, "failed to synchronize setup for vdev %i stop: %d\n",
>> +			    vdev_id, ret);
>
> I added return ret here for consistency..
>
>> +	return ret;
>
> I don't thinks this is right, in an error path (vdev_stop label) we
> return 0? I changed this to -EIO.
>
>> +static int ath11k_mac_monitor_vdev_stop(struct ath11k *ar)
>> +{
>> +	int ret;
>> +
>> +	lockdep_assert_held(&ar->conf_mutex);
>> +
>> +	reinit_completion(&ar->vdev_setup_done);
>> +
>> +	ret = ath11k_wmi_vdev_stop(ar, ar->monitor_vdev_id);
>> +	if (ret)
>> +		ath11k_warn(ar->ab, "failed to request monitor vdev %i stop: %d\n",
>> +			    ar->monitor_vdev_id, ret);
>> +
>> +	ret = ath11k_mac_vdev_setup_sync(ar);
>> +	if (ret)
>> + ath11k_warn(ar->ab, "failed to synchronize monitor vdev %i stop:
>> %d\n",
>> +			    ar->monitor_vdev_id, ret);
>> +
>> +	ret = ath11k_wmi_vdev_down(ar, ar->monitor_vdev_id);
>> +	if (ret)
>> +		ath11k_warn(ar->ab, "failed to put down monitor vdev %i: %d\n",
>> +			    ar->monitor_vdev_id, ret);
>> +
>> +	ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac monitor vdev %i stopped\n",
>> +		   ar->monitor_vdev_id);
>> +	return ret;
>> +}
>
> I was not sure what's the idea of error path handling here, we print
> warnings but still continue the normal execution. I changed this so that
> we bail out in the first error and if everything goes well we return 0.

I found quite a few missing error checks, too many to list here but
fixed in the pending branch:

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=8b2f8d11422e7909ff02db456cda41728f621de4

https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git/commit/?h=pending&id=5ff318be206b3d2a0bfdcfaf0ac52cc3b4ecdeae

Please double check, compile tested only.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

  reply	other threads:[~2021-09-21 15:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21 16:20 [PATCH 0/3] ath11k: Fix no data captured in monitor co-exist mode Jouni Malinen
2021-07-21 16:20 ` [PATCH 1/3] ath11k: move static function ath11k_mac_vdev_setup_sync to top Jouni Malinen
2021-09-24 11:34   ` Kalle Valo
2021-07-21 16:20 ` [PATCH 2/3] ath11k: add separate APIs for monitor mode Jouni Malinen
2021-09-21 13:26   ` Kalle Valo
2021-09-21 15:55     ` Kalle Valo [this message]
2021-09-22 15:53       ` Seevalamuthu Mariappan
2021-07-21 16:20 ` [PATCH 3/3] ath11k: monitor mode clean up to use separate APIs Jouni Malinen
2021-09-16  9:35   ` Kalle Valo
2021-09-16  9:38     ` Kalle Valo
2021-09-21 12:14   ` Kalle Valo
2021-09-21 13:42     ` Kalle Valo

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=87tuidudmi.fsf@codeaurora.org \
    --to=kvalo@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=jouni@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=milehu@codeaurora.org \
    --cc=seevalam@codeaurora.org \
    --cc=vthiagar@codeaurora.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).