firmware/arm_sdei: Fix invalid argument to unregister private events.
PATCH 1/1 firmware/arm_sdei: Fix invalid argument to unregister private events.
To unregister private events in device freeze, it should call cpuhp_remove_state with sdei_hp_state not sdei_entry_point. otherwise, it seems to fail on cpuhp_cb_check.
--- drivers/firmware/arm_sdei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/arm_sdei.c +1 -1
@@ -763,7 +763,7 @@ static int sdei_device_freeze(struct device *dev)int err;/* unregister private events */ -cpuhp_remove_state (sdei_entry_point); +cpuhp_remove_state (sdei_hp_state); err =sdei_unregister_shared ();if (err)
Signature · 1 line
2.41.0
Hello Levi,
Quoted 4 lines · Levi Yun
To unregister private events in device freeze, it should call
cpuhp_remove_statewithsdei_hp_statenotsdei_entry_point. otherwise, it seems to fail oncpuhp_cb_check.
I think you can also add:
Quoted 10 lines
Signed-off-by Levi Yun <[email protected]>--- drivers/firmware/arm_sdei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/firmware/arm_sdei.c +0
-0
drivers/firmware/arm_sdei.c static int sdei_device_freeze(struct device *dev) · line 766
Quoted 5 lines
drivers/firmware/arm_sdei.c +1
-1@@ -763,7 +763,7 @@ static int sdei_device_freeze(struct device *dev)int err;/* unregister private events */ -cpuhp_remove_state (sdei_entry_point); +cpuhp_remove_state (sdei_hp_state);
Maybe it would also be worth resetting 'sdei_hp_state':
sdei_hp_state = 0;
drivers/firmware/arm_sdei.c static int sdei_device_freeze(struct device *dev) · line 769
Quoted 3 lines
drivers/firmware/arm_sdei.c +0
-0err =sdei_unregister_shared ();if (err)
Regards,
Pierre
Hi Levi, Pierre,
Quoted 4 lines · Pierre Gondois
Quoted 3 lines · Levi Yun
To unregister private events in device freeze, it should call
cpuhp_remove_statewithsdei_hp_statenotsdei_entry_point. otherwise, it seems to fail oncpuhp_cb_check.
Oops. Well caught!
Quoted 4 lines
I think you can also add:
Fixes d2c48b2387eb ("firmware: arm_sdei: Fix sleep from invalid context BUG")
Quoted 12 lines
drivers/firmware/arm_sdei.c static int sdei_device_freeze(struct device *dev) · line 765
Quoted 9 lines
drivers/firmware/arm_sdei.c +1
-1@@ -763,7 +763,7 @@ static int sdei_device_freeze(struct device *dev) int err; /* unregister private events */ - cpuhp_remove_state(sdei_entry_point); + cpuhp_remove_state(sdei_hp_state);Maybe it would also be worth resetting '
sdei_hp_state':
sdei_hp_state= 0;
The next call should always be 'thaw', which doesn't check this, but it's good to cleanup stale values.
Regardless:
Thanks,
James
Hi James, Pierre.
Quoted 2 lines
Quoted 2 lines
I think you can also add:
Fixes d2c48b2387eb ("firmware: arm_sdei: Fix sleep from invalid context BUG")
Thanks, I'll add this fix tag.
Quoted 13 lines
Quoted 4 lines
Quoted 4 lines
drivers/firmware/arm_sdei.c +0
-0Quoted 8 lines
drivers/firmware/arm_sdei.c static int sdei_device_freeze(struct device *dev) · line 765
Quoted 5 lines
drivers/firmware/arm_sdei.c +1
-1@@ -763,7 +763,7 @@ static int sdei_device_freeze(struct device *dev)int err;/* unregister private events */ -cpuhp_remove_state (sdei_entry_point); +cpuhp_remove_state (sdei_hp_state);Maybe it would also be worth resetting '
sdei_hp_state':
sdei_hp_state= 0;
Quoted 3 lines
The next call should always be 'thaw', which doesn't check this, but it's good to cleanup stale values.
But, I think it should be checked on sdei_reboot_notifier. otherwise, In the situation sdei device was freezed, when sdei_reboot_notifier is called,
It would fail on cpuhp_cb_check too.
Should I add a sanity check on sdei_reboot_notifier in the next patch?
Many thanks!
Quoted 7 lines
But, I think it should be checked on
sdei_reboot_notifier. otherwise, In the situation sdei device was freezed, whensdei_reboot_notifieris called,
It would fail oncpuhp_cb_checktoo.Should I add a sanity check on
sdei_reboot_notifierin the next patch?
Sorry to make a noise. Maybe there's no case for this.
PATCH v2 1/1 firmware/arm_sdei: Fix invalid argument to unregister private events.
In reply to James MorseTo unregister private events in device freeze, it should call cpuhp_remove_state with sdei_hp_state not sdei_entry_point. otherwise, it seems to fail on cpuhp_cb_check.
---
Changes:
v1->v2: add fixes tag and resetting sdei_hp_state
drivers/firmware/arm_sdei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/arm_sdei.c +1 -1
@@ -763,7 +763,7 @@ static int sdei_device_freeze(struct device *dev)int err;/* unregister private events */ -cpuhp_remove_state (sdei_entry_point); +cpuhp_remove_state (sdei_hp_state); err =sdei_unregister_shared ();if (err)
--
2.41.0
PATCH v3 1/1 firmware/arm_sdei: Fix invalid argument to unregister private events.
To unregister private events in device freeze, it should call cpuhp_remove_state with sdei_hp_state not sdei_entry_point. otherwise, it seems to fail on cpuhp_cb_check.
---
Changes:
v1->v2: add fixes tag and resetting sdei_hp_state
v2->v3: add missing resetting sdei_hp_state.
drivers/firmware/arm_sdei.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/firmware/arm_sdei.c +3 -1
@@ -763,7 +763,9 @@ static int sdei_device_freeze(struct device *dev)int err;/* unregister private events */ -cpuhp_remove_state (sdei_entry_point); +cpuhp_remove_state (sdei_hp_state); + + sdei_hp_state =0 ; err =sdei_unregister_shared ();if (err)
--
2.41.0