Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1686c1b3 authored by Kai Liu's avatar Kai Liu Committed by Gerrit - the friendly Code Review server
Browse files

cnss2: set high 32bit of MSI addr only when device is 64 bit capable



If EP is 32bit MSI capable, then MSI address is 4 bytes. Platform
driver check MSI capability before read MSI address.

Change-Id: I8157b7ba2c9ed2a8d93f168f893cf1a2e6bb50b6
Signed-off-by: default avatarKai Liu <kaliu@codeaurora.org>
parent c2f82240
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -3692,12 +3692,19 @@ void cnss_get_msi_address(struct device *dev, u32 *msi_addr_low,
			  u32 *msi_addr_high)
{
	struct pci_dev *pci_dev = to_pci_dev(dev);
	u16 control;

	pci_read_config_word(pci_dev, pci_dev->msi_cap + PCI_MSI_FLAGS,
			     &control);
	pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_LO,
			      msi_addr_low);

	pci_read_config_dword(pci_dev, pci_dev->msi_cap + PCI_MSI_ADDRESS_HI,
	/*return msi high addr only when device support 64 BIT MSI */
	if (control & PCI_MSI_FLAGS_64BIT)
		pci_read_config_dword(pci_dev,
				      pci_dev->msi_cap + PCI_MSI_ADDRESS_HI,
				      msi_addr_high);
	else
		*msi_addr_high = 0;
}
EXPORT_SYMBOL(cnss_get_msi_address);