1 // SPDX-License-Identifier: GPL-2.0-only
2 //
3 // Copyright(c) 2021-2022 Intel Corporation
4 //
5 // Authors: Cezary Rojewski <cezary.rojewski@intel.com>
6 // Amadeusz Slawinski <amadeuszx.slawinski@linux.intel.com>
7 //
8
9 #include <linux/cleanup.h>
10 #include <linux/io-64-nonatomic-lo-hi.h>
11 #include <linux/slab.h>
12 #include <sound/hdaudio_ext.h>
13 #include "avs.h"
14 #include "debug.h"
15 #include "messages.h"
16 #include "registers.h"
17 #include "trace.h"
18
19 #define AVS_IPC_TIMEOUT_MS 300
20 #define AVS_D0IX_DELAY_MS 300
21
22 static int
avs_dsp_set_d0ix(struct avs_dev * adev,bool enable)23 avs_dsp_set_d0ix(struct avs_dev *adev, bool enable)
24 {
25 struct avs_ipc *ipc = adev->ipc;
26 int ret;
27
28 /* Is transition required? */
29 if (ipc->in_d0ix == enable)
30 return 0;
31
32 ret = avs_dsp_op(adev, set_d0ix, enable);
33 if (ret) {
34 /* Prevent further d0ix attempts on conscious IPC failure. */
35 if (ret == -AVS_EIPC)
36 atomic_inc(&ipc->d0ix_disable_depth);
37
38 ipc->in_d0ix = false;
39 return ret;
40 }
41
42 ipc->in_d0ix = enable;
43 return 0;
44 }
45
avs_dsp_schedule_d0ix(struct avs_dev * adev,struct avs_ipc_msg * tx)46 static void avs_dsp_schedule_d0ix(struct avs_dev *adev, struct avs_ipc_msg *tx)
47 {
48 if (atomic_read(&adev->ipc->d0ix_disable_depth))
49 return;
50
51 mod_delayed_work(system_power_efficient_wq, &adev->ipc->d0ix_work,
52 msecs_to_jiffies(AVS_D0IX_DELAY_MS));
53 }
54
avs_dsp_d0ix_work(struct work_struct * work)55 static void avs_dsp_d0ix_work(struct work_struct *work)
56 {
57 struct avs_ipc *ipc = container_of(work, struct avs_ipc, d0ix_work.work);
58
59 avs_dsp_set_d0ix(to_avs_dev(ipc->dev), true);
60 }
61
avs_dsp_wake_d0i0(struct avs_dev * adev,struct avs_ipc_msg * tx)62 static int avs_dsp_wake_d0i0(struct avs_dev *adev, struct avs_ipc_msg *tx)
63 {
64 struct avs_ipc *ipc = adev->ipc;
65
66 if (!atomic_read(&ipc->d0ix_disable_depth)) {
67 cancel_delayed_work_sync(&ipc->d0ix_work);
68 return avs_dsp_set_d0ix(adev, false);
69 }
70
71 return 0;
72 }
73
avs_dsp_disable_d0ix(struct avs_dev * adev)74 int avs_dsp_disable_d0ix(struct avs_dev *adev)
75 {
76 struct avs_ipc *ipc = adev->ipc;
77
78 /* Prevent PG only on the first disable. */
79 if (atomic_inc_return(&ipc->d0ix_disable_depth) == 1) {
80 cancel_delayed_work_sync(&ipc->d0ix_work);
81 return avs_dsp_set_d0ix(adev, false);
82 }
83
84 return 0;
85 }
86
avs_dsp_enable_d0ix(struct avs_dev * adev)87 int avs_dsp_enable_d0ix(struct avs_dev *adev)
88 {
89 struct avs_ipc *ipc = adev->ipc;
90
91 if (atomic_dec_and_test(&ipc->d0ix_disable_depth))
92 queue_delayed_work(system_power_efficient_wq, &ipc->d0ix_work,
93 msecs_to_jiffies(AVS_D0IX_DELAY_MS));
94 return 0;
95 }
96
avs_dsp_recovery(struct avs_dev * adev)97 static void avs_dsp_recovery(struct avs_dev *adev)
98 {
99 struct avs_soc_component *acomp;
100 unsigned int core_mask;
101 int ret;
102
103 scoped_guard(mutex, &adev->comp_list_mutex) {
104 /* disconnect all running streams */
105 list_for_each_entry(acomp, &adev->comp_list, node) {
106 struct snd_soc_pcm_runtime *rtd;
107 struct snd_soc_card *card;
108
109 card = acomp->base->card;
110 if (!card)
111 continue;
112
113 for_each_card_rtds(card, rtd) {
114 struct snd_pcm *pcm;
115 int dir;
116
117 pcm = rtd->pcm;
118 if (!pcm || rtd->dai_link->no_pcm)
119 continue;
120
121 for_each_pcm_streams(dir) {
122 struct snd_pcm_substream *substream;
123
124 substream = pcm->streams[dir].substream;
125 if (!substream || !substream->runtime)
126 continue;
127
128 /* No need for _irq() as we are in nonatomic context. */
129 snd_pcm_stream_lock(substream);
130 snd_pcm_stop(substream, SNDRV_PCM_STATE_DISCONNECTED);
131 snd_pcm_stream_unlock(substream);
132 }
133 }
134 }
135 }
136
137 /* forcibly shutdown all cores */
138 core_mask = GENMASK(adev->hw_cfg.dsp_cores - 1, 0);
139 avs_dsp_core_disable(adev, core_mask);
140
141 /* attempt dsp reboot */
142 ret = avs_dsp_boot_firmware(adev, true);
143 if (ret < 0)
144 dev_err(adev->dev, "dsp reboot failed: %d\n", ret);
145
146 pm_runtime_enable(adev->dev);
147 pm_request_autosuspend(adev->dev);
148
149 atomic_set(&adev->ipc->recovering, 0);
150 }
151
avs_dsp_recovery_work(struct work_struct * work)152 static void avs_dsp_recovery_work(struct work_struct *work)
153 {
154 struct avs_ipc *ipc = container_of(work, struct avs_ipc, recovery_work);
155
156 avs_dsp_recovery(to_avs_dev(ipc->dev));
157 }
158
avs_dsp_exception_caught(struct avs_dev * adev,union avs_notify_msg * msg)159 static void avs_dsp_exception_caught(struct avs_dev *adev, union avs_notify_msg *msg)
160 {
161 struct avs_ipc *ipc = adev->ipc;
162
163 /* Account for the double-exception case. */
164 ipc->ready = false;
165
166 if (!atomic_add_unless(&ipc->recovering, 1, 1)) {
167 dev_err(adev->dev, "dsp recovery is already in progress\n");
168 return;
169 }
170
171 dev_crit(adev->dev, "communication severed, rebooting dsp..\n");
172
173 /* Avoid deadlock as the exception may be the response to SET_D0IX. */
174 if (current_work() != &ipc->d0ix_work.work)
175 cancel_delayed_work(&ipc->d0ix_work);
176 ipc->in_d0ix = false;
177 /* Re-enabled on recovery completion. */
178 pm_runtime_disable(adev->dev);
179
180 /* Process received notification. */
181 avs_dsp_op(adev, coredump, msg);
182
183 schedule_work(&ipc->recovery_work);
184 }
185
avs_dsp_receive_rx(struct avs_dev * adev,u64 header)186 static void avs_dsp_receive_rx(struct avs_dev *adev, u64 header)
187 {
188 struct avs_ipc *ipc = adev->ipc;
189 union avs_reply_msg msg = AVS_MSG(header);
190 u32 sts, lec;
191
192 sts = snd_hdac_adsp_readl(adev, AVS_FW_REG_STATUS(adev));
193 lec = snd_hdac_adsp_readl(adev, AVS_FW_REG_ERROR(adev));
194 trace_avs_ipc_reply_msg(header, sts, lec);
195
196 ipc->rx.header = header;
197 /* Abort copying payload if request processing was unsuccessful. */
198 if (!msg.status) {
199 /* update size in case of LARGE_CONFIG_GET */
200 if (msg.msg_target == AVS_MOD_MSG &&
201 msg.global_msg_type == AVS_MOD_LARGE_CONFIG_GET)
202 ipc->rx.size = min_t(u32, AVS_MAILBOX_SIZE,
203 msg.ext.large_config.data_off_size);
204
205 memcpy_fromio(ipc->rx.data, avs_uplink_addr(adev), ipc->rx.size);
206 trace_avs_msg_payload(ipc->rx.data, ipc->rx.size);
207 }
208 }
209
avs_dsp_process_notification(struct avs_dev * adev,u64 header)210 static void avs_dsp_process_notification(struct avs_dev *adev, u64 header)
211 {
212 struct avs_notify_mod_data mod_data;
213 union avs_notify_msg msg = AVS_MSG(header);
214 size_t data_size = 0;
215 void *data = NULL;
216 u32 sts, lec;
217
218 sts = snd_hdac_adsp_readl(adev, AVS_FW_REG_STATUS(adev));
219 lec = snd_hdac_adsp_readl(adev, AVS_FW_REG_ERROR(adev));
220 trace_avs_ipc_notify_msg(header, sts, lec);
221
222 /* Ignore spurious notifications until handshake is established. */
223 if (!adev->ipc->ready && msg.notify_msg_type != AVS_NOTIFY_FW_READY) {
224 dev_dbg(adev->dev, "FW not ready, skip notification: 0x%08x\n", msg.primary);
225 return;
226 }
227
228 /* Calculate notification payload size. */
229 switch (msg.notify_msg_type) {
230 case AVS_NOTIFY_FW_READY:
231 break;
232
233 case AVS_NOTIFY_PHRASE_DETECTED:
234 data_size = sizeof(struct avs_notify_voice_data);
235 break;
236
237 case AVS_NOTIFY_RESOURCE_EVENT:
238 data_size = sizeof(struct avs_notify_res_data);
239 break;
240
241 case AVS_NOTIFY_LOG_BUFFER_STATUS:
242 case AVS_NOTIFY_EXCEPTION_CAUGHT:
243 break;
244
245 case AVS_NOTIFY_MODULE_EVENT:
246 /* To know the total payload size, header needs to be read first. */
247 memcpy_fromio(&mod_data, avs_uplink_addr(adev), sizeof(mod_data));
248 data_size = sizeof(mod_data) + mod_data.data_size;
249 break;
250
251 default:
252 dev_info(adev->dev, "unknown notification: 0x%08x\n", msg.primary);
253 break;
254 }
255
256 if (data_size) {
257 data = kmalloc(data_size, GFP_KERNEL);
258 if (!data)
259 return;
260
261 memcpy_fromio(data, avs_uplink_addr(adev), data_size);
262 trace_avs_msg_payload(data, data_size);
263 }
264
265 /* Perform notification-specific operations. */
266 switch (msg.notify_msg_type) {
267 case AVS_NOTIFY_FW_READY:
268 dev_dbg(adev->dev, "FW READY 0x%08x\n", msg.primary);
269 adev->ipc->ready = true;
270 complete(&adev->fw_ready);
271 break;
272
273 case AVS_NOTIFY_LOG_BUFFER_STATUS:
274 avs_log_buffer_status_locked(adev, &msg);
275 break;
276
277 case AVS_NOTIFY_EXCEPTION_CAUGHT:
278 avs_dsp_exception_caught(adev, &msg);
279 break;
280
281 default:
282 break;
283 }
284
285 kfree(data);
286 }
287
avs_dsp_process_response(struct avs_dev * adev,u64 header)288 void avs_dsp_process_response(struct avs_dev *adev, u64 header)
289 {
290 struct avs_ipc *ipc = adev->ipc;
291
292 /*
293 * Response may either be solicited - a reply for a request that has
294 * been sent beforehand - or unsolicited (notification).
295 */
296 if (avs_msg_is_reply(header)) {
297 /* Response processing is invoked from IRQ thread. */
298 spin_lock_irq(&ipc->rx_lock);
299 avs_dsp_receive_rx(adev, header);
300 ipc->rx_completed = true;
301 spin_unlock_irq(&ipc->rx_lock);
302 } else {
303 avs_dsp_process_notification(adev, header);
304 }
305
306 complete(&ipc->busy_completion);
307 }
308
avs_ipc_is_busy(struct avs_ipc * ipc)309 static bool avs_ipc_is_busy(struct avs_ipc *ipc)
310 {
311 struct avs_dev *adev = to_avs_dev(ipc->dev);
312 const struct avs_spec *const spec = adev->spec;
313 u32 hipc_rsp;
314
315 hipc_rsp = snd_hdac_adsp_readl(adev, spec->hipc->rsp_offset);
316 return hipc_rsp & spec->hipc->rsp_busy_mask;
317 }
318
avs_ipc_wait_busy_completion(struct avs_ipc * ipc,int timeout)319 static int avs_ipc_wait_busy_completion(struct avs_ipc *ipc, int timeout)
320 {
321 u32 repeats_left = 128; /* to avoid infinite looping */
322 int ret;
323
324 again:
325 ret = wait_for_completion_timeout(&ipc->busy_completion, msecs_to_jiffies(timeout));
326
327 /* DSP could be unresponsive at this point. */
328 if (!ipc->ready)
329 return -EPERM;
330
331 if (!ret) {
332 if (!avs_ipc_is_busy(ipc))
333 return -ETIMEDOUT;
334 /*
335 * Firmware did its job, either notification or reply
336 * has been received - now wait until it's processed.
337 */
338 wait_for_completion_killable(&ipc->busy_completion);
339 }
340
341 /* Ongoing notification's bottom-half may cause early wakeup */
342 spin_lock(&ipc->rx_lock);
343 if (!ipc->rx_completed) {
344 if (repeats_left) {
345 /* Reply delayed due to notification. */
346 repeats_left--;
347 reinit_completion(&ipc->busy_completion);
348 spin_unlock(&ipc->rx_lock);
349 goto again;
350 }
351
352 spin_unlock(&ipc->rx_lock);
353 return -ETIMEDOUT;
354 }
355
356 spin_unlock(&ipc->rx_lock);
357 return 0;
358 }
359
avs_ipc_msg_init(struct avs_ipc * ipc,struct avs_ipc_msg * reply)360 static void avs_ipc_msg_init(struct avs_ipc *ipc, struct avs_ipc_msg *reply)
361 {
362 lockdep_assert_held(&ipc->rx_lock);
363
364 ipc->rx.header = 0;
365 ipc->rx.size = reply ? reply->size : 0;
366 ipc->rx_completed = false;
367
368 reinit_completion(&ipc->done_completion);
369 reinit_completion(&ipc->busy_completion);
370 }
371
avs_dsp_send_tx(struct avs_dev * adev,struct avs_ipc_msg * tx,bool read_fwregs)372 static void avs_dsp_send_tx(struct avs_dev *adev, struct avs_ipc_msg *tx, bool read_fwregs)
373 {
374 const struct avs_spec *const spec = adev->spec;
375 u32 sts = UINT_MAX;
376 u32 lec = UINT_MAX;
377
378 tx->header |= spec->hipc->req_busy_mask;
379 if (read_fwregs) {
380 sts = snd_hdac_adsp_readl(adev, AVS_FW_REG_STATUS(adev));
381 lec = snd_hdac_adsp_readl(adev, AVS_FW_REG_ERROR(adev));
382 }
383
384 trace_avs_request(tx, sts, lec);
385
386 if (tx->size)
387 memcpy_toio(avs_downlink_addr(adev), tx->data, tx->size);
388 snd_hdac_adsp_writel(adev, spec->hipc->req_ext_offset, tx->header >> 32);
389 snd_hdac_adsp_writel(adev, spec->hipc->req_offset, tx->header & UINT_MAX);
390 }
391
avs_dsp_do_send_msg(struct avs_dev * adev,struct avs_ipc_msg * request,struct avs_ipc_msg * reply,int timeout,const char * name)392 static int avs_dsp_do_send_msg(struct avs_dev *adev, struct avs_ipc_msg *request,
393 struct avs_ipc_msg *reply, int timeout, const char *name)
394 {
395 struct avs_ipc *ipc = adev->ipc;
396 int ret;
397
398 guard(mutex)(&ipc->msg_mutex);
399
400 if (!ipc->ready)
401 return -EPERM;
402
403 spin_lock(&ipc->rx_lock);
404 avs_ipc_msg_init(ipc, reply);
405 avs_dsp_send_tx(adev, request, true);
406 spin_unlock(&ipc->rx_lock);
407
408 ret = avs_ipc_wait_busy_completion(ipc, timeout);
409 if (ret) {
410 if (ret == -ETIMEDOUT) {
411 union avs_notify_msg msg = AVS_NOTIFICATION(EXCEPTION_CAUGHT);
412
413 /* Same treatment as on exception, just stack_dump=0. */
414 avs_dsp_exception_caught(adev, &msg);
415 }
416 return ret;
417 }
418
419 ret = ipc->rx.rsp.status;
420 /*
421 * If IPC channel is blocked e.g.: due to ongoing recovery,
422 * -EPERM error code is expected and thus it's not an actual error.
423 *
424 * Unsupported IPCs are of no harm either.
425 */
426 if (ret == -EPERM || ret == AVS_IPC_NOT_SUPPORTED)
427 dev_dbg(adev->dev, "%s (0x%08x 0x%08x) failed: %d\n",
428 name, request->glb.primary, request->glb.ext.val, ret);
429 else if (ret)
430 dev_err(adev->dev, "%s (0x%08x 0x%08x) failed: %d\n",
431 name, request->glb.primary, request->glb.ext.val, ret);
432
433 if (reply) {
434 reply->header = ipc->rx.header;
435 reply->size = ipc->rx.size;
436 if (reply->data && ipc->rx.size)
437 memcpy(reply->data, ipc->rx.data, reply->size);
438 }
439
440 return ret;
441 }
442
avs_dsp_send_msg_sequence(struct avs_dev * adev,struct avs_ipc_msg * request,struct avs_ipc_msg * reply,int timeout,bool wake_d0i0,bool schedule_d0ix,const char * name)443 static int avs_dsp_send_msg_sequence(struct avs_dev *adev, struct avs_ipc_msg *request,
444 struct avs_ipc_msg *reply, int timeout, bool wake_d0i0,
445 bool schedule_d0ix, const char *name)
446 {
447 int ret;
448
449 trace_avs_d0ix("wake", wake_d0i0, request->header);
450 if (wake_d0i0) {
451 ret = avs_dsp_wake_d0i0(adev, request);
452 if (ret)
453 return ret;
454 }
455
456 ret = avs_dsp_do_send_msg(adev, request, reply, timeout, name);
457 if (ret)
458 return ret;
459
460 trace_avs_d0ix("schedule", schedule_d0ix, request->header);
461 if (schedule_d0ix)
462 avs_dsp_schedule_d0ix(adev, request);
463
464 return 0;
465 }
466
avs_dsp_send_msg_timeout(struct avs_dev * adev,struct avs_ipc_msg * request,struct avs_ipc_msg * reply,int timeout,const char * name)467 int avs_dsp_send_msg_timeout(struct avs_dev *adev, struct avs_ipc_msg *request,
468 struct avs_ipc_msg *reply, int timeout, const char *name)
469 {
470 bool wake_d0i0 = avs_dsp_op(adev, d0ix_toggle, request, true);
471 bool schedule_d0ix = avs_dsp_op(adev, d0ix_toggle, request, false);
472
473 return avs_dsp_send_msg_sequence(adev, request, reply, timeout, wake_d0i0, schedule_d0ix,
474 name);
475 }
476
avs_dsp_send_msg(struct avs_dev * adev,struct avs_ipc_msg * request,struct avs_ipc_msg * reply,const char * name)477 int avs_dsp_send_msg(struct avs_dev *adev, struct avs_ipc_msg *request,
478 struct avs_ipc_msg *reply, const char *name)
479 {
480 return avs_dsp_send_msg_timeout(adev, request, reply, adev->ipc->default_timeout_ms, name);
481 }
482
avs_dsp_send_pm_msg_timeout(struct avs_dev * adev,struct avs_ipc_msg * request,struct avs_ipc_msg * reply,int timeout,bool wake_d0i0,const char * name)483 int avs_dsp_send_pm_msg_timeout(struct avs_dev *adev, struct avs_ipc_msg *request,
484 struct avs_ipc_msg *reply, int timeout, bool wake_d0i0,
485 const char *name)
486 {
487 return avs_dsp_send_msg_sequence(adev, request, reply, timeout, wake_d0i0, false, name);
488 }
489
avs_dsp_send_pm_msg(struct avs_dev * adev,struct avs_ipc_msg * request,struct avs_ipc_msg * reply,bool wake_d0i0,const char * name)490 int avs_dsp_send_pm_msg(struct avs_dev *adev, struct avs_ipc_msg *request,
491 struct avs_ipc_msg *reply, bool wake_d0i0, const char *name)
492 {
493 return avs_dsp_send_pm_msg_timeout(adev, request, reply, adev->ipc->default_timeout_ms,
494 wake_d0i0, name);
495 }
496
avs_dsp_do_send_rom_msg(struct avs_dev * adev,struct avs_ipc_msg * request,int timeout,const char * name)497 static int avs_dsp_do_send_rom_msg(struct avs_dev *adev, struct avs_ipc_msg *request, int timeout,
498 const char *name)
499 {
500 struct avs_ipc *ipc = adev->ipc;
501 int ret;
502
503 guard(mutex)(&ipc->msg_mutex);
504
505 spin_lock(&ipc->rx_lock);
506 avs_ipc_msg_init(ipc, NULL);
507 /*
508 * with hw still stalled, memory windows may not be
509 * configured properly so avoid accessing SRAM
510 */
511 avs_dsp_send_tx(adev, request, false);
512 spin_unlock(&ipc->rx_lock);
513
514 /* ROM messages must be sent before main core is unstalled */
515 ret = avs_dsp_op(adev, stall, AVS_MAIN_CORE_MASK, false);
516 if (!ret) {
517 ret = wait_for_completion_timeout(&ipc->done_completion, msecs_to_jiffies(timeout));
518 ret = ret ? 0 : -ETIMEDOUT;
519 }
520 if (ret)
521 dev_err(adev->dev, "%s (0x%08x 0x%08x) failed: %d\n",
522 name, request->glb.primary, request->glb.ext.val, ret);
523
524 return ret;
525 }
526
avs_dsp_send_rom_msg_timeout(struct avs_dev * adev,struct avs_ipc_msg * request,int timeout,const char * name)527 int avs_dsp_send_rom_msg_timeout(struct avs_dev *adev, struct avs_ipc_msg *request, int timeout,
528 const char *name)
529 {
530 return avs_dsp_do_send_rom_msg(adev, request, timeout, name);
531 }
532
avs_dsp_send_rom_msg(struct avs_dev * adev,struct avs_ipc_msg * request,const char * name)533 int avs_dsp_send_rom_msg(struct avs_dev *adev, struct avs_ipc_msg *request, const char *name)
534 {
535 return avs_dsp_send_rom_msg_timeout(adev, request, adev->ipc->default_timeout_ms, name);
536 }
537
avs_dsp_interrupt_control(struct avs_dev * adev,bool enable)538 void avs_dsp_interrupt_control(struct avs_dev *adev, bool enable)
539 {
540 const struct avs_spec *const spec = adev->spec;
541 u32 value, mask;
542
543 /*
544 * No particular bit setting order. All of these are required
545 * to have a functional SW <-> FW communication.
546 */
547 value = enable ? AVS_ADSP_ADSPIC_IPC : 0;
548 snd_hdac_adsp_updatel(adev, AVS_ADSP_REG_ADSPIC, AVS_ADSP_ADSPIC_IPC, value);
549
550 mask = AVS_ADSP_HIPCCTL_DONE | AVS_ADSP_HIPCCTL_BUSY;
551 value = enable ? mask : 0;
552 snd_hdac_adsp_updatel(adev, spec->hipc->ctl_offset, mask, value);
553 }
554
avs_ipc_init(struct avs_ipc * ipc,struct device * dev)555 int avs_ipc_init(struct avs_ipc *ipc, struct device *dev)
556 {
557 ipc->rx.data = devm_kzalloc(dev, AVS_MAILBOX_SIZE, GFP_KERNEL);
558 if (!ipc->rx.data)
559 return -ENOMEM;
560
561 ipc->dev = dev;
562 ipc->ready = false;
563 ipc->default_timeout_ms = AVS_IPC_TIMEOUT_MS;
564 INIT_WORK(&ipc->recovery_work, avs_dsp_recovery_work);
565 INIT_DELAYED_WORK(&ipc->d0ix_work, avs_dsp_d0ix_work);
566 init_completion(&ipc->done_completion);
567 init_completion(&ipc->busy_completion);
568 spin_lock_init(&ipc->rx_lock);
569 mutex_init(&ipc->msg_mutex);
570
571 return 0;
572 }
573
avs_ipc_block(struct avs_ipc * ipc)574 void avs_ipc_block(struct avs_ipc *ipc)
575 {
576 ipc->ready = false;
577 cancel_work_sync(&ipc->recovery_work);
578 cancel_delayed_work_sync(&ipc->d0ix_work);
579 ipc->in_d0ix = false;
580 }
581