mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
ANDROID: dma/debug: fix warning of check_sync
check_sync() checks for whether device driver DMA sync sg list entry count equals to map sg list entry count, but in struct dma_buf_ops, there has below interface:
int (*begin_cpu_access_partial)
int (*end_cpu_access_partial)
When vendor implement these interface in dma heap to support dma-buf partial cache sync for performance improvement, in dma_buf_ops of heap, we copy a sgtable from orginal sgtable but with necessary nents, it will less then nents used in map attachment, in the way, the following warning had occurred:
DMA-API: device_xxx: device driver syncs DMA sg list with different entry count [map count=5] [sync count=1]
Call trace:
check_sync+0x6d8/0xb40
debug_dma_sync_sg_for_cpu+0x114/0x16c
dma_sync_sg_for_cpu+0xa0/0xe4
So need change check conditation in check_sync to support dma-buf partial cache sync.
Fixes: Icce61fc21b1 ("ANDROID: dma-buf: Add support for partial cache maintenance")
Bug: 236343688
Signed-off-by: Mingyuan Ma <mingyuan.ma@mediatek.com>
Signed-off-by: Yunfei Wang <yf.wang@mediatek.com>
Change-Id: I2f4db3b156e752eeb022927957f77a3fa534a573
(cherry picked from commit d61fe3ad4bab3f4bc040e7ac0c7ec919b50e8a43)
This commit is contained in:
committed by
Treehugger Robot
parent
1235d2f7e8
commit
5c5a86e82d
@@ -1134,10 +1134,11 @@ static void check_sync(struct device *dev,
|
||||
dir2name[entry->direction],
|
||||
dir2name[ref->direction]);
|
||||
|
||||
/* sg list count can be less than map count when partial cache sync */
|
||||
if (ref->sg_call_ents && ref->type == dma_debug_sg &&
|
||||
ref->sg_call_ents != entry->sg_call_ents) {
|
||||
ref->sg_call_ents > entry->sg_call_ents) {
|
||||
err_printk(ref->dev, entry, "device driver syncs "
|
||||
"DMA sg list with different entry count "
|
||||
"DMA sg list count larger than map count "
|
||||
"[map count=%d] [sync count=%d]\n",
|
||||
entry->sg_call_ents, ref->sg_call_ents);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user