s3c-fb: add support for DMA channel control on S5PV210
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / block / xsysace.c
index ac278ac908d50a8b27046d5a3424558809e0f621..b71888b909a0e43dea2ad8cf36faffb1de27701b 100644 (file)
@@ -89,6 +89,7 @@
 #include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/blkdev.h>
+#include <linux/smp_lock.h>
 #include <linux/ata.h>
 #include <linux/hdreg.h>
 #include <linux/platform_device.h>
@@ -901,11 +902,14 @@ static int ace_open(struct block_device *bdev, fmode_t mode)
 
        dev_dbg(ace->dev, "ace_open() users=%i\n", ace->users + 1);
 
+       lock_kernel();
        spin_lock_irqsave(&ace->lock, flags);
        ace->users++;
        spin_unlock_irqrestore(&ace->lock, flags);
 
        check_disk_change(bdev);
+       unlock_kernel();
+
        return 0;
 }
 
@@ -917,6 +921,7 @@ static int ace_release(struct gendisk *disk, fmode_t mode)
 
        dev_dbg(ace->dev, "ace_release() users=%i\n", ace->users - 1);
 
+       lock_kernel();
        spin_lock_irqsave(&ace->lock, flags);
        ace->users--;
        if (ace->users == 0) {
@@ -924,6 +929,7 @@ static int ace_release(struct gendisk *disk, fmode_t mode)
                ace_out(ace, ACE_CTRL, val & ~ACE_CTRL_LOCKREQ);
        }
        spin_unlock_irqrestore(&ace->lock, flags);
+       unlock_kernel();
        return 0;
 }