0002-gpio-thunderx-fix-irq_request_resources.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From e8287ec10f21877eb0ac4c1fb4e89e42d8bc10da Mon Sep 17 00:00:00 2001
  2. From: Tim Harvey <[email protected]>
  3. Date: Wed, 11 Mar 2020 08:19:45 -0700
  4. Subject: [PATCH 2/7] gpio: thunderx: fix irq_request_resources
  5. If there are no parent resources do not call irq_chip_request_resources_parent
  6. at all as this will return an error.
  7. This resolves a regression where devices using a thunderx gpio as an interrupt
  8. would fail probing.
  9. Fixes: 0d04d0c ("gpio: thunderx: Use the default parent apis for {request,release}_resources")
  10. Signed-off-by: Tim Harvey <[email protected]>
  11. ---
  12. drivers/gpio/gpio-thunderx.c | 9 ++++++---
  13. 1 file changed, 6 insertions(+), 3 deletions(-)
  14. --- a/drivers/gpio/gpio-thunderx.c
  15. +++ b/drivers/gpio/gpio-thunderx.c
  16. @@ -363,15 +363,18 @@ static int thunderx_gpio_irq_request_res
  17. {
  18. struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
  19. struct thunderx_gpio *txgpio = txline->txgpio;
  20. + struct irq_data *parent_data = data->parent_data;
  21. int r;
  22. r = gpiochip_lock_as_irq(&txgpio->chip, txline->line);
  23. if (r)
  24. return r;
  25. - r = irq_chip_request_resources_parent(data);
  26. - if (r)
  27. - gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
  28. + if (parent_data && parent_data->chip->irq_request_resources) {
  29. + r = irq_chip_request_resources_parent(data);
  30. + if (r)
  31. + gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
  32. + }
  33. return r;
  34. }