2021-10-11 07:06:00

by Baochen Qiang

[permalink] [raw]
Subject: [PATCH] ath11k: Advertise PLATFORM_CAP_PCIE_GLOBAL_RESET in qmi msg

Inform firmware that host is capable of triggering a global reset.
This is requested by firmware team.

Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1

Signed-off-by: Baochen Qiang <[email protected]>
---
drivers/net/wireless/ath/ath11k/core.c | 5 +++++
drivers/net/wireless/ath/ath11k/hw.h | 1 +
drivers/net/wireless/ath/ath11k/qmi.c | 4 ++++
3 files changed, 10 insertions(+)

diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 969bf1a590d9..5601f758a0a6 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -71,6 +71,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_suspend = false,
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
.fix_l1ss = true,
+ .global_reset = false,
},
{
.hw_rev = ATH11K_HW_IPQ6018_HW10,
@@ -112,6 +113,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_suspend = false,
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
.fix_l1ss = true,
+ .global_reset = false,
},
{
.name = "qca6390 hw2.0",
@@ -152,6 +154,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_suspend = true,
.hal_desc_sz = sizeof(struct hal_rx_desc_ipq8074),
.fix_l1ss = true,
+ .global_reset = true,
},
{
.name = "qcn9074 hw1.0",
@@ -190,6 +193,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_suspend = false,
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
.fix_l1ss = true,
+ .global_reset = false,
},
{
.name = "wcn6855 hw2.0",
@@ -230,6 +234,7 @@ static const struct ath11k_hw_params ath11k_hw_params[] = {
.supports_suspend = true,
.hal_desc_sz = sizeof(struct hal_rx_desc_wcn6855),
.fix_l1ss = false,
+ .global_reset = true,
},
};

diff --git a/drivers/net/wireless/ath/ath11k/hw.h b/drivers/net/wireless/ath/ath11k/hw.h
index 62f5978b3005..82952ef9abec 100644
--- a/drivers/net/wireless/ath/ath11k/hw.h
+++ b/drivers/net/wireless/ath/ath11k/hw.h
@@ -163,6 +163,7 @@ struct ath11k_hw_params {
bool supports_suspend;
u32 hal_desc_sz;
bool fix_l1ss;
+ bool global_reset;
};

struct ath11k_hw_ops {
diff --git a/drivers/net/wireless/ath/ath11k/qmi.c b/drivers/net/wireless/ath/ath11k/qmi.c
index b5e34d670715..16f2adb54d03 100644
--- a/drivers/net/wireless/ath/ath11k/qmi.c
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
@@ -13,6 +13,7 @@

#define SLEEP_CLOCK_SELECT_INTERNAL_BIT 0x02
#define HOST_CSTATE_BIT 0x04
+#define PLATFORM_CAP_PCIE_GLOBAL_RESET 0x08

bool ath11k_cold_boot_cal = 1;
EXPORT_SYMBOL(ath11k_cold_boot_cal);
@@ -1556,6 +1557,9 @@ static int ath11k_qmi_host_cap_send(struct ath11k_base *ab)
req.nm_modem |= SLEEP_CLOCK_SELECT_INTERNAL_BIT;
}

+ if (ab->hw_params.global_reset)
+ req.nm_modem |= PLATFORM_CAP_PCIE_GLOBAL_RESET;
+
ath11k_dbg(ab, ATH11K_DBG_QMI, "qmi host cap request\n");

ret = qmi_txn_init(&ab->qmi.handle, &txn,
--
2.25.1


2021-10-12 09:18:12

by Baochen Qiang

[permalink] [raw]
Subject: Re: [PATCH] ath11k: Advertise PLATFORM_CAP_PCIE_GLOBAL_RESET in qmi msg

On 2021-10-11 14:30, Kalle Valo wrote:
> Baochen Qiang <[email protected]> writes:
>
>> Inform firmware that host is capable of triggering a global reset.
>> This is requested by firmware team.
>
> Why?
>
> https://wireless.wiki.kernel.org/en/users/drivers/ath10k/submittingpatches#answer_to_why

In some scenarios like rmmod/insmod, HW target needs to be completely
reset. On ARM platforms we can rely on WL_EN pin and other power
regulators to do this. However on x86 or some third party platforms,
this has to be done by ath11k host by writing HW register
PCIE_SOC_GLOBAL_RESET. But the problem is that some HW registers can not
be cleared/restored. With this flag PLATFORM_CAP_PCIE_GLOBAL_RESET in
QMI host_cap message, firmware can do some platform specific operations
to fix this issue.

2022-03-21 23:09:50

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath11k: Advertise PLATFORM_CAP_PCIE_GLOBAL_RESET in qmi msg

Baochen Qiang <[email protected]> wrote:

> Inform firmware that host is capable of triggering a global reset.
> This is requested by firmware team.
>
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>
> Signed-off-by: Baochen Qiang <[email protected]>

In the pending branch I fixed the trivial conflicts and enabled this feature on
both wcn6855 hw2.0 and hw2.1.

I also now have more information what this is about so changed the commit log to:

---------------------------------------------------------------------

ath11k: enable PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability

In Qualcomm ARM platforms there is WL_EN pin and other power regulators
which can be controlled at platform side to completely reset the chip.
For most of x86 and other platforms, the chip is connected via PCIe M.2
interface, and there is no way to control WL_EN pin. Instead the host
driver needs to reset the chip via PCIE_SOC_GLOBAL_RESET hardware
register, just like ath11k does currently.

But when using PCIE_SOC_GLOBAL_RESET there are some hardware registers
which are not cleared/restored. To handle those cases we can enable
PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability to tell the firmware
to do some platform specific operations after firmware download.

This does not fix any known issues, but is recommended by the firmware
team, so enable the capability on QCA6390 and WCN6855 PCI devices. It is
currently unclear if this should be enabled also on QCN9074, so leave it
disabled for now. On AHB devices this is not needed as they don't use
PCIE_SOC_GLOBAL_RESET.

---------------------------------------------------------------------

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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

2022-03-24 14:20:07

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] ath11k: Advertise PLATFORM_CAP_PCIE_GLOBAL_RESET in qmi msg

Baochen Qiang <[email protected]> wrote:

> In Qualcomm ARM platforms there is WL_EN pin and other power regulators
> which can be controlled at platform side to completely reset the chip.
> For most of x86 and other platforms, the chip is connected via PCIe M.2
> interface, and there is no way to control WL_EN pin. Instead the host
> driver needs to reset the chip via PCIE_SOC_GLOBAL_RESET hardware
> register, just like ath11k does currently.
>
> But when using PCIE_SOC_GLOBAL_RESET there are some hardware registers
> which are not cleared/restored. To handle those cases we can enable
> PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability to tell the firmware
> to do some platform specific operations after firmware download.
>
> This does not fix any known issues, but is recommended by the firmware
> team, so enable the capability on QCA6390 and WCN6855 PCI devices. It is
> currently unclear if this should be enabled also on QCN9074, so leave it
> disabled for now. On AHB devices this is not needed as they don't use
> PCIE_SOC_GLOBAL_RESET.
>
> Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-01720.1-QCAHSPSWPL_V1_V2_SILICONZ_LITE-1
>
> Signed-off-by: Baochen Qiang <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

1e4ac7173c93 ath11k: enable PLATFORM_CAP_PCIE_GLOBAL_RESET QMI host capability

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

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