Skip to content

Commit 3f32af3

Browse files
committed
mwifiex_pcie: disable parent bridge_d3
On Windows, it seems that wifi parent bridge will not enter D3 state (stay on D0 state) [1]. And on Linux, disabling the D3 state for the bridge fixes driver crashing after suspend. This commit disables the parent bridge D3 state on driver initialization to fix driver crashing after suspend. NOTE_1: The driver does not crash on LTS 4.4 series but does crash on LTS 4.9 series. Maybe commit 9d26d3a ("PCI: Put PCIe ports into D3 during suspend") changed the bridge D-state behavior. NOTE_2: As a side effect, it reports parent bridge is in D3hot. I'm not sure why. acpi device:4b: Cannot transition to power state D0 for parent in D3hot Power state of the parent bridge on SB1 before this commit: $ grep -H . /sys/bus/pci/devices/0000:00:1d.3/firmware_node/{power_state,real_power_state} /sys/bus/pci/devices/0000:00:1d.3/firmware_node/power_state:D0 /sys/bus/pci/devices/0000:00:1d.3/firmware_node/real_power_state:D3hot Power state of the parent bridge on SB1 after this commit: $ grep -H . /sys/bus/pci/devices/0000:00:1d.3/firmware_node/{power_state,real_power_state} /sys/bus/pci/devices/0000:00:1d.3/firmware_node/power_state:D3hot /sys/bus/pci/devices/0000:00:1d.3/firmware_node/real_power_state:D3hot NOTE_3: This change is needed for SP4 and later generations that use mwifiex (i.e. SP4/SP5/SP6, SB1/SB2 and SL1/SL2). Not needed for Surface 3 but safe to apply as this change doesn't break S0ix. Not sure if needed for SP1/SP2 and SP3. Anyway, I think applying this change to all the devices may be safe regarding S0ix because Surface 3 can achieve S0ix anyway even when this patch applied. So, let's apply this change for all the devices for now. [1] jakeday/linux-surface#554 (comment) Signed-off-by: Tsuchiya Yuto (kitakar5525) <kitakar@gmail.com> (cherry picked from commit 028e378 from PR #44) Signed-off-by: Tsuchiya Yuto (kitakar5525) <kitakar@gmail.com>
1 parent d416922 commit 3f32af3

File tree

1 file changed

+5
-0
lines changed
  • drivers/net/wireless/marvell/mwifiex

1 file changed

+5
-0
lines changed

drivers/net/wireless/marvell/mwifiex/pcie.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,13 @@ static int mwifiex_pcie_probe(struct pci_dev *pdev,
240240
const struct pci_device_id *ent)
241241
{
242242
struct pcie_service_card *card;
243+
struct pci_dev *parent_pdev = pci_upstream_bridge(pdev);
243244
int ret;
244245

246+
/* disable bridge_d3 to fix driver crashing after suspend on gen4+
247+
* Surface devices */
248+
parent_pdev->bridge_d3 = false;
249+
245250
pr_debug("info: vendor=0x%4.04X device=0x%4.04X rev=%d\n",
246251
pdev->vendor, pdev->device, pdev->revision);
247252

0 commit comments

Comments
 (0)