iommu: msm: Use scattergather list as reference for lookup
Previously, all IOMMU mapping was based on the ion buffer. Ion
handles and buffers are treated separately and may be reference
counted separtely. The current iommu abstraction layer uses the
ion handle for tracking instead of the buffer. Unfortunately, there
seems to be a race where the handle may have been freed despite
still being tracked in the IOMMU data structures. To ensure that
there are no issues with buffers going away, switch to use the
sg_table which is tied to the buffer for tracking and take a
reference to the buffer. The sg_table will be present and unique
for the entire lifetime of the buffer so it's safe to use for
metadata tracking.
Change-Id: I2d26a75427bad32b45f4277abecb2772c5283c79
CRs-Fixed: 482382
Signed-off-by:
Laura Abbott <lauraa@codeaurora.org>
Loading
Please register or sign in to comment