Skip to content

Commit

Permalink
ASoC: SOF: Intel: ipc: simplify spin-lock usage
Browse files Browse the repository at this point in the history
spin_lock_irqsave is not required, feedback from Takashi Iwai.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
  • Loading branch information
plbossart committed May 24, 2019
1 parent 072cf06 commit 924347d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 17 deletions.
6 changes: 2 additions & 4 deletions sound/soc/sof/intel/bdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,14 +281,12 @@ static irqreturn_t bdw_irq_thread(int irq, void *context)
/* reply message from DSP */
if (ipcx & SHIM_IPCX_DONE &&
!(imrx & SHIM_IMRX_DONE)) {
unsigned long flags;

/* Mask Done interrupt before return */
snd_sof_dsp_update_bits_unlocked(sdev, BDW_DSP_BAR,
SHIM_IMRX, SHIM_IMRX_DONE,
SHIM_IMRX_DONE);

spin_lock_irqsave(&sdev->ipc_lock, flags);
spin_lock_irq(&sdev->ipc_lock);

/*
* handle immediate reply from DSP core. If the msg is
Expand All @@ -302,7 +300,7 @@ static irqreturn_t bdw_irq_thread(int irq, void *context)

bdw_dsp_done(sdev);

spin_unlock_irqrestore(&sdev->ipc_lock, flags);
spin_unlock_irq(&sdev->ipc_lock);
}

ipcd = snd_sof_dsp_read(sdev, BDW_DSP_BAR, SHIM_IPCD);
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/sof/intel/byt.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,15 +327,13 @@ static irqreturn_t byt_irq_thread(int irq, void *context)
/* reply message from DSP */
if (ipcx & SHIM_BYT_IPCX_DONE &&
!(imrx & SHIM_IMRX_DONE)) {
unsigned long flags;

/* Mask Done interrupt before first */
snd_sof_dsp_update_bits64_unlocked(sdev, BYT_DSP_BAR,
SHIM_IMRX,
SHIM_IMRX_DONE,
SHIM_IMRX_DONE);

spin_lock_irqsave(&sdev->ipc_lock, flags);
spin_lock_irq(&sdev->ipc_lock);

/*
* handle immediate reply from DSP core. If the msg is
Expand All @@ -349,7 +347,7 @@ static irqreturn_t byt_irq_thread(int irq, void *context)

byt_dsp_done(sdev);

spin_unlock_irqrestore(&sdev->ipc_lock, flags);
spin_unlock_irq(&sdev->ipc_lock);
}

/* new message from DSP */
Expand Down
6 changes: 2 additions & 4 deletions sound/soc/sof/intel/cnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)

/* reply message from DSP */
if (hipcida & CNL_DSP_REG_HIPCIDA_DONE) {
unsigned long flags;

msg_ext = hipci & CNL_DSP_REG_HIPCIDR_MSG_MASK;
msg = hipcida & CNL_DSP_REG_HIPCIDA_MSG_MASK;

Expand All @@ -59,7 +57,7 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)
CNL_DSP_REG_HIPCCTL,
CNL_DSP_REG_HIPCCTL_DONE, 0);

spin_lock_irqsave(&sdev->ipc_lock, flags);
spin_lock_irq(&sdev->ipc_lock);

/* handle immediate reply from DSP core */
hda_dsp_ipc_get_reply(sdev);
Expand All @@ -72,7 +70,7 @@ static irqreturn_t cnl_ipc_irq_thread(int irq, void *context)

cnl_ipc_dsp_done(sdev);

spin_unlock_irqrestore(&sdev->ipc_lock, flags);
spin_unlock_irq(&sdev->ipc_lock);

ipc_irq = true;
}
Expand Down
7 changes: 2 additions & 5 deletions sound/soc/sof/intel/hda-ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,6 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context)

/* is this a reply message from the DSP */
if (hipcie & HDA_DSP_REG_HIPCIE_DONE) {
unsigned long flags;

msg = hipci & HDA_DSP_REG_HIPCI_MSG_MASK;
msg_ext = hipcie & HDA_DSP_REG_HIPCIE_MSG_MASK;

Expand All @@ -172,7 +170,7 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context)
* place, the message might not yet be marked as expecting a
* reply.
*/
spin_lock_irqsave(&sdev->ipc_lock, flags);
spin_lock_irq(&sdev->ipc_lock);

/* handle immediate reply from DSP core - ignore ROM messages */
if (hda_dsp_ipc_is_sof(msg)) {
Expand All @@ -189,14 +187,13 @@ irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context)
/* set the done bit */
hda_dsp_ipc_dsp_done(sdev);

spin_unlock_irqrestore(&sdev->ipc_lock, flags);
spin_unlock_irq(&sdev->ipc_lock);

ipc_irq = true;
}

/* is this a new message from DSP */
if (hipct & HDA_DSP_REG_HIPCT_BUSY) {

msg = hipct & HDA_DSP_REG_HIPCT_MSG_MASK;
msg_ext = hipcte & HDA_DSP_REG_HIPCTE_MSG_MASK;

Expand Down

0 comments on commit 924347d

Please sign in to comment.