platform/x86/amd/pmf: Add debugging message for missing policy data
authorMario Limonciello <mario.limonciello@amd.com>
Sat, 17 Feb 2024 01:41:06 +0000 (19:41 -0600)
committerHans de Goede <hdegoede@redhat.com>
Mon, 19 Feb 2024 12:39:40 +0000 (13:39 +0100)
If a machine advertises Smart PC support but is missing policy data
show a debugging message to help clarify why Smart PC wasn't enabled.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20240217014107.113749-2-mario.limonciello@amd.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/amd/pmf/tee-if.c

index 8b7e3f87702e1df40b3f5bf486e6bd647c918537..1359ab340f7cb0099751904ace190099b8dcc209 100644 (file)
@@ -252,8 +252,10 @@ static int amd_pmf_start_policy_engine(struct amd_pmf_dev *dev)
        cookie = readl(dev->policy_buf + POLICY_COOKIE_OFFSET);
        length = readl(dev->policy_buf + POLICY_COOKIE_LEN);
 
-       if (cookie != POLICY_SIGN_COOKIE || !length)
+       if (cookie != POLICY_SIGN_COOKIE || !length) {
+               dev_dbg(dev->dev, "cookie doesn't match\n");
                return -EINVAL;
+       }
 
        /* Update the actual length */
        dev->policy_sz = length + 512;