summaryrefslogtreecommitdiff
path: root/drivers/staging/poch
diff options
context:
space:
mode:
authorVijay Kumar <vijaykumar@bravegnu.org>2008-10-29 08:58:40 +0530
committerGreg Kroah-Hartman <gregkh@suse.de>2009-01-06 13:52:04 -0800
commit1b8ee916f5e5f0de1367a5a437ba504a96953836 (patch)
treee01797dc0f00166cd6bd66375300ddf1c03900c1 /drivers/staging/poch
parentbf437012503cc99519e20b4a8bddf830cdaae794 (diff)
Staging: poch: Fine grained locking
Lock only the portion of code that does register access. Signed-off-by: Vijay Kumar <vijaykumar@bravegnu.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/poch')
-rw-r--r--drivers/staging/poch/poch.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/staging/poch/poch.c b/drivers/staging/poch/poch.c
index 3ecbd7c43c48..1f14792b917e 100644
--- a/drivers/staging/poch/poch.c
+++ b/drivers/staging/poch/poch.c
@@ -485,27 +485,30 @@ static void channel_dma_init(struct channel_info *channel)
/* The DMA address page register is shared between the RX and
* TX channels, so acquire lock.
*/
- spin_lock(channel->iomem_lock);
for (i = 0; i < channel->group_count; i++) {
page = i / 32;
group_in_page = i % 32;
group_reg = group_regs_base + (group_in_page * 4);
+ spin_lock(channel->iomem_lock);
iowrite32(page, fpga + FPGA_DMA_ADR_PAGE_REG);
iowrite32(channel->groups[i].dma_addr, fpga + group_reg);
+ spin_unlock(channel->iomem_lock);
}
+
for (i = 0; i < channel->group_count; i++) {
page = i / 32;
group_in_page = i % 32;
group_reg = group_regs_base + (group_in_page * 4);
+ spin_lock(channel->iomem_lock);
iowrite32(page, fpga + FPGA_DMA_ADR_PAGE_REG);
printk(KERN_INFO PFX "%ld: read dma_addr: 0x%x\n", i,
ioread32(fpga + group_reg));
+ spin_unlock(channel->iomem_lock);
}
- spin_unlock(channel->iomem_lock);
}