spu_task_sync.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667
  1. /*
  2. * Cell Broadband Engine OProfile Support
  3. *
  4. * (C) Copyright IBM Corporation 2006
  5. *
  6. * Author: Maynard Johnson <maynardj@us.ibm.com>
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. */
  13. /* The purpose of this file is to handle SPU event task switching
  14. * and to record SPU context information into the OProfile
  15. * event buffer.
  16. *
  17. * Additionally, the spu_sync_buffer function is provided as a helper
  18. * for recoding actual SPU program counter samples to the event buffer.
  19. */
  20. #include <linux/dcookies.h>
  21. #include <linux/kref.h>
  22. #include <linux/mm.h>
  23. #include <linux/fs.h>
  24. #include <linux/module.h>
  25. #include <linux/notifier.h>
  26. #include <linux/numa.h>
  27. #include <linux/oprofile.h>
  28. #include <linux/slab.h>
  29. #include <linux/spinlock.h>
  30. #include "pr_util.h"
  31. #define RELEASE_ALL 9999
  32. static DEFINE_SPINLOCK(buffer_lock);
  33. static DEFINE_SPINLOCK(cache_lock);
  34. static int num_spu_nodes;
  35. int spu_prof_num_nodes;
  36. struct spu_buffer spu_buff[MAX_NUMNODES * SPUS_PER_NODE];
  37. struct delayed_work spu_work;
  38. static unsigned max_spu_buff;
  39. static void spu_buff_add(unsigned long int value, int spu)
  40. {
  41. /* spu buff is a circular buffer. Add entries to the
  42. * head. Head is the index to store the next value.
  43. * The buffer is full when there is one available entry
  44. * in the queue, i.e. head and tail can't be equal.
  45. * That way we can tell the difference between the
  46. * buffer being full versus empty.
  47. *
  48. * ASSUPTION: the buffer_lock is held when this function
  49. * is called to lock the buffer, head and tail.
  50. */
  51. int full = 1;
  52. if (spu_buff[spu].head >= spu_buff[spu].tail) {
  53. if ((spu_buff[spu].head - spu_buff[spu].tail)
  54. < (max_spu_buff - 1))
  55. full = 0;
  56. } else if (spu_buff[spu].tail > spu_buff[spu].head) {
  57. if ((spu_buff[spu].tail - spu_buff[spu].head)
  58. > 1)
  59. full = 0;
  60. }
  61. if (!full) {
  62. spu_buff[spu].buff[spu_buff[spu].head] = value;
  63. spu_buff[spu].head++;
  64. if (spu_buff[spu].head >= max_spu_buff)
  65. spu_buff[spu].head = 0;
  66. } else {
  67. /* From the user's perspective make the SPU buffer
  68. * size management/overflow look like we are using
  69. * per cpu buffers. The user uses the same
  70. * per cpu parameter to adjust the SPU buffer size.
  71. * Increment the sample_lost_overflow to inform
  72. * the user the buffer size needs to be increased.
  73. */
  74. oprofile_cpu_buffer_inc_smpl_lost();
  75. }
  76. }
  77. /* This function copies the per SPU buffers to the
  78. * OProfile kernel buffer.
  79. */
  80. void sync_spu_buff(void)
  81. {
  82. int spu;
  83. unsigned long flags;
  84. int curr_head;
  85. for (spu = 0; spu < num_spu_nodes; spu++) {
  86. /* In case there was an issue and the buffer didn't
  87. * get created skip it.
  88. */
  89. if (spu_buff[spu].buff == NULL)
  90. continue;
  91. /* Hold the lock to make sure the head/tail
  92. * doesn't change while spu_buff_add() is
  93. * deciding if the buffer is full or not.
  94. * Being a little paranoid.
  95. */
  96. spin_lock_irqsave(&buffer_lock, flags);
  97. curr_head = spu_buff[spu].head;
  98. spin_unlock_irqrestore(&buffer_lock, flags);
  99. /* Transfer the current contents to the kernel buffer.
  100. * data can still be added to the head of the buffer.
  101. */
  102. oprofile_put_buff(spu_buff[spu].buff,
  103. spu_buff[spu].tail,
  104. curr_head, max_spu_buff);
  105. spin_lock_irqsave(&buffer_lock, flags);
  106. spu_buff[spu].tail = curr_head;
  107. spin_unlock_irqrestore(&buffer_lock, flags);
  108. }
  109. }
  110. static void wq_sync_spu_buff(struct work_struct *work)
  111. {
  112. /* move data from spu buffers to kernel buffer */
  113. sync_spu_buff();
  114. /* only reschedule if profiling is not done */
  115. if (spu_prof_running)
  116. schedule_delayed_work(&spu_work, DEFAULT_TIMER_EXPIRE);
  117. }
  118. /* Container for caching information about an active SPU task. */
  119. struct cached_info {
  120. struct vma_to_fileoffset_map *map;
  121. struct spu *the_spu; /* needed to access pointer to local_store */
  122. struct kref cache_ref;
  123. };
  124. static struct cached_info *spu_info[MAX_NUMNODES * 8];
  125. static void destroy_cached_info(struct kref *kref)
  126. {
  127. struct cached_info *info;
  128. info = container_of(kref, struct cached_info, cache_ref);
  129. vma_map_free(info->map);
  130. kfree(info);
  131. module_put(THIS_MODULE);
  132. }
  133. /* Return the cached_info for the passed SPU number.
  134. * ATTENTION: Callers are responsible for obtaining the
  135. * cache_lock if needed prior to invoking this function.
  136. */
  137. static struct cached_info *get_cached_info(struct spu *the_spu, int spu_num)
  138. {
  139. struct kref *ref;
  140. struct cached_info *ret_info;
  141. if (spu_num >= num_spu_nodes) {
  142. printk(KERN_ERR "SPU_PROF: "
  143. "%s, line %d: Invalid index %d into spu info cache\n",
  144. __func__, __LINE__, spu_num);
  145. ret_info = NULL;
  146. goto out;
  147. }
  148. if (!spu_info[spu_num] && the_spu) {
  149. ref = spu_get_profile_private_kref(the_spu->ctx);
  150. if (ref) {
  151. spu_info[spu_num] = container_of(ref, struct cached_info, cache_ref);
  152. kref_get(&spu_info[spu_num]->cache_ref);
  153. }
  154. }
  155. ret_info = spu_info[spu_num];
  156. out:
  157. return ret_info;
  158. }
  159. /* Looks for cached info for the passed spu. If not found, the
  160. * cached info is created for the passed spu.
  161. * Returns 0 for success; otherwise, -1 for error.
  162. */
  163. static int
  164. prepare_cached_spu_info(struct spu *spu, unsigned long objectId)
  165. {
  166. unsigned long flags;
  167. struct vma_to_fileoffset_map *new_map;
  168. int retval = 0;
  169. struct cached_info *info;
  170. /* We won't bother getting cache_lock here since
  171. * don't do anything with the cached_info that's returned.
  172. */
  173. info = get_cached_info(spu, spu->number);
  174. if (info) {
  175. pr_debug("Found cached SPU info.\n");
  176. goto out;
  177. }
  178. /* Create cached_info and set spu_info[spu->number] to point to it.
  179. * spu->number is a system-wide value, not a per-node value.
  180. */
  181. info = kzalloc(sizeof(struct cached_info), GFP_KERNEL);
  182. if (!info) {
  183. printk(KERN_ERR "SPU_PROF: "
  184. "%s, line %d: create vma_map failed\n",
  185. __func__, __LINE__);
  186. retval = -ENOMEM;
  187. goto err_alloc;
  188. }
  189. new_map = create_vma_map(spu, objectId);
  190. if (!new_map) {
  191. printk(KERN_ERR "SPU_PROF: "
  192. "%s, line %d: create vma_map failed\n",
  193. __func__, __LINE__);
  194. retval = -ENOMEM;
  195. goto err_alloc;
  196. }
  197. pr_debug("Created vma_map\n");
  198. info->map = new_map;
  199. info->the_spu = spu;
  200. kref_init(&info->cache_ref);
  201. spin_lock_irqsave(&cache_lock, flags);
  202. spu_info[spu->number] = info;
  203. /* Increment count before passing off ref to SPUFS. */
  204. kref_get(&info->cache_ref);
  205. /* We increment the module refcount here since SPUFS is
  206. * responsible for the final destruction of the cached_info,
  207. * and it must be able to access the destroy_cached_info()
  208. * function defined in the OProfile module. We decrement
  209. * the module refcount in destroy_cached_info.
  210. */
  211. try_module_get(THIS_MODULE);
  212. spu_set_profile_private_kref(spu->ctx, &info->cache_ref,
  213. destroy_cached_info);
  214. spin_unlock_irqrestore(&cache_lock, flags);
  215. goto out;
  216. err_alloc:
  217. kfree(info);
  218. out:
  219. return retval;
  220. }
  221. /*
  222. * NOTE: The caller is responsible for locking the
  223. * cache_lock prior to calling this function.
  224. */
  225. static int release_cached_info(int spu_index)
  226. {
  227. int index, end;
  228. if (spu_index == RELEASE_ALL) {
  229. end = num_spu_nodes;
  230. index = 0;
  231. } else {
  232. if (spu_index >= num_spu_nodes) {
  233. printk(KERN_ERR "SPU_PROF: "
  234. "%s, line %d: "
  235. "Invalid index %d into spu info cache\n",
  236. __func__, __LINE__, spu_index);
  237. goto out;
  238. }
  239. end = spu_index + 1;
  240. index = spu_index;
  241. }
  242. for (; index < end; index++) {
  243. if (spu_info[index]) {
  244. kref_put(&spu_info[index]->cache_ref,
  245. destroy_cached_info);
  246. spu_info[index] = NULL;
  247. }
  248. }
  249. out:
  250. return 0;
  251. }
  252. /* The source code for fast_get_dcookie was "borrowed"
  253. * from drivers/oprofile/buffer_sync.c.
  254. */
  255. /* Optimisation. We can manage without taking the dcookie sem
  256. * because we cannot reach this code without at least one
  257. * dcookie user still being registered (namely, the reader
  258. * of the event buffer).
  259. */
  260. static inline unsigned long fast_get_dcookie(struct path *path)
  261. {
  262. unsigned long cookie;
  263. if (path->dentry->d_flags & DCACHE_COOKIE)
  264. return (unsigned long)path->dentry;
  265. get_dcookie(path, &cookie);
  266. return cookie;
  267. }
  268. /* Look up the dcookie for the task's first VM_EXECUTABLE mapping,
  269. * which corresponds loosely to "application name". Also, determine
  270. * the offset for the SPU ELF object. If computed offset is
  271. * non-zero, it implies an embedded SPU object; otherwise, it's a
  272. * separate SPU binary, in which case we retrieve it's dcookie.
  273. * For the embedded case, we must determine if SPU ELF is embedded
  274. * in the executable application or another file (i.e., shared lib).
  275. * If embedded in a shared lib, we must get the dcookie and return
  276. * that to the caller.
  277. */
  278. static unsigned long
  279. get_exec_dcookie_and_offset(struct spu *spu, unsigned int *offsetp,
  280. unsigned long *spu_bin_dcookie,
  281. unsigned long spu_ref)
  282. {
  283. unsigned long app_cookie = 0;
  284. unsigned int my_offset = 0;
  285. struct file *app = NULL;
  286. struct vm_area_struct *vma;
  287. struct mm_struct *mm = spu->mm;
  288. if (!mm)
  289. goto out;
  290. down_read(&mm->mmap_sem);
  291. for (vma = mm->mmap; vma; vma = vma->vm_next) {
  292. if (!vma->vm_file)
  293. continue;
  294. if (!(vma->vm_flags & VM_EXECUTABLE))
  295. continue;
  296. app_cookie = fast_get_dcookie(&vma->vm_file->f_path);
  297. pr_debug("got dcookie for %s\n",
  298. vma->vm_file->f_dentry->d_name.name);
  299. app = vma->vm_file;
  300. break;
  301. }
  302. for (vma = mm->mmap; vma; vma = vma->vm_next) {
  303. if (vma->vm_start > spu_ref || vma->vm_end <= spu_ref)
  304. continue;
  305. my_offset = spu_ref - vma->vm_start;
  306. if (!vma->vm_file)
  307. goto fail_no_image_cookie;
  308. pr_debug("Found spu ELF at %X(object-id:%lx) for file %s\n",
  309. my_offset, spu_ref,
  310. vma->vm_file->f_dentry->d_name.name);
  311. *offsetp = my_offset;
  312. break;
  313. }
  314. *spu_bin_dcookie = fast_get_dcookie(&vma->vm_file->f_path);
  315. pr_debug("got dcookie for %s\n", vma->vm_file->f_dentry->d_name.name);
  316. up_read(&mm->mmap_sem);
  317. out:
  318. return app_cookie;
  319. fail_no_image_cookie:
  320. up_read(&mm->mmap_sem);
  321. printk(KERN_ERR "SPU_PROF: "
  322. "%s, line %d: Cannot find dcookie for SPU binary\n",
  323. __func__, __LINE__);
  324. goto out;
  325. }
  326. /* This function finds or creates cached context information for the
  327. * passed SPU and records SPU context information into the OProfile
  328. * event buffer.
  329. */
  330. static int process_context_switch(struct spu *spu, unsigned long objectId)
  331. {
  332. unsigned long flags;
  333. int retval;
  334. unsigned int offset = 0;
  335. unsigned long spu_cookie = 0, app_dcookie;
  336. retval = prepare_cached_spu_info(spu, objectId);
  337. if (retval)
  338. goto out;
  339. /* Get dcookie first because a mutex_lock is taken in that
  340. * code path, so interrupts must not be disabled.
  341. */
  342. app_dcookie = get_exec_dcookie_and_offset(spu, &offset, &spu_cookie, objectId);
  343. if (!app_dcookie || !spu_cookie) {
  344. retval = -ENOENT;
  345. goto out;
  346. }
  347. /* Record context info in event buffer */
  348. spin_lock_irqsave(&buffer_lock, flags);
  349. spu_buff_add(ESCAPE_CODE, spu->number);
  350. spu_buff_add(SPU_CTX_SWITCH_CODE, spu->number);
  351. spu_buff_add(spu->number, spu->number);
  352. spu_buff_add(spu->pid, spu->number);
  353. spu_buff_add(spu->tgid, spu->number);
  354. spu_buff_add(app_dcookie, spu->number);
  355. spu_buff_add(spu_cookie, spu->number);
  356. spu_buff_add(offset, spu->number);
  357. /* Set flag to indicate SPU PC data can now be written out. If
  358. * the SPU program counter data is seen before an SPU context
  359. * record is seen, the postprocessing will fail.
  360. */
  361. spu_buff[spu->number].ctx_sw_seen = 1;
  362. spin_unlock_irqrestore(&buffer_lock, flags);
  363. smp_wmb(); /* insure spu event buffer updates are written */
  364. /* don't want entries intermingled... */
  365. out:
  366. return retval;
  367. }
  368. /*
  369. * This function is invoked on either a bind_context or unbind_context.
  370. * If called for an unbind_context, the val arg is 0; otherwise,
  371. * it is the object-id value for the spu context.
  372. * The data arg is of type 'struct spu *'.
  373. */
  374. static int spu_active_notify(struct notifier_block *self, unsigned long val,
  375. void *data)
  376. {
  377. int retval;
  378. unsigned long flags;
  379. struct spu *the_spu = data;
  380. pr_debug("SPU event notification arrived\n");
  381. if (!val) {
  382. spin_lock_irqsave(&cache_lock, flags);
  383. retval = release_cached_info(the_spu->number);
  384. spin_unlock_irqrestore(&cache_lock, flags);
  385. } else {
  386. retval = process_context_switch(the_spu, val);
  387. }
  388. return retval;
  389. }
  390. static struct notifier_block spu_active = {
  391. .notifier_call = spu_active_notify,
  392. };
  393. static int number_of_online_nodes(void)
  394. {
  395. u32 cpu; u32 tmp;
  396. int nodes = 0;
  397. for_each_online_cpu(cpu) {
  398. tmp = cbe_cpu_to_node(cpu) + 1;
  399. if (tmp > nodes)
  400. nodes++;
  401. }
  402. return nodes;
  403. }
  404. static int oprofile_spu_buff_create(void)
  405. {
  406. int spu;
  407. max_spu_buff = oprofile_get_cpu_buffer_size();
  408. for (spu = 0; spu < num_spu_nodes; spu++) {
  409. /* create circular buffers to store the data in.
  410. * use locks to manage accessing the buffers
  411. */
  412. spu_buff[spu].head = 0;
  413. spu_buff[spu].tail = 0;
  414. /*
  415. * Create a buffer for each SPU. Can't reliably
  416. * create a single buffer for all spus due to not
  417. * enough contiguous kernel memory.
  418. */
  419. spu_buff[spu].buff = kzalloc((max_spu_buff
  420. * sizeof(unsigned long)),
  421. GFP_KERNEL);
  422. if (!spu_buff[spu].buff) {
  423. printk(KERN_ERR "SPU_PROF: "
  424. "%s, line %d: oprofile_spu_buff_create "
  425. "failed to allocate spu buffer %d.\n",
  426. __func__, __LINE__, spu);
  427. /* release the spu buffers that have been allocated */
  428. while (spu >= 0) {
  429. kfree(spu_buff[spu].buff);
  430. spu_buff[spu].buff = 0;
  431. spu--;
  432. }
  433. return -ENOMEM;
  434. }
  435. }
  436. return 0;
  437. }
  438. /* The main purpose of this function is to synchronize
  439. * OProfile with SPUFS by registering to be notified of
  440. * SPU task switches.
  441. *
  442. * NOTE: When profiling SPUs, we must ensure that only
  443. * spu_sync_start is invoked and not the generic sync_start
  444. * in drivers/oprofile/oprof.c. A return value of
  445. * SKIP_GENERIC_SYNC or SYNC_START_ERROR will
  446. * accomplish this.
  447. */
  448. int spu_sync_start(void)
  449. {
  450. int spu;
  451. int ret = SKIP_GENERIC_SYNC;
  452. int register_ret;
  453. unsigned long flags = 0;
  454. spu_prof_num_nodes = number_of_online_nodes();
  455. num_spu_nodes = spu_prof_num_nodes * 8;
  456. INIT_DELAYED_WORK(&spu_work, wq_sync_spu_buff);
  457. /* create buffer for storing the SPU data to put in
  458. * the kernel buffer.
  459. */
  460. ret = oprofile_spu_buff_create();
  461. if (ret)
  462. goto out;
  463. spin_lock_irqsave(&buffer_lock, flags);
  464. for (spu = 0; spu < num_spu_nodes; spu++) {
  465. spu_buff_add(ESCAPE_CODE, spu);
  466. spu_buff_add(SPU_PROFILING_CODE, spu);
  467. spu_buff_add(num_spu_nodes, spu);
  468. }
  469. spin_unlock_irqrestore(&buffer_lock, flags);
  470. for (spu = 0; spu < num_spu_nodes; spu++) {
  471. spu_buff[spu].ctx_sw_seen = 0;
  472. spu_buff[spu].last_guard_val = 0;
  473. }
  474. /* Register for SPU events */
  475. register_ret = spu_switch_event_register(&spu_active);
  476. if (register_ret) {
  477. ret = SYNC_START_ERROR;
  478. goto out;
  479. }
  480. pr_debug("spu_sync_start -- running.\n");
  481. out:
  482. return ret;
  483. }
  484. /* Record SPU program counter samples to the oprofile event buffer. */
  485. void spu_sync_buffer(int spu_num, unsigned int *samples,
  486. int num_samples)
  487. {
  488. unsigned long long file_offset;
  489. unsigned long flags;
  490. int i;
  491. struct vma_to_fileoffset_map *map;
  492. struct spu *the_spu;
  493. unsigned long long spu_num_ll = spu_num;
  494. unsigned long long spu_num_shifted = spu_num_ll << 32;
  495. struct cached_info *c_info;
  496. /* We need to obtain the cache_lock here because it's
  497. * possible that after getting the cached_info, the SPU job
  498. * corresponding to this cached_info may end, thus resulting
  499. * in the destruction of the cached_info.
  500. */
  501. spin_lock_irqsave(&cache_lock, flags);
  502. c_info = get_cached_info(NULL, spu_num);
  503. if (!c_info) {
  504. /* This legitimately happens when the SPU task ends before all
  505. * samples are recorded.
  506. * No big deal -- so we just drop a few samples.
  507. */
  508. pr_debug("SPU_PROF: No cached SPU contex "
  509. "for SPU #%d. Dropping samples.\n", spu_num);
  510. goto out;
  511. }
  512. map = c_info->map;
  513. the_spu = c_info->the_spu;
  514. spin_lock(&buffer_lock);
  515. for (i = 0; i < num_samples; i++) {
  516. unsigned int sample = *(samples+i);
  517. int grd_val = 0;
  518. file_offset = 0;
  519. if (sample == 0)
  520. continue;
  521. file_offset = vma_map_lookup( map, sample, the_spu, &grd_val);
  522. /* If overlays are used by this SPU application, the guard
  523. * value is non-zero, indicating which overlay section is in
  524. * use. We need to discard samples taken during the time
  525. * period which an overlay occurs (i.e., guard value changes).
  526. */
  527. if (grd_val && grd_val != spu_buff[spu_num].last_guard_val) {
  528. spu_buff[spu_num].last_guard_val = grd_val;
  529. /* Drop the rest of the samples. */
  530. break;
  531. }
  532. /* We must ensure that the SPU context switch has been written
  533. * out before samples for the SPU. Otherwise, the SPU context
  534. * information is not available and the postprocessing of the
  535. * SPU PC will fail with no available anonymous map information.
  536. */
  537. if (spu_buff[spu_num].ctx_sw_seen)
  538. spu_buff_add((file_offset | spu_num_shifted),
  539. spu_num);
  540. }
  541. spin_unlock(&buffer_lock);
  542. out:
  543. spin_unlock_irqrestore(&cache_lock, flags);
  544. }
  545. int spu_sync_stop(void)
  546. {
  547. unsigned long flags = 0;
  548. int ret;
  549. int k;
  550. ret = spu_switch_event_unregister(&spu_active);
  551. if (ret)
  552. printk(KERN_ERR "SPU_PROF: "
  553. "%s, line %d: spu_switch_event_unregister " \
  554. "returned %d\n",
  555. __func__, __LINE__, ret);
  556. /* flush any remaining data in the per SPU buffers */
  557. sync_spu_buff();
  558. spin_lock_irqsave(&cache_lock, flags);
  559. ret = release_cached_info(RELEASE_ALL);
  560. spin_unlock_irqrestore(&cache_lock, flags);
  561. /* remove scheduled work queue item rather then waiting
  562. * for every queued entry to execute. Then flush pending
  563. * system wide buffer to event buffer.
  564. */
  565. cancel_delayed_work(&spu_work);
  566. for (k = 0; k < num_spu_nodes; k++) {
  567. spu_buff[k].ctx_sw_seen = 0;
  568. /*
  569. * spu_sys_buff will be null if there was a problem
  570. * allocating the buffer. Only delete if it exists.
  571. */
  572. kfree(spu_buff[k].buff);
  573. spu_buff[k].buff = 0;
  574. }
  575. pr_debug("spu_sync_stop -- done.\n");
  576. return ret;
  577. }