1 The gpiommc configfs context structure needs locking, as configfs
2 does not lock access between files.
4 Index: linux-2.6.25.10/drivers/mmc/host/gpiommc.c
5 ===================================================================
6 --- linux-2.6.25.10.orig/drivers/mmc/host/gpiommc.c 2008-07-21 11:57:01.000000000 +0200
7 +++ linux-2.6.25.10/drivers/mmc/host/gpiommc.c 2008-07-21 12:01:33.000000000 +0200
8 @@ -143,6 +143,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 @@ -233,6 +235,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 @@ -293,6 +297,8 @@ static ssize_t gpiommc_config_attr_show(
30 + mutex_unlock(&dev->mutex);
32 return err ? err : count;
35 @@ -352,6 +358,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 @@ -477,6 +485,8 @@ static ssize_t gpiommc_config_attr_store
48 + mutex_unlock(&dev->mutex);
50 return err ? err : count;
53 @@ -513,6 +523,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);