From 869e35b81973b3b4240021ea7bbb8f1fe407e75e Mon Sep 17 00:00:00 2001 From: Anjelique Melendez Date: Wed, 28 Feb 2024 15:59:38 -0800 Subject: [PATCH 1/2] dt-bindings: qcom,battery-charger: Add qcom,ship-mode-immediate property Currently, charger FW configures and enables ship mode in parallel with shutdown activity. This can cause a race condition leaving the device in a bad state if the device is powering down while SW is still issuing SPMI writes. Add new "qcom,ship-mode-immediate" property to flag that ship mode should be immediately configured after user sets ship_mode_en to avoid this race condition. Change-Id: I16b1e307cac8befff7a1136de1cb522e03a95c46 Signed-off-by: Anjelique Melendez --- bindings/power/supply/qcom,battery-charger.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bindings/power/supply/qcom,battery-charger.yaml b/bindings/power/supply/qcom,battery-charger.yaml index b3de6112..b553855e 100644 --- a/bindings/power/supply/qcom,battery-charger.yaml +++ b/bindings/power/supply/qcom,battery-charger.yaml @@ -54,6 +54,12 @@ properties: $ref: /schemas/types.yaml#/definitions/phandle-array minItems: 1 + qcom,ship-mode-immediate: + description: | + Flag indicating that ship mode will be configured immediately and enabled + after shut down is initiated. + $ref: /schemas/types.yaml#/definitions/flag + required: - compatible From ff3eff593b20113a9f2f757ade27c5902fd0e7da Mon Sep 17 00:00:00 2001 From: Anjelique Melendez Date: Wed, 28 Feb 2024 15:50:37 -0800 Subject: [PATCH 2/2] ARM: dts: qcom: Add qcom,ship-mode-immediate property for Sun platforms Currently, charger FW configures and enables ship mode in parallel with shutdown activity. This can cause a race condition leaving the device in a bad state if the device is powering off while SW is still issuing SPMI writes. Add the battery charger "qcom,ship-mode-immediate" property on Sun platforms so that ship mode will be configured immediately by charger FW after user sets ship_mode_en. Change-Id: I55a78c7b5c59b8b82519713fb4267d081c54a92f Signed-off-by: Anjelique Melendez --- qcom/sun-mtp.dtsi | 1 + qcom/sun-qrd-sku1.dtsi | 1 + qcom/sun-qrd-sku2.dtsi | 1 + 3 files changed, 3 insertions(+) diff --git a/qcom/sun-mtp.dtsi b/qcom/sun-mtp.dtsi index a6e8d650..0aafa3f6 100644 --- a/qcom/sun-mtp.dtsi +++ b/qcom/sun-mtp.dtsi @@ -68,6 +68,7 @@ qcom,thermal-mitigation-step = <500000>; #cooling-cells = <2>; qcom,wireless-fw-name = "idt9418.bin"; + qcom,ship-mode-immediate; }; &pmic_glink_debug { diff --git a/qcom/sun-qrd-sku1.dtsi b/qcom/sun-qrd-sku1.dtsi index 1ec32423..5123f1a8 100644 --- a/qcom/sun-qrd-sku1.dtsi +++ b/qcom/sun-qrd-sku1.dtsi @@ -45,6 +45,7 @@ qcom,thermal-mitigation-step = <500000>; #cooling-cells = <2>; qcom,wireless-fw-name = "idt9418.bin"; + qcom,ship-mode-immediate; }; &pmic_glink_debug { diff --git a/qcom/sun-qrd-sku2.dtsi b/qcom/sun-qrd-sku2.dtsi index 4b02e10e..24045880 100644 --- a/qcom/sun-qrd-sku2.dtsi +++ b/qcom/sun-qrd-sku2.dtsi @@ -43,6 +43,7 @@ qcom,thermal-mitigation-step = <500000>; #cooling-cells = <2>; qcom,wireless-fw-name = "idt9418.bin"; + qcom,ship-mode-immediate; }; &pmic_glink_debug {