summaryrefslogtreecommitdiffstats
path: root/drivers/slimbus/qcom-ngd-ctrl.c
Commit message (Collapse)AuthorAgeFilesLines
* slimbus: qcom-ngd-ctrl: Add of_node_put() before returnNishka Dasgupta2019-08-181-1/+4
| | | | | | | | | | | | | | Each iteration of for_each_available_child_of_node puts the previous node, but in the case of a return from the middle of the loop, there is no put, thus causing a memory leak. Hence add an of_node_put before the return in two places. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta <nishkadg.linux@gmail.com> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20190818093902.29993-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: fix a potential NULL pointer dereference in of_qcom_slim_ngd_registerKangjie Lu2019-04-251-0/+4
| | | | | | | | | In case platform_device_alloc fails, the fix returns an error code to avoid the NULL pointer dereference. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: fix spelling mistake "exeeds" -> "exceeds"Colin Ian King2018-12-061-1/+1
| | | | | | | | There is a spelling mistake in a dev_err message, fix this. 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>
* slimbus: ngd: Fix build error on x86Srinivas Kandagatla2018-11-271-2/+3
| | | | | | | | | | on non DT platforms like x86 of_match_node is set to NULL, dereferencing directly would throw an error. Fix this by doing this in two steps, get the match then the data. Reported-by: Greg KH <gregkh@linuxfoundation.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: remove unnecessary checkSrinivas Kandagatla2018-11-071-3/+0
| | | | | | | | | | | | | | | | SLIM_MSG_CLK_PAUSE_SEQ_FLG is never set in any of the slim core, so performing a check in ngd driver is totally unnecessary. Also this patch fixes warning about mc field overflow reported with CoverityScan. Making clk pause feature optional will be added to slim core in next development cycle. Reported-by: Colin Ian King <colin.king@canonical.com> Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: validate logical address assigned by remoteSrinivas Kandagatla2018-09-251-0/+4
| | | | | | | | Validate logical address assigned by remote, in failure cases this value is all zeors. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* silmbus: ngd: register controller after power up.Srinivas Kandagatla2018-09-251-9/+11
| | | | | | | | | Register slimbus controller only after finishing powerup sequnce so that we do not endup in situation where core starts sending transactions before the controller is ready. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: return proper error code instead of zeroSrinivas Kandagatla2018-09-251-1/+1
| | | | | | | It looks like there is a typo in probe return. Fix it. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: register ngd driver only once.Srinivas Kandagatla2018-09-251-1/+1
| | | | | | | Move ngd platform driver out of loop so that it registers only once. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: mark PM functions as __maybe_unusedArnd Bergmann2018-09-141-4/+2
| | | | | | | | | | | | | | qcom_slim_ngd_runtime_suspend is protected by an #ifdef, qcom_slim_ngd_runtime_idle is now, which causes a build time warning: drivers/slimbus/qcom-ngd-ctrl.c:1470:12: error: 'qcom_slim_ngd_runtime_idle' defined but not used [-Werror=unused-function] Marking both as __maybe_unused lets us get rid of the warning as well as the #ifdef. Fixes: 917809e2280b ("slimbus: ngd: Add qcom SLIMBus NGD driver") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: add stream supportSrinivas Kandagatla2018-07-071-2/+147
| | | | | | | | | This patch adds support to stream support, this involve implementing user specific implementation of Data channel management and channel management SLIMbus messages. Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* slimbus: ngd: Add qcom SLIMBus NGD driverSrinivas Kandagatla2018-07-071-0/+1381
This patch adds suppor to Qualcomm SLIMBus Non-Generic Device (NGD) controller driver. This is light-weight SLIMBus controller driver responsible for communicating with slave HW directly over the bus using messaging interface, and communicating with master component residing on ADSP for bandwidth and data-channel management Based on intial work from Karthikeyan Ramasubramanian <kramasub@codeaurora.org> and Sagar Dharia <sdharia@codeaurora.org> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Tested-by: Craig Tatlor <ctatlor97@gmail.com> Reviewed-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>