Skip to content
Snippets Groups Projects
Commit d43c52cf authored by Masayuki Ishikawa's avatar Masayuki Ishikawa
Browse files

arch/arm/src/lc823450: Assign I2S IRQ handling to CPU0


Previous commit assumed that the caller is running on CPU0.
However, the caller sometimes runs at CPU1.  This patch will
assign the caller to CPU0 explicitly.

Signed-off-by: default avatarMasayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
parent e276d4d1
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,10 @@
#include <nuttx/audio/audio.h>
#include <nuttx/audio/i2s.h>
#ifdef CONFIG_SMP
# include <nuttx/signal.h>
#endif
#include "up_arch.h"
#include "lc823450_dma.h"
#include "lc823450_i2s.h"
......@@ -460,8 +464,32 @@ FAR struct i2s_dev_s *lc823450_i2sdev_initialize(void)
nxsem_init(&_sem_txdma, 0, 0);
nxsem_init(&_sem_buf_under, 0, 0);
#ifdef CONFIG_SMP
cpu_set_t cpuset0;
cpu_set_t cpuset1;
CPU_ZERO(&cpuset1);
CPU_SET(0, &cpuset1);
/* Backup the current affinity */
sched_getaffinity(getpid(), sizeof(cpuset0), &cpuset0);
/* Set the new affinity which assigns to CPU0 */
sched_setaffinity(getpid(), sizeof(cpuset1), &cpuset1);
nxsig_usleep(10 * 1000);
#endif
irq_attach(LC823450_IRQ_AUDIOBUF0, _i2s_isr, NULL);
#ifdef CONFIG_SMP
/* Restore the original affinity */
sched_setaffinity(getpid(), sizeof(cpuset0), &cpuset0);
nxsig_usleep(10 * 1000);
#endif
/* Enable IRQ for Audio Buffer */
up_enable_irq(LC823450_IRQ_AUDIOBUF0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment