asoc: msm_common: add counter to reset vote at the time of SSR
When target enters into secure mode, HLOS receives an event to place vote against sleep until writing of required registers from TZ. Once the secure DMA registers write done, HLOS will get a event to unvote against sleep. Issue scenario: When device enter secure mode votes for sleep against, before unvote event receives for TZ SSR is triggered. When SSR triggers all votes are reset on ADSP. While recovering from SSR, HLOS receives unvote event to HLOS, which will unvoting of other use case vote and leading to NOC issue. Solution: Maintain a counter for sleep against vote to track the votes and unvotes. Also reset the sleep counter if SSR is trigger as ADSP will reset all votes on SSR. Change-Id: Ib1689d8f54408a9a80a12fb2697ba5c3d7087b9a Signed-off-by: Prasad Kumpatla <quic_pkumpatl@quicinc.com>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
575a0b0dd1
commit
7769502c7d
@@ -88,6 +88,7 @@ static const struct snd_pcm_hardware dummy_dma_hardware = {
|
||||
static int qos_vote_status;
|
||||
static bool lpi_pcm_logging_enable;
|
||||
static bool vote_against_sleep_enable;
|
||||
static unsigned int vote_against_sleep_cnt;
|
||||
|
||||
static struct dev_pm_qos_request latency_pm_qos_req; /* pm_qos request */
|
||||
static unsigned int qos_client_active_cnt;
|
||||
@@ -171,6 +172,8 @@ int snd_card_notify_user(snd_card_status_t card_status)
|
||||
{
|
||||
snd_card_pdata->card_status = card_status;
|
||||
sysfs_notify(&snd_card_pdata->snd_card_kobj, NULL, "card_state");
|
||||
if (card_status == 0)
|
||||
vote_against_sleep_cnt = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1082,10 +1085,24 @@ static int msm_vote_against_sleep_ctl_put(struct snd_kcontrol *kcontrol,
|
||||
int ret = 0;
|
||||
|
||||
vote_against_sleep_enable = ucontrol->value.integer.value[0];
|
||||
pr_debug("%s: vote against sleep enable: %d", __func__,
|
||||
vote_against_sleep_enable);
|
||||
pr_debug("%s: vote against sleep enable: %d sleep cnt: %d", __func__,
|
||||
vote_against_sleep_enable, vote_against_sleep_cnt);
|
||||
|
||||
ret = audio_prm_set_vote_against_sleep((uint8_t)vote_against_sleep_enable);
|
||||
if (vote_against_sleep_enable) {
|
||||
vote_against_sleep_cnt++;
|
||||
if (vote_against_sleep_cnt == 1) {
|
||||
ret = audio_prm_set_vote_against_sleep(1);
|
||||
if (ret < 0) {
|
||||
--vote_against_sleep_cnt;
|
||||
pr_err("%s: failed to vote against sleep ret: %d\n", __func__, ret);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (vote_against_sleep_cnt == 1)
|
||||
ret = audio_prm_set_vote_against_sleep(0);
|
||||
if (vote_against_sleep_cnt > 0)
|
||||
vote_against_sleep_cnt--;
|
||||
}
|
||||
|
||||
pr_debug("%s: vote against sleep vote ret: %d\n", __func__, ret);
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user