Skip to contentSkip to conversation

power: domain: apple: Restore reset ops that return 0

PATCH In review Mark Kettenis 3 participants 6 messages Apr 26, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: domain: apple: Restore reset ops that return 0

These were removed inadvertently in commit 20874a60722b. Fixes a crash on Apple M1 systems.

---
 drivers/power/domain/apple-pmgr.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
drivers/power/domain/apple-pmgr.c +12 -0
index 402c5b1fd1..88eafd0468 100644
@@ -42,6 +42,16 @@ static int apple_reset_of_xlate(struct reset_ctl *reset_ctl,
 	return 0;
 }
 
+static int apple_reset_request(struct reset_ctl *reset_ctl)
+{
+	return 0;
+}
+
+static int apple_reset_free(struct reset_ctl *reset_ctl)
+{
+	return 0;
+}
+
 static int apple_reset_assert(struct reset_ctl *reset_ctl)
 {
 	struct apple_pmgr_priv *priv = dev_get_priv(reset_ctl->dev->parent);
@@ -70,6 +80,8 @@ static int apple_reset_deassert(struct reset_ctl *reset_ctl)
 
 struct reset_ops apple_reset_ops = {
 	.of_xlate = apple_reset_of_xlate,
+	.request = apple_reset_request,
+	.rfree = apple_reset_free,
 	.rst_assert = apple_reset_assert,
 	.rst_deassert = apple_reset_deassert,
 };
Signature · 1 line
2.35.2
#1 lore raw
Quoted 2 lines · Mark Kettenis

These were removed inadvertently in commit 20874a60722b. Fixes a crash on Apple M1 systems.

The drivers/power/domain/power-domain-uclass.c should handle empty implementation of request/rfree callback in exactly the commit you reference above.

#2 lore raw
Quoted 10 lines

Date: Tue, 26 Apr 2022 20:04:19 +0200
From: Marek Vasut <[email protected]>

Quoted 2 lines · Mark Kettenis

These were removed inadvertently in commit 20874a60722b. Fixes a crash on Apple M1 systems.

The drivers/power/domain/power-domain-uclass.c should handle empty implementation of request/rfree callback in exactly the commit you reference above.

Yes, but drivers/reset/reset-uclass.c doesn't and you also removed the request/rfree callbacks for that part of the apple_pmgr driver.

#3 lore raw
Quoted 7 lines · Mark Kettenis
Quoted 7 lines

Date: Tue, 26 Apr 2022 20:04:19 +0200
From: Marek Vasut <[email protected]>

Quoted 2 lines · Mark Kettenis

These were removed inadvertently in commit 20874a60722b. Fixes a crash on Apple M1 systems.

Quoted 6 lines
Quoted 3 lines

The drivers/power/domain/power-domain-uclass.c should handle empty implementation of request/rfree callback in exactly the commit you reference above.

Yes, but drivers/reset/reset-uclass.c doesn't and you also removed the request/rfree callbacks for that part of the apple_pmgr driver.

Ah, sigh. Would it rather make sense to change the reset uclass ? It would reduce the amount of empty callbacks.

#4 lore raw
Quoted 15 lines

Date: Tue, 26 Apr 2022 21:01:01 +0200
From: Marek Vasut <[email protected]>

Quoted 11 lines · Mark Kettenis
Quoted 10 lines

Date: Tue, 26 Apr 2022 20:04:19 +0200
From: Marek Vasut <[email protected]>

Quoted 2 lines · Mark Kettenis

These were removed inadvertently in commit 20874a60722b. Fixes a crash on Apple M1 systems.

The drivers/power/domain/power-domain-uclass.c should handle empty implementation of request/rfree callback in exactly the commit you reference above.

Quoted 5 lines
Quoted 2 lines

Yes, but drivers/reset/reset-uclass.c doesn't and you also removed the request/rfree callbacks for that part of the apple_pmgr driver.

Ah, sigh. Would it rather make sense to change the reset uclass ? It would reduce the amount of empty callbacks.

Maybe. But that should probably done as a single sweep like you did for the power domains. Let's fix this crash first.

#5 lore raw
Quoted 15 lines · Mark Kettenis
Quoted 15 lines

Date: Tue, 26 Apr 2022 21:01:01 +0200
From: Marek Vasut <[email protected]>

Quoted 11 lines · Mark Kettenis
Quoted 10 lines

Date: Tue, 26 Apr 2022 20:04:19 +0200
From: Marek Vasut <[email protected]>

Quoted 2 lines · Mark Kettenis

These were removed inadvertently in commit 20874a60722b. Fixes a crash on Apple M1 systems.

The drivers/power/domain/power-domain-uclass.c should handle empty implementation of request/rfree callback in exactly the commit you reference above.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Yes, but drivers/reset/reset-uclass.c doesn't and you also removed the request/rfree callbacks for that part of the apple_pmgr driver.

Ah, sigh. Would it rather make sense to change the reset uclass ? It would reduce the amount of empty callbacks.

Maybe. But that should probably done as a single sweep like you did for the power domains. Let's fix this crash first.

Try:
[PATCH] reset: Return 0 if ops unimplemented and remove empty functions

If this patch gets applied first, then please make sure it is also un-applied once the above is applied, so we don't grow useless empty functions again.