• Stephen Boyd's avatar
    firmware: qcom_scm: Use proper types for dma mappings · 6e37ccf7
    Stephen Boyd authored
    We need to use the proper types and convert between physical addresses
    and dma addresses here to avoid mismatch warnings. This is especially
    important on systems with a different size for dma addresses and
    physical addresses. Otherwise, we get the following warning:
    
      drivers/firmware/qcom_scm.c: In function "qcom_scm_assign_mem":
      drivers/firmware/qcom_scm.c:469:47: error: passing argument 3 of "dma_alloc_coherent" from incompatible pointer type [-Werror=incompatible-pointer-types]
    
    We also fix the size argument to dma_free_coherent() because that size
    doesn't need to be aligned after it's already aligned on the allocation
    size. In fact, dma debugging expects the same arguments to be passed to
    both the allocation and freeing sides of the functions so changing the
    size is incorrect regardless.
    Reported-by: default avatarIan Jackson <ian.jackson@citrix.com>
    Cc: Ian Jackson <ian.jackson@citrix.com>
    Cc: Julien Grall <julien.grall@arm.com>
    Cc: Bjorn Andersson <bjorn.andersson@linaro.org>
    Cc: Avaneesh Kumar Dwivedi <akdwived@codeaurora.org>
    Tested-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
    Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
    Signed-off-by: default avatarBjorn Andersson <bjorn.andersson@linaro.org>
    6e37ccf7
qcom_scm.c 15.5 KB