Cleaned up stray spinlock sleep
authorTom Knot <tomasknot@gmail.com>
Wed, 27 Jun 2018 14:56:17 +0000 (16:56 +0200)
committerTom Knot <tomasknot@gmail.com>
Wed, 27 Jun 2018 14:56:17 +0000 (16:56 +0200)
modules/unipi/src/unipi_sysfs.c
version.txt

index 0a03e9ed76c8781b8f7216024b082355846cabbd..5824e98d6854428cfbda0f30e0b9799aa16a0fb2 100644 (file)
@@ -778,6 +778,7 @@ err_end:
 static ssize_t neuronspi_show_regmap(struct device *dev, struct device_attribute *attr, char *buf)
 {
        ssize_t ret = 0;
+       unsigned int target = 0;
        u32 val = 0;
        unsigned long flags;
        struct neuronspi_driver_data *n_spi;
@@ -787,9 +788,10 @@ static ssize_t neuronspi_show_regmap(struct device *dev, struct device_attribute
        spi = neuronspi_s_dev[n_spi->neuron_index];
        if (n_spi && n_spi->reg_map) {
                spin_lock_irqsave(&n_spi->sysfs_regmap_lock, flags);
-               regmap_read(n_spi->reg_map, n_spi->sysfs_regmap_target, &val);
-               ret = scnprintf(buf, 255, "%x\n", val);
+               target = n_spi->sysfs_regmap_target;
                spin_unlock_irqrestore(&n_spi->sysfs_regmap_lock, flags);
+               regmap_read(n_spi->reg_map, target, &val);
+               ret = scnprintf(buf, 255, "%x\n", val);
        }
        return ret;
 }
@@ -817,6 +819,7 @@ static ssize_t neuronspi_store_regmap_value(struct device *dev, struct device_at
 {
        ssize_t err = 0;
        unsigned int val = 0;
+       unsigned int target = 0;
        unsigned long flags;
        struct neuronspi_driver_data *n_spi;
        struct platform_device *plat = to_platform_device(dev);
@@ -825,8 +828,9 @@ static ssize_t neuronspi_store_regmap_value(struct device *dev, struct device_at
        if (err < 0) goto err_end;
        if (n_spi && n_spi->reg_map && val < 65536) {
                spin_lock_irqsave(&n_spi->sysfs_regmap_lock, flags);
-               regmap_write(n_spi->reg_map, n_spi->sysfs_regmap_target, val);
+               target = n_spi->sysfs_regmap_target;
                spin_unlock_irqrestore(&n_spi->sysfs_regmap_lock, flags);
+               regmap_write(n_spi->reg_map, n_spi->sysfs_regmap_target, val);
        }
 err_end:
        return count;
@@ -976,9 +980,7 @@ static ssize_t neuronspi_spi_gpio_show_di_count(struct device *dev, struct devic
        n_di = platform_get_drvdata(plat);
        n_spi = spi_get_drvdata(n_di->spi);
        if (n_spi->features && n_spi->features->di_count > 0 && n_spi->di_driver) {
-               spin_lock_irqsave(&n_spi->sysfs_regmap_lock, flags);
                ret = scnprintf(buf, 255, "%d\n", n_spi->di_driver[n_di->di_index]->gpio_c.ngpio);
-               spin_unlock_irqrestore(&n_spi->sysfs_regmap_lock, flags);
        }
        return ret;
 }
index 3d74b0f00ab685bd28ff1715e29a4b22ef51e9a2..26d3e6c39c11e35bd54c2e3b6d9690f50abc042c 100644 (file)
@@ -1 +1 @@
-Repository:neuron-kernel ActiveBranch:[uart_timeout] PrecedingRelease:v.0.12 PrecedingRevision:66(1438c36) LatestCommit:Wed Jun 27 15:43:47 CEST 2018
+Repository:neuron-kernel ActiveBranch:[uart_timeout] PrecedingRelease:v.0.12 PrecedingRevision:67(655f219) LatestCommit:Wed Jun 27 16:56:18 CEST 2018