Skip to content

Commit 016284a

Browse files
superm1gregkh
authored andcommitted
platform/x86/amd: pmc: Drop SMU F/W match for Cezanne
[ Upstream commit 5b9e075 ] Chris reported that even on a BIOS that has a new enough SMU F/W version there is still a spurious IRQ1. Although the solution was added to SMU F/W 64.66.0 it turns out there needs to be a matching SBIOS change to activate it. Thus Linux shouldn't be avoiding the IRQ1 workaround on newer SMU F/W because there is no indication the BIOS change is in place. Drop the match for 64.66.0+ and instead match all RN/CZN/BRC (they all share same SMU F/W). Adjust the quirk infrastructure to allow quirking the workaround on or off and also adjust existing quirks to match properly. Unfortunately this may cause some systems that did have the SBIOS change in place to regress in keyboard wakeup but we don't have a way to know. If a user reports a keyboard wakeup regression they can run with amd_pmc.disable_workarounds=1 to deactivate the workaround and share DMI data so that their system can be quirked not to use the workaround in the upstream kernel. Reported-by: Chris Bainbridge <chris.bainbridge@gmail.com> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4449 Tested-by: Chris Bainbridge <chris.bainbridge@gmail.com> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com> Link: https://lore.kernel.org/r/20250724185156.1827592-1-superm1@kernel.org Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 0800d97 commit 016284a

File tree

2 files changed

+34
-33
lines changed

2 files changed

+34
-33
lines changed

drivers/platform/x86/amd/pmc/pmc-quirks.c

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -28,90 +28,95 @@ static struct quirk_entry quirk_spurious_8042 = {
2828
.spurious_8042 = true,
2929
};
3030

31+
static struct quirk_entry quirk_s2idle_spurious_8042 = {
32+
.s2idle_bug_mmio = FCH_PM_BASE + FCH_PM_SCRATCH,
33+
.spurious_8042 = true,
34+
};
35+
3136
static const struct dmi_system_id fwbug_list[] = {
3237
{
3338
.ident = "L14 Gen2 AMD",
34-
.driver_data = &quirk_s2idle_bug,
39+
.driver_data = &quirk_s2idle_spurious_8042,
3540
.matches = {
3641
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
3742
DMI_MATCH(DMI_PRODUCT_NAME, "20X5"),
3843
}
3944
},
4045
{
4146
.ident = "T14s Gen2 AMD",
42-
.driver_data = &quirk_s2idle_bug,
47+
.driver_data = &quirk_s2idle_spurious_8042,
4348
.matches = {
4449
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
4550
DMI_MATCH(DMI_PRODUCT_NAME, "20XF"),
4651
}
4752
},
4853
{
4954
.ident = "X13 Gen2 AMD",
50-
.driver_data = &quirk_s2idle_bug,
55+
.driver_data = &quirk_s2idle_spurious_8042,
5156
.matches = {
5257
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
5358
DMI_MATCH(DMI_PRODUCT_NAME, "20XH"),
5459
}
5560
},
5661
{
5762
.ident = "T14 Gen2 AMD",
58-
.driver_data = &quirk_s2idle_bug,
63+
.driver_data = &quirk_s2idle_spurious_8042,
5964
.matches = {
6065
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
6166
DMI_MATCH(DMI_PRODUCT_NAME, "20XK"),
6267
}
6368
},
6469
{
6570
.ident = "T14 Gen1 AMD",
66-
.driver_data = &quirk_s2idle_bug,
71+
.driver_data = &quirk_s2idle_spurious_8042,
6772
.matches = {
6873
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
6974
DMI_MATCH(DMI_PRODUCT_NAME, "20UD"),
7075
}
7176
},
7277
{
7378
.ident = "T14 Gen1 AMD",
74-
.driver_data = &quirk_s2idle_bug,
79+
.driver_data = &quirk_s2idle_spurious_8042,
7580
.matches = {
7681
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
7782
DMI_MATCH(DMI_PRODUCT_NAME, "20UE"),
7883
}
7984
},
8085
{
8186
.ident = "T14s Gen1 AMD",
82-
.driver_data = &quirk_s2idle_bug,
87+
.driver_data = &quirk_s2idle_spurious_8042,
8388
.matches = {
8489
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
8590
DMI_MATCH(DMI_PRODUCT_NAME, "20UH"),
8691
}
8792
},
8893
{
8994
.ident = "T14s Gen1 AMD",
90-
.driver_data = &quirk_s2idle_bug,
95+
.driver_data = &quirk_s2idle_spurious_8042,
9196
.matches = {
9297
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
9398
DMI_MATCH(DMI_PRODUCT_NAME, "20UJ"),
9499
}
95100
},
96101
{
97102
.ident = "P14s Gen1 AMD",
98-
.driver_data = &quirk_s2idle_bug,
103+
.driver_data = &quirk_s2idle_spurious_8042,
99104
.matches = {
100105
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
101106
DMI_MATCH(DMI_PRODUCT_NAME, "20Y1"),
102107
}
103108
},
104109
{
105110
.ident = "P14s Gen2 AMD",
106-
.driver_data = &quirk_s2idle_bug,
111+
.driver_data = &quirk_s2idle_spurious_8042,
107112
.matches = {
108113
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
109114
DMI_MATCH(DMI_PRODUCT_NAME, "21A0"),
110115
}
111116
},
112117
{
113118
.ident = "P14s Gen2 AMD",
114-
.driver_data = &quirk_s2idle_bug,
119+
.driver_data = &quirk_s2idle_spurious_8042,
115120
.matches = {
116121
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
117122
DMI_MATCH(DMI_PRODUCT_NAME, "21A1"),
@@ -152,39 +157,39 @@ static const struct dmi_system_id fwbug_list[] = {
152157
},
153158
{
154159
.ident = "IdeaPad 1 14AMN7",
155-
.driver_data = &quirk_s2idle_bug,
160+
.driver_data = &quirk_s2idle_spurious_8042,
156161
.matches = {
157162
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
158163
DMI_MATCH(DMI_PRODUCT_NAME, "82VF"),
159164
}
160165
},
161166
{
162167
.ident = "IdeaPad 1 15AMN7",
163-
.driver_data = &quirk_s2idle_bug,
168+
.driver_data = &quirk_s2idle_spurious_8042,
164169
.matches = {
165170
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
166171
DMI_MATCH(DMI_PRODUCT_NAME, "82VG"),
167172
}
168173
},
169174
{
170175
.ident = "IdeaPad 1 15AMN7",
171-
.driver_data = &quirk_s2idle_bug,
176+
.driver_data = &quirk_s2idle_spurious_8042,
172177
.matches = {
173178
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
174179
DMI_MATCH(DMI_PRODUCT_NAME, "82X5"),
175180
}
176181
},
177182
{
178183
.ident = "IdeaPad Slim 3 14AMN8",
179-
.driver_data = &quirk_s2idle_bug,
184+
.driver_data = &quirk_s2idle_spurious_8042,
180185
.matches = {
181186
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
182187
DMI_MATCH(DMI_PRODUCT_NAME, "82XN"),
183188
}
184189
},
185190
{
186191
.ident = "IdeaPad Slim 3 15AMN8",
187-
.driver_data = &quirk_s2idle_bug,
192+
.driver_data = &quirk_s2idle_spurious_8042,
188193
.matches = {
189194
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
190195
DMI_MATCH(DMI_PRODUCT_NAME, "82XQ"),
@@ -193,7 +198,7 @@ static const struct dmi_system_id fwbug_list[] = {
193198
/* https://gitlab.freedesktop.org/drm/amd/-/issues/4434 */
194199
{
195200
.ident = "Lenovo Yoga 6 13ALC6",
196-
.driver_data = &quirk_s2idle_bug,
201+
.driver_data = &quirk_s2idle_spurious_8042,
197202
.matches = {
198203
DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"),
199204
DMI_MATCH(DMI_PRODUCT_NAME, "82ND"),
@@ -202,7 +207,7 @@ static const struct dmi_system_id fwbug_list[] = {
202207
/* https://gitlab.freedesktop.org/drm/amd/-/issues/2684 */
203208
{
204209
.ident = "HP Laptop 15s-eq2xxx",
205-
.driver_data = &quirk_s2idle_bug,
210+
.driver_data = &quirk_s2idle_spurious_8042,
206211
.matches = {
207212
DMI_MATCH(DMI_SYS_VENDOR, "HP"),
208213
DMI_MATCH(DMI_PRODUCT_NAME, "HP Laptop 15s-eq2xxx"),
@@ -285,6 +290,16 @@ void amd_pmc_quirks_init(struct amd_pmc_dev *dev)
285290
{
286291
const struct dmi_system_id *dmi_id;
287292

293+
/*
294+
* IRQ1 may cause an interrupt during resume even without a keyboard
295+
* press.
296+
*
297+
* Affects Renoir, Cezanne and Barcelo SoCs
298+
*
299+
* A solution is available in PMFW 64.66.0, but it must be activated by
300+
* SBIOS. If SBIOS is known to have the fix a quirk can be added for
301+
* a given system to avoid workaround.
302+
*/
288303
if (dev->cpu_id == AMD_CPU_ID_CZN)
289304
dev->disable_8042_wakeup = true;
290305

@@ -295,6 +310,5 @@ void amd_pmc_quirks_init(struct amd_pmc_dev *dev)
295310
if (dev->quirks->s2idle_bug_mmio)
296311
pr_info("Using s2idle quirk to avoid %s platform firmware bug\n",
297312
dmi_id->ident);
298-
if (dev->quirks->spurious_8042)
299-
dev->disable_8042_wakeup = true;
313+
dev->disable_8042_wakeup = dev->quirks->spurious_8042;
300314
}

drivers/platform/x86/amd/pmc/pmc.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -530,19 +530,6 @@ static int amd_pmc_get_os_hint(struct amd_pmc_dev *dev)
530530
static int amd_pmc_wa_irq1(struct amd_pmc_dev *pdev)
531531
{
532532
struct device *d;
533-
int rc;
534-
535-
/* cezanne platform firmware has a fix in 64.66.0 */
536-
if (pdev->cpu_id == AMD_CPU_ID_CZN) {
537-
if (!pdev->major) {
538-
rc = amd_pmc_get_smu_version(pdev);
539-
if (rc)
540-
return rc;
541-
}
542-
543-
if (pdev->major > 64 || (pdev->major == 64 && pdev->minor > 65))
544-
return 0;
545-
}
546533

547534
d = bus_find_device_by_name(&serio_bus, NULL, "serio0");
548535
if (!d)

0 commit comments

Comments
 (0)