Shyam Sundar S K
146b6f6855
platform/x86/amd/pmf: Register notify handler only if SPS is enabled
...
Power source notify handler is getting registered even when none of the
PMF feature in enabled leading to a crash.
...
[ 22.592162] Call Trace:
[ 22.592164] <TASK>
[ 22.592164] ? rcu_note_context_switch+0x5e0/0x660
[ 22.592166] ? __warn+0x81/0x130
[ 22.592171] ? rcu_note_context_switch+0x5e0/0x660
[ 22.592172] ? report_bug+0x171/0x1a0
[ 22.592175] ? prb_read_valid+0x1b/0x30
[ 22.592177] ? handle_bug+0x3c/0x80
[ 22.592178] ? exc_invalid_op+0x17/0x70
[ 22.592179] ? asm_exc_invalid_op+0x1a/0x20
[ 22.592182] ? rcu_note_context_switch+0x5e0/0x660
[ 22.592183] ? acpi_ut_delete_object_desc+0x86/0xb0
[ 22.592186] ? acpi_ut_update_ref_count.part.0+0x22d/0x930
[ 22.592187] __schedule+0xc0/0x1410
[ 22.592189] ? ktime_get+0x3c/0xa0
[ 22.592191] ? lapic_next_event+0x1d/0x30
[ 22.592193] ? hrtimer_start_range_ns+0x25b/0x350
[ 22.592196] schedule+0x5e/0xd0
[ 22.592197] schedule_hrtimeout_range_clock+0xbe/0x140
[ 22.592199] ? __pfx_hrtimer_wakeup+0x10/0x10
[ 22.592200] usleep_range_state+0x64/0x90
[ 22.592203] amd_pmf_send_cmd+0x106/0x2a0 [amd_pmf bddfe0fe3712aaa99acce3d5487405c5213c6616]
[ 22.592207] amd_pmf_update_slider+0x56/0x1b0 [amd_pmf bddfe0fe3712aaa99acce3d5487405c5213c6616]
[ 22.592210] amd_pmf_set_sps_power_limits+0x72/0x80 [amd_pmf bddfe0fe3712aaa99acce3d5487405c5213c6616]
[ 22.592213] amd_pmf_pwr_src_notify_call+0x49/0x90 [amd_pmf bddfe0fe3712aaa99acce3d5487405c5213c6616]
[ 22.592216] notifier_call_chain+0x5a/0xd0
[ 22.592218] atomic_notifier_call_chain+0x32/0x50
...
Fix this by moving the registration of source change notify handler only
when SPS(Static Slider) is advertised as supported.
Reported-by: Allen Zhong <allen@atr.me>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217571
Fixes: 4c71ae414474 ("platform/x86/amd/pmf: Add support SPS PMF feature")
Tested-by: Patil Rajesh Reddy <Patil.Reddy@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com>
Link: https://lore.kernel.org/r/20230622060309.310001-1-Shyam-sundar.S-k@amd.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2023-06-22 10:20:00 +02:00
..
2023-06-22 10:20:00 +02:00
2023-03-16 14:51:07 +01:00
2023-05-09 10:54:33 +02:00
2023-05-30 12:10:22 +02:00
2023-04-17 12:23:26 +02:00
2023-03-07 12:19:13 +01:00
2023-04-25 18:32:43 -07:00
2023-03-07 12:19:26 +01:00
2023-03-07 12:19:43 +01:00
2023-04-06 14:24:04 +02:00
2022-11-23 19:11:22 +01:00
2023-05-15 14:55:57 +02:00
2023-02-06 15:08:45 +01:00
2022-11-23 19:11:22 +01:00
2023-01-24 13:41:13 +01:00
2023-01-12 19:35:51 +01:00
2023-03-07 12:19:45 +01:00
2023-03-16 16:10:54 +01:00
2023-03-07 12:19:47 +01:00
2022-11-23 19:11:22 +01:00
2022-09-03 12:17:27 +02:00
2022-11-23 19:11:22 +01:00
2022-11-23 19:11:22 +01:00
2023-03-31 19:31:48 +02:00
2022-10-03 09:40:04 +02:00
2023-03-07 12:20:17 +01:00
2023-03-17 15:29:06 +01:00
2023-04-25 16:59:48 -07:00
2023-04-06 12:33:34 +02:00
2023-03-17 15:16:27 +01:00
2023-05-08 17:35:08 +02:00
2023-04-06 12:33:34 +02:00
2023-04-06 12:33:34 +02:00
2022-12-12 13:38:17 -08:00
2023-04-06 12:33:34 +02:00
2023-03-07 12:08:30 +01:00
2023-03-27 16:10:20 +02:00
2023-03-27 16:10:20 +02:00
2022-10-03 09:40:04 +02:00
2022-12-08 16:32:12 +01:00
2023-02-18 11:45:52 +01:00
2022-11-07 12:33:49 +01:00
2022-11-23 19:11:22 +01:00
2023-03-16 16:14:52 +01:00
2022-08-25 16:23:52 +02:00
2022-10-03 09:40:04 +02:00
2023-03-07 12:20:44 +01:00
2023-04-27 11:02:26 -07:00
2023-01-12 19:42:53 +01:00
2023-03-16 16:11:03 +01:00
2022-12-12 13:38:17 -08:00
2023-04-25 16:59:48 -07:00
2022-04-04 15:20:53 +02:00
2023-05-09 10:54:45 +02:00
2022-11-23 19:11:22 +01:00
2022-12-12 13:38:17 -08:00
2022-11-23 19:11:22 +01:00
2022-11-23 19:11:22 +01:00
2023-05-09 10:54:58 +02:00
2023-02-10 17:24:37 +01:00
2022-10-03 09:40:04 +02:00
2022-12-12 13:38:17 -08:00
2023-03-07 12:20:47 +01:00
2023-03-07 12:20:50 +01:00
2022-11-23 19:11:22 +01:00