ath11k: add 64bit check before reading msi high addr
PATCH 1/1 ath11k: add 64bit check before reading msi high addr
In QCN9074 ath11k boot, firmware crash is observed in 64-bit builds and is due to wrong 64 bit MSI address size. This patch fixes the firmware crash. Read msi high addr if 64-bit addresses allowed on MSI.
Tested-On: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2
---
drivers/net/wireless/ath/ath11k/pci.c | 11 +++++++++-- drivers/net/wireless/ath/ath11k/pci.h | 1 + 2 files changed, 10 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath11k/pci.c +9 -2
@@ -264,13 +264,18 @@ int ath11k_pci_get_msi_irq(struct device *dev, unsigned int vector)static void ath11k_pci_get_msi_address (struct ath11k_base *ab,u32 *msi_addr_lo,u32 *msi_addr_hi) { +struct ath11k_pci *ar_pci =ath11k_pci_priv (ab);struct pci_dev *pci_dev =to_pci_dev (ab->dev);pci_read_config_dword (pci_dev, pci_dev->msi_cap +PCI_MSI_ADDRESS_LO , msi_addr_lo); -pci_read_config_dword (pci_dev, pci_dev->msi_cap +PCI_MSI_ADDRESS_HI , - msi_addr_hi); +if (test_bit (ATH11K_PCI_FLAG_IS_MSI_64 , &ab_pci->flags)) { +pci_read_config_dword (pci_dev, pci_dev->msi_cap +PCI_MSI_ADDRESS_HI , + msi_addr_hi); + }else { + *msi_addr_hi =0 ; + } } int ath11k_pci_get_user_msi_assignment(struct ath11k_pci *ab_pci, char *user_name,
@@ -658,6 +663,8 @@ static int ath11k_pci_enable_msi(struct ath11k_pci *ab_pci) } ab_pci->msi_ep_base_data = msi_desc->msg.data; +if (msi_desc->msi_attrib.is_64) +set_bit (ATH11K_PCI_FLAG_IS_MSI_64 , &ab_pci->flags);ath11k_dbg (ab,ATH11K_DBG_PCI ,"msi base data is %d\n" , ab_pci->msi_ep_base_data);
drivers/net/wireless/ath/ath11k/pci.h +1 -0
@@ -38,6 +38,7 @@ struct ath11k_msi_config {enum ath11k_pci_flags {ATH11K_PCI_FLAG_INIT_DONE , +ATH11K_PCI_FLAG_IS_MSI_64 , };struct ath11k_pci {
Signature · 7 lines
2.7.4 -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 8 lines · Anilkumar Kolli
In QCN9074 ath11k boot, firmware crash is observed in 64-bit builds and is due to wrong 64 bit MSI address size. This patch fixes the firmware crash. Read msi high addr if 64-bit addresses allowed on MSI.
Tested-On: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2
Signed-off-by Anilkumar Kolli <[email protected]>
Fails to build:
drivers/net/wireless/ath/ath11k/pci.c: In function 'ath11k_pci_get_msi_address':drivers/net/wireless/ath/ath11k/pci.c:273:43: error: 'ab_pci' undeclared (first use in this function); did you mean 'ar_pci'?
273 | if (test_bit(ATH11K_PCI_FLAG_IS_MSI_64, &ab_pci->flags)) {
| ^~~~~~
| ar_pcidrivers/net/wireless/ath/ath11k/pci.c:273:43: note: each undeclared identifier is reported only once for each function it appears in drivers/net/wireless/ath/ath11k/pci.c:267:21: warning: unused variable 'ar_pci' [-Wunused-variable]
267 | struct ath11k_pci *ar_pci = ath11k_pci_priv(ab);
| ^~~~~~
make[5]: *** [drivers/net/wireless/ath/ath11k/pci.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [drivers/net/wireless/ath/ath11k] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
Patch set to Changes Requested.
Signature · 9 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k
Quoted 8 lines · Anilkumar Kolli
In QCN9074 ath11k boot, firmware crash is observed in 64-bit builds and is due to wrong 64 bit MSI address size. This patch fixes the firmware crash. Read msi high addr if 64-bit addresses allowed on MSI.
Tested-On: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1.r1-00026-QCAHKSWPL_SILICONZ-2
Signed-off-by Anilkumar Kolli <[email protected]>
Fails to build:
drivers/net/wireless/ath/ath11k/pci.c: In function 'ath11k_pci_get_msi_address':drivers/net/wireless/ath/ath11k/pci.c:273:43: error: 'ab_pci' undeclared (first use in this function); did you mean 'ar_pci'?
273 | if (test_bit(ATH11K_PCI_FLAG_IS_MSI_64, &ab_pci->flags)) {
| ^~~~~~
| ar_pcidrivers/net/wireless/ath/ath11k/pci.c:273:43: note: each undeclared identifier is reported only once for each function it appears in drivers/net/wireless/ath/ath11k/pci.c:267:21: warning: unused variable 'ar_pci' [-Wunused-variable]
267 | struct ath11k_pci *ar_pci = ath11k_pci_priv(ab);
| ^~~~~~
make[5]: *** [drivers/net/wireless/ath/ath11k/pci.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[4]: *** [drivers/net/wireless/ath/ath11k] Error 2
make[3]: *** [drivers/net/wireless/ath] Error 2
make[2]: *** [drivers/net/wireless] Error 2
make[1]: *** [drivers/net] Error 2
make: *** [drivers] Error 2
Patch set to Changes Requested.
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches