Skip to contentSkip to conversation

ACPI / gpio: do not fall back to parsing _CRS when we get a deferral

PATCH In review Dmitry Torokhov 5 participants 8 messages Mar 23, 2017 – Mar 30, 2017 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ACPI / gpio: do not fall back to parsing _CRS when we get a deferral

If, while locating GPIOs by name, we get probe deferral, we should immediately report it to caller rather than trying to fall back to parsing unnamed GPIOs from _CRS block.

---
 drivers/gpio/gpiolib-acpi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib-acpi.c +3 -1
index a3faefa44f68..d3f9f028a37b 100644
@@ -572,8 +572,10 @@ struct gpio_desc *acpi_find_gpio(struct device *dev,
 		}
 
 		desc = acpi_get_gpiod_by_index(adev, propname, idx, &info);
-		if (!IS_ERR(desc) || (PTR_ERR(desc) == -EPROBE_DEFER))
+		if (!IS_ERR(desc))
 			break;
+		if (PTR_ERR(desc) == -EPROBE_DEFER)
+			return ERR_CAST(desc);
 	}
 
 	/* Then from plain _CRS GPIOs */
Signature · 5 lines
2.12.1.500.gab5fba24ee-goog


-- 
Dmitry
#1 lore raw
Quoted 5 lines · Dmitry Torokhov

If, while locating GPIOs by name, we get probe deferral, we should immediately report it to caller rather than trying to fall back to parsing unnamed GPIOs from _CRS block.

Can I get some indication from Mika/Rafael/Andy whether this is correct?

Yours,
Linus Walleij

#2 lore raw
Quoted 10 lines · Linus Walleij
Quoted 5 lines · Dmitry Torokhov

If, while locating GPIOs by name, we get probe deferral, we should immediately report it to caller rather than trying to fall back to parsing unnamed GPIOs from _CRS block.

Can I get some indication from Mika/Rafael/Andy whether this is correct?

Sorry, I saw the patch but then forgot to ack it.

#3 lore raw
In reply to Linus Walleij
Quoted 8 lines · Linus Walleij
Quoted 5 lines · Dmitry Torokhov

If, while locating GPIOs by name, we get probe deferral, we should immediately report it to caller rather than trying to fall back to parsing
unnamed GPIOs from _CRS block.

Quoted 4 lines
Quoted 1 line

Can I get some indication from Mika/Rafael/Andy whether this is correct?

While Mika agrees on the change, I would like nevertheless to hear Hans' opinion or even Tested-by tag since it was his fix around those lines.

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#4 lore raw
In reply to Dmitry Torokhov
Quoted 4 lines · Dmitry Torokhov

If, while locating GPIOs by name, we get probe deferral, we should immediately report it to caller rather than trying to fall back to parsing
unnamed GPIOs from _CRS block.

+Cc: Hans.

Hans, do have any objections on this? Would you ideally give your Tested-by?

Quoted 29 lines

---
 drivers/gpio/gpiolib-acpi.c | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib-acpi.c +0 -0
index a3faefa44f68..d3f9f028a37b 100644
@@ -572,8 +572,10 @@ struct gpio_desc *acpi_find_gpio(struct device
 *dev,
  		}


  desc = acpi_get_gpiod_by_index(adev, propname, idx, &info);

drivers/gpio/gpiolib-acpi.c +1 -2
-		if (!IS_ERR(desc) || (PTR_ERR(desc) ==
-EPROBE_DEFER))
+		if (!IS_ERR(desc))

  break;

drivers/gpio/gpiolib-acpi.c +2 -0
+		if (PTR_ERR(desc) == -EPROBE_DEFER)
+			return ERR_CAST(desc);

  }

  /* Then from plain _CRS GPIOs */
--
2.12.1.500.gab5fba24ee-goog

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#5 lore raw

HI,

Quoted 10 lines · Andy Shevchenko
Quoted 4 lines · Dmitry Torokhov

If, while locating GPIOs by name, we get probe deferral, we should immediately report it to caller rather than trying to fall back to parsing
unnamed GPIOs from _CRS block.

+Cc: Hans.

Hans, do have any objections on this? Would you ideally give your Tested-by?

Looks good to me and also does not seem to break anything on my test devices, so:

Regards,

Hans

Quoted 31 lines
Quoted 30 lines
---
 drivers/gpio/gpiolib-acpi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib-acpi.c +3 -3
index a3faefa44f68..d3f9f028a37b 100644
@@ -572,8 +572,10 @@ struct gpio_desc *acpi_find_gpio(struct device
 *dev,
 		}
 
 		desc = acpi_get_gpiod_by_index(adev, propname, idx,
 &info);
-		if (!IS_ERR(desc) || (PTR_ERR(desc) ==
-EPROBE_DEFER))
+		if (!IS_ERR(desc))
 			break;
+		if (PTR_ERR(desc) == -EPROBE_DEFER)
+			return ERR_CAST(desc);
 	}
 
 	/* Then from plain _CRS GPIOs */
--

2.12.1.500.gab5fba24ee-goog

#6 lore raw
Quoted 11 lines · Hans de Goede

HI,

Quoted 8 lines · Andy Shevchenko
Quoted 4 lines · Dmitry Torokhov

If, while locating GPIOs by name, we get probe deferral, we should immediately report it to caller rather than trying to fall back to parsing
unnamed GPIOs from _CRS block.

+Cc: Hans.

Quoted 7 lines
Quoted 2 lines

Hans, do have any objections on this? Would you ideally give your Tested-by?

Looks good to me and also does not seem to break anything on my test devices, so:

Thanks!

Linus, I'm fully satisfied :-)

Quoted 39 lines

Regards,

Hans

Quoted 33 lines
Quoted 33 lines

---
 drivers/gpio/gpiolib-acpi.c | 4 +++-

 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpiolib- renamed from drivers/gpio/gpiolib-acpi.c +0 -0

acpi.c
index a3faefa44f68..d3f9f028a37b 100644

drivers/gpio/gpiolib-acpi.c +0 -0
@@ -572,8 +572,10 @@ struct gpio_desc *acpi_find_gpio(struct

device
*dev,
  }

  desc = acpi_get_gpiod_by_index(adev, propname, idx,
&info);

drivers/gpio/gpiolib-acpi.c +1 -2
-		if (!IS_ERR(desc) || (PTR_ERR(desc) ==
-EPROBE_DEFER))
+		if (!IS_ERR(desc))

  break;

drivers/gpio/gpiolib-acpi.c +2 -0
+		if (PTR_ERR(desc) == -EPROBE_DEFER)
+			return ERR_CAST(desc);

  }

  /* Then from plain _CRS GPIOs */
--
2.12.1.500.gab5fba24ee-goog

Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy