mirror of
https://github.com/torvalds/linux.git
synced 2024-12-23 19:31:53 +00:00
media: staging: imgu: do not hold spinlock during freeing mmu page table
ImgU need set the mmu page table in memory as uncached, and set back to write-back when free the page table by set_memory_wb(), set_memory_wb() can not do flushing without interrupt, so the spinlock should not be hold during ImgU page alloc and free, the interrupt should be enabled during memory cache flush. This patch release spinlock before freeing pages table. Signed-off-by: Bingbu Cao <bingbu.cao@intel.com> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
9611ba28d8
commit
e1ebe9f9c8
@ -174,8 +174,10 @@ static u32 *imgu_mmu_get_l2pt(struct imgu_mmu *mmu, u32 l1pt_idx)
|
||||
spin_lock_irqsave(&mmu->lock, flags);
|
||||
|
||||
l2pt = mmu->l2pts[l1pt_idx];
|
||||
if (l2pt)
|
||||
goto done;
|
||||
if (l2pt) {
|
||||
spin_unlock_irqrestore(&mmu->lock, flags);
|
||||
return l2pt;
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(&mmu->lock, flags);
|
||||
|
||||
@ -190,8 +192,9 @@ static u32 *imgu_mmu_get_l2pt(struct imgu_mmu *mmu, u32 l1pt_idx)
|
||||
|
||||
l2pt = mmu->l2pts[l1pt_idx];
|
||||
if (l2pt) {
|
||||
spin_unlock_irqrestore(&mmu->lock, flags);
|
||||
imgu_mmu_free_page_table(new_l2pt);
|
||||
goto done;
|
||||
return l2pt;
|
||||
}
|
||||
|
||||
l2pt = new_l2pt;
|
||||
@ -200,7 +203,6 @@ static u32 *imgu_mmu_get_l2pt(struct imgu_mmu *mmu, u32 l1pt_idx)
|
||||
pteval = IPU3_ADDR2PTE(virt_to_phys(new_l2pt));
|
||||
mmu->l1pt[l1pt_idx] = pteval;
|
||||
|
||||
done:
|
||||
spin_unlock_irqrestore(&mmu->lock, flags);
|
||||
return l2pt;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user