Skip to contentSkip to conversation

gpio: Add missing spin_lock_init in gpio-ml-ioh driver

PATCH In review Axel Lin 2 participants 3 messages Jan 17, 2012

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 gpio: Add missing spin_lock_init in gpio-ml-ioh driver

I think this bug was introduced by commit 54be5663 "gpio-ml-ioh: Support interrupt function" which adds a spinlock to struct ioh_gpio but never init the spinlock.

---
 drivers/gpio/gpio-ml-ioh.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpio/gpio-ml-ioh.c +1 -0
index 461958f..271fd49 100644
@@ -448,6 +448,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev,
 		chip->reg = chip->base;
 		chip->ch = i;
 		mutex_init(&chip->lock);
+		spin_lock_init(&chip->spinlock);
 		ioh_gpio_setup(chip, num_ports[i]);
 		ret = gpiochip_add(&chip->gpio);
 		if (ret) {
Signature · 1 line
1.7.5.4
#1 lore raw

Hi Alex

Thank you for your indication. gpio-pch also looks having the same issue. Could you post the patch for gpio-pch ? If you can't, I wil post the patch.

thanks,
tomoya

2012/1/17 Axel Lin <[email protected]>:

Quoted 31 lines

I think this bug was introduced by commit 54be5663 "gpio-ml-ioh: Support interrupt function" which adds a spinlock to struct ioh_gpio but never init the spinlock.

---
 drivers/gpio/gpio-ml-ioh.c |    1 +

 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpio/gpio-ml-ioh.c +1 -1
index 461958f..271fd49 100644
@@ -448,6 +448,7 @@ static int __devinit ioh_gpio_probe(struct pci_dev *pdev,
                chip->reg = chip->base;
                chip->ch = i;
                mutex_init(&chip->lock);
+               spin_lock_init(&chip->spinlock);
                ioh_gpio_setup(chip, num_ports[i]);
                ret = gpiochip_add(&chip->gpio);
                if (ret) {
--

1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

author
#2 lore raw

2012/1/17 Tomoya MORINAGA <[email protected]>:

Quoted 1 line

Hi Alex

It's Axel :-)

Quoted 4 lines

Thank you for your indication.
gpio-pch also looks having the same issue.
Could you post the patch for gpio-pch ?

Sure. I'll send the patch soon.