* [PATCH v2 0/2] ath10k: detect hw1.0 boards
@ 2013-09-01 8:22 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-01 8:22 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
Here's a patchset which detects hw1.0 from the
chip id register and fails the probe if found.
v2:
o use SOC_CHIP_ID_REV_MASK
o move detection to core.c so that it's not just PCI
specific
o add debugfs file for reading the chip id
---
Kalle Valo (2):
ath10k: check chip id from the soc register during probe
ath10k: add chip_id file to debugfs
drivers/net/wireless/ath/ath10k/core.c | 35 ++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/core.h | 3 ++-
drivers/net/wireless/ath/ath10k/debug.c | 22 +++++++++++++++++++
drivers/net/wireless/ath/ath10k/hw.h | 8 +++++++
drivers/net/wireless/ath/ath10k/pci.c | 15 ++++++++++++-
5 files changed, 79 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 14+ messages in thread* [PATCH v2 1/2] ath10k: check chip id from the soc register during probe
2013-09-01 8:22 ` Kalle Valo
@ 2013-09-01 8:22 ` Kalle Valo
-1 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-01 8:22 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
hw1.0 boards anyway. But without hw1.0 workarounds in place
ath10k just crashes horribly.
To avoid using hw1.0 boards at all add a chip id detection
and fail the probe if hw1.0 is detected:
[ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
[ 5265.786497] ath10k: Unsupported chip id 0x043202ff
[ 5265.786574] ath10k: could not register driver core (-95)
[ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95
Also add a warning if there's an unknown chip id but continue
the boot process normally anyway.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 35 +++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/core.h | 3 ++-
drivers/net/wireless/ath/ath10k/hw.h | 8 +++++++
drivers/net/wireless/ath/ath10k/pci.c | 15 ++++++++++++--
4 files changed, 57 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 04c132e..2dd39a8 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -706,10 +706,43 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
return 0;
}
-int ath10k_core_register(struct ath10k *ar)
+static int ath10k_core_check_chip_id(struct ath10k *ar)
+{
+ u32 hw_revision = MS(ar->chip_id, SOC_CHIP_ID_REV);
+
+ /* Check that we are not using hw1.0 (some of them have same pci id
+ * as hw2.0) before doing anything else as ath10k crashes horribly
+ * due to missing hw1.0 workarounds. */
+ switch (hw_revision) {
+ case QCA988X_HW_1_0_CHIP_ID_REV:
+ ath10k_err("ERROR: qca988x hw1.0 is not supported\n");
+ return -EOPNOTSUPP;
+
+ case QCA988X_HW_2_0_CHIP_ID_REV:
+ /* known hardware revision, continue normally */
+ return 0;
+
+ default:
+ ath10k_warn("Warning: hardware revision unknown (0x%x), expect problems\n",
+ ar->chip_id);
+ return 0;
+ }
+
+ return 0;
+}
+
+int ath10k_core_register(struct ath10k *ar, u32 chip_id)
{
int status;
+ ar->chip_id = chip_id;
+
+ status = ath10k_core_check_chip_id(ar);
+ if (status) {
+ ath10k_err("Unsupported chip id 0x%08x\n", ar->chip_id);
+ return status;
+ }
+
status = ath10k_core_probe_fw(ar);
if (status) {
ath10k_err("could not probe fw (%d)\n", status);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index ab05c4c..174c4b4 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -284,6 +284,7 @@ struct ath10k {
struct device *dev;
u8 mac_addr[ETH_ALEN];
+ u32 chip_id;
u32 target_version;
u8 fw_version_major;
u32 fw_version_minor;
@@ -403,7 +404,7 @@ void ath10k_core_destroy(struct ath10k *ar);
int ath10k_core_start(struct ath10k *ar);
void ath10k_core_stop(struct ath10k *ar);
-int ath10k_core_register(struct ath10k *ar);
+int ath10k_core_register(struct ath10k *ar, u32 chip_id);
void ath10k_core_unregister(struct ath10k *ar);
#endif /* _CORE_H_ */
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 5708888..643f0c9 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -26,8 +26,12 @@
#define SUPPORTED_FW_RELEASE 0
#define SUPPORTED_FW_BUILD 636
+/* QCA988X 1.0 definitions (unsupported) */
+#define QCA988X_HW_1_0_CHIP_ID_REV 0x0
+
/* QCA988X 2.0 definitions */
#define QCA988X_HW_2_0_VERSION 0x4100016c
+#define QCA988X_HW_2_0_CHIP_ID_REV 0x2
#define QCA988X_HW_2_0_FW_DIR "ath10k/QCA988X/hw2.0"
#define QCA988X_HW_2_0_FW_FILE "firmware.bin"
#define QCA988X_HW_2_0_OTP_FILE "otp.bin"
@@ -164,6 +168,10 @@ enum ath10k_mcast2ucast_mode {
#define SOC_LPO_CAL_ENABLE_LSB 20
#define SOC_LPO_CAL_ENABLE_MASK 0x00100000
+#define SOC_CHIP_ID_ADDRESS 0x000000ec
+#define SOC_CHIP_ID_REV_LSB 8
+#define SOC_CHIP_ID_REV_MASK 0x00000f00
+
#define WLAN_RESET_CONTROL_COLD_RST_MASK 0x00000008
#define WLAN_RESET_CONTROL_WARM_RST_MASK 0x00000004
#define WLAN_SYSTEM_SLEEP_DISABLE_LSB 0
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 29ccd04..622901d 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2390,7 +2390,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
int ret = 0;
struct ath10k *ar;
struct ath10k_pci *ar_pci;
- u32 lcr_val;
+ u32 lcr_val, chip_id;
ath10k_dbg(ATH10K_DBG_PCI, "%s\n", __func__);
@@ -2492,7 +2492,18 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
spin_lock_init(&ar_pci->ce_lock);
- ret = ath10k_core_register(ar);
+ ret = ath10k_do_pci_wake(ar);
+ if (ret) {
+ ath10k_err("Failed to get chip id: %d\n", ret);
+ return ret;
+ }
+
+ chip_id = ath10k_pci_read32(ar,
+ RTC_SOC_BASE_ADDRESS + SOC_CHIP_ID_ADDRESS);
+
+ ath10k_do_pci_sleep(ar);
+
+ ret = ath10k_core_register(ar, chip_id);
if (ret) {
ath10k_err("could not register driver core (%d)\n", ret);
goto err_iomap;
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v2 1/2] ath10k: check chip id from the soc register during probe
@ 2013-09-01 8:22 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-01 8:22 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
hw1.0 boards anyway. But without hw1.0 workarounds in place
ath10k just crashes horribly.
To avoid using hw1.0 boards at all add a chip id detection
and fail the probe if hw1.0 is detected:
[ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
[ 5265.786497] ath10k: Unsupported chip id 0x043202ff
[ 5265.786574] ath10k: could not register driver core (-95)
[ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95
Also add a warning if there's an unknown chip id but continue
the boot process normally anyway.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/core.c | 35 +++++++++++++++++++++++++++++++-
drivers/net/wireless/ath/ath10k/core.h | 3 ++-
drivers/net/wireless/ath/ath10k/hw.h | 8 +++++++
drivers/net/wireless/ath/ath10k/pci.c | 15 ++++++++++++--
4 files changed, 57 insertions(+), 4 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
index 04c132e..2dd39a8 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
@@ -706,10 +706,43 @@ static int ath10k_core_probe_fw(struct ath10k *ar)
return 0;
}
-int ath10k_core_register(struct ath10k *ar)
+static int ath10k_core_check_chip_id(struct ath10k *ar)
+{
+ u32 hw_revision = MS(ar->chip_id, SOC_CHIP_ID_REV);
+
+ /* Check that we are not using hw1.0 (some of them have same pci id
+ * as hw2.0) before doing anything else as ath10k crashes horribly
+ * due to missing hw1.0 workarounds. */
+ switch (hw_revision) {
+ case QCA988X_HW_1_0_CHIP_ID_REV:
+ ath10k_err("ERROR: qca988x hw1.0 is not supported\n");
+ return -EOPNOTSUPP;
+
+ case QCA988X_HW_2_0_CHIP_ID_REV:
+ /* known hardware revision, continue normally */
+ return 0;
+
+ default:
+ ath10k_warn("Warning: hardware revision unknown (0x%x), expect problems\n",
+ ar->chip_id);
+ return 0;
+ }
+
+ return 0;
+}
+
+int ath10k_core_register(struct ath10k *ar, u32 chip_id)
{
int status;
+ ar->chip_id = chip_id;
+
+ status = ath10k_core_check_chip_id(ar);
+ if (status) {
+ ath10k_err("Unsupported chip id 0x%08x\n", ar->chip_id);
+ return status;
+ }
+
status = ath10k_core_probe_fw(ar);
if (status) {
ath10k_err("could not probe fw (%d)\n", status);
diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
index ab05c4c..174c4b4 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
@@ -284,6 +284,7 @@ struct ath10k {
struct device *dev;
u8 mac_addr[ETH_ALEN];
+ u32 chip_id;
u32 target_version;
u8 fw_version_major;
u32 fw_version_minor;
@@ -403,7 +404,7 @@ void ath10k_core_destroy(struct ath10k *ar);
int ath10k_core_start(struct ath10k *ar);
void ath10k_core_stop(struct ath10k *ar);
-int ath10k_core_register(struct ath10k *ar);
+int ath10k_core_register(struct ath10k *ar, u32 chip_id);
void ath10k_core_unregister(struct ath10k *ar);
#endif /* _CORE_H_ */
diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
index 5708888..643f0c9 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
@@ -26,8 +26,12 @@
#define SUPPORTED_FW_RELEASE 0
#define SUPPORTED_FW_BUILD 636
+/* QCA988X 1.0 definitions (unsupported) */
+#define QCA988X_HW_1_0_CHIP_ID_REV 0x0
+
/* QCA988X 2.0 definitions */
#define QCA988X_HW_2_0_VERSION 0x4100016c
+#define QCA988X_HW_2_0_CHIP_ID_REV 0x2
#define QCA988X_HW_2_0_FW_DIR "ath10k/QCA988X/hw2.0"
#define QCA988X_HW_2_0_FW_FILE "firmware.bin"
#define QCA988X_HW_2_0_OTP_FILE "otp.bin"
@@ -164,6 +168,10 @@ enum ath10k_mcast2ucast_mode {
#define SOC_LPO_CAL_ENABLE_LSB 20
#define SOC_LPO_CAL_ENABLE_MASK 0x00100000
+#define SOC_CHIP_ID_ADDRESS 0x000000ec
+#define SOC_CHIP_ID_REV_LSB 8
+#define SOC_CHIP_ID_REV_MASK 0x00000f00
+
#define WLAN_RESET_CONTROL_COLD_RST_MASK 0x00000008
#define WLAN_RESET_CONTROL_WARM_RST_MASK 0x00000004
#define WLAN_SYSTEM_SLEEP_DISABLE_LSB 0
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 29ccd04..622901d 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2390,7 +2390,7 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
int ret = 0;
struct ath10k *ar;
struct ath10k_pci *ar_pci;
- u32 lcr_val;
+ u32 lcr_val, chip_id;
ath10k_dbg(ATH10K_DBG_PCI, "%s\n", __func__);
@@ -2492,7 +2492,18 @@ static int ath10k_pci_probe(struct pci_dev *pdev,
spin_lock_init(&ar_pci->ce_lock);
- ret = ath10k_core_register(ar);
+ ret = ath10k_do_pci_wake(ar);
+ if (ret) {
+ ath10k_err("Failed to get chip id: %d\n", ret);
+ return ret;
+ }
+
+ chip_id = ath10k_pci_read32(ar,
+ RTC_SOC_BASE_ADDRESS + SOC_CHIP_ID_ADDRESS);
+
+ ath10k_do_pci_sleep(ar);
+
+ ret = ath10k_core_register(ar, chip_id);
if (ret) {
ath10k_err("could not register driver core (%d)\n", ret);
goto err_iomap;
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH v2 1/2] ath10k: check chip id from the soc register during probe
2013-09-01 8:22 ` Kalle Valo
@ 2013-09-01 15:48 ` Christian Lamparter
-1 siblings, 0 replies; 14+ messages in thread
From: Christian Lamparter @ 2013-09-01 15:48 UTC (permalink / raw)
To: ath10k; +Cc: Kalle Valo, linux-wireless
On Sunday 01 September 2013 10:22:14 Kalle Valo wrote:
> ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
> the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
> hw1.0 boards anyway. But without hw1.0 workarounds in place
> ath10k just crashes horribly.
>
> To avoid using hw1.0 boards at all add a chip id detection
> and fail the probe if hw1.0 is detected:
>
> [ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
> [ 5265.786497] ath10k: Unsupported chip id 0x043202ff
Wait a second... Isn't "0x043202ff" the id for v2.0?
Shouldn't this have worked?
> [ 5265.786574] ath10k: could not register driver core (-95)
> [ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95
>
> Also add a warning if there's an unknown chip id but continue
> the boot process normally anyway.
>
[22217.940000] ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[22217.950000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
[22217.960000] ath10k: ERROR: qca988x hw1.0 is not supported
[22217.960000] ath10k: Unsupported chip id 0x043200ff
[22217.970000] ath10k: could not register driver core (-122)
[22217.970000] ath10k_pci: probe of 0000:01:00.0 failed with error -122
[ Ok. Although I wonder why the error code is -122 (-EDQUOT) and
not -95 (-EOPNOTSUPP)?! Anyway, it still works. However I'm
looking forward to run some more tests, but first I'll need
to get that 2.0 hw ;-) ].
Tested-by: Christian Lamparter <chunkeey@googlemail.com>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Regards,
Chr
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] ath10k: check chip id from the soc register during probe
@ 2013-09-01 15:48 ` Christian Lamparter
0 siblings, 0 replies; 14+ messages in thread
From: Christian Lamparter @ 2013-09-01 15:48 UTC (permalink / raw)
To: ath10k; +Cc: Kalle Valo, linux-wireless
On Sunday 01 September 2013 10:22:14 Kalle Valo wrote:
> ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
> the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
> hw1.0 boards anyway. But without hw1.0 workarounds in place
> ath10k just crashes horribly.
>
> To avoid using hw1.0 boards at all add a chip id detection
> and fail the probe if hw1.0 is detected:
>
> [ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
> [ 5265.786497] ath10k: Unsupported chip id 0x043202ff
Wait a second... Isn't "0x043202ff" the id for v2.0?
Shouldn't this have worked?
> [ 5265.786574] ath10k: could not register driver core (-95)
> [ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95
>
> Also add a warning if there's an unknown chip id but continue
> the boot process normally anyway.
>
[22217.940000] ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
[22217.950000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
[22217.960000] ath10k: ERROR: qca988x hw1.0 is not supported
[22217.960000] ath10k: Unsupported chip id 0x043200ff
[22217.970000] ath10k: could not register driver core (-122)
[22217.970000] ath10k_pci: probe of 0000:01:00.0 failed with error -122
[ Ok. Although I wonder why the error code is -122 (-EDQUOT) and
not -95 (-EOPNOTSUPP)?! Anyway, it still works. However I'm
looking forward to run some more tests, but first I'll need
to get that 2.0 hw ;-) ].
Tested-by: Christian Lamparter <chunkeey@googlemail.com>
> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Regards,
Chr
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] ath10k: check chip id from the soc register during probe
2013-09-01 15:48 ` Christian Lamparter
@ 2013-09-02 4:38 ` Kalle Valo
-1 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-02 4:38 UTC (permalink / raw)
To: Christian Lamparter; +Cc: linux-wireless, ath10k
Christian Lamparter <chunkeey@googlemail.com> writes:
> On Sunday 01 September 2013 10:22:14 Kalle Valo wrote:
>> ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
>> the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
>> hw1.0 boards anyway. But without hw1.0 workarounds in place
>> ath10k just crashes horribly.
>>
>> To avoid using hw1.0 boards at all add a chip id detection
>> and fail the probe if hw1.0 is detected:
>>
>> [ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
>> [ 5265.786497] ath10k: Unsupported chip id 0x043202ff
>
> Wait a second... Isn't "0x043202ff" the id for v2.0?
> Shouldn't this have worked?
Hehe, you catched me cheating now :)
Yesterday I was too lazy to switch to the v1 board I have, so I just
temporarily switched id definitions in hw.h but then forgot the hack
while copying the "screenshot". I'll change this in the commit log to
0x043000ff which it should have been. Good catch!
>
>> [ 5265.786574] ath10k: could not register driver core (-95)
>> [ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95
>>
>> Also add a warning if there's an unknown chip id but continue
>> the boot process normally anyway.
>>
>
> [22217.940000] ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
> [22217.950000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
> [22217.960000] ath10k: ERROR: qca988x hw1.0 is not supported
> [22217.960000] ath10k: Unsupported chip id 0x043200ff
> [22217.970000] ath10k: could not register driver core (-122)
> [22217.970000] ath10k_pci: probe of 0000:01:00.0 failed with error -122
>
> [ Ok. Although I wonder why the error code is -122 (-EDQUOT) and
> not -95 (-EOPNOTSUPP)?!
That is odd. I just rerun this (with the hw1.0 <-> hw2.0 id hack) and I
got the -95 error code. No idea what happened before.
So I will change the screenshot in commit log to this:
[ 90.939484] ath10k: ERROR: qca988x hw1.0 is not supported
[ 90.939663] ath10k: Unsupported chip id 0x043200ff
[ 90.939818] ath10k: could not register driver core (-95)
[ 90.952324] ath10k_pci: probe of 0000:02:00.0 failed with error -95
> Anyway, it still works. However I'm looking forward to run some more
> tests, but first I'll need to get that 2.0 hw ;-) ].
Indeed!
> Tested-by: Christian Lamparter <chunkeey@googlemail.com>
Thanks, I'll add that.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] ath10k: check chip id from the soc register during probe
@ 2013-09-02 4:38 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-02 4:38 UTC (permalink / raw)
To: Christian Lamparter; +Cc: ath10k, linux-wireless
Christian Lamparter <chunkeey@googlemail.com> writes:
> On Sunday 01 September 2013 10:22:14 Kalle Valo wrote:
>> ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
>> the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
>> hw1.0 boards anyway. But without hw1.0 workarounds in place
>> ath10k just crashes horribly.
>>
>> To avoid using hw1.0 boards at all add a chip id detection
>> and fail the probe if hw1.0 is detected:
>>
>> [ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
>> [ 5265.786497] ath10k: Unsupported chip id 0x043202ff
>
> Wait a second... Isn't "0x043202ff" the id for v2.0?
> Shouldn't this have worked?
Hehe, you catched me cheating now :)
Yesterday I was too lazy to switch to the v1 board I have, so I just
temporarily switched id definitions in hw.h but then forgot the hack
while copying the "screenshot". I'll change this in the commit log to
0x043000ff which it should have been. Good catch!
>
>> [ 5265.786574] ath10k: could not register driver core (-95)
>> [ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95
>>
>> Also add a warning if there's an unknown chip id but continue
>> the boot process normally anyway.
>>
>
> [22217.940000] ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
> [22217.950000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
> [22217.960000] ath10k: ERROR: qca988x hw1.0 is not supported
> [22217.960000] ath10k: Unsupported chip id 0x043200ff
> [22217.970000] ath10k: could not register driver core (-122)
> [22217.970000] ath10k_pci: probe of 0000:01:00.0 failed with error -122
>
> [ Ok. Although I wonder why the error code is -122 (-EDQUOT) and
> not -95 (-EOPNOTSUPP)?!
That is odd. I just rerun this (with the hw1.0 <-> hw2.0 id hack) and I
got the -95 error code. No idea what happened before.
So I will change the screenshot in commit log to this:
[ 90.939484] ath10k: ERROR: qca988x hw1.0 is not supported
[ 90.939663] ath10k: Unsupported chip id 0x043200ff
[ 90.939818] ath10k: could not register driver core (-95)
[ 90.952324] ath10k_pci: probe of 0000:02:00.0 failed with error -95
> Anyway, it still works. However I'm looking forward to run some more
> tests, but first I'll need to get that 2.0 hw ;-) ].
Indeed!
> Tested-by: Christian Lamparter <chunkeey@googlemail.com>
Thanks, I'll add that.
--
Kalle Valo
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 1/2] ath10k: check chip id from the soc register during probe
2013-09-02 4:38 ` Kalle Valo
(?)
@ 2013-09-03 3:55 ` Zaki
2013-09-03 4:35 ` Kalle Valo
-1 siblings, 1 reply; 14+ messages in thread
From: Zaki @ 2013-09-03 3:55 UTC (permalink / raw)
To: Kalle Valo; +Cc: ath10k
Hi Kalle,
Sorry, i was out of town for last few days. Tested and confirmed that
on my setup with HW1.0, no more crash happened with your patch.
Rgds,
Zaki.
On Mon, Sep 2, 2013 at 12:38 PM, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Christian Lamparter <chunkeey@googlemail.com> writes:
>
>> On Sunday 01 September 2013 10:22:14 Kalle Valo wrote:
>>> ath10k doesn't support qca988x hw1.0 boards anymore. Unfortunately
>>> the PCI id is the same in hw1.0 and hw2.0 so ath10k tries to use
>>> hw1.0 boards anyway. But without hw1.0 workarounds in place
>>> ath10k just crashes horribly.
>>>
>>> To avoid using hw1.0 boards at all add a chip id detection
>>> and fail the probe if hw1.0 is detected:
>>>
>>> [ 5265.786408] ath10k: ERROR: qca988x hw1.0 is not supported
>>> [ 5265.786497] ath10k: Unsupported chip id 0x043202ff
>>
>> Wait a second... Isn't "0x043202ff" the id for v2.0?
>> Shouldn't this have worked?
>
> Hehe, you catched me cheating now :)
>
> Yesterday I was too lazy to switch to the v1 board I have, so I just
> temporarily switched id definitions in hw.h but then forgot the hack
> while copying the "screenshot". I'll change this in the commit log to
> 0x043000ff which it should have been. Good catch!
>
>>
>>> [ 5265.786574] ath10k: could not register driver core (-95)
>>> [ 5265.793191] ath10k_pci: probe of 0000:02:00.0 failed with error -95
>>>
>>> Also add a warning if there's an unknown chip id but continue
>>> the boot process normally anyway.
>>>
>>
>> [22217.940000] ath10k_pci 0000:01:00.0: BAR 0: assigned [mem 0x12000000-0x121fffff 64bit]
>> [22217.950000] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
>> [22217.960000] ath10k: ERROR: qca988x hw1.0 is not supported
>> [22217.960000] ath10k: Unsupported chip id 0x043200ff
>> [22217.970000] ath10k: could not register driver core (-122)
>> [22217.970000] ath10k_pci: probe of 0000:01:00.0 failed with error -122
>>
>> [ Ok. Although I wonder why the error code is -122 (-EDQUOT) and
>> not -95 (-EOPNOTSUPP)?!
>
> That is odd. I just rerun this (with the hw1.0 <-> hw2.0 id hack) and I
> got the -95 error code. No idea what happened before.
>
> So I will change the screenshot in commit log to this:
>
> [ 90.939484] ath10k: ERROR: qca988x hw1.0 is not supported
> [ 90.939663] ath10k: Unsupported chip id 0x043200ff
> [ 90.939818] ath10k: could not register driver core (-95)
> [ 90.952324] ath10k_pci: probe of 0000:02:00.0 failed with error -95
>
>> Anyway, it still works. However I'm looking forward to run some more
>> tests, but first I'll need to get that 2.0 hw ;-) ].
>
> Indeed!
>
>> Tested-by: Christian Lamparter <chunkeey@googlemail.com>
>
> Thanks, I'll add that.
>
> --
> Kalle Valo
>
> _______________________________________________
> ath10k mailing list
> ath10k@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/ath10k
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH v2 2/2] ath10k: add chip_id file to debugfs
2013-09-01 8:22 ` Kalle Valo
@ 2013-09-01 8:22 ` Kalle Valo
-1 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-01 8:22 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
So that's it's possible to query chip id from ath10k anytime.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/debug.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index fcb40cc..09f535a 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -498,6 +498,25 @@ static const struct file_operations fops_simulate_fw_crash = {
.llseek = default_llseek,
};
+static ssize_t ath10k_read_chip_id(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath10k *ar = file->private_data;
+ unsigned int len;
+ char buf[50];
+
+ len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->chip_id);
+
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static const struct file_operations fops_chip_id = {
+ .read = ath10k_read_chip_id,
+ .open = simple_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
int ath10k_debug_create(struct ath10k *ar)
{
ar->debug.debugfs_phy = debugfs_create_dir("ath10k",
@@ -517,6 +536,9 @@ int ath10k_debug_create(struct ath10k *ar)
debugfs_create_file("simulate_fw_crash", S_IRUSR, ar->debug.debugfs_phy,
ar, &fops_simulate_fw_crash);
+ debugfs_create_file("chip_id", S_IRUSR, ar->debug.debugfs_phy,
+ ar, &fops_chip_id);
+
return 0;
}
#endif /* CONFIG_ATH10K_DEBUGFS */
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH v2 2/2] ath10k: add chip_id file to debugfs
@ 2013-09-01 8:22 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-01 8:22 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
So that's it's possible to query chip id from ath10k anytime.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
---
drivers/net/wireless/ath/ath10k/debug.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/debug.c b/drivers/net/wireless/ath/ath10k/debug.c
index fcb40cc..09f535a 100644
--- a/drivers/net/wireless/ath/ath10k/debug.c
+++ b/drivers/net/wireless/ath/ath10k/debug.c
@@ -498,6 +498,25 @@ static const struct file_operations fops_simulate_fw_crash = {
.llseek = default_llseek,
};
+static ssize_t ath10k_read_chip_id(struct file *file, char __user *user_buf,
+ size_t count, loff_t *ppos)
+{
+ struct ath10k *ar = file->private_data;
+ unsigned int len;
+ char buf[50];
+
+ len = scnprintf(buf, sizeof(buf), "0x%08x\n", ar->chip_id);
+
+ return simple_read_from_buffer(user_buf, count, ppos, buf, len);
+}
+
+static const struct file_operations fops_chip_id = {
+ .read = ath10k_read_chip_id,
+ .open = simple_open,
+ .owner = THIS_MODULE,
+ .llseek = default_llseek,
+};
+
int ath10k_debug_create(struct ath10k *ar)
{
ar->debug.debugfs_phy = debugfs_create_dir("ath10k",
@@ -517,6 +536,9 @@ int ath10k_debug_create(struct ath10k *ar)
debugfs_create_file("simulate_fw_crash", S_IRUSR, ar->debug.debugfs_phy,
ar, &fops_simulate_fw_crash);
+ debugfs_create_file("chip_id", S_IRUSR, ar->debug.debugfs_phy,
+ ar, &fops_chip_id);
+
return 0;
}
#endif /* CONFIG_ATH10K_DEBUGFS */
^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH v2 0/2] ath10k: detect hw1.0 boards
2013-09-01 8:22 ` Kalle Valo
@ 2013-09-03 7:00 ` Kalle Valo
-1 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-03 7:00 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> Here's a patchset which detects hw1.0 from the
> chip id register and fails the probe if found.
>
> v2:
>
> o use SOC_CHIP_ID_REV_MASK
>
> o move detection to core.c so that it's not just PCI
> specific
>
> o add debugfs file for reading the chip id
>
> ---
>
> Kalle Valo (2):
> ath10k: check chip id from the soc register during probe
> ath10k: add chip_id file to debugfs
Both patches applied, but I fixed the commit log in patch 1 based on the
discussion.
--
Kalle Valo
_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH v2 0/2] ath10k: detect hw1.0 boards
@ 2013-09-03 7:00 ` Kalle Valo
0 siblings, 0 replies; 14+ messages in thread
From: Kalle Valo @ 2013-09-03 7:00 UTC (permalink / raw)
To: ath10k; +Cc: linux-wireless
Kalle Valo <kvalo@qca.qualcomm.com> writes:
> Here's a patchset which detects hw1.0 from the
> chip id register and fails the probe if found.
>
> v2:
>
> o use SOC_CHIP_ID_REV_MASK
>
> o move detection to core.c so that it's not just PCI
> specific
>
> o add debugfs file for reading the chip id
>
> ---
>
> Kalle Valo (2):
> ath10k: check chip id from the soc register during probe
> ath10k: add chip_id file to debugfs
Both patches applied, but I fixed the commit log in patch 1 based on the
discussion.
--
Kalle Valo
^ permalink raw reply [flat|nested] 14+ messages in thread