Skip to content

Patch: fix IPU7 s2idle suspend on Panther Lake (Dell XPS 16, ThinkPad X9, Latitude 9440) #826

@jibsta210

Description

@jibsta210

Summary

Two-patch fix for s2idle suspend on Intel Panther Lake systems with the IPU7 camera stack. Without these, suspend fails (cleanly with stock kernel; with kernel oopses or hard-freezes various combinations) on every PTL laptop after the first camera use.

Reproducer (current upstream linux-cachyos kernel + intel/ipu7-drivers):

sudo timeout 4 cam -c 1 --capture=4 --file=/tmp/r.raw   # use camera once
sudo systemctl suspend                                   # fails or freezes

The two patches

1. drivers/staging/media/ipu7/ipu7.cipu7_pci_remove ordering fix

Reorder so ipu7_bus_del_devices() runs BEFORE ipu7_mmu_cleanup(). Otherwise isys_remove calls ipu7_dma_free → find_iova(&mmu->dmap->iovad, ...) after mmu->dmap is NULL → kernel oops at _raw_spin_lock_irqsave+0x27.

3-line diff:

@@ -2643,11 +2643,11 @@ static void ipu7_pci_remove(struct pci_dev *pdev)
 	if (!IS_ERR_OR_NULL(isp->fw_code_region))
 		vfree(isp->fw_code_region);

+	ipu7_bus_del_devices(pdev);
+
 	ipu7_mmu_cleanup(isp->isys->mmu);
 	ipu7_mmu_cleanup(isp->psys->mmu);

-	ipu7_bus_del_devices(pdev);
-
 	pm_runtime_forbid(&pdev->dev);
 	pm_runtime_get_noresume(&pdev->dev);

I'll be submitting this to linux-media for kernel staging tree. Including here so CachyOS can carry it as a downstream patch in the meantime.

2. intel/ipu7-drivers (DKMS) — psys_suspend graceful teardown

Replace return -EBUSY (when psys->ready=1) with return psys_runtime_pm_suspend(dev). PR open at intel/ipu7-drivers#66.

Verification

  • Hardware: Dell XPS 16 PB16250 (Panther Lake) + Synaptics SVP7500 CVS bridge + ov08x40 sensor
  • Before: PM: dpm_run_callback(): psys_suspend [intel_ipu7_psys] returns -16 then suspend abort. With cosmic-comp, GUI sometimes hard-freezes.
  • After both patches: clean PM: suspend entry (s2idle)PM: suspend exit (5s cycle), camera survives the cycle.

Test cycle:

$ sudo systemctl suspend       # closes display, system sleeps
$ # power button to wake
$ sudo timeout 4 cam --list    # camera enumerates fine
1: Internal front camera

Affected hardware (likely all PTL laptops with IPU7+CVS bridge)

  • Dell XPS 16 PB16250
  • Lenovo ThinkPad X9
  • Dell Latitude 9440
  • Other Panther Lake systems with Synaptics SVP7500 CVS bridge

Happy to submit the patches as PRs to linux-cachyos PKGBUILD if that's the preferred ingestion route.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions