soc: qcom: glink_spi_xprt: Add support for WDSP SSR
Handle WDSP_EVENT_PRE_SHUTDOWN event to indicate link down event to G-Link core and the clients of G-Link. Handle WDSP_EVENT_POST_BOOTUP event to indicate link up event. CRs-Fixed: 1080354 Change-Id: I12c04ceb7af51cc5d2f0c79b524ef783dc5f749e Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
This commit is contained in:
parent
1ff56658f3
commit
4c65e88972
1 changed files with 12 additions and 7 deletions
|
@ -875,21 +875,20 @@ static void __rx_worker(struct edge_info *einfo)
|
||||||
int rcu_id;
|
int rcu_id;
|
||||||
|
|
||||||
rcu_id = srcu_read_lock(&einfo->use_ref);
|
rcu_id = srcu_read_lock(&einfo->use_ref);
|
||||||
|
if (einfo->in_ssr) {
|
||||||
|
srcu_read_unlock(&einfo->use_ref, rcu_id);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (unlikely(!einfo->rx_fifo_start)) {
|
if (unlikely(!einfo->rx_fifo_start)) {
|
||||||
rx_avail = glink_spi_xprt_read_avail(einfo);
|
rx_avail = glink_spi_xprt_read_avail(einfo);
|
||||||
if (!rx_avail) {
|
if (!rx_avail) {
|
||||||
srcu_read_unlock(&einfo->use_ref, rcu_id);
|
srcu_read_unlock(&einfo->use_ref, rcu_id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
einfo->in_ssr = false;
|
|
||||||
einfo->xprt_if.glink_core_if_ptr->link_up(&einfo->xprt_if);
|
einfo->xprt_if.glink_core_if_ptr->link_up(&einfo->xprt_if);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (einfo->in_ssr) {
|
|
||||||
srcu_read_unlock(&einfo->use_ref, rcu_id);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
glink_spi_xprt_set_poll_mode(einfo);
|
glink_spi_xprt_set_poll_mode(einfo);
|
||||||
while (inactive_cycles < MAX_INACTIVE_CYCLES) {
|
while (inactive_cycles < MAX_INACTIVE_CYCLES) {
|
||||||
if (einfo->tx_resume_needed &&
|
if (einfo->tx_resume_needed &&
|
||||||
|
@ -1818,9 +1817,16 @@ static int glink_wdsp_cmpnt_event_handler(struct device *dev,
|
||||||
spi_dev = to_spi_device(sdev);
|
spi_dev = to_spi_device(sdev);
|
||||||
einfo->spi_dev = spi_dev;
|
einfo->spi_dev = spi_dev;
|
||||||
break;
|
break;
|
||||||
|
case WDSP_EVENT_POST_BOOTUP:
|
||||||
|
einfo->in_ssr = false;
|
||||||
|
synchronize_srcu(&einfo->use_ref);
|
||||||
|
/* No break here to trigger fake rx_worker */
|
||||||
case WDSP_EVENT_IPC1_INTR:
|
case WDSP_EVENT_IPC1_INTR:
|
||||||
queue_kthread_work(&einfo->kworker, &einfo->kwork);
|
queue_kthread_work(&einfo->kworker, &einfo->kwork);
|
||||||
break;
|
break;
|
||||||
|
case WDSP_EVENT_PRE_SHUTDOWN:
|
||||||
|
ssr(&einfo->xprt_if);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
pr_debug("%s: unhandled event %d", __func__, event);
|
pr_debug("%s: unhandled event %d", __func__, event);
|
||||||
break;
|
break;
|
||||||
|
@ -2040,7 +2046,6 @@ static int glink_spi_probe(struct platform_device *pdev)
|
||||||
init_xprt_cfg(einfo, subsys_name);
|
init_xprt_cfg(einfo, subsys_name);
|
||||||
init_xprt_if(einfo);
|
init_xprt_if(einfo);
|
||||||
|
|
||||||
einfo->in_ssr = true;
|
|
||||||
einfo->fifo_size = DEFAULT_FIFO_SIZE;
|
einfo->fifo_size = DEFAULT_FIFO_SIZE;
|
||||||
init_kthread_work(&einfo->kwork, rx_worker);
|
init_kthread_work(&einfo->kwork, rx_worker);
|
||||||
init_kthread_worker(&einfo->kworker);
|
init_kthread_worker(&einfo->kworker);
|
||||||
|
|
Loading…
Add table
Reference in a new issue