From 958c19b19befe0a4e0c68c3c4070af50822daabc Mon Sep 17 00:00:00 2001 From: John Stultz Date: Fri, 19 Mar 2021 03:51:28 +0000 Subject: [PATCH] ANDROID: usb: typec: tcpm: Fix event storm caused by error in backport As noted by Badhri, the patch https://lore.kernel.org/linux-usb/20210317181249.1062995-1-badhri@google.com/ Adds the power_supply_changed() to tcpm_psy_set_prop(), but the patch submitted to Gerrit added it in tcpm_psy_get_prop() This causes a uevent storm which results in lots of strange behavior and error messages. Thus, as suggested by Badhri, this patch removes the power_supply_changed() call in the tcpm_psy_get_prop(), and adds it to the tcpm_psy_get_prop() function to match the original patch. Debugged-and-Suggested-by: Badhri Jagan Sridharan Signed-off-by: John Stultz Fixes: 6f85b7e0f816 ("UPSTREAM: usb: typec: tcpm: Invoke power_supply_changed for tcpm-source-psy-") Change-Id: Ib161d15b82ef0fad541cda79f8832145218fb137 --- drivers/usb/typec/tcpm/tcpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index acc3fb22647f..49caf4cad123 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -6009,7 +6009,6 @@ static int tcpm_psy_get_prop(struct power_supply *psy, ret = -EINVAL; break; } - power_supply_changed(port->psy); return ret; } @@ -6061,6 +6060,7 @@ static int tcpm_psy_set_prop(struct power_supply *psy, ret = -EINVAL; break; } + power_supply_changed(port->psy); return ret; }