Enumeration issue with QCA9005 AR9462

From: Bjorn Helgaas
Date: Mon Aug 20 2018 - 19:06:29 EST


mmyangfl@xxxxxxxxx reported a problem [1]: on v4.17, a QCA9005 AR9462
wifi device was present at boot, but disappeared after suspend/resume.

He/she also tested a recent kernel (5c60a7389d79, from Thu Aug 16),
where the suspend/resume problem doesn't seem to happen, but the wifi
device isn't enumerated correctly at boot-time.

pci 0000:00:1c.3: PCIe Root Port to [bus 03-07]
pci 0000:03:00.0: [1ae9:0101] PCIe Switch Upstream Port to [bus 04-07]
pci 0000:04:00.0: [1ae9:0200] PCIe Switch Downstream Port to [bus 05]
pci 0000:05:00.0: [168c:0034] QCA9005 AR9462 wifi NIC

These messages are extracted from [2]:

[ 0.928714] pciehp 0000:04:00.0:pcie204: Slot #0 AttnBtn- PwrCtrl- MRL- AttnInd- PwrInd- HotPlug+ Surprise+ Interlock- NoCompl- LLActRep+
[ 0.928752] pciehp 0000:04:00.0:pcie204: Slot(0-1): Card not present
[ 0.928811] pciehp 0000:04:00.0:pcie204: Slot(0-1): Link Up
[ 0.928815] pciehp 0000:04:00.0:pcie204: Slot(0-1): No adapter

After manually executing:

echo 1 > /sys/devices/pci0000\:00/0000\:00\:1c.3/0000\:03\:00.0/0000\:04\:00.0/rescan

the wifi NIC is discovered correctly:

[ 114.649896] pci 0000:05:00.0: [168c:0034] type 00 class 0x028000
[ 114.649977] pci 0000:05:00.0: reg 0x10: [mem 0xf7400000-0xf747ffff 64bit]
[ 114.650090] pci 0000:05:00.0: reg 0x30: [mem 0xf7480000-0xf748ffff pref]

[1] https://bugzilla.kernel.org/show_bug.cgi?id=200839
[2] https://bugzilla.kernel.org/attachment.cgi?id=277923