diff options
| author | Rama Krishna Phani A <rphani@codeaurora.org> | 2016-09-12 18:34:18 +0530 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-09-13 23:39:34 -0700 |
| commit | db91b2eba72dc11f6e6d8f83a016c11e75d532a6 (patch) | |
| tree | 9ec8aea1007cac27df0aa0038535a9c8b8bd09d1 /drivers/platform | |
| parent | 9b82a4c5896632b62140d1ddda55638fea254007 (diff) | |
msm: sps: Avoid pipe disconnect while IRQ is in progress and viceversa
Client driver may disconnect pipe while some data is still
pending on the pipe and might not need IRQ for that data. Current
implementation might result in crash in case disconnect and IRQ happens
on same pipe in parallel. Implement lock to avoid pipe disconnect
while IRQ is in progress for that pipe and viceversa.
Change-Id: Icf43c0a18cfc1644270b684a792632a6c81f1797
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
Diffstat (limited to 'drivers/platform')
| -rw-r--r-- | drivers/platform/msm/sps/sps_bam.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/platform/msm/sps/sps_bam.c b/drivers/platform/msm/sps/sps_bam.c index f34242f29e2b..38a6474dd06f 100644 --- a/drivers/platform/msm/sps/sps_bam.c +++ b/drivers/platform/msm/sps/sps_bam.c @@ -1083,6 +1083,7 @@ int sps_bam_pipe_disconnect(struct sps_bam *dev, u32 pipe_index) { struct sps_pipe *pipe; int result; + unsigned long flags; if (pipe_index >= dev->props.num_pipes) { SPS_ERR(dev, "sps:Invalid BAM %pa pipe: %d\n", BAM_ID(dev), @@ -1094,8 +1095,10 @@ int sps_bam_pipe_disconnect(struct sps_bam *dev, u32 pipe_index) pipe = dev->pipes[pipe_index]; if (BAM_PIPE_IS_ASSIGNED(pipe)) { if ((dev->pipe_active_mask & (1UL << pipe_index))) { + spin_lock_irqsave(&dev->isr_lock, flags); list_del(&pipe->list); dev->pipe_active_mask &= ~(1UL << pipe_index); + spin_unlock_irqrestore(&dev->isr_lock, flags); } dev->pipe_remote_mask &= ~(1UL << pipe_index); if (pipe->connect.options & SPS_O_NO_DISABLE) |
