From a3f25b925fe690be7744d47df0135321e43e2c2a Mon Sep 17 00:00:00 2001 From: Keerthy Date: Wed, 24 Apr 2019 16:33:54 +0530 Subject: drivers: dma: ti: k3-udma: Extract packet data only when Meta data is not NULL Currently packet data is wrongly extracted when metadata is NULL. Fix it and negate the if check. Signed-off-by: Keerthy Reviewed-by: Grygorii Strashko Reviewed-by: Peter Ujfalusi --- drivers/dma/ti/k3-udma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index f78a01aa8f..e9ca09d8d3 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -1492,7 +1492,7 @@ static int udma_send(struct dma *dma, void *src, size_t len, void *metadata) u32 tc_ring_id; int ret; - if (!metadata) + if (metadata) packet_data = *((struct ti_udma_drv_packet_data *)metadata); if (dma->id >= (ud->rchan_cnt + ud->tchan_cnt)) { -- cgit v1.2.3 From 32aebcf244bea1c3270aa1f87b2be8e5f0fa546e Mon Sep 17 00:00:00 2001 From: Andreas Dannenberg Date: Wed, 24 Apr 2019 14:20:08 -0500 Subject: firmware: ti_sci: Fix TISCI mailbox receive timeout handling An earlier commit converted the TISCI receive timeouts to be specified in ms rather than us however it failed to take this change into account when passing the actual timeout to be used when invoking the mailbox receive API. This leads to the actual timeout to be 1,000 times shorter than expected and as a result certain TISCI operations would fail. Fix the issue by converting the timeout declared in ms to us on the fly as expected by the respective API. Fixes: fd6b40b1ba20 ("firmware: ti_sci: Add support for NAVSS resource management") Signed-off-by: Andreas Dannenberg Reviewed-by: Lokesh Vutla --- drivers/firmware/ti_sci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 1196ce0712..66d7dd48ac 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -158,7 +158,7 @@ static inline int ti_sci_get_response(struct ti_sci_info *info, int ret; /* Receive the response */ - ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms); + ret = mbox_recv(chan, msg, info->desc->max_rx_timeout_ms * 1000); if (ret) { dev_err(info->dev, "%s: Message receive failed. ret = %d\n", __func__, ret); -- cgit v1.2.3 From 5487772517817a7e3b501062f3962b56fad34075 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Thu, 25 Apr 2019 12:08:15 +0530 Subject: dma: ti: k3-udma: Do not touch RT registers before channel configuration Upcoming sysfw (2019.03) will not open the channelized firewalls during init, it only going to do so in response to the channel configuration message. Remove the channel state checks done before the channel configuration and move it after the configuration for warning purposes. Signed-off-by: Peter Ujfalusi Signed-off-by: Vignesh Raghavendra Reviewed-by: Grygorii Strashko --- drivers/dma/ti/k3-udma.c | 33 +++++++++------------------------ 1 file changed, 9 insertions(+), 24 deletions(-) (limited to 'drivers') diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index e9ca09d8d3..a5fc7809bc 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -575,14 +575,6 @@ static int udma_get_tchan(struct udma_chan *uc) pr_debug("chan%d: got tchan%d\n", uc->id, uc->tchan->id); - if (udma_is_chan_running(uc)) { - dev_warn(ud->dev, "chan%d: tchan%d is running!\n", uc->id, - uc->tchan->id); - udma_stop(uc); - if (udma_is_chan_running(uc)) - dev_err(ud->dev, "chan%d: won't stop!\n", uc->id); - } - return 0; } @@ -602,14 +594,6 @@ static int udma_get_rchan(struct udma_chan *uc) pr_debug("chan%d: got rchan%d\n", uc->id, uc->rchan->id); - if (udma_is_chan_running(uc)) { - dev_warn(ud->dev, "chan%d: rchan%d is running!\n", uc->id, - uc->rchan->id); - udma_stop(uc); - if (udma_is_chan_running(uc)) - dev_err(ud->dev, "chan%d: won't stop!\n", uc->id); - } - return 0; } @@ -652,14 +636,6 @@ static int udma_get_chan_pair(struct udma_chan *uc) pr_debug("chan%d: got t/rchan%d pair\n", uc->id, chan_id); - if (udma_is_chan_running(uc)) { - dev_warn(ud->dev, "chan%d: t/rchan%d pair is running!\n", - uc->id, chan_id); - udma_stop(uc); - if (udma_is_chan_running(uc)) - dev_err(ud->dev, "chan%d: won't stop!\n", uc->id); - } - return 0; } @@ -1071,6 +1047,15 @@ static int udma_alloc_chan_resources(struct udma_chan *uc) } } + if (udma_is_chan_running(uc)) { + dev_warn(ud->dev, "chan%d: is running!\n", uc->id); + udma_stop(uc); + if (udma_is_chan_running(uc)) { + dev_err(ud->dev, "chan%d: won't stop!\n", uc->id); + goto err_free_res; + } + } + /* PSI-L pairing */ ret = udma_navss_psil_pair(ud, uc->src_thread, uc->dst_thread); if (ret) { -- cgit v1.2.3 From 8d4f91bb19c70502ee1c38e0a0f4fd134307aa5e Mon Sep 17 00:00:00 2001 From: Patrice Chotard Date: Thu, 25 Apr 2019 12:57:28 +0200 Subject: watchdog: Kconfig: update WDT help message Restart operation never exists and reset operation never makes the watchdog expire immediately but expire_now operation does. Signed-off-by: Patrice Chotard Reviewed-by: Stefan Roese --- drivers/watchdog/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 3bce0aa0b8..16d47b8885 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig @@ -55,7 +55,7 @@ config WDT help Enable driver model for watchdog timer. At the moment the API is very simple and only supports four operations: - start, restart, stop and reset (expire immediately). + start, stop, reset and expire_now (expire immediately). What exactly happens when the timer expires is up to a particular device/driver. -- cgit v1.2.3 From efbfd448e51a75acbace51849e8bed63e0ea5ce0 Mon Sep 17 00:00:00 2001 From: "Andrew F. Davis" Date: Mon, 29 Apr 2019 09:04:11 -0400 Subject: firmware: ti_sci: Always request response from firmware TI-SCI firmware will only respond to messages when the TI_SCI_FLAG_REQ_ACK_ON_PROCESSED flag is set. Most messages already do this, set this for the ones that do not. Signed-off-by: Andrew F. Davis Tested-by: Alejandro Hernandez Acked-by: Nishanth Menon --- drivers/firmware/ti_sci.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c index 66d7dd48ac..303aa6a631 100644 --- a/drivers/firmware/ti_sci.c +++ b/drivers/firmware/ti_sci.c @@ -257,7 +257,8 @@ static int ti_sci_cmd_get_revision(struct ti_sci_handle *handle) info = handle_to_ti_sci_info(handle); - xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_VERSION, 0x0, + xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_VERSION, + TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, (u32 *)&hdr, sizeof(struct ti_sci_msg_hdr), sizeof(*rev_info)); if (IS_ERR(xfer)) { @@ -499,8 +500,8 @@ static int ti_sci_get_device_state(const struct ti_sci_handle *handle, info = handle_to_ti_sci_info(handle); - /* Response is expected, so need of any flags */ - xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_GET_DEVICE_STATE, 0, + xfer = ti_sci_setup_one_xfer(info, TI_SCI_MSG_GET_DEVICE_STATE, + TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, (u32 *)&req, sizeof(req), sizeof(*resp)); if (IS_ERR(xfer)) { ret = PTR_ERR(xfer); @@ -2574,8 +2575,8 @@ static int ti_sci_cmd_change_fwl_owner(const struct ti_sci_handle *handle, info = handle_to_ti_sci_info(handle); - xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_FWL_GET, - TISCI_MSG_FWL_CHANGE_OWNER, + xfer = ti_sci_setup_one_xfer(info, TISCI_MSG_FWL_CHANGE_OWNER, + TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, (u32 *)&req, sizeof(req), sizeof(*resp)); if (IS_ERR(xfer)) { ret = PTR_ERR(xfer); -- cgit v1.2.3