Trying to sort of vaguely do what Linux does. With queued invalidation disabled (hw.dmar.enable=1 hw.dmar.qi=0) my laptop actually does resume :)
(debug prints are left over in the patch, I'll remove them in a later update)
Differential D22642
Intel IOMMU DMAR suspend/resume support (only without QI for now) val_packett.cool on Dec 3 2019, 2:23 PM. Authored by Tags Referenced Files
Details
Trying to sort of vaguely do what Linux does. With queued invalidation disabled (hw.dmar.enable=1 hw.dmar.qi=0) my laptop actually does resume :) (debug prints are left over in the patch, I'll remove them in a later update)
Diff Detail
Event TimelineComment Actions DMARs must be suspended after, and resumed before any subordinate devices. Because DMARs do not participate in the newbus hierarchy, or rather, they are placed there in the arbitrary place determined by not relevant details of the driver implementation, newbus suspend/resume methods are really not appropriate to use. The methods should be nops, and actual suspend/resume done near nexus.
Comment Actions Now calling from IOAPIC suspend/resume functions (if there's any better place "close to the nexus" I haven't found it.) Moved setting head/tail registers into dmar_enable_qi, so now that gets called on resume. Added waiting for the queue to empty, it's actually already empty (tail == head) both before suspend and right after resume (in the latter case, it's just not initialized, head and tail are 0). Now hangs in dmar_qi_invalidate_ctx_glob_locked… |