Merge tag 'pinctrl-v4.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl

Pull pinctrl fix from Linus Walleij:
"Brian noticed that this regression has not got a proper fix for the
entire merge window and consequently we need to revert the offending
commit.

It's part of the RT-mainstream work, the dance goes like this, two
steps forward, one step back.

Summary:

- A last fix for v4.12, an IRQ problem reported early in the merge
window appears not to have been properly fixed, so the offending
commit will be reverted and we will find the proper fix for v4.13.
Hopefully"

* tag 'pinctrl-v4.12-4' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
Revert "pinctrl: rockchip: avoid hardirq-unsafe functions in irq_chip"

Changed files
+4 -40
drivers
+4 -40
drivers/pinctrl/pinctrl-rockchip.c
··· 143 143 * @gpio_chip: gpiolib chip 144 144 * @grange: gpio range 145 145 * @slock: spinlock for the gpio bank 146 - * @irq_lock: bus lock for irq chip 147 - * @new_irqs: newly configured irqs which must be muxed as GPIOs in 148 - * irq_bus_sync_unlock() 149 146 */ 150 147 struct rockchip_pin_bank { 151 148 void __iomem *reg_base; ··· 165 168 struct pinctrl_gpio_range grange; 166 169 raw_spinlock_t slock; 167 170 u32 toggle_edge_mode; 168 - struct mutex irq_lock; 169 - u32 new_irqs; 170 171 }; 171 172 172 173 #define PIN_BANK(id, pins, label) \ ··· 2129 2134 int ret; 2130 2135 2131 2136 /* make sure the pin is configured as gpio input */ 2132 - ret = rockchip_verify_mux(bank, d->hwirq, RK_FUNC_GPIO); 2137 + ret = rockchip_set_mux(bank, d->hwirq, RK_FUNC_GPIO); 2133 2138 if (ret < 0) 2134 2139 return ret; 2135 2140 2136 - bank->new_irqs |= mask; 2137 - 2141 + clk_enable(bank->clk); 2138 2142 raw_spin_lock_irqsave(&bank->slock, flags); 2139 2143 2140 2144 data = readl_relaxed(bank->reg_base + GPIO_SWPORT_DDR); ··· 2191 2197 default: 2192 2198 irq_gc_unlock(gc); 2193 2199 raw_spin_unlock_irqrestore(&bank->slock, flags); 2200 + clk_disable(bank->clk); 2194 2201 return -EINVAL; 2195 2202 } 2196 2203 ··· 2200 2205 2201 2206 irq_gc_unlock(gc); 2202 2207 raw_spin_unlock_irqrestore(&bank->slock, flags); 2208 + clk_disable(bank->clk); 2203 2209 2204 2210 return 0; 2205 2211 } ··· 2241 2245 struct rockchip_pin_bank *bank = gc->private; 2242 2246 2243 2247 irq_gc_mask_set_bit(d); 2244 - clk_disable(bank->clk); 2245 - } 2246 - 2247 - static void rockchip_irq_bus_lock(struct irq_data *d) 2248 - { 2249 - struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 2250 - struct rockchip_pin_bank *bank = gc->private; 2251 - 2252 - clk_enable(bank->clk); 2253 - mutex_lock(&bank->irq_lock); 2254 - } 2255 - 2256 - static void rockchip_irq_bus_sync_unlock(struct irq_data *d) 2257 - { 2258 - struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 2259 - struct rockchip_pin_bank *bank = gc->private; 2260 - 2261 - while (bank->new_irqs) { 2262 - unsigned int irq = __ffs(bank->new_irqs); 2263 - int ret; 2264 - 2265 - ret = rockchip_set_mux(bank, irq, RK_FUNC_GPIO); 2266 - WARN_ON(ret < 0); 2267 - 2268 - bank->new_irqs &= ~BIT(irq); 2269 - } 2270 - 2271 - mutex_unlock(&bank->irq_lock); 2272 2248 clk_disable(bank->clk); 2273 2249 } 2274 2250 ··· 2310 2342 gc->chip_types[0].chip.irq_suspend = rockchip_irq_suspend; 2311 2343 gc->chip_types[0].chip.irq_resume = rockchip_irq_resume; 2312 2344 gc->chip_types[0].chip.irq_set_type = rockchip_irq_set_type; 2313 - gc->chip_types[0].chip.irq_bus_lock = rockchip_irq_bus_lock; 2314 - gc->chip_types[0].chip.irq_bus_sync_unlock = 2315 - rockchip_irq_bus_sync_unlock; 2316 2345 gc->wake_enabled = IRQ_MSK(bank->nr_pins); 2317 2346 2318 2347 irq_set_chained_handler_and_data(bank->irq, ··· 2483 2518 int bank_pins = 0; 2484 2519 2485 2520 raw_spin_lock_init(&bank->slock); 2486 - mutex_init(&bank->irq_lock); 2487 2521 bank->drvdata = d; 2488 2522 bank->pin_base = ctrl->nr_pins; 2489 2523 ctrl->nr_pins += bank->nr_pins;