Commit e8e55d89 authored by Anilkumar Kolli's avatar Anilkumar Kolli Committed by Kalle Valo
Browse files

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

Signed-off-by: default avatarAnilkumar Kolli <akolli@codeaurora.org>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/1606199334-18206-1-git-send-email-akolli@codeaurora.org
parent 7f881a72
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -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,
static void ath11k_pci_get_msi_address(struct ath11k_base *ab, u32 *msi_addr_lo,
				       u32 *msi_addr_hi)
				       u32 *msi_addr_hi)
{
{
	struct ath11k_pci *ab_pci = ath11k_pci_priv(ab);
	struct pci_dev *pci_dev = to_pci_dev(ab->dev);
	struct pci_dev *pci_dev = to_pci_dev(ab->dev);


	pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO,
	pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO,
			      msi_addr_lo);
			      msi_addr_lo);


	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,
		pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_HI,
				      msi_addr_hi);
				      msi_addr_hi);
	} else {
		*msi_addr_hi = 0;
	}
}
}


int ath11k_pci_get_user_msi_assignment(struct ath11k_pci *ab_pci, char *user_name,
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;
	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);
	ath11k_dbg(ab, ATH11K_DBG_PCI, "msi base data is %d\n", ab_pci->msi_ep_base_data);


+1 −0
Original line number Original line Diff line number Diff line
@@ -38,6 +38,7 @@ struct ath11k_msi_config {


enum ath11k_pci_flags {
enum ath11k_pci_flags {
	ATH11K_PCI_FLAG_INIT_DONE,
	ATH11K_PCI_FLAG_INIT_DONE,
	ATH11K_PCI_FLAG_IS_MSI_64,
};
};


struct ath11k_pci {
struct ath11k_pci {