Skip to content

Commit b1ad2d3

Browse files
committed
asc: Do not clear ASC run bit while running
Some ASCs will get stuck if we do that. Instead, explicitly clear it after an RTKit shutdown. Signed-off-by: Hector Martin <[email protected]>
1 parent b02eed8 commit b1ad2d3

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

src/asc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,10 @@ int asc_get_iop_node(asc_dev_t *asc)
6969
void asc_cpu_start(asc_dev_t *asc)
7070
{
7171
set32(asc->cpu_base + ASC_CPU_CONTROL, ASC_CPU_CONTROL_START);
72-
udelay(10);
72+
}
73+
74+
void asc_cpu_stop(asc_dev_t *asc)
75+
{
7376
clear32(asc->cpu_base + ASC_CPU_CONTROL, ASC_CPU_CONTROL_START);
7477
}
7578

src/asc.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ void asc_free(asc_dev_t *asc);
1818
int asc_get_iop_node(asc_dev_t *asc);
1919

2020
void asc_cpu_start(asc_dev_t *asc);
21+
void asc_cpu_stop(asc_dev_t *asc);
2122

2223
bool asc_can_recv(asc_dev_t *asc);
2324
bool asc_can_send(asc_dev_t *asc);

src/rtkit.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,5 +700,10 @@ bool rtkit_quiesce(rtkit_dev_t *rtk)
700700

701701
bool rtkit_sleep(rtkit_dev_t *rtk)
702702
{
703-
return rtkit_switch_power_state(rtk, RTKIT_POWER_SLEEP);
703+
int ret = rtkit_switch_power_state(rtk, RTKIT_POWER_SLEEP);
704+
if (ret < 0)
705+
return ret;
706+
707+
asc_cpu_stop(rtk->asc);
708+
return 0;
704709
}

0 commit comments

Comments
 (0)