* [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready
@ 2025-05-22 20:01 Rodrigo Gobbi
2025-05-23 5:05 ` Baochen Qiang
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Rodrigo Gobbi @ 2025-05-22 20:01 UTC (permalink / raw)
To: jjohnson; +Cc: ~lkcamp/patches, linux-wireless, ath11k, linux-kernel
if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW),
ath11k_core_qmi_firmware_ready() will not undo some actions that was previously
started/configured. Do the validation as soon as possible in order to avoid
undoing actions in that case and also to fix the following smatch warning:
drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
warn: missing unwind goto?
Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
---
Changelog:
v3: move validation to the beginning of the ath11k_core_qmi_firmware_ready(), so
we do not need to clean-up things. A small change over the commit msg due that change.
v2: https://lore.kernel.org/linux-wireless/20250515222520.4922-1-rodrigo.gobbi.7@gmail.com/#t
v1: https://lore.kernel.org/linux-wireless/20250515004258.87234-1-rodrigo.gobbi.7@gmail.com/
---
drivers/net/wireless/ath/ath11k/core.c | 28 +++++++++++++-------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 2e9f8a5e61e4..b894e27435da 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -2134,6 +2134,20 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
{
int ret;
+ switch (ath11k_crypto_mode) {
+ case ATH11K_CRYPT_MODE_SW:
+ set_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
+ set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
+ break;
+ case ATH11K_CRYPT_MODE_HW:
+ clear_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
+ clear_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
+ break;
+ default:
+ ath11k_info(ab, "invalid crypto_mode: %d\n", ath11k_crypto_mode);
+ return -EINVAL;
+ }
+
ret = ath11k_core_start_firmware(ab, ab->fw_mode);
if (ret) {
ath11k_err(ab, "failed to start firmware: %d\n", ret);
@@ -2152,20 +2166,6 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
goto err_firmware_stop;
}
- switch (ath11k_crypto_mode) {
- case ATH11K_CRYPT_MODE_SW:
- set_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
- set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
- break;
- case ATH11K_CRYPT_MODE_HW:
- clear_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
- clear_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
- break;
- default:
- ath11k_info(ab, "invalid crypto_mode: %d\n", ath11k_crypto_mode);
- return -EINVAL;
- }
-
if (ath11k_frame_mode == ATH11K_HW_TXRX_RAW)
set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
--
2.49.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready
2025-05-22 20:01 [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready Rodrigo Gobbi
@ 2025-05-23 5:05 ` Baochen Qiang
2025-06-02 18:44 ` Jeff Johnson
2025-06-07 14:44 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Baochen Qiang @ 2025-05-23 5:05 UTC (permalink / raw)
To: Rodrigo Gobbi, jjohnson
Cc: ~lkcamp/patches, linux-wireless, ath11k, linux-kernel
On 5/23/2025 4:01 AM, Rodrigo Gobbi wrote:
> if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW),
> ath11k_core_qmi_firmware_ready() will not undo some actions that was previously
> started/configured. Do the validation as soon as possible in order to avoid
> undoing actions in that case and also to fix the following smatch warning:
>
> drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
> warn: missing unwind goto?
>
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
> ---
> Changelog:
> v3: move validation to the beginning of the ath11k_core_qmi_firmware_ready(), so
> we do not need to clean-up things. A small change over the commit msg due that change.
> v2: https://lore.kernel.org/linux-wireless/20250515222520.4922-1-rodrigo.gobbi.7@gmail.com/#t
> v1: https://lore.kernel.org/linux-wireless/20250515004258.87234-1-rodrigo.gobbi.7@gmail.com/
> ---
> drivers/net/wireless/ath/ath11k/core.c | 28 +++++++++++++-------------
> 1 file changed, 14 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
> index 2e9f8a5e61e4..b894e27435da 100644
> --- a/drivers/net/wireless/ath/ath11k/core.c
> +++ b/drivers/net/wireless/ath/ath11k/core.c
> @@ -2134,6 +2134,20 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
> {
> int ret;
>
> + switch (ath11k_crypto_mode) {
> + case ATH11K_CRYPT_MODE_SW:
> + set_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
> + set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
> + break;
> + case ATH11K_CRYPT_MODE_HW:
> + clear_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
> + clear_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
> + break;
> + default:
> + ath11k_info(ab, "invalid crypto_mode: %d\n", ath11k_crypto_mode);
> + return -EINVAL;
> + }
> +
> ret = ath11k_core_start_firmware(ab, ab->fw_mode);
> if (ret) {
> ath11k_err(ab, "failed to start firmware: %d\n", ret);
> @@ -2152,20 +2166,6 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
> goto err_firmware_stop;
> }
>
> - switch (ath11k_crypto_mode) {
> - case ATH11K_CRYPT_MODE_SW:
> - set_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
> - set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
> - break;
> - case ATH11K_CRYPT_MODE_HW:
> - clear_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ab->dev_flags);
> - clear_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
> - break;
> - default:
> - ath11k_info(ab, "invalid crypto_mode: %d\n", ath11k_crypto_mode);
> - return -EINVAL;
> - }
> -
> if (ath11k_frame_mode == ATH11K_HW_TXRX_RAW)
> set_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags);
>
Reviewed-by: Baochen Qiang <quic_bqiang@quicinc.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready
2025-05-22 20:01 [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready Rodrigo Gobbi
2025-05-23 5:05 ` Baochen Qiang
@ 2025-06-02 18:44 ` Jeff Johnson
2025-06-07 14:44 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2025-06-02 18:44 UTC (permalink / raw)
To: Rodrigo Gobbi, jjohnson
Cc: ~lkcamp/patches, linux-wireless, ath11k, linux-kernel
On 5/22/2025 1:01 PM, Rodrigo Gobbi wrote:
> if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW),
> ath11k_core_qmi_firmware_ready() will not undo some actions that was previously
> started/configured. Do the validation as soon as possible in order to avoid
> undoing actions in that case and also to fix the following smatch warning:
>
> drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
> warn: missing unwind goto?
>
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
Since this issue was previously reported, I'm adding:
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Closes: https://lore.kernel.org/r/202304151955.oqAetVFd-lkp@intel.com/
Fixes: aa2092a9bab3 ("ath11k: add raw mode and software crypto support")
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready
2025-05-22 20:01 [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready Rodrigo Gobbi
2025-05-23 5:05 ` Baochen Qiang
2025-06-02 18:44 ` Jeff Johnson
@ 2025-06-07 14:44 ` Jeff Johnson
2 siblings, 0 replies; 4+ messages in thread
From: Jeff Johnson @ 2025-06-07 14:44 UTC (permalink / raw)
To: jjohnson, Rodrigo Gobbi
Cc: ~lkcamp/patches, linux-wireless, ath11k, linux-kernel
On Thu, 22 May 2025 17:01:12 -0300, Rodrigo Gobbi wrote:
> if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW),
> ath11k_core_qmi_firmware_ready() will not undo some actions that was previously
> started/configured. Do the validation as soon as possible in order to avoid
> undoing actions in that case and also to fix the following smatch warning:
>
> drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
> warn: missing unwind goto?
>
> [...]
Applied, thanks!
[1/1] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready
commit: b0d226a60856a1b765bb9a3848c7b2322fd08c47
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-06-07 14:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-22 20:01 [PATCH ath-next v3] wifi: ath11k: validate ath11k_crypto_mode on top of ath11k_core_qmi_firmware_ready Rodrigo Gobbi
2025-05-23 5:05 ` Baochen Qiang
2025-06-02 18:44 ` Jeff Johnson
2025-06-07 14:44 ` Jeff Johnson
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).