Skip to content

Commit 72923e5

Browse files
westerilinusw
authored andcommitted
Revert "pinctrl: intel: Do pin translation when lock IRQ"
This reverts commit 55aedef. Commit 55aedef ("pinctrl: intel: Do pin translation when lock IRQ") added special translation from GPIO number to hardware pin number to irq_reqres/relres hooks to avoid failure when IRQs are requested. The actual failure happened inside gpiochip_lock_as_irq() because it calls gpiod_get_direction() and pinctrl-intel.c::intel_gpio_get_direction() implementation originally missed the translation so the two hooks made it work by skipping the ->get_direction() call entirely (it overwrote the default GPIOLIB provided functions). The proper fix that adds translation to GPIO callbacks was merged with commit 96147db ("pinctrl: intel: Do pin translation in other GPIO operations as well"). This allows us to use the default GPIOLIB provided functions again. In addition as find out by Benjamin Tissoires the two functions (intel_gpio_irq_reqres()/intel_gpio_irq_relres()) now cause problems of their own because they operate on pin numbers and pass that pin number to gpiochip_lock_as_irq() which actually expects a GPIO number. Link: https://bugzilla.kernel.org/show_bug.cgi?id=199911 Fixes: 55aedef ("pinctrl: intel: Do pin translation when lock IRQ") Reported-and-tested-by: Benjamin Tissoires <benjamin.tissoires@gmail.com> Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
1 parent e50d95e commit 72923e5

File tree

1 file changed

+0
-32
lines changed

1 file changed

+0
-32
lines changed

drivers/pinctrl/intel/pinctrl-intel.c

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -887,36 +887,6 @@ static const struct gpio_chip intel_gpio_chip = {
887887
.set_config = gpiochip_generic_config,
888888
};
889889

890-
static int intel_gpio_irq_reqres(struct irq_data *d)
891-
{
892-
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
893-
struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
894-
int pin;
895-
int ret;
896-
897-
pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL);
898-
if (pin >= 0) {
899-
ret = gpiochip_lock_as_irq(gc, pin);
900-
if (ret) {
901-
dev_err(pctrl->dev, "unable to lock HW IRQ %d for IRQ\n",
902-
pin);
903-
return ret;
904-
}
905-
}
906-
return 0;
907-
}
908-
909-
static void intel_gpio_irq_relres(struct irq_data *d)
910-
{
911-
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
912-
struct intel_pinctrl *pctrl = gpiochip_get_data(gc);
913-
int pin;
914-
915-
pin = intel_gpio_to_pin(pctrl, irqd_to_hwirq(d), NULL, NULL);
916-
if (pin >= 0)
917-
gpiochip_unlock_as_irq(gc, pin);
918-
}
919-
920890
static void intel_gpio_irq_ack(struct irq_data *d)
921891
{
922892
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
@@ -1132,8 +1102,6 @@ static irqreturn_t intel_gpio_irq(int irq, void *data)
11321102

11331103
static struct irq_chip intel_gpio_irqchip = {
11341104
.name = "intel-gpio",
1135-
.irq_request_resources = intel_gpio_irq_reqres,
1136-
.irq_release_resources = intel_gpio_irq_relres,
11371105
.irq_enable = intel_gpio_irq_enable,
11381106
.irq_ack = intel_gpio_irq_ack,
11391107
.irq_mask = intel_gpio_irq_mask,

0 commit comments

Comments
 (0)