ATH11K Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: ath11k@lists.infradead.org, kvalo@codeaurora.org
Subject: IPQ807x: No regulatory rules available in the event info
Date: Wed, 21 Oct 2020 17:51:07 +0200	[thread overview]
Message-ID: <3358088.zmNjgFgxhd@ripper> (raw)


[-- Attachment #1.1.1: Type: text/plain, Size: 3599 bytes --]

Hi,

I've just tried QC_IMAGE_VERSION_STRING=WLAN.HK.2.4.0.1.r1-00026-
QCAHKSWPL_SILICONZ-2 on IPQ8074. The board.bin I am loading *has the 
regulatory domain information* included. This worked fine in the past but now 
I get following when I am trying to change the regulatory from US to CA (or 
DE):

    ath11k c000000.wifi1: No regulatory rules available in the event info
    ath11k c000000.wifi1: failed to extract regulatory info from received event

The data which is send down to the device via WMI_SET_INIT_COUNTRY_CMDID is:

    00000000: 0c 00 87 02 02 00 00 00 00 00 00 00 43 41 00 00

Interestingly, this works fine with QC_IMAGE_VERSION_STRING=WLAN.HK.
2.1.0.1-01228-QCAHKSWPL_SILICONZ-1


The skb->data I get in ath11k_pull_reg_chan_list_update_ev is with WLAN.HK.
2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2 (fails) is:

    00000000: 38 00 61 02 01 00 00 00 01 00 00 00 43 41 00 00
    00000010: 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000020: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 00

and with WLAN.HK.2.1.0.1-01228-QCAHKSWPL_SILICONZ-1 (works):

    00000000: 38 00 61 02 00 00 00 00 00 00 00 00 43 41 00 00
    00000010: 02 00 00 00 7c 00 00 00 0f 00 00 00 01 00 00 00
    00000020: 00 00 00 00 00 00 00 00 28 00 00 00 02 00 00 00
    00000030: a0 00 00 00 01 00 00 00 05 00 00 00 60 00 12 00
    00000040: 0c 00 60 02 62 09 a8 09 28 00 1e 00 00 00 00 00
    00000050: 0c 00 60 02 1e 14 82 14 50 00 17 06 00 02 00 00
    00000060: 0c 00 60 02 82 14 e6 14 50 00 18 06 08 00 00 00
    00000070: 0c 00 60 02 5e 15 e0 15 50 00 18 06 08 00 00 00
    00000080: 0c 00 60 02 12 16 62 16 50 00 18 06 08 00 00 00
    00000090: 0c 00 60 02 67 16 cb 16 50 00 1e 06 00 00 00 00



But on bootup (when the US gets "automatically" set), I get with WLAN.HK.
2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2 (which usually fails otherwise):

     00000000: 38 00 61 02 00 00 00 00 00 00 00 00 55 53 00 00
     00000010: 02 00 00 00 48 03 00 00 3d 00 00 00 01 00 00 00
     00000020: 00 00 00 00 00 00 00 00 28 00 00 00 02 00 00 00
     00000030: a0 00 00 00 01 00 00 00 04 00 00 00 50 00 12 00
     00000040: 0c 00 60 02 62 09 a8 09 28 00 1e 06 00 00 00 00
     00000050: 0c 00 60 02 32 14 82 14 50 00 17 06 00 00 00 00
     00000060: 0c 00 60 02 82 14 d2 14 50 00 17 06 08 00 00 00
     00000070: 0c 00 60 02 72 15 62 16 a0 00 17 06 08 00 00 00
     00000080: 0c 00 60 02 67 16 cb 16 50 00 1e 06 00 00 00 00
     00000000: 38 00 61 02 00 00 00 00 01 00 00 00 55 53 00 00
     00000010: 02 00 00 00 48 03 00 00 3d 00 00 00 01 00 00 00
     00000020: 00 00 00 00 00 00 00 00 28 00 00 00 00 00 00 00
     00000030: 00 00 00 00 01 00 00 00 00 00 00 00 10 00 12 00
     00000040: 0c 00 60 02 62 09 a8 09 28 00 1e 06 00 00 00 00


Here an overview of tested firmware version:

* WLAN.HK.2.0.0.1-00043-QCAHKSWPL_SILICONZ-1: Q6 fails to boot
* WLAN.HK.2.0.0.1-00240-QCAHKSWPL_SILICONZ-1: Q6 fails to boot
* WLAN.HK.2.1.0.1-00410-QCAHKSWPL_SILICONZ-2: Q6 fails to boot
* WLAN.HK.2.1.0.1-00629-QCAHKSWPL_SILICONZ-1: Q6 fails to boot
* WLAN.HK.2.1.0.1-01161-QCAHKSWPL_SILICONZ-1: works
* WLAN.HK.2.1.0.1-01228-QCAHKSWPL_SILICONZ-1: works
* WLAN.HK.2.1.0.1-01238-QCAHKSWPL_SILICONZ-2: works
* WLAN.HK.2.4.0.1.r1-00019-QCAHKSWPL_SILICONZ-1: fails
* WLAN.HK.2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2: fails


A board.bin is attached which causes the problem. It is just the 
bus=ahb,qmi-chip-id=0,qmi-board-id=255.bin (from IPQ8074/hw2.0/board-2.bin) 
with the REGULATORY_DB_SECTION.regDbFlag set to 1 and the regdb included.

Kind regards,
	Sven

[-- Attachment #1.1.2: board.bin --]
[-- Type: application/octet-stream, Size: 131072 bytes --]

[-- Attachment #1.1.3: ath11k-dbg-regdb-printk.patch --]
[-- Type: text/x-patch, Size: 3515 bytes --]

diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c
index 772da6d..f49e5d6 100644
--- a/drivers/net/wireless/ath/ath11k/reg.c
+++ b/drivers/net/wireless/ath/ath11k/reg.c
@@ -63,24 +64,29 @@ ath11k_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
 		return;
 	}
 
+	printk("%s:%u\n", __func__, __LINE__);
 	if (!IS_ENABLED(CPTCFG_ATH_REG_DYNAMIC_USER_REG_HINTS)) {
 		ath11k_dbg(ar->ab, ATH11K_DBG_REG,
 			   "Country Setting is not allowed\n");
 		return;
 	}
 
+	printk("%s:%u\n", __func__, __LINE__);
 	if (!ath11k_regdom_changes(ar, request->alpha2)) {
 		ath11k_dbg(ar->ab, ATH11K_DBG_REG, "Country is already set\n");
 		return;
 	}
 
+	printk("%s:%u\n", __func__, __LINE__);
 	/* Set the country code to the firmware and wait for
 	 * the WMI_REG_CHAN_LIST_CC EVENT for updating the
 	 * reg info
 	 */
 	init_country_param.flags = ALPHA_IS_SET;
 	memcpy(&init_country_param.cc_info.alpha2, request->alpha2, 2);
+	init_country_param.cc_info.alpha2[2] = 0;
 
+	printk("%s:%u\n", __func__, __LINE__);
 	ret = ath11k_wmi_send_init_country_cmd(ar, init_country_param);
 	if (ret)
 		ath11k_warn(ar->ab,
diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c
index 0762cbc..b62fed0 100644
--- a/drivers/net/wireless/ath/ath11k/wmi.c
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
@@ -3110,42 +3110,55 @@ ath11k_wmi_send_init_country_cmd(struct ath11k *ar,
 	struct sk_buff *skb;
 	int ret;
 
+	printk("%s:%u\n", __func__, __LINE__);
 	skb = ath11k_wmi_alloc_skb(wmi->wmi_ab, sizeof(*cmd));
 	if (!skb)
 		return -ENOMEM;
 
+	printk("%s:%u\n", __func__, __LINE__);
 	cmd = (struct wmi_init_country_cmd *)skb->data;
 	cmd->tlv_header =
 		FIELD_PREP(WMI_TLV_TAG,
 			   WMI_TAG_SET_INIT_COUNTRY_CMD) |
 		FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
 
+	printk("%s:%u\n", __func__, __LINE__);
 	cmd->pdev_id = ar->pdev->pdev_id;
 
+	printk("%s:%u\n", __func__, __LINE__);
 	switch (init_cc_params.flags) {
 	case ALPHA_IS_SET:
 		cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_ALPHA;
 		memcpy((u8 *)&cmd->cc_info.alpha2,
 		       init_cc_params.cc_info.alpha2, 3);
+	printk("%s:%u %s\n", __func__, __LINE__, init_cc_params.cc_info.alpha2);
 		break;
 	case CC_IS_SET:
+	printk("%s:%u\n", __func__, __LINE__);
 		cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_COUNTRY_CODE;
 		cmd->cc_info.country_code = init_cc_params.cc_info.country_code;
 		break;
 	case REGDMN_IS_SET:
+	printk("%s:%u\n", __func__, __LINE__);
 		cmd->init_cc_type = WMI_COUNTRY_INFO_TYPE_REGDOMAIN;
 		cmd->cc_info.regdom_id = init_cc_params.cc_info.regdom_id;
 		break;
 	default:
+	printk("%s:%u\n", __func__, __LINE__);
 		ret = -EINVAL;
 		goto out;
 	}
 
+	print_hex_dump(KERN_CRIT, "", DUMP_PREFIX_OFFSET,
+			16, 1, cmd, sizeof(*cmd), false);
+	printk("%s:%u\n", __func__, __LINE__);
 	ret = ath11k_wmi_cmd_send(wmi, skb,
 				  WMI_SET_INIT_COUNTRY_CMDID);
 
+	printk("%s:%u\n", __func__, __LINE__);
 out:
 	if (ret) {
+	printk("%s:%u\n", __func__, __LINE__);
 		ath11k_warn(ar->ab,
 			    "failed to send WMI_SET_INIT_COUNTRY CMD :%d\n",
 			    ret);
@@ -4551,7 +4564,8 @@ static int ath11k_pull_reg_chan_list_update_ev(struct ath11k_base *ab,
 	int ret;
 
 	ath11k_dbg(ab, ATH11K_DBG_WMI, "processing regulatory channel list\n");
-
+	print_hex_dump(KERN_CRIT, "", DUMP_PREFIX_OFFSET,
+			16, 1, skb->data, skb->len, false);
 	tb = ath11k_wmi_tlv_parse_alloc(ab, skb->data, skb->len, GFP_ATOMIC);
 	if (IS_ERR(tb)) {
 		ret = PTR_ERR(tb);

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 102 bytes --]

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

             reply	other threads:[~2020-10-21 15:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21 15:51 Sven Eckelmann [this message]
2020-10-21 17:45 ` IPQ807x: No regulatory rules available in the event info Sven Eckelmann

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=3358088.zmNjgFgxhd@ripper \
    --to=sven@narfation.org \
    --cc=ath11k@lists.infradead.org \
    --cc=kvalo@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