From 979b7c981469d46c268bd49629b966f7761a5668 Mon Sep 17 00:00:00 2001 From: Ramprasad Katkam Date: Fri, 17 May 2019 15:31:21 +0530 Subject: [PATCH] soc: swr-mstr: skip port disable when master is down skip port disable when master is already down to avoid queuing commands to master which is already down due to ssr/pdr. Change-Id: I7fadc479784feb0fd8afa229599eb217bb579ea2 Signed-off-by: Ramprasad Katkam --- soc/swr-mstr-ctrl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/soc/swr-mstr-ctrl.c b/soc/swr-mstr-ctrl.c index e6559bdf0dd6..a12ed9f2c030 100644 --- a/soc/swr-mstr-ctrl.c +++ b/soc/swr-mstr-ctrl.c @@ -984,6 +984,26 @@ static int swrm_slvdev_datapath_control(struct swr_master *master, bool enable) mutex_lock(&swrm->mlock); + /* + * During disable if master is already down, which implies an ssr/pdr + * scenario, just mark ports as disabled and exit + */ + if (swrm->state == SWR_MSTR_SSR && !enable) { + if (!test_bit(DISABLE_PENDING, &swrm->port_req_pending)) { + dev_dbg(swrm->dev, "%s:No pending disconn port req\n", + __func__); + goto exit; + } + clear_bit(DISABLE_PENDING, &swrm->port_req_pending); + swrm_cleanup_disabled_port_reqs(master); + if (!swrm_is_port_en(master)) { + dev_dbg(&master->dev, "%s: pm_runtime auto suspend triggered\n", + __func__); + pm_runtime_mark_last_busy(swrm->dev); + pm_runtime_put_autosuspend(swrm->dev); + } + goto exit; + } bank = get_inactive_bank_num(swrm); if (enable) {