summaryrefslogtreecommitdiff
path: root/drivers/slimbus/qcom-ctrl.c
AgeCommit message (Collapse)Author
2018-01-09slimbus: qcom: Fix return value check in qcom_slim_probe()Wei Yongjun
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: make functions slim_ack_txn and slim_alloc_txbuf staticColin Ian King
The functions slim_ack_txn and slim_alloc_txbuf are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'slim_ack_txn' was not declared. Should it be static? symbol 'slim_alloc_txbuf' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: fix retries comparison to correctly identify failed allocationColin Ian King
Currently the check for too many retries fails because retries is actually -1 when the retry loop terminates if no pbuf can be allocated because of the post decrement on retries. Fix this by not comparing retries with zero but instead check if it is negative. Detected by CoverityScan, CID#1463143 ("Logically dead code") and CID#1463144 ("Dereference after null check") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-02slimbus: qcom-ctrl: use normal allocationArnd Bergmann
The previous patch addressed a warning but not the cause: drivers/slimbus/qcom-ctrl.c: In function 'qcom_slim_probe': drivers/slimbus/qcom-ctrl.c:584:9: error: passing argument 3 of 'dmam_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types] There are two things wrong here: - The naming is very confusing, we now have a member named 'phys' that doesn't refer to a phys_addr_t but a dma_addr_t. If we needed a dma address, it should be named 'dma' to avoid confusion, and to make it less likely that someone passes it into a function that expects a physical address. - The dma address is not used at all at this point. It may have been designed to support DMA in the future, but today it doesn't, so the only effect right now is to make transfers artificially slower by using uncached memory instead of cached memory for a temporary buffer. This removes the unused structure member and instead changes the code to call devm_kcalloc(), which matches the usage of the 'base' pointer as an array of temporary buffers. Fixes: db809859c8ce ("slimbus: qcom: fix incompatible pointer warning") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-31slimbus: qcom: fix incompatible pointer warningSrinivas Kandagatla
One of the pointer passed to dmam_alloc_coherent seems to be phys_addr_t * instead of dma_addr_t *. This address will be used by dma apis, so change this to proper type. Reported-by: kbuild test robot <fengguang.wu@intel.com> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19slimbus: qcom: Add runtime-pm support using clock-pauseSagar Dharia
Slimbus HW mandates that clock-pause sequence has to be executed before disabling relevant interface and core clocks. Runtime-PM's autosuspend feature is used here to enter/exit low power mode for Qualcomm's Slimbus controller. Autosuspend feature enables driver to avoid changing power-modes too frequently since entering clock-pause is an expensive sequence Signed-off-by: Sagar Dharia <sdharia@codeaurora.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviwed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19slimbus: qcom: Add Qualcomm Slimbus controller driverSagar Dharia
This controller driver programs manager, interface, and framer devices for Qualcomm's slimbus HW block. Manager component currently implements logical address setting, and messaging interface. Interface device reports bus synchronization information, and framer device clocks the bus from the time it's woken up, until clock-pause is executed by the manager device. Signed-off-by: Sagar Dharia <sdharia@codeaurora.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Reviwed-by: Mark Brown <broonie@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>