* [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it
@ 2023-12-20 23:54 Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property Mark Hasemeyer
` (18 more replies)
0 siblings, 19 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Alim Akhtar, Andre Przywara,
Andy Shevchenko, Bartosz Golaszewski, Benson Leung,
Bhanu Prakash Maiya, Bjorn Andersson, Chen-Yu Tsai, Conor Dooley,
Daniel Scally, David Gow, Enric Balletbo i Serra, Frank Rowand,
Greg Kroah-Hartman, Guenter Roeck, Heikki Krogerus,
Heiko Stuebner, Jesper Nilsson, Jisheng Zhang, Jonathan Hunter,
Krzysztof Kozlowski, Kunihiko Hayashi, Lee Jones, Len Brown,
Linus Walleij, Mark Brown, Matthias Brugger, Mika Westerberg,
Patrice Chotard, Prashant Malani, Rafael J. Wysocki, Rob Barnes,
Rob Herring, Romain Perier, Sakari Ailus, Stephen Boyd,
Takashi Iwai, Thierry Reding, Uwe Kleine-König, Wei Xu,
Wolfram Sang, chrome-platform, cros-qcom-dts-watchers, devicetree,
linux-acpi, linux-arm-kernel, linux-arm-msm, linux-gpio,
linux-i2c, linux-mediatek, linux-rockchip, linux-samsung-soc,
linux-tegra
Currently the cros_ec driver assumes that its associated interrupt is
wake capable. This is an incorrect assumption as some Chromebooks use a
separate wake pin, while others overload the interrupt for wake and IO.
This patch train updates the driver to query the underlying ACPI/DT data
to determine whether or not the IRQ should be enabled for wake.
Both the device tree and ACPI systems have methods for reporting IRQ
wake capability. In device tree based systems, a node can advertise
itself as a 'wakeup-source'. In ACPI based systems, GpioInt and
Interrupt resource descriptors can use the 'SharedAndWake' or
'ExclusiveAndWake' share types.
Some logic is added to the platform, ACPI, and DT subsystems to more
easily pipe wakeirq information up to the driver.
Changes in v2:
-Rebase on linux-next
-Add cover letter
-See each patch for patch specific changes
Mark Hasemeyer (22):
gpiolib: acpi: Modify acpi_dev_irq_wake_get_by() to use resource
i2c: acpi: Modify i2c_acpi_get_irq() to use resource
Documentation: devicetree: Clarify wording for wakeup-source property
ARM: dts: tegra: Enable cros-ec-spi as wake source
ARM: dts: rockchip: rk3288: Enable cros-ec-spi as wake source
ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
ARM: dts: samsung: exynos5800: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8173: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8183: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8192: Enable cros-ec-spi as wake source
arm64: dts: mediatek: mt8195: Enable cros-ec-spi as wake source
arm64: dts: tegra: Enable cros-ec-spi as wake source
arm64: dts: qcom: sc7180: Enable cros-ec-spi as wake source
arm64: dts: qcom: sc7280: Enable cros-ec-spi as wake source
arm64: dts: qcom: sdm845: Enable cros-ec-spi as wake source
arm64: dts: rockchip: rk3399: Enable cros-ec-spi as wake source
of: irq: add wake capable bit to of_irq_resource()
of: irq: Add default implementation for of_irq_to_resource()
of: irq: Remove extern from function declarations
device property: Modify fwnode irq_get() to use resource
platform: Modify platform_get_irq_optional() to use resource
platform/chrome: cros_ec: Use PM subsystem to manage wakeirq
.../bindings/power/wakeup-source.txt | 18 +++--
arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi | 1 +
arch/arm/boot/dts/nvidia/tegra124-venice2.dts | 1 +
.../rockchip/rk3288-veyron-chromebook.dtsi | 1 +
.../boot/dts/samsung/exynos5420-peach-pit.dts | 1 +
.../boot/dts/samsung/exynos5800-peach-pi.dts | 1 +
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 1 +
.../arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
.../boot/dts/mediatek/mt8192-asurada.dtsi | 1 +
.../boot/dts/mediatek/mt8195-cherry.dtsi | 1 +
.../arm64/boot/dts/nvidia/tegra132-norrin.dts | 1 +
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 +
.../arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 +
.../arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi | 1 +
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 1 +
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 1 +
drivers/acpi/property.c | 11 ++-
drivers/base/platform.c | 74 +++++++++++++------
drivers/base/property.c | 24 +++++-
drivers/gpio/gpiolib-acpi.c | 25 ++++---
drivers/i2c/i2c-core-acpi.c | 38 +++++-----
drivers/i2c/i2c-core-base.c | 6 +-
drivers/i2c/i2c-core.h | 4 +-
drivers/of/irq.c | 32 +++++++-
drivers/of/property.c | 8 +-
drivers/platform/chrome/cros_ec.c | 9 ---
drivers/platform/chrome/cros_ec_lpc.c | 52 ++++++++++++-
drivers/platform/chrome/cros_ec_spi.c | 41 ++++++++--
drivers/platform/chrome/cros_ec_uart.c | 34 +++++++--
include/linux/acpi.h | 23 +++---
include/linux/fwnode.h | 8 +-
include/linux/of_irq.h | 41 +++++-----
include/linux/platform_data/cros_ec_proto.h | 2 -
include/linux/platform_device.h | 3 +
include/linux/property.h | 2 +
35 files changed, 328 insertions(+), 142 deletions(-)
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply [flat|nested] 49+ messages in thread
* [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 8:13 ` Krzysztof Kozlowski
2023-12-20 23:54 ` [PATCH v2 04/22] ARM: dts: tegra: Enable cros-ec-spi as wake source Mark Hasemeyer
` (17 subsequent siblings)
18 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Krzysztof Kozlowski,
Rob Herring, devicetree
The wording in the current documentation is a little strong. The
intention was not to fix any particular interrupt as wakeup capable but
leave those details to the device. It wasn't intended to enforce any
rules as what can be or can't be a wakeup interrupt.
Soften the wording to not mandate that the 'wakeup-source' property be
used, and clarify what it means when an interrupt is marked (or not
marked) for wakeup.
Link: https://lore.kernel.org/all/ZYAjxxHcCOgDVMTQ@bogus/
Link: https://lore.kernel.org/all/CAL_Jsq+MYwOG40X26cYmO9EkZ9xqWrXDi03MaRfxnV-+VGkXWQ@mail.gmail.com/
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-New patch
.../bindings/power/wakeup-source.txt | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/power/wakeup-source.txt b/Documentation/devicetree/bindings/power/wakeup-source.txt
index 697333a56d5e2..75bc20b95688f 100644
--- a/Documentation/devicetree/bindings/power/wakeup-source.txt
+++ b/Documentation/devicetree/bindings/power/wakeup-source.txt
@@ -3,16 +3,20 @@ Specifying wakeup capability for devices
Any device nodes
----------------
-Nodes that describe devices which has wakeup capability must contain an
+Nodes that describe devices which have wakeup capability may contain a
"wakeup-source" boolean property.
-Also, if device is marked as a wakeup source, then all the primary
-interrupt(s) can be used as wakeup interrupt(s).
+If the device is marked as a wakeup-source, interrupt wake capability depends
+on the device specific "interrupt-names" property. If no interrupts are labeled
+as wake capable, then it is up to the device to determine which interrupts can
+wake the system.
-However if the devices have dedicated interrupt as the wakeup source
-then they need to specify/identify the same using device specific
-interrupt name. In such cases only that interrupt can be used as wakeup
-interrupt.
+However if a device has a dedicated interrupt as the wakeup source, then it
+needs to specify/identify it using a device specific interrupt name. In such
+cases only that interrupt can be used as a wakeup interrupt.
+
+While various legacy interrupt names exist, new devices should use "wakeup" as
+the canonical interrupt name.
List of legacy properties and respective binding document
---------------------------------------------------------
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 04/22] ARM: dts: tegra: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 05/22] ARM: dts: rockchip: rk3288: " Mark Hasemeyer
` (16 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Andre Przywara, Conor Dooley,
Enric Balletbo i Serra, Jesper Nilsson, Jisheng Zhang,
Jonathan Hunter, Krzysztof Kozlowski, Kunihiko Hayashi,
Patrice Chotard, Rob Herring, Romain Perier, Thierry Reding,
Wei Xu, devicetree, linux-tegra
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi | 1 +
arch/arm/boot/dts/nvidia/tegra124-venice2.dts | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi b/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi
index a2ee371802004..8125c1b3e8d79 100644
--- a/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi
+++ b/arch/arm/boot/dts/nvidia/tegra124-nyan.dtsi
@@ -338,6 +338,7 @@ cros_ec: cros-ec@0 {
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(C, 7) IRQ_TYPE_LEVEL_LOW>;
reg = <0>;
+ wakeup-source;
google,cros-ec-spi-msg-delay = <2000>;
diff --git a/arch/arm/boot/dts/nvidia/tegra124-venice2.dts b/arch/arm/boot/dts/nvidia/tegra124-venice2.dts
index 3924ee385dee0..df98dc2a67b85 100644
--- a/arch/arm/boot/dts/nvidia/tegra124-venice2.dts
+++ b/arch/arm/boot/dts/nvidia/tegra124-venice2.dts
@@ -857,6 +857,7 @@ cros_ec: cros-ec@0 {
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(C, 7) IRQ_TYPE_LEVEL_LOW>;
reg = <0>;
+ wakeup-source;
google,cros-ec-spi-msg-delay = <2000>;
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 05/22] ARM: dts: rockchip: rk3288: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 04/22] ARM: dts: tegra: Enable cros-ec-spi as wake source Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 06/22] ARM: dts: samsung: exynos5420: " Mark Hasemeyer
` (15 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Heiko Stuebner,
Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel,
linux-rockchip
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi b/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi
index 092316be67f74..1554fe36e60fe 100644
--- a/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi
+++ b/arch/arm/boot/dts/rockchip/rk3288-veyron-chromebook.dtsi
@@ -112,6 +112,7 @@ cros_ec: ec@0 {
pinctrl-names = "default";
pinctrl-0 = <&ec_int>;
spi-max-frequency = <3000000>;
+ wakeup-source;
i2c_tunnel: i2c-tunnel {
compatible = "google,cros-ec-i2c-tunnel";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (2 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 05/22] ARM: dts: rockchip: rk3288: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 8:14 ` Krzysztof Kozlowski
2024-01-22 11:15 ` (subset) " Krzysztof Kozlowski
2023-12-20 23:54 ` [PATCH v2 07/22] ARM: dts: samsung: exynos5800: " Mark Hasemeyer
` (14 subsequent siblings)
18 siblings, 2 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Alim Akhtar, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel,
linux-samsung-soc
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts b/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts
index 4e757b6e28e1c..3759742d38cac 100644
--- a/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts
+++ b/arch/arm/boot/dts/samsung/exynos5420-peach-pit.dts
@@ -967,6 +967,7 @@ cros_ec: cros-ec@0 {
reg = <0>;
spi-max-frequency = <3125000>;
google,has-vbc-nvram;
+ wakeup-source;
controller-data {
samsung,spi-feedback-delay = <1>;
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 07/22] ARM: dts: samsung: exynos5800: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (3 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 06/22] ARM: dts: samsung: exynos5420: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2024-01-22 11:15 ` (subset) " Krzysztof Kozlowski
2023-12-20 23:54 ` [PATCH v2 08/22] arm64: dts: mediatek: mt8173: " Mark Hasemeyer
` (13 subsequent siblings)
18 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Alim Akhtar, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel,
linux-samsung-soc
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts b/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts
index f91bc4ae008e4..9bbbdce9103a6 100644
--- a/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts
+++ b/arch/arm/boot/dts/samsung/exynos5800-peach-pi.dts
@@ -949,6 +949,7 @@ cros_ec: cros-ec@0 {
reg = <0>;
spi-max-frequency = <3125000>;
google,has-vbc-nvram;
+ wakeup-source;
controller-data {
samsung,spi-feedback-delay = <1>;
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 08/22] arm64: dts: mediatek: mt8173: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (4 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 07/22] ARM: dts: samsung: exynos5800: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 09/22] arm64: dts: mediatek: mt8183: " Mark Hasemeyer
` (12 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Krzysztof Kozlowski,
Matthias Brugger, Rob Herring, devicetree, linux-arm-kernel,
linux-mediatek
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
index 111495622cacd..190a3ffd81471 100644
--- a/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8173-elm.dtsi
@@ -1163,6 +1163,7 @@ cros_ec: ec@0 {
interrupt-parent = <&pio>;
interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
google,cros-ec-spi-msg-delay = <500>;
+ wakeup-source;
i2c_tunnel: i2c-tunnel0 {
compatible = "google,cros-ec-i2c-tunnel";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 09/22] arm64: dts: mediatek: mt8183: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (5 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 08/22] arm64: dts: mediatek: mt8173: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 10/22] arm64: dts: mediatek: mt8192: " Mark Hasemeyer
` (11 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Krzysztof Kozlowski,
Matthias Brugger, Rob Herring, devicetree, linux-arm-kernel,
linux-mediatek
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
index 7881a27be0297..06cbf29d16215 100644
--- a/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi
@@ -922,6 +922,7 @@ cros_ec: cros-ec@0 {
interrupts = <151 IRQ_TYPE_LEVEL_LOW>;
pinctrl-names = "default";
pinctrl-0 = <&ec_ap_int_odl>;
+ wakeup-source;
i2c_tunnel: i2c-tunnel {
compatible = "google,cros-ec-i2c-tunnel";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 10/22] arm64: dts: mediatek: mt8192: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (6 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 09/22] arm64: dts: mediatek: mt8183: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 11/22] arm64: dts: mediatek: mt8195: " Mark Hasemeyer
` (10 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Krzysztof Kozlowski,
Matthias Brugger, Rob Herring, devicetree, linux-arm-kernel,
linux-mediatek
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
index f2281250ac35d..ab44d382f757e 100644
--- a/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8192-asurada.dtsi
@@ -1332,6 +1332,7 @@ cros_ec: ec@0 {
spi-max-frequency = <3000000>;
pinctrl-names = "default";
pinctrl-0 = <&cros_ec_int>;
+ wakeup-source;
#address-cells = <1>;
#size-cells = <0>;
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 11/22] arm64: dts: mediatek: mt8195: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (7 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 10/22] arm64: dts: mediatek: mt8192: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 12/22] arm64: dts: tegra: " Mark Hasemeyer
` (9 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Krzysztof Kozlowski,
Matthias Brugger, Rob Herring, devicetree, linux-arm-kernel,
linux-mediatek
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 5a7cab489ff3a..4292b72566bcf 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -1067,6 +1067,7 @@ cros_ec: ec@0 {
pinctrl-names = "default";
pinctrl-0 = <&cros_ec_int>;
spi-max-frequency = <3000000>;
+ wakeup-source;
keyboard-backlight {
compatible = "google,cros-kbd-led-backlight";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 12/22] arm64: dts: tegra: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (8 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 11/22] arm64: dts: mediatek: mt8195: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 13/22] arm64: dts: qcom: sc7180: " Mark Hasemeyer
` (8 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Jonathan Hunter,
Krzysztof Kozlowski, Rob Herring, Thierry Reding, devicetree,
linux-tegra
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/nvidia/tegra132-norrin.dts | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts b/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts
index bbc2e9bef08da..14d58859bb55c 100644
--- a/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts
+++ b/arch/arm64/boot/dts/nvidia/tegra132-norrin.dts
@@ -762,6 +762,7 @@ ec: cros-ec@0 {
interrupt-parent = <&gpio>;
interrupts = <TEGRA_GPIO(C, 7) IRQ_TYPE_LEVEL_LOW>;
reg = <0>;
+ wakeup-source;
google,cros-ec-spi-msg-delay = <2000>;
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 13/22] arm64: dts: qcom: sc7180: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (9 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 12/22] arm64: dts: tegra: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 0:10 ` Doug Anderson
2023-12-20 23:54 ` [PATCH v2 14/22] arm64: dts: qcom: sc7280: " Mark Hasemeyer
` (7 subsequent siblings)
18 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Bjorn Andersson, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, cros-qcom-dts-watchers,
devicetree, linux-arm-msm
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
index 46aaeba286047..f3a6da8b28901 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
@@ -649,6 +649,7 @@ cros_ec: ec@0 {
pinctrl-names = "default";
pinctrl-0 = <&ap_ec_int_l>;
spi-max-frequency = <3000000>;
+ wakeup-source;
cros_ec_pwm: pwm {
compatible = "google,cros-ec-pwm";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 14/22] arm64: dts: qcom: sc7280: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (10 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 13/22] arm64: dts: qcom: sc7180: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 0:10 ` Doug Anderson
2023-12-20 23:54 ` [PATCH v2 15/22] arm64: dts: qcom: sdm845: " Mark Hasemeyer
` (6 subsequent siblings)
18 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Bjorn Andersson, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, cros-qcom-dts-watchers,
devicetree, linux-arm-msm
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 +
arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi | 1 +
2 files changed, 2 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
index 9ea6636125ad9..2ba4ea60cb147 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
@@ -548,6 +548,7 @@ cros_ec: ec@0 {
pinctrl-names = "default";
pinctrl-0 = <&ap_ec_int_l>;
spi-max-frequency = <3000000>;
+ wakeup-source;
cros_ec_pwm: pwm {
compatible = "google,cros-ec-pwm";
diff --git a/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi b/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi
index ebae545c587c4..fbfac7534d3c6 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi
@@ -19,6 +19,7 @@ cros_ec: ec@0 {
pinctrl-names = "default";
pinctrl-0 = <&ap_ec_int_l>;
spi-max-frequency = <3000000>;
+ wakeup-source;
cros_ec_pwm: pwm {
compatible = "google,cros-ec-pwm";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 15/22] arm64: dts: qcom: sdm845: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (11 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 14/22] arm64: dts: qcom: sc7280: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 0:11 ` Doug Anderson
2023-12-20 23:54 ` [PATCH v2 16/22] arm64: dts: rockchip: rk3399: " Mark Hasemeyer
` (5 subsequent siblings)
18 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Bjorn Andersson, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, cros-qcom-dts-watchers,
devicetree, linux-arm-msm
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
index 0ab5e8f53ac9f..e8276db9eabb2 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
@@ -852,6 +852,7 @@ cros_ec: ec@0 {
pinctrl-names = "default";
pinctrl-0 = <&ec_ap_int_l>;
spi-max-frequency = <3000000>;
+ wakeup-source;
cros_ec_pwm: pwm {
compatible = "google,cros-ec-pwm";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 16/22] arm64: dts: rockchip: rk3399: Enable cros-ec-spi as wake source
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (12 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 15/22] arm64: dts: qcom: sdm845: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource() Mark Hasemeyer
` (4 subsequent siblings)
18 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Conor Dooley, Heiko Stuebner,
Krzysztof Kozlowski, Rob Herring, devicetree, linux-arm-kernel,
linux-rockchip
The cros_ec driver currently assumes that cros-ec-spi compatible device
nodes are a wakeup-source even though the wakeup-source property is not
defined.
Add the wakeup-source property to all cros-ec-spi compatible device
nodes to match expected behavior.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Split by arch/soc
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 789fd0dcc88ba..b5734e056aef1 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -603,6 +603,7 @@ cros_ec: ec@0 {
pinctrl-names = "default";
pinctrl-0 = <&ec_ap_int_l>;
spi-max-frequency = <3000000>;
+ wakeup-source;
i2c_tunnel: i2c-tunnel {
compatible = "google,cros-ec-i2c-tunnel";
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource()
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (13 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 16/22] arm64: dts: rockchip: rk3399: " Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 15:25 ` Andy Shevchenko
2023-12-21 20:44 ` Rob Herring
2023-12-20 23:54 ` [PATCH v2 18/22] of: irq: Add default implementation for of_irq_to_resource() Mark Hasemeyer
` (3 subsequent siblings)
18 siblings, 2 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Frank Rowand, Rob Herring,
devicetree
Add wake capability information to the IRQ resource. Wake capability is
assumed based on conventions provided in the devicetree wakeup-source
binding documentation. An interrupt is considered wake capable if the
following are true:
1. A wakeup-source property exits in the same device node as the
interrupt.
2. The IRQ is marked as dedicated by setting its interrupt-name to
"wakeup".
The wakeup-source documentation states that dedicated interrupts can use
device specific interrupt names and device drivers are still welcome to
use their own naming schemes. This API is provided as a helper if one is
willing to conform to the above conventions.
The ACPI subsystems already provides similar APIs that allow one to
query the wake capability of an IRQ. This brings closer feature parity
to the devicetree.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-Update logic to return true only if wakeup-source property and
"wakeup" interrupt-name are defined
-irq->IRQ, api->API
drivers/of/irq.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/drivers/of/irq.c b/drivers/of/irq.c
index 174900072c18c..7583adf386220 100644
--- a/drivers/of/irq.c
+++ b/drivers/of/irq.c
@@ -383,11 +383,39 @@ int of_irq_parse_one(struct device_node *device, int index, struct of_phandle_ar
}
EXPORT_SYMBOL_GPL(of_irq_parse_one);
+/**
+ * __of_irq_wake_capable - Determine whether a given IRQ index is wake capable
+ *
+ * The IRQ is considered wake capable if the following are true:
+ * 1. wakeup-source property exists
+ * 2. provided IRQ index is labelled as a dedicated wakeirq
+ *
+ * This logic assumes the provided IRQ index is valid.
+ *
+ * @dev: pointer to device tree node
+ * @index: zero-based index of the IRQ
+ * Return: True if provided IRQ index for #dev is wake capable. False otherwise.
+ */
+static bool __of_irq_wake_capable(const struct device_node *dev, int index)
+{
+ int wakeindex;
+
+ if (!of_property_read_bool(dev, "wakeup-source"))
+ return false;
+
+ wakeindex = of_property_match_string(dev, "interrupt-names", "wakeup");
+ return wakeindex >= 0 && wakeindex == index;
+}
+
/**
* of_irq_to_resource - Decode a node's IRQ and return it as a resource
* @dev: pointer to device tree node
- * @index: zero-based index of the irq
+ * @index: zero-based index of the IRQ
* @r: pointer to resource structure to return result into.
+ *
+ * Return: Linux IRQ number on success, or 0 on the IRQ mapping failure, or
+ * -EPROBE_DEFER if the IRQ domain is not yet created, or error code in case
+ * of any other failure.
*/
int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
{
@@ -411,6 +439,8 @@ int of_irq_to_resource(struct device_node *dev, int index, struct resource *r)
r->start = r->end = irq;
r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));
+ if (__of_irq_wake_capable(dev, index))
+ r->flags |= IORESOURCE_IRQ_WAKECAPABLE;
r->name = name ? name : of_node_full_name(dev);
}
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 18/22] of: irq: Add default implementation for of_irq_to_resource()
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (14 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource() Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 20:48 ` Rob Herring
2023-12-20 23:54 ` [PATCH v2 19/22] of: irq: Remove extern from function declarations Mark Hasemeyer
` (2 subsequent siblings)
18 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Frank Rowand, Rob Herring,
devicetree
Similar to of_irq_to_resource_table(), add a default implementation of
of_irq_to_resource() for systems that don't have CONFIG_OF_IRQ defined.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-None
include/linux/of_irq.h | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index d6d3eae2f1452..0d73b2ca92d31 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -34,8 +34,6 @@ static inline int of_irq_parse_oldworld(const struct device_node *device, int in
extern int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq);
extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data);
-extern int of_irq_to_resource(struct device_node *dev, int index,
- struct resource *r);
#ifdef CONFIG_OF_IRQ
extern void of_irq_init(const struct of_device_id *matches);
@@ -44,6 +42,7 @@ extern int of_irq_parse_one(struct device_node *device, int index,
extern int of_irq_count(struct device_node *dev);
extern int of_irq_get(struct device_node *dev, int index);
extern int of_irq_get_byname(struct device_node *dev, const char *name);
+extern int of_irq_to_resource(struct device_node *dev, int index, struct resource *r);
extern int of_irq_to_resource_table(struct device_node *dev,
struct resource *res, int nr_irqs);
extern struct device_node *of_irq_find_parent(struct device_node *child);
@@ -76,6 +75,11 @@ static inline int of_irq_get_byname(struct device_node *dev, const char *name)
{
return 0;
}
+static inline int of_irq_to_resource(struct device_node *dev, int index,
+ struct resource *r)
+{
+ return 0;
+}
static inline int of_irq_to_resource_table(struct device_node *dev,
struct resource *res, int nr_irqs)
{
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 19/22] of: irq: Remove extern from function declarations
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (15 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 18/22] of: irq: Add default implementation for of_irq_to_resource() Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 20:49 ` Rob Herring
2023-12-20 23:54 ` [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource Mark Hasemeyer
2023-12-21 13:42 ` [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Andy Shevchenko
18 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Frank Rowand, Rob Herring,
devicetree
The extern keyword is implicit for function declarations.
Remove it where possible and adjust the line wrapping accordingly.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-New patch
include/linux/of_irq.h | 35 +++++++++++++++++------------------
1 file changed, 17 insertions(+), 18 deletions(-)
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index 0d73b2ca92d31..a130dcbc4bb45 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -32,27 +32,26 @@ static inline int of_irq_parse_oldworld(const struct device_node *device, int in
}
#endif /* CONFIG_PPC32 && CONFIG_PPC_PMAC */
-extern int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq);
-extern unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data);
+int of_irq_parse_raw(const __be32 *addr, struct of_phandle_args *out_irq);
+unsigned int irq_create_of_mapping(struct of_phandle_args *irq_data);
#ifdef CONFIG_OF_IRQ
-extern void of_irq_init(const struct of_device_id *matches);
-extern int of_irq_parse_one(struct device_node *device, int index,
- struct of_phandle_args *out_irq);
-extern int of_irq_count(struct device_node *dev);
-extern int of_irq_get(struct device_node *dev, int index);
-extern int of_irq_get_byname(struct device_node *dev, const char *name);
-extern int of_irq_to_resource(struct device_node *dev, int index, struct resource *r);
-extern int of_irq_to_resource_table(struct device_node *dev,
- struct resource *res, int nr_irqs);
-extern struct device_node *of_irq_find_parent(struct device_node *child);
-extern struct irq_domain *of_msi_get_domain(struct device *dev,
+void of_irq_init(const struct of_device_id *matches);
+int of_irq_parse_one(struct device_node *device, int index,
+ struct of_phandle_args *out_irq);
+int of_irq_count(struct device_node *dev);
+int of_irq_get(struct device_node *dev, int index);
+int of_irq_get_byname(struct device_node *dev, const char *name);
+int of_irq_to_resource(struct device_node *dev, int index, struct resource *r);
+int of_irq_to_resource_table(struct device_node *dev, struct resource *res,
+ int nr_irqs);
+struct device_node *of_irq_find_parent(struct device_node *child);
+struct irq_domain *of_msi_get_domain(struct device *dev,
struct device_node *np,
enum irq_domain_bus_token token);
-extern struct irq_domain *of_msi_map_get_device_domain(struct device *dev,
- u32 id,
- u32 bus_token);
-extern void of_msi_configure(struct device *dev, struct device_node *np);
+struct irq_domain *of_msi_map_get_device_domain(struct device *dev, u32 id,
+ u32 bus_token);
+void of_msi_configure(struct device *dev, struct device_node *np);
u32 of_msi_map_id(struct device *dev, struct device_node *msi_np, u32 id_in);
#else
static inline void of_irq_init(const struct of_device_id *matches)
@@ -117,7 +116,7 @@ static inline u32 of_msi_map_id(struct device *dev,
* implements it differently. However, the prototype is the same for all,
* so declare it here regardless of the CONFIG_OF_IRQ setting.
*/
-extern unsigned int irq_of_parse_and_map(struct device_node *node, int index);
+unsigned int irq_of_parse_and_map(struct device_node *node, int index);
#else /* !CONFIG_OF && !CONFIG_SPARC */
static inline unsigned int irq_of_parse_and_map(struct device_node *dev,
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (16 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 19/22] of: irq: Remove extern from function declarations Mark Hasemeyer
@ 2023-12-20 23:54 ` Mark Hasemeyer
2023-12-21 10:37 ` Sakari Ailus
2023-12-21 13:56 ` Andy Shevchenko
2023-12-21 13:42 ` [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Andy Shevchenko
18 siblings, 2 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-20 23:54 UTC (permalink / raw)
To: LKML
Cc: AngeloGioacchino Del Regno, Krzysztof Kozlowski, Tzung-Bi Shih,
Raul Rangel, Konrad Dybcio, Andy Shevchenko, Rob Herring,
Sudeep Holla, Mark Hasemeyer, Andy Shevchenko, Daniel Scally,
Frank Rowand, Greg Kroah-Hartman, Heikki Krogerus, Len Brown,
Rafael J. Wysocki, Rob Herring, Sakari Ailus, devicetree,
linux-acpi
The underlying ACPI and OF subsystems provide their own APIs which
provide IRQ information as a struct resource. This allows callers to get
more information about the IRQ by looking at the resource flags. For
example, whether or not an IRQ is wake capable.
Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
---
Changes in v2:
-New patch
drivers/acpi/property.c | 11 +++++------
drivers/base/property.c | 24 +++++++++++++++++++++---
drivers/of/property.c | 8 ++++----
include/linux/fwnode.h | 8 +++++---
include/linux/property.h | 2 ++
5 files changed, 37 insertions(+), 16 deletions(-)
diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
index a6ead5204046b..259869987ffff 100644
--- a/drivers/acpi/property.c
+++ b/drivers/acpi/property.c
@@ -1627,17 +1627,16 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
return 0;
}
-static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
- unsigned int index)
+static int acpi_fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
+ unsigned int index, struct resource *r)
{
- struct resource res;
int ret;
- ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, &res);
+ ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, r);
if (ret)
return ret;
- return res.start;
+ return r->start;
}
#define DECLARE_ACPI_FWNODE_OPS(ops) \
@@ -1664,7 +1663,7 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
acpi_graph_get_remote_endpoint, \
.graph_get_port_parent = acpi_fwnode_get_parent, \
.graph_parse_endpoint = acpi_fwnode_graph_parse_endpoint, \
- .irq_get = acpi_fwnode_irq_get, \
+ .irq_get_resource = acpi_fwnode_irq_get_resource, \
}; \
EXPORT_SYMBOL_GPL(ops)
diff --git a/drivers/base/property.c b/drivers/base/property.c
index a1b01ab420528..4f5d5ab5ab8cf 100644
--- a/drivers/base/property.c
+++ b/drivers/base/property.c
@@ -1047,23 +1047,41 @@ void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index)
EXPORT_SYMBOL(fwnode_iomap);
/**
- * fwnode_irq_get - Get IRQ directly from a fwnode
+ * fwnode_irq_get_resource - Get IRQ directly from a fwnode and populate
+ * the resource struct
* @fwnode: Pointer to the firmware node
* @index: Zero-based index of the IRQ
+ * @r: Pointer to resource to populate with IRQ information.
*
* Return: Linux IRQ number on success. Negative errno on failure.
*/
-int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
+int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
+ unsigned int index, struct resource *r)
{
int ret;
- ret = fwnode_call_int_op(fwnode, irq_get, index);
+ ret = fwnode_call_int_op(fwnode, irq_get_resource, index, r);
/* We treat mapping errors as invalid case */
if (ret == 0)
return -EINVAL;
return ret;
}
+EXPORT_SYMBOL(fwnode_irq_get_resource);
+
+/**
+ * fwnode_irq_get - Get IRQ directly from a fwnode
+ * @fwnode: Pointer to the firmware node
+ * @index: Zero-based index of the IRQ
+ *
+ * Return: Linux IRQ number on success. Negative errno on failure.
+ */
+int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
+{
+ struct resource r;
+
+ return fwnode_irq_get_resource(fwnode, index, &r);
+}
EXPORT_SYMBOL(fwnode_irq_get);
/**
diff --git a/drivers/of/property.c b/drivers/of/property.c
index afdaefbd03f61..864ea5fa5702b 100644
--- a/drivers/of/property.c
+++ b/drivers/of/property.c
@@ -1425,10 +1425,10 @@ static void __iomem *of_fwnode_iomap(struct fwnode_handle *fwnode, int index)
#endif
}
-static int of_fwnode_irq_get(const struct fwnode_handle *fwnode,
- unsigned int index)
+static int of_fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
+ unsigned int index, struct resource *r)
{
- return of_irq_get(to_of_node(fwnode), index);
+ return of_irq_to_resource(to_of_node(fwnode), index, r);
}
static int of_fwnode_add_links(struct fwnode_handle *fwnode)
@@ -1469,7 +1469,7 @@ const struct fwnode_operations of_fwnode_ops = {
.graph_get_port_parent = of_fwnode_graph_get_port_parent,
.graph_parse_endpoint = of_fwnode_graph_parse_endpoint,
.iomap = of_fwnode_iomap,
- .irq_get = of_fwnode_irq_get,
+ .irq_get_resource = of_fwnode_irq_get_resource,
.add_links = of_fwnode_add_links,
};
EXPORT_SYMBOL_GPL(of_fwnode_ops);
diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
index 2a72f55d26eb8..716ed863acde0 100644
--- a/include/linux/fwnode.h
+++ b/include/linux/fwnode.h
@@ -9,10 +9,11 @@
#ifndef _LINUX_FWNODE_H_
#define _LINUX_FWNODE_H_
-#include <linux/types.h>
-#include <linux/list.h>
#include <linux/bits.h>
#include <linux/err.h>
+#include <linux/ioport.h>
+#include <linux/list.h>
+#include <linux/types.h>
struct fwnode_operations;
struct device;
@@ -164,7 +165,8 @@ struct fwnode_operations {
int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode,
struct fwnode_endpoint *endpoint);
void __iomem *(*iomap)(struct fwnode_handle *fwnode, int index);
- int (*irq_get)(const struct fwnode_handle *fwnode, unsigned int index);
+ int (*irq_get_resource)(const struct fwnode_handle *fwnode,
+ unsigned int index, struct resource *r);
int (*add_links)(struct fwnode_handle *fwnode);
};
diff --git a/include/linux/property.h b/include/linux/property.h
index e6516d0b7d52a..685ba72a8ce9e 100644
--- a/include/linux/property.h
+++ b/include/linux/property.h
@@ -190,6 +190,8 @@ struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode);
void fwnode_handle_put(struct fwnode_handle *fwnode);
int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index);
+int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
+ unsigned int index, struct resource *r);
int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name);
unsigned int device_get_child_node_count(const struct device *dev);
--
2.43.0.472.g3155946c3a-goog
^ permalink raw reply related [flat|nested] 49+ messages in thread
* Re: [PATCH v2 13/22] arm64: dts: qcom: sc7180: Enable cros-ec-spi as wake source
2023-12-20 23:54 ` [PATCH v2 13/22] arm64: dts: qcom: sc7180: " Mark Hasemeyer
@ 2023-12-21 0:10 ` Doug Anderson
0 siblings, 0 replies; 49+ messages in thread
From: Doug Anderson @ 2023-12-21 0:10 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Andy Shevchenko,
Rob Herring, Sudeep Holla, Bjorn Andersson, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, cros-qcom-dts-watchers,
devicetree, linux-arm-msm
Hi,
On Wed, Dec 20, 2023 at 3:55 PM Mark Hasemeyer <markhas@chromium.org> wrote:
>
> The cros_ec driver currently assumes that cros-ec-spi compatible device
> nodes are a wakeup-source even though the wakeup-source property is not
> defined.
>
> Add the wakeup-source property to all cros-ec-spi compatible device
> nodes to match expected behavior.
>
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
>
> Changes in v2:
> -Split by arch/soc
>
> arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi | 1 +
> 1 file changed, 1 insertion(+)
It's hard to get context with just the dts patches, but digging up the
cover letter and other patches from lore I see you point at
`Documentation/devicetree/bindings/power/wakeup-source.txt` which says
that devices that can wakeup should have this property. ...and our EC
can wake us up, so this looks right from that point of view.
Also the yaml file for cros-ec says it's fine to have this property. I
think it was used when things were connected via i2c since the i2c
subsystem needed it. ...so from a bindings perspective it also seems
fine to me.
...and looking at the code in Linux, I guess things work today because
cros_ec_spi_probe() unconditionally calls device_init_wakeup(). ...but
even with the code today I believe it should be fine to add this
property.
So with all that, this patch looks fine to me.
Reviewed-by: Douglas Anderson <dianders@chromium.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 14/22] arm64: dts: qcom: sc7280: Enable cros-ec-spi as wake source
2023-12-20 23:54 ` [PATCH v2 14/22] arm64: dts: qcom: sc7280: " Mark Hasemeyer
@ 2023-12-21 0:10 ` Doug Anderson
0 siblings, 0 replies; 49+ messages in thread
From: Doug Anderson @ 2023-12-21 0:10 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Andy Shevchenko,
Rob Herring, Sudeep Holla, Bjorn Andersson, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, cros-qcom-dts-watchers,
devicetree, linux-arm-msm
Hi,
On Wed, Dec 20, 2023 at 3:55 PM Mark Hasemeyer <markhas@chromium.org> wrote:
>
> The cros_ec driver currently assumes that cros-ec-spi compatible device
> nodes are a wakeup-source even though the wakeup-source property is not
> defined.
>
> Add the wakeup-source property to all cros-ec-spi compatible device
> nodes to match expected behavior.
>
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
>
> Changes in v2:
> -Split by arch/soc
>
> arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 1 +
> arch/arm64/boot/dts/qcom/sc7280-idp-ec-h1.dtsi | 1 +
> 2 files changed, 2 insertions(+)
Reviewed-by: Douglas Anderson <dianders@chromium.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 15/22] arm64: dts: qcom: sdm845: Enable cros-ec-spi as wake source
2023-12-20 23:54 ` [PATCH v2 15/22] arm64: dts: qcom: sdm845: " Mark Hasemeyer
@ 2023-12-21 0:11 ` Doug Anderson
0 siblings, 0 replies; 49+ messages in thread
From: Doug Anderson @ 2023-12-21 0:11 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Andy Shevchenko,
Rob Herring, Sudeep Holla, Bjorn Andersson, Conor Dooley,
Krzysztof Kozlowski, Rob Herring, cros-qcom-dts-watchers,
devicetree, linux-arm-msm
Hi,
On Wed, Dec 20, 2023 at 3:55 PM Mark Hasemeyer <markhas@chromium.org> wrote:
>
> The cros_ec driver currently assumes that cros-ec-spi compatible device
> nodes are a wakeup-source even though the wakeup-source property is not
> defined.
>
> Add the wakeup-source property to all cros-ec-spi compatible device
> nodes to match expected behavior.
>
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
>
> Changes in v2:
> -Split by arch/soc
>
> arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi | 1 +
> 1 file changed, 1 insertion(+)
Reviewed-by: Douglas Anderson <dianders@chromium.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property
2023-12-20 23:54 ` [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property Mark Hasemeyer
@ 2023-12-21 8:13 ` Krzysztof Kozlowski
2023-12-21 18:16 ` Mark Hasemeyer
0 siblings, 1 reply; 49+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21 8:13 UTC (permalink / raw)
To: Mark Hasemeyer, LKML
Cc: AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Conor Dooley, Krzysztof Kozlowski, Rob Herring, devicetree
On 21/12/2023 00:54, Mark Hasemeyer wrote:
> The wording in the current documentation is a little strong. The
> intention was not to fix any particular interrupt as wakeup capable but
> leave those details to the device. It wasn't intended to enforce any
> rules as what can be or can't be a wakeup interrupt.
>
> Soften the wording to not mandate that the 'wakeup-source' property be
> used, and clarify what it means when an interrupt is marked (or not
> marked) for wakeup.
>
> Link: https://lore.kernel.org/all/ZYAjxxHcCOgDVMTQ@bogus/
> Link: https://lore.kernel.org/all/CAL_Jsq+MYwOG40X26cYmO9EkZ9xqWrXDi03MaRfxnV-+VGkXWQ@mail.gmail.com/
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
Please use subject prefixes matching the subsystem. You can get them for
example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
your patch is touching.
You nicely skipped all my filters... No need to resend to fix this, but
fix it if sending a new version.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
2023-12-20 23:54 ` [PATCH v2 06/22] ARM: dts: samsung: exynos5420: " Mark Hasemeyer
@ 2023-12-21 8:14 ` Krzysztof Kozlowski
2023-12-21 18:29 ` Mark Hasemeyer
2024-01-22 11:15 ` (subset) " Krzysztof Kozlowski
1 sibling, 1 reply; 49+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21 8:14 UTC (permalink / raw)
To: Mark Hasemeyer, LKML
Cc: AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Alim Akhtar, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-samsung-soc
On 21/12/2023 00:54, Mark Hasemeyer wrote:
> The cros_ec driver currently assumes that cros-ec-spi compatible device
> nodes are a wakeup-source even though the wakeup-source property is not
> defined.
>
> Add the wakeup-source property to all cros-ec-spi compatible device
> nodes to match expected behavior.
>
You do not need this property, if driver assumes that. Just enable it
unconditionally. I don't think anything from previous discussion was
resolved.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-20 23:54 ` [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource Mark Hasemeyer
@ 2023-12-21 10:37 ` Sakari Ailus
2023-12-21 23:52 ` Mark Hasemeyer
2023-12-21 13:56 ` Andy Shevchenko
1 sibling, 1 reply; 49+ messages in thread
From: Sakari Ailus @ 2023-12-21 10:37 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Andy Shevchenko,
Rob Herring, Sudeep Holla, Andy Shevchenko, Daniel Scally,
Frank Rowand, Greg Kroah-Hartman, Heikki Krogerus, Len Brown,
Rafael J. Wysocki, Rob Herring, devicetree, linux-acpi
Hi Mark,
Thank you for the patch.
On Wed, Dec 20, 2023 at 04:54:34PM -0700, Mark Hasemeyer wrote:
> The underlying ACPI and OF subsystems provide their own APIs which
> provide IRQ information as a struct resource. This allows callers to get
> more information about the IRQ by looking at the resource flags. For
> example, whether or not an IRQ is wake capable.
>
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
>
> Changes in v2:
> -New patch
>
> drivers/acpi/property.c | 11 +++++------
> drivers/base/property.c | 24 +++++++++++++++++++++---
> drivers/of/property.c | 8 ++++----
> include/linux/fwnode.h | 8 +++++---
> include/linux/property.h | 2 ++
> 5 files changed, 37 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c
> index a6ead5204046b..259869987ffff 100644
> --- a/drivers/acpi/property.c
> +++ b/drivers/acpi/property.c
> @@ -1627,17 +1627,16 @@ static int acpi_fwnode_graph_parse_endpoint(const struct fwnode_handle *fwnode,
> return 0;
> }
>
> -static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
> - unsigned int index)
> +static int acpi_fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> + unsigned int index, struct resource *r)
> {
> - struct resource res;
> int ret;
>
> - ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, &res);
> + ret = acpi_irq_get(ACPI_HANDLE_FWNODE(fwnode), index, r);
> if (ret)
> return ret;
>
> - return res.start;
> + return r->start;
> }
>
> #define DECLARE_ACPI_FWNODE_OPS(ops) \
> @@ -1664,7 +1663,7 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode,
> acpi_graph_get_remote_endpoint, \
> .graph_get_port_parent = acpi_fwnode_get_parent, \
> .graph_parse_endpoint = acpi_fwnode_graph_parse_endpoint, \
> - .irq_get = acpi_fwnode_irq_get, \
> + .irq_get_resource = acpi_fwnode_irq_get_resource, \
> }; \
> EXPORT_SYMBOL_GPL(ops)
>
> diff --git a/drivers/base/property.c b/drivers/base/property.c
> index a1b01ab420528..4f5d5ab5ab8cf 100644
> --- a/drivers/base/property.c
> +++ b/drivers/base/property.c
> @@ -1047,23 +1047,41 @@ void __iomem *fwnode_iomap(struct fwnode_handle *fwnode, int index)
> EXPORT_SYMBOL(fwnode_iomap);
>
> /**
> - * fwnode_irq_get - Get IRQ directly from a fwnode
> + * fwnode_irq_get_resource - Get IRQ directly from a fwnode and populate
> + * the resource struct
> * @fwnode: Pointer to the firmware node
> * @index: Zero-based index of the IRQ
> + * @r: Pointer to resource to populate with IRQ information.
> *
> * Return: Linux IRQ number on success. Negative errno on failure.
> */
> -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
> +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> + unsigned int index, struct resource *r)
> {
> int ret;
>
> - ret = fwnode_call_int_op(fwnode, irq_get, index);
> + ret = fwnode_call_int_op(fwnode, irq_get_resource, index, r);
> /* We treat mapping errors as invalid case */
> if (ret == 0)
> return -EINVAL;
>
> return ret;
> }
> +EXPORT_SYMBOL(fwnode_irq_get_resource);
Both acpi_irq_get() and of_irq_to_resourece() use EXPORT_SYMBOL_GPL()
instead. I don't see why fwnode_irq_get_resource() shouldn't do the same.
With this changed,
Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
In fact this should have always been the case for fwnode_irq_get(). I
wouldn't mind changing that, too, in a separate patch.
> +
> +/**
> + * fwnode_irq_get - Get IRQ directly from a fwnode
> + * @fwnode: Pointer to the firmware node
> + * @index: Zero-based index of the IRQ
> + *
> + * Return: Linux IRQ number on success. Negative errno on failure.
> + */
> +int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
> +{
> + struct resource r;
> +
> + return fwnode_irq_get_resource(fwnode, index, &r);
> +}
> EXPORT_SYMBOL(fwnode_irq_get);
>
> /**
> diff --git a/drivers/of/property.c b/drivers/of/property.c
> index afdaefbd03f61..864ea5fa5702b 100644
> --- a/drivers/of/property.c
> +++ b/drivers/of/property.c
> @@ -1425,10 +1425,10 @@ static void __iomem *of_fwnode_iomap(struct fwnode_handle *fwnode, int index)
> #endif
> }
>
> -static int of_fwnode_irq_get(const struct fwnode_handle *fwnode,
> - unsigned int index)
> +static int of_fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> + unsigned int index, struct resource *r)
> {
> - return of_irq_get(to_of_node(fwnode), index);
> + return of_irq_to_resource(to_of_node(fwnode), index, r);
> }
>
> static int of_fwnode_add_links(struct fwnode_handle *fwnode)
> @@ -1469,7 +1469,7 @@ const struct fwnode_operations of_fwnode_ops = {
> .graph_get_port_parent = of_fwnode_graph_get_port_parent,
> .graph_parse_endpoint = of_fwnode_graph_parse_endpoint,
> .iomap = of_fwnode_iomap,
> - .irq_get = of_fwnode_irq_get,
> + .irq_get_resource = of_fwnode_irq_get_resource,
> .add_links = of_fwnode_add_links,
> };
> EXPORT_SYMBOL_GPL(of_fwnode_ops);
> diff --git a/include/linux/fwnode.h b/include/linux/fwnode.h
> index 2a72f55d26eb8..716ed863acde0 100644
> --- a/include/linux/fwnode.h
> +++ b/include/linux/fwnode.h
> @@ -9,10 +9,11 @@
> #ifndef _LINUX_FWNODE_H_
> #define _LINUX_FWNODE_H_
>
> -#include <linux/types.h>
> -#include <linux/list.h>
> #include <linux/bits.h>
> #include <linux/err.h>
> +#include <linux/ioport.h>
> +#include <linux/list.h>
> +#include <linux/types.h>
>
> struct fwnode_operations;
> struct device;
> @@ -164,7 +165,8 @@ struct fwnode_operations {
> int (*graph_parse_endpoint)(const struct fwnode_handle *fwnode,
> struct fwnode_endpoint *endpoint);
> void __iomem *(*iomap)(struct fwnode_handle *fwnode, int index);
> - int (*irq_get)(const struct fwnode_handle *fwnode, unsigned int index);
> + int (*irq_get_resource)(const struct fwnode_handle *fwnode,
> + unsigned int index, struct resource *r);
> int (*add_links)(struct fwnode_handle *fwnode);
> };
>
> diff --git a/include/linux/property.h b/include/linux/property.h
> index e6516d0b7d52a..685ba72a8ce9e 100644
> --- a/include/linux/property.h
> +++ b/include/linux/property.h
> @@ -190,6 +190,8 @@ struct fwnode_handle *fwnode_handle_get(struct fwnode_handle *fwnode);
> void fwnode_handle_put(struct fwnode_handle *fwnode);
>
> int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index);
> +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> + unsigned int index, struct resource *r);
> int fwnode_irq_get_byname(const struct fwnode_handle *fwnode, const char *name);
>
> unsigned int device_get_child_node_count(const struct device *dev);
--
Kind regards,
Sakari Ailus
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
` (17 preceding siblings ...)
2023-12-20 23:54 ` [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource Mark Hasemeyer
@ 2023-12-21 13:42 ` Andy Shevchenko
2023-12-22 22:30 ` Mark Hasemeyer
18 siblings, 1 reply; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-21 13:42 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, chrome-platform, cros-qcom-dts-watchers, devicetree,
linux-acpi, linux-arm-kernel, linux-arm-msm, linux-gpio,
linux-i2c, linux-mediatek, linux-rockchip, linux-samsung-soc,
linux-tegra
On Wed, Dec 20, 2023 at 04:54:14PM -0700, Mark Hasemeyer wrote:
> Currently the cros_ec driver assumes that its associated interrupt is
> wake capable. This is an incorrect assumption as some Chromebooks use a
> separate wake pin, while others overload the interrupt for wake and IO.
> This patch train updates the driver to query the underlying ACPI/DT data
> to determine whether or not the IRQ should be enabled for wake.
>
> Both the device tree and ACPI systems have methods for reporting IRQ
> wake capability. In device tree based systems, a node can advertise
> itself as a 'wakeup-source'. In ACPI based systems, GpioInt and
> Interrupt resource descriptors can use the 'SharedAndWake' or
> 'ExclusiveAndWake' share types.
>
> Some logic is added to the platform, ACPI, and DT subsystems to more
> easily pipe wakeirq information up to the driver.
Just wondering if you used --histogram diff algo when preparing patches.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-20 23:54 ` [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource Mark Hasemeyer
2023-12-21 10:37 ` Sakari Ailus
@ 2023-12-21 13:56 ` Andy Shevchenko
2023-12-21 23:46 ` Mark Hasemeyer
1 sibling, 1 reply; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-21 13:56 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Rob Herring,
Sudeep Holla, Daniel Scally, Frank Rowand, Greg Kroah-Hartman,
Heikki Krogerus, Len Brown, Rafael J. Wysocki, Rob Herring,
Sakari Ailus, devicetree, linux-acpi
On Wed, Dec 20, 2023 at 04:54:34PM -0700, Mark Hasemeyer wrote:
> The underlying ACPI and OF subsystems provide their own APIs which
> provide IRQ information as a struct resource. This allows callers to get
> more information about the IRQ by looking at the resource flags. For
Double space when other lines have a single space.
> example, whether or not an IRQ is wake capable.
Suggested-by?
...
> -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
> +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> + unsigned int index, struct resource *r)
It's perfectly fine to replace ) by , on the previous line, no need
to make it shorter.
...
> +int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
> +{
> + struct resource r;
struct resource r = {};
?
> + return fwnode_irq_get_resource(fwnode, index, &r);
> +}
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource()
2023-12-20 23:54 ` [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource() Mark Hasemeyer
@ 2023-12-21 15:25 ` Andy Shevchenko
2023-12-22 22:22 ` Mark Hasemeyer
2023-12-21 20:44 ` Rob Herring
1 sibling, 1 reply; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-21 15:25 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Rob Herring,
Sudeep Holla, Frank Rowand, Rob Herring, devicetree
On Wed, Dec 20, 2023 at 04:54:31PM -0700, Mark Hasemeyer wrote:
> Add wake capability information to the IRQ resource. Wake capability is
> assumed based on conventions provided in the devicetree wakeup-source
> binding documentation. An interrupt is considered wake capable if the
> following are true:
> 1. A wakeup-source property exits in the same device node as the
> interrupt.
> 2. The IRQ is marked as dedicated by setting its interrupt-name to
> "wakeup".
>
> The wakeup-source documentation states that dedicated interrupts can use
> device specific interrupt names and device drivers are still welcome to
> use their own naming schemes. This API is provided as a helper if one is
> willing to conform to the above conventions.
>
> The ACPI subsystems already provides similar APIs that allow one to
> query the wake capability of an IRQ. This brings closer feature parity
> to the devicetree.
...
> r->start = r->end = irq;
> r->flags = IORESOURCE_IRQ | irqd_get_trigger_type(irq_get_irq_data(irq));
> + if (__of_irq_wake_capable(dev, index))
> + r->flags |= IORESOURCE_IRQ_WAKECAPABLE;
> r->name = name ? name : of_node_full_name(dev);
irq_flags = irqd_get_trigger_type(irq_get_irq_data(irq));
if (__of_irq_wake_capable(dev, index))
irq_flags |= IORESOURCE_IRQ_WAKECAPABLE;
*r = DEFINE_RES_NAMED(irq, 1, name ?: of_node_full_name(dev), irq_flags);
?
...
Or even refactor ioport.h (in a separate patch) as we seems already have
two users (and might be more in the existing code):
#define DEFINE_RES_IRQ_NAMED_FLAGS(_irq, _name, _flags) \
DEFINE_RES_NAMED((_irq), 1, (_name), (_flags) | IORESOURCE_IRQ)
#define DEFINE_RES_IRQ_NAMED(_irq, _name) \
DEFINE_RES_IRQ_NAMED_FLAGS((_irq), (_name), 0)
#define DEFINE_RES_IRQ(_irq) \
DEFINE_RES_IRQ_NAMED((_irq), NULL)
(Note, I will Ack such a patch once it appears.)
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property
2023-12-21 8:13 ` Krzysztof Kozlowski
@ 2023-12-21 18:16 ` Mark Hasemeyer
2023-12-21 18:42 ` Krzysztof Kozlowski
0 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-21 18:16 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: LKML, AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Conor Dooley, Krzysztof Kozlowski, Rob Herring, devicetree
> Please use subject prefixes matching the subsystem. You can get them for
> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
> your patch is touching.
>
> You nicely skipped all my filters... No need to resend to fix this, but
> fix it if sending a new version.
I picked up the tags by using that exact command against "wakeup-source.txt".
"Documentation: devicetree:" was used in the originating commit and is
why I used it. There isn't really a consistent history wrt to tags on
this file. Looking at the containing directory, "dt-bindings: power"
looks pretty common. I'll use that unless you'd prefer something else.
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
2023-12-21 8:14 ` Krzysztof Kozlowski
@ 2023-12-21 18:29 ` Mark Hasemeyer
2023-12-21 18:38 ` Krzysztof Kozlowski
0 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-21 18:29 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: LKML, AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Alim Akhtar, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-samsung-soc
> You do not need this property, if driver assumes that. Just enable it
> unconditionally.
The goal of this patch series is to change exactly that: to prevent
the driver from unconditionally enabling the irq for wake.
The driver works across numerous buses (spi, uart, i2c, lpc) and
supports DT and ACPI.
SPI+DT systems all happen to need irq wake enabled.
> I don't think anything from previous discussion was
> resolved.
Which previous discussion do you mean? In v1 it was suggested to split
up the DTS changes by arch/soc and add a cover letter (which I did).
Wrt to the binding discussion, Sudeep said the new documentation
wording looked good to him [1].
[1]: https://lore.kernel.org/all/ZYAjxxHcCOgDVMTQ@bogus/
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
2023-12-21 18:29 ` Mark Hasemeyer
@ 2023-12-21 18:38 ` Krzysztof Kozlowski
2023-12-21 19:24 ` Mark Hasemeyer
0 siblings, 1 reply; 49+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21 18:38 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Alim Akhtar, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-samsung-soc
On 21/12/2023 19:29, Mark Hasemeyer wrote:
>> You do not need this property, if driver assumes that. Just enable it
>> unconditionally.
>
> The goal of this patch series is to change exactly that: to prevent
> the driver from unconditionally enabling the irq for wake.
But why? What is the problem being solved? Is unconditional wakeup in
the driver incorrect? If so, mention it shortly in the commit msg, what
is rationale because existing one does not justify this change.
> The driver works across numerous buses (spi, uart, i2c, lpc) and
> supports DT and ACPI.
> SPI+DT systems all happen to need irq wake enabled.
>
>> I don't think anything from previous discussion was
>> resolved.
>
> Which previous discussion do you mean? In v1 it was suggested to split
https://lore.kernel.org/all/20231213221124.GB2115075-robh@kernel.org/
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property
2023-12-21 18:16 ` Mark Hasemeyer
@ 2023-12-21 18:42 ` Krzysztof Kozlowski
0 siblings, 0 replies; 49+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21 18:42 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Conor Dooley, Krzysztof Kozlowski, Rob Herring, devicetree
On 21/12/2023 19:16, Mark Hasemeyer wrote:
>> Please use subject prefixes matching the subsystem. You can get them for
>> example with `git log --oneline -- DIRECTORY_OR_FILE` on the directory
>> your patch is touching.
>>
>> You nicely skipped all my filters... No need to resend to fix this, but
>> fix it if sending a new version.
>
> I picked up the tags by using that exact command against "wakeup-source.txt".
> "Documentation: devicetree:" was used in the originating commit and is
> why I used it. There isn't really a consistent history wrt to tags on
> this file. Looking at the containing directory, "dt-bindings: power"
All bindings use dt-bindings: prefix. Either first or second. It's the
only correct, even though you will find way too many wrong ones... yet
still my command gives you the answer.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
2023-12-21 18:38 ` Krzysztof Kozlowski
@ 2023-12-21 19:24 ` Mark Hasemeyer
2023-12-21 20:34 ` Krzysztof Kozlowski
0 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-21 19:24 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: LKML, AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Alim Akhtar, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-samsung-soc
> >> You do not need this property, if driver assumes that. Just enable it
> >> unconditionally.
> >
> > The goal of this patch series is to change exactly that: to prevent
> > the driver from unconditionally enabling the irq for wake.
>
> But why? What is the problem being solved? Is unconditional wakeup in
> the driver incorrect? If so, mention it shortly in the commit msg, what
> is rationale because existing one does not justify this change.
The cover letter talks about it:
"Currently the cros_ec driver assumes that its associated interrupt is
wake capable. This is an incorrect assumption as some Chromebooks use
a separate wake pin, while others overload the interrupt for wake and
IO."
With the current assumption, spurious wakes can occur on systems that
use a separate wake pin.
I can add wording to the dts patches to help clarify.
> > The driver works across numerous buses (spi, uart, i2c, lpc) and
> > supports DT and ACPI.
> > SPI+DT systems all happen to need irq wake enabled.
> >
> >> I don't think anything from previous discussion was
> >> resolved.
> >
> > Which previous discussion do you mean? In v1 it was suggested to split
>
> https://lore.kernel.org/all/20231213221124.GB2115075-robh@kernel.org/
Hmm, I thought that was addressed [2]. I was referencing the existing
binding documentation. From there, there was discussion about updating
the docs to clarify what was actually intended (patch 3 in this
series). I also addressed the ABI break concern in the thread and
mentioned it in patch 22.
"For device tree base systems, it is not an issue as the relevant
device tree entries have been updated and DTS is built from source for
each ChromeOS update."
Is there a specific concern you feel is not resolved? Or can I make
something more clear?
[2] https://lore.kernel.org/all/CANg-bXCG61HFW7JFuAd3k+OrCG_F9F3e8brjM-pmBauS53aobQ@mail.gmail.com/
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
2023-12-21 19:24 ` Mark Hasemeyer
@ 2023-12-21 20:34 ` Krzysztof Kozlowski
0 siblings, 0 replies; 49+ messages in thread
From: Krzysztof Kozlowski @ 2023-12-21 20:34 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Alim Akhtar, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-samsung-soc
On 21/12/2023 20:24, Mark Hasemeyer wrote:
>>>> You do not need this property, if driver assumes that. Just enable it
>>>> unconditionally.
>>>
>>> The goal of this patch series is to change exactly that: to prevent
>>> the driver from unconditionally enabling the irq for wake.
>>
>> But why? What is the problem being solved? Is unconditional wakeup in
>> the driver incorrect? If so, mention it shortly in the commit msg, what
>> is rationale because existing one does not justify this change.
>
> The cover letter talks about it:
> "Currently the cros_ec driver assumes that its associated interrupt is
> wake capable. This is an incorrect assumption as some Chromebooks use
> a separate wake pin, while others overload the interrupt for wake and
> IO."
> With the current assumption, spurious wakes can occur on systems that
> use a separate wake pin.
This sentence would be enough.
> I can add wording to the dts patches to help clarify.
>
>>> The driver works across numerous buses (spi, uart, i2c, lpc) and
>>> supports DT and ACPI.
>>> SPI+DT systems all happen to need irq wake enabled.
>>>
>>>> I don't think anything from previous discussion was
>>>> resolved.
>>>
>>> Which previous discussion do you mean? In v1 it was suggested to split
>>
>> https://lore.kernel.org/all/20231213221124.GB2115075-robh@kernel.org/
>
> Hmm, I thought that was addressed [2]. I was referencing the existing
> binding documentation. From there, there was discussion about updating
> the docs to clarify what was actually intended (patch 3 in this
> series). I also addressed the ABI break concern in the thread and
> mentioned it in patch 22.
> "For device tree base systems, it is not an issue as the relevant
> device tree entries have been updated and DTS is built from source for
> each ChromeOS update."
>
> Is there a specific concern you feel is not resolved? Or can I make
> something more clear?
>
Seems fine, thanks.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource()
2023-12-20 23:54 ` [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource() Mark Hasemeyer
2023-12-21 15:25 ` Andy Shevchenko
@ 2023-12-21 20:44 ` Rob Herring
1 sibling, 0 replies; 49+ messages in thread
From: Rob Herring @ 2023-12-21 20:44 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: Krzysztof Kozlowski, Raul Rangel, Frank Rowand, devicetree,
Rob Herring, AngeloGioacchino Del Regno, Andy Shevchenko,
Tzung-Bi Shih, Sudeep Holla, Konrad Dybcio, LKML
On Wed, 20 Dec 2023 16:54:31 -0700, Mark Hasemeyer wrote:
> Add wake capability information to the IRQ resource. Wake capability is
> assumed based on conventions provided in the devicetree wakeup-source
> binding documentation. An interrupt is considered wake capable if the
> following are true:
> 1. A wakeup-source property exits in the same device node as the
> interrupt.
> 2. The IRQ is marked as dedicated by setting its interrupt-name to
> "wakeup".
>
> The wakeup-source documentation states that dedicated interrupts can use
> device specific interrupt names and device drivers are still welcome to
> use their own naming schemes. This API is provided as a helper if one is
> willing to conform to the above conventions.
>
> The ACPI subsystems already provides similar APIs that allow one to
> query the wake capability of an IRQ. This brings closer feature parity
> to the devicetree.
>
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
>
> Changes in v2:
> -Update logic to return true only if wakeup-source property and
> "wakeup" interrupt-name are defined
> -irq->IRQ, api->API
>
> drivers/of/irq.c | 32 +++++++++++++++++++++++++++++++-
> 1 file changed, 31 insertions(+), 1 deletion(-)
>
Reviewed-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 18/22] of: irq: Add default implementation for of_irq_to_resource()
2023-12-20 23:54 ` [PATCH v2 18/22] of: irq: Add default implementation for of_irq_to_resource() Mark Hasemeyer
@ 2023-12-21 20:48 ` Rob Herring
0 siblings, 0 replies; 49+ messages in thread
From: Rob Herring @ 2023-12-21 20:48 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: Sudeep Holla, Konrad Dybcio, devicetree, LKML, Andy Shevchenko,
Frank Rowand, Krzysztof Kozlowski, Raul Rangel,
AngeloGioacchino Del Regno, Rob Herring, Tzung-Bi Shih
On Wed, 20 Dec 2023 16:54:32 -0700, Mark Hasemeyer wrote:
> Similar to of_irq_to_resource_table(), add a default implementation of
> of_irq_to_resource() for systems that don't have CONFIG_OF_IRQ defined.
>
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
>
> Changes in v2:
> -None
>
> include/linux/of_irq.h | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 19/22] of: irq: Remove extern from function declarations
2023-12-20 23:54 ` [PATCH v2 19/22] of: irq: Remove extern from function declarations Mark Hasemeyer
@ 2023-12-21 20:49 ` Rob Herring
0 siblings, 0 replies; 49+ messages in thread
From: Rob Herring @ 2023-12-21 20:49 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: Raul Rangel, Konrad Dybcio, devicetree, Frank Rowand,
Sudeep Holla, Tzung-Bi Shih, AngeloGioacchino Del Regno,
Rob Herring, Andy Shevchenko, LKML, Krzysztof Kozlowski
On Wed, 20 Dec 2023 16:54:33 -0700, Mark Hasemeyer wrote:
> The extern keyword is implicit for function declarations.
> Remove it where possible and adjust the line wrapping accordingly.
>
> Signed-off-by: Mark Hasemeyer <markhas@chromium.org>
> ---
>
> Changes in v2:
> -New patch
>
> include/linux/of_irq.h | 35 +++++++++++++++++------------------
> 1 file changed, 17 insertions(+), 18 deletions(-)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-21 13:56 ` Andy Shevchenko
@ 2023-12-21 23:46 ` Mark Hasemeyer
2023-12-22 12:44 ` Andy Shevchenko
[not found] ` <CAHQZ30BOA7zuRrN-kK5Qw+NYSVydfhJ0gDPr9q-U+7VKXHzG8g@mail.gmail.com>
0 siblings, 2 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-21 23:46 UTC (permalink / raw)
To: Andy Shevchenko
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Rob Herring,
Sudeep Holla, Daniel Scally, Frank Rowand, Greg Kroah-Hartman,
Heikki Krogerus, Len Brown, Rafael J. Wysocki, Rob Herring,
Sakari Ailus, devicetree, linux-acpi
> > -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
> > +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> > + unsigned int index, struct resource *r)
>
> It's perfectly fine to replace ) by , on the previous line, no need
> to make it shorter.
That puts the line at 115 chars? checkpatch.pl allows a maximum line
length of 100. I can bump the 'index' argument up a line and keep it
to a length of 95?
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-21 10:37 ` Sakari Ailus
@ 2023-12-21 23:52 ` Mark Hasemeyer
2023-12-22 12:48 ` Andy Shevchenko
0 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-21 23:52 UTC (permalink / raw)
To: Sakari Ailus
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Andy Shevchenko,
Rob Herring, Sudeep Holla, Andy Shevchenko, Daniel Scally,
Frank Rowand, Greg Kroah-Hartman, Heikki Krogerus, Len Brown,
Rafael J. Wysocki, Rob Herring, devicetree, linux-acpi
> Both acpi_irq_get() and of_irq_to_resourece() use EXPORT_SYMBOL_GPL()
> instead. I don't see why fwnode_irq_get_resource() shouldn't do the same.
>
> With this changed,
>
> Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
>
> In fact this should have always been the case for fwnode_irq_get(). I
> wouldn't mind changing that, too, in a separate patch.
Sure. It looks like fwnode_iomap(), fwnode_irq_get(),
fwnode_irq_get_byname(), and fwnode_graph_parse_endpoint() could all
be updated. I'll add another patch with these changes unless there's a
reason some of those functions shouldn't be GPL'd?
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
[not found] ` <CAHQZ30BOA7zuRrN-kK5Qw+NYSVydfhJ0gDPr9q-U+7VKXHzG8g@mail.gmail.com>
@ 2023-12-21 23:59 ` Mark Hasemeyer
2023-12-22 12:46 ` Andy Shevchenko
2023-12-22 12:46 ` Andy Shevchenko
1 sibling, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-21 23:59 UTC (permalink / raw)
To: Raul Rangel
Cc: Andy Shevchenko, LKML, AngeloGioacchino Del Regno,
Krzysztof Kozlowski, Tzung-Bi Shih, Konrad Dybcio, Rob Herring,
Sudeep Holla, Daniel Scally, Frank Rowand, Greg Kroah-Hartman,
Heikki Krogerus, Len Brown, Rafael J. Wysocki, Rob Herring,
Sakari Ailus, devicetree, linux-acpi
>> > > -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
>> > > +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
>> > > + unsigned int index, struct resource *r)
>> >
>> > It's perfectly fine to replace ) by , on the previous line, no need
>> > to make it shorter.
>>
>> That puts the line at 115 chars? checkpatch.pl allows a maximum line
>> length of 100. I can bump the 'index' argument up a line and keep it
>> to a length of 95?
>
>
> clang-format should do the right thing.
It formats the line as-is in the patch: with 'unsigned int index' on
the next line.
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-21 23:46 ` Mark Hasemeyer
@ 2023-12-22 12:44 ` Andy Shevchenko
[not found] ` <CAHQZ30BOA7zuRrN-kK5Qw+NYSVydfhJ0gDPr9q-U+7VKXHzG8g@mail.gmail.com>
1 sibling, 0 replies; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-22 12:44 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Rob Herring,
Sudeep Holla, Daniel Scally, Frank Rowand, Greg Kroah-Hartman,
Heikki Krogerus, Len Brown, Rafael J. Wysocki, Rob Herring,
Sakari Ailus, devicetree, linux-acpi
On Thu, Dec 21, 2023 at 04:46:11PM -0700, Mark Hasemeyer wrote:
> > > -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
> > > +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> > > + unsigned int index, struct resource *r)
> >
> > It's perfectly fine to replace ) by , on the previous line, no need
> > to make it shorter.
>
> That puts the line at 115 chars? checkpatch.pl allows a maximum line
> length of 100. I can bump the 'index' argument up a line and keep it
> to a length of 95?
Yes, the point is to leave index on the previous line and add a new one with
the r.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
[not found] ` <CAHQZ30BOA7zuRrN-kK5Qw+NYSVydfhJ0gDPr9q-U+7VKXHzG8g@mail.gmail.com>
2023-12-21 23:59 ` Mark Hasemeyer
@ 2023-12-22 12:46 ` Andy Shevchenko
1 sibling, 0 replies; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-22 12:46 UTC (permalink / raw)
To: Raul Rangel
Cc: Mark Hasemeyer, LKML, AngeloGioacchino Del Regno,
Krzysztof Kozlowski, Tzung-Bi Shih, Konrad Dybcio, Rob Herring,
Sudeep Holla, Daniel Scally, Frank Rowand, Greg Kroah-Hartman,
Heikki Krogerus, Len Brown, Rafael J. Wysocki, Rob Herring,
Sakari Ailus, devicetree, linux-acpi
On Thu, Dec 21, 2023 at 04:47:59PM -0700, Raul Rangel wrote:
> On Thu, Dec 21, 2023 at 4:46 PM Mark Hasemeyer <markhas@chromium.org> wrote:
>
> > > > -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int
> > index)
> > > > +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> > > > + unsigned int index, struct resource *r)
> > >
> > > It's perfectly fine to replace ) by , on the previous line, no need
> > > to make it shorter.
> >
> > That puts the line at 115 chars? checkpatch.pl allows a maximum line
> > length of 100. I can bump the 'index' argument up a line and keep it
> > to a length of 95?
>
> clang-format should do the right thing.
Sorry, but no. It has some interesting results sometimes.
Like any other tool it has to be used with caution and
common sense. If it works in the particular case, fine.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-21 23:59 ` Mark Hasemeyer
@ 2023-12-22 12:46 ` Andy Shevchenko
0 siblings, 0 replies; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-22 12:46 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: Raul Rangel, LKML, AngeloGioacchino Del Regno,
Krzysztof Kozlowski, Tzung-Bi Shih, Konrad Dybcio, Rob Herring,
Sudeep Holla, Daniel Scally, Frank Rowand, Greg Kroah-Hartman,
Heikki Krogerus, Len Brown, Rafael J. Wysocki, Rob Herring,
Sakari Ailus, devicetree, linux-acpi
On Thu, Dec 21, 2023 at 04:59:42PM -0700, Mark Hasemeyer wrote:
> >> > > -int fwnode_irq_get(const struct fwnode_handle *fwnode, unsigned int index)
> >> > > +int fwnode_irq_get_resource(const struct fwnode_handle *fwnode,
> >> > > + unsigned int index, struct resource *r)
> >> >
> >> > It's perfectly fine to replace ) by , on the previous line, no need
> >> > to make it shorter.
> >>
> >> That puts the line at 115 chars? checkpatch.pl allows a maximum line
> >> length of 100. I can bump the 'index' argument up a line and keep it
> >> to a length of 95?
> >
> > clang-format should do the right thing.
>
> It formats the line as-is in the patch: with 'unsigned int index' on
> the next line.
Exactly, and I don't think we need that "smartness" in this case.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource
2023-12-21 23:52 ` Mark Hasemeyer
@ 2023-12-22 12:48 ` Andy Shevchenko
0 siblings, 0 replies; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-22 12:48 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: Sakari Ailus, LKML, AngeloGioacchino Del Regno,
Krzysztof Kozlowski, Tzung-Bi Shih, Raul Rangel, Konrad Dybcio,
Rob Herring, Sudeep Holla, Daniel Scally, Frank Rowand,
Greg Kroah-Hartman, Heikki Krogerus, Len Brown, Rafael J. Wysocki,
Rob Herring, devicetree, linux-acpi
On Thu, Dec 21, 2023 at 04:52:15PM -0700, Mark Hasemeyer wrote:
> > Both acpi_irq_get() and of_irq_to_resourece() use EXPORT_SYMBOL_GPL()
> > instead. I don't see why fwnode_irq_get_resource() shouldn't do the same.
> >
> > With this changed,
> >
> > Reviewed-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> >
> > In fact this should have always been the case for fwnode_irq_get(). I
> > wouldn't mind changing that, too, in a separate patch.
>
> Sure. It looks like fwnode_iomap(), fwnode_irq_get(),
> fwnode_irq_get_byname(), and fwnode_graph_parse_endpoint() could all
> be updated. I'll add another patch with these changes unless there's a
> reason some of those functions shouldn't be GPL'd?
Interesting... Once should look at the history of those changes.
I don't think anything prevents us from moving to GPLed versions.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource()
2023-12-21 15:25 ` Andy Shevchenko
@ 2023-12-22 22:22 ` Mark Hasemeyer
0 siblings, 0 replies; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-22 22:22 UTC (permalink / raw)
To: Andy Shevchenko
Cc: LKML, AngeloGioacchino Del Regno, Krzysztof Kozlowski,
Tzung-Bi Shih, Raul Rangel, Konrad Dybcio, Rob Herring,
Sudeep Holla, Frank Rowand, Rob Herring, devicetree
> Or even refactor ioport.h (in a separate patch) as we seems already have
> two users (and might be more in the existing code):
>
> #define DEFINE_RES_IRQ_NAMED_FLAGS(_irq, _name, _flags) \
> DEFINE_RES_NAMED((_irq), 1, (_name), (_flags) | IORESOURCE_IRQ)
> #define DEFINE_RES_IRQ_NAMED(_irq, _name) \
> DEFINE_RES_IRQ_NAMED_FLAGS((_irq), (_name), 0)
> #define DEFINE_RES_IRQ(_irq) \
> DEFINE_RES_IRQ_NAMED((_irq), NULL)
>
> (Note, I will Ack such a patch once it appears.)
I'll add a new patch to the series. I'll probably include the MEM, IO,
and RES variants as well.
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it
2023-12-21 13:42 ` [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Andy Shevchenko
@ 2023-12-22 22:30 ` Mark Hasemeyer
2023-12-27 16:01 ` Andy Shevchenko
0 siblings, 1 reply; 49+ messages in thread
From: Mark Hasemeyer @ 2023-12-22 22:30 UTC (permalink / raw)
To: Andy Shevchenko
Cc: LKML, chrome-platform, cros-qcom-dts-watchers, devicetree,
linux-acpi, linux-arm-kernel, linux-arm-msm, linux-gpio,
linux-i2c, linux-mediatek, linux-rockchip, linux-samsung-soc,
linux-tegra
> Just wondering if you used --histogram diff algo when preparing patches.
Not knowingly. I use patman which uses 'git format-patch' under the
covers with some added options:
https://github.com/siemens/u-boot/blob/master/tools/patman/gitutil.py#L308
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it
2023-12-22 22:30 ` Mark Hasemeyer
@ 2023-12-27 16:01 ` Andy Shevchenko
0 siblings, 0 replies; 49+ messages in thread
From: Andy Shevchenko @ 2023-12-27 16:01 UTC (permalink / raw)
To: Mark Hasemeyer
Cc: LKML, chrome-platform, cros-qcom-dts-watchers, devicetree,
linux-acpi, linux-arm-kernel, linux-arm-msm, linux-gpio,
linux-i2c, linux-mediatek, linux-rockchip, linux-samsung-soc,
linux-tegra
On Fri, Dec 22, 2023 at 03:30:43PM -0700, Mark Hasemeyer wrote:
> > Just wondering if you used --histogram diff algo when preparing patches.
>
> Not knowingly. I use patman which uses 'git format-patch' under the
> covers with some added options:
> https://github.com/siemens/u-boot/blob/master/tools/patman/gitutil.py#L308
Add a configuration into your ~/.gitconfig (or local for the project),
it really makes the difference.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: (subset) [PATCH v2 06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
2023-12-20 23:54 ` [PATCH v2 06/22] ARM: dts: samsung: exynos5420: " Mark Hasemeyer
2023-12-21 8:14 ` Krzysztof Kozlowski
@ 2024-01-22 11:15 ` Krzysztof Kozlowski
1 sibling, 0 replies; 49+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-22 11:15 UTC (permalink / raw)
To: LKML, Mark Hasemeyer
Cc: AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Alim Akhtar, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-samsung-soc
On Wed, 20 Dec 2023 16:54:20 -0700, Mark Hasemeyer wrote:
> The cros_ec driver currently assumes that cros-ec-spi compatible device
> nodes are a wakeup-source even though the wakeup-source property is not
> defined.
>
> Add the wakeup-source property to all cros-ec-spi compatible device
> nodes to match expected behavior.
>
> [...]
Applied, thanks!
[06/22] ARM: dts: samsung: exynos5420: Enable cros-ec-spi as wake source
https://git.kernel.org/krzk/linux/c/8f51b5290ff4f8a9f1c634cf42ca37cd9e90018c
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
* Re: (subset) [PATCH v2 07/22] ARM: dts: samsung: exynos5800: Enable cros-ec-spi as wake source
2023-12-20 23:54 ` [PATCH v2 07/22] ARM: dts: samsung: exynos5800: " Mark Hasemeyer
@ 2024-01-22 11:15 ` Krzysztof Kozlowski
0 siblings, 0 replies; 49+ messages in thread
From: Krzysztof Kozlowski @ 2024-01-22 11:15 UTC (permalink / raw)
To: LKML, Mark Hasemeyer
Cc: AngeloGioacchino Del Regno, Tzung-Bi Shih, Raul Rangel,
Konrad Dybcio, Andy Shevchenko, Rob Herring, Sudeep Holla,
Alim Akhtar, Conor Dooley, Krzysztof Kozlowski, Rob Herring,
devicetree, linux-arm-kernel, linux-samsung-soc
On Wed, 20 Dec 2023 16:54:21 -0700, Mark Hasemeyer wrote:
> The cros_ec driver currently assumes that cros-ec-spi compatible device
> nodes are a wakeup-source even though the wakeup-source property is not
> defined.
>
> Add the wakeup-source property to all cros-ec-spi compatible device
> nodes to match expected behavior.
>
> [...]
Applied, thanks!
[07/22] ARM: dts: samsung: exynos5800: Enable cros-ec-spi as wake source
https://git.kernel.org/krzk/linux/c/df294f4ec618c9f0d7e9a2fde1c541b731972389
Best regards,
--
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply [flat|nested] 49+ messages in thread
end of thread, other threads:[~2024-01-22 11:15 UTC | newest]
Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-20 23:54 [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 03/22] Documentation: devicetree: Clarify wording for wakeup-source property Mark Hasemeyer
2023-12-21 8:13 ` Krzysztof Kozlowski
2023-12-21 18:16 ` Mark Hasemeyer
2023-12-21 18:42 ` Krzysztof Kozlowski
2023-12-20 23:54 ` [PATCH v2 04/22] ARM: dts: tegra: Enable cros-ec-spi as wake source Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 05/22] ARM: dts: rockchip: rk3288: " Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 06/22] ARM: dts: samsung: exynos5420: " Mark Hasemeyer
2023-12-21 8:14 ` Krzysztof Kozlowski
2023-12-21 18:29 ` Mark Hasemeyer
2023-12-21 18:38 ` Krzysztof Kozlowski
2023-12-21 19:24 ` Mark Hasemeyer
2023-12-21 20:34 ` Krzysztof Kozlowski
2024-01-22 11:15 ` (subset) " Krzysztof Kozlowski
2023-12-20 23:54 ` [PATCH v2 07/22] ARM: dts: samsung: exynos5800: " Mark Hasemeyer
2024-01-22 11:15 ` (subset) " Krzysztof Kozlowski
2023-12-20 23:54 ` [PATCH v2 08/22] arm64: dts: mediatek: mt8173: " Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 09/22] arm64: dts: mediatek: mt8183: " Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 10/22] arm64: dts: mediatek: mt8192: " Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 11/22] arm64: dts: mediatek: mt8195: " Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 12/22] arm64: dts: tegra: " Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 13/22] arm64: dts: qcom: sc7180: " Mark Hasemeyer
2023-12-21 0:10 ` Doug Anderson
2023-12-20 23:54 ` [PATCH v2 14/22] arm64: dts: qcom: sc7280: " Mark Hasemeyer
2023-12-21 0:10 ` Doug Anderson
2023-12-20 23:54 ` [PATCH v2 15/22] arm64: dts: qcom: sdm845: " Mark Hasemeyer
2023-12-21 0:11 ` Doug Anderson
2023-12-20 23:54 ` [PATCH v2 16/22] arm64: dts: rockchip: rk3399: " Mark Hasemeyer
2023-12-20 23:54 ` [PATCH v2 17/22] of: irq: add wake capable bit to of_irq_resource() Mark Hasemeyer
2023-12-21 15:25 ` Andy Shevchenko
2023-12-22 22:22 ` Mark Hasemeyer
2023-12-21 20:44 ` Rob Herring
2023-12-20 23:54 ` [PATCH v2 18/22] of: irq: Add default implementation for of_irq_to_resource() Mark Hasemeyer
2023-12-21 20:48 ` Rob Herring
2023-12-20 23:54 ` [PATCH v2 19/22] of: irq: Remove extern from function declarations Mark Hasemeyer
2023-12-21 20:49 ` Rob Herring
2023-12-20 23:54 ` [PATCH v2 20/22] device property: Modify fwnode irq_get() to use resource Mark Hasemeyer
2023-12-21 10:37 ` Sakari Ailus
2023-12-21 23:52 ` Mark Hasemeyer
2023-12-22 12:48 ` Andy Shevchenko
2023-12-21 13:56 ` Andy Shevchenko
2023-12-21 23:46 ` Mark Hasemeyer
2023-12-22 12:44 ` Andy Shevchenko
[not found] ` <CAHQZ30BOA7zuRrN-kK5Qw+NYSVydfhJ0gDPr9q-U+7VKXHzG8g@mail.gmail.com>
2023-12-21 23:59 ` Mark Hasemeyer
2023-12-22 12:46 ` Andy Shevchenko
2023-12-22 12:46 ` Andy Shevchenko
2023-12-21 13:42 ` [PATCH v2 00/22] Improve IRQ wake capability reporting and update the cros_ec driver to use it Andy Shevchenko
2023-12-22 22:30 ` Mark Hasemeyer
2023-12-27 16:01 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).