• Y
    qm: fix wrong number of sg elements after dma map · 2956bf1e
    Yu'an Wang 提交于
    driver inclusion
    category: bugfix
    bugzilla: NA
    CVE: NA
    
    1. use sgl API to get sgl dma addr and len
    Use sgl API to get sgl dma addr and len, this will help to avoid compile
    error in some platforms. So NEED_SG_DMA_LENGTH can be removed here, which
    can only be selected by arch code.
    2. Fix issue with wrong number of sg elements after dma map
    We fill the hardware scatter gather list assuming it will need the same
    number of elements at the original scatterlist. If an IOMMU is involved,
    then it may well need fewer. The return value of dma_map_sg tells us how
    many.
    Probably never caused visible problems as the hardware won't get to
    the elements that are incorrect before it finds enough space.
    3.Remove useless MODULE macros
    As we already merge hardware sgl into hisi_qm module, remove useless
    MODULE macros
    Signed-off-by: NYu'an Wang <wangyuan46@huawei.com>
    Reviewed-by: NCheng Hu <hucheng.hu@huawei.com>
    Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
    2956bf1e
sgl.c 6.9 KB