1 The gpiommc configfs context structure needs locking, as configfs
2 does not lock access between files.
4 Index: linux-2.6.25.17/drivers/mmc/host/gpiommc.c
5 ===================================================================
6 --- linux-2.6.25.17.orig/drivers/mmc/host/gpiommc.c 2008-10-18 23:33:54.000000000 +0200
7 +++ linux-2.6.25.17/drivers/mmc/host/gpiommc.c 2008-10-18 23:34:33.000000000 +0200
8 @@ -140,6 +140,8 @@ struct gpiommc_configfs_device {
9 struct platform_device *pdev;
10 /* The configuration */
11 struct gpiommc_platform_data pdata;
12 + /* Mutex to protect this structure */
16 #define GPIO_INVALID -1
17 @@ -230,6 +232,8 @@ static ssize_t gpiommc_config_attr_show(
21 + mutex_lock(&dev->mutex);
23 if (attr == &gpiommc_attr_DI) {
24 gpio = dev->pdata.pins.gpio_di;
25 if (gpio == GPIO_INVALID)
26 @@ -290,6 +294,8 @@ static ssize_t gpiommc_config_attr_show(
30 + mutex_unlock(&dev->mutex);
32 return err ? err : count;
35 @@ -349,6 +355,8 @@ static ssize_t gpiommc_config_attr_store
39 + mutex_lock(&dev->mutex);
41 if (attr == &gpiommc_attr_register) {
42 err = strict_strtoul(page, 10, &data);
44 @@ -474,6 +482,8 @@ static ssize_t gpiommc_config_attr_store
48 + mutex_unlock(&dev->mutex);
50 return err ? err : count;
53 @@ -510,6 +520,7 @@ static struct config_item *gpiommc_make_
57 + mutex_init(&dev->mutex);
58 config_item_init_type_name(&dev->item, name,
59 &gpiommc_dev_ci_type);