From: Seevalamuthu Mariappan <seevalam@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Jouni Malinen <jouni@codeaurora.org>,
ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
Miles Hu <milehu@codeaurora.org>,
Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
Subject: Re: [PATCH 2/3] ath11k: add separate APIs for monitor mode
Date: Wed, 22 Sep 2021 21:23:32 +0530 [thread overview]
Message-ID: <58b100804acf0afc1c8baf4840ed65d8@codeaurora.org> (raw)
In-Reply-To: <87tuidudmi.fsf@codeaurora.org>
On 2021-09-21 21:25, Kalle Valo wrote:
> 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.
Thanks for the fixes Kalle. It looks fine and tested the same.
Regards,
Seevalamuthu M
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
WARNING: multiple messages have this Message-ID (diff)
From: Seevalamuthu Mariappan <seevalam@codeaurora.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Jouni Malinen <jouni@codeaurora.org>,
ath11k@lists.infradead.org, linux-wireless@vger.kernel.org,
Miles Hu <milehu@codeaurora.org>,
Vasanthakumar Thiagarajan <vthiagar@codeaurora.org>
Subject: Re: [PATCH 2/3] ath11k: add separate APIs for monitor mode
Date: Wed, 22 Sep 2021 21:23:32 +0530 [thread overview]
Message-ID: <58b100804acf0afc1c8baf4840ed65d8@codeaurora.org> (raw)
In-Reply-To: <87tuidudmi.fsf@codeaurora.org>
On 2021-09-21 21:25, Kalle Valo wrote:
> 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.
Thanks for the fixes Kalle. It looks fine and tested the same.
Regards,
Seevalamuthu M
next prev parent reply other threads:[~2021-09-22 15:53 UTC|newest]
Thread overview: 24+ 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 ` Jouni Malinen
2021-07-21 16:20 ` [PATCH 1/3] ath11k: move static function ath11k_mac_vdev_setup_sync to top Jouni Malinen
2021-07-21 16:20 ` Jouni Malinen
2021-09-24 11:34 ` Kalle Valo
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-07-21 16:20 ` Jouni Malinen
2021-09-21 13:26 ` Kalle Valo
2021-09-21 13:26 ` Kalle Valo
2021-09-21 15:55 ` Kalle Valo
2021-09-21 15:55 ` Kalle Valo
2021-09-22 15:53 ` Seevalamuthu Mariappan [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-07-21 16:20 ` Jouni Malinen
2021-09-16 9:35 ` Kalle Valo
2021-09-16 9:35 ` Kalle Valo
2021-09-16 9:38 ` Kalle Valo
2021-09-16 9:38 ` Kalle Valo
2021-09-21 12:14 ` Kalle Valo
2021-09-21 12:14 ` Kalle Valo
2021-09-21 13:42 ` 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=58b100804acf0afc1c8baf4840ed65d8@codeaurora.org \
--to=seevalam@codeaurora.org \
--cc=ath11k@lists.infradead.org \
--cc=jouni@codeaurora.org \
--cc=kvalo@codeaurora.org \
--cc=linux-wireless@vger.kernel.org \
--cc=milehu@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.