From nobody Tue Oct 7 16:35:40 2025 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 833C126A0C5; Tue, 8 Jul 2025 10:03:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751969041; cv=none; b=sbJ7IkmxCuj8otsuaNUXssHYZ2egQoP+j1hZN6UvuXfiCljjjSo/SX+qloZ6Y9cUbwjNu/avhUf1/Sn7lBmA09p6RIjXPYofjXIVPOn35ogKCxMoZD05BYet3Fqjx5D8aDh9gHOAFTyadlB6KsDcrVe1UoIL6vKNnGZE5MxkGFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751969041; c=relaxed/simple; bh=3W+tcsYe+u4UmKff6/HCw/VCwbZ23+GPdtoxUvPG1Dk=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=JYX+LLqg0jAuS3do3y8wFZMukNig0aDWCx76or0bZJJ0Kwev45BNYi8Un3Za8iqOJFZT7GPDDP564j+m0cfIobSsoO6B9O9Xci1qPRAcYgZNLykPN68fjTwgOL0rhr9BEZronMAjvcpPn9OF8H007bbIffrztBqReulTVCU/geg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=w0AIPUr5; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2CWS2wtg; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="w0AIPUr5"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2CWS2wtg" Date: Tue, 08 Jul 2025 10:03:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1751969037; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OoCLk/19QVezg+X3Gj0TR38KeLiGzCUxSg8R3adOaH8=; b=w0AIPUr50j+3OTOsL3eqsBKmLrXf80zV22PXZ0sJh+7gvb7APjtuV8+/dAQHcvxa7R3I5o 46/wcK4uQcaBgYAkUg75GGFXhqu8gKRk8IoWBK0+5+RwXdnEsunjqcbT3CC5rT21S8joNI lXL0GWfeAb2/OHqW5Bqa4Udc9tzornZ74a/Zd8j5OVyW56WFSTRyBot71BIeh2i2FjQTtt E7bdTVZ05G2wX5+gFoJDy+UaA17myeUIjzaI2Tw+5f9WcGNkd9n1+e+gDOMaQtDhYFrvo/ mR46WrZyGoFVXOFHZ1afPe5pToDA1Ijokmh0UtlKNTSQ40fXFCYq4/5BRM1RYA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1751969037; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OoCLk/19QVezg+X3Gj0TR38KeLiGzCUxSg8R3adOaH8=; b=2CWS2wtg2PD94M/qEYrUl3k/J/SNgEFYolQ0D3UXEmjkRrS/Y1/iMhiOTPikMIz+HoSYNk puUPW3Lac+++8TBA== From: "tip-bot2 for Perry Yuan" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/platform] platform/x86: hfi: Add power management callback Cc: Perry Yuan , Mario Limonciello , "Borislav Petkov (AMD)" , "Gautham R. Shenoy" , ilpo.jarvinen@linux.intel.com, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20250609200518.3616080-9-superm1@kernel.org> References: <20250609200518.3616080-9-superm1@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <175196903664.406.14079997026829440530.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the x86/platform branch of tip: Commit-ID: 263e66f9c35922d0cfd961df6d7a492820143792 Gitweb: https://git.kernel.org/tip/263e66f9c35922d0cfd961df6d7a49282= 0143792 Author: Perry Yuan AuthorDate: Mon, 09 Jun 2025 15:05:13 -05:00 Committer: Borislav Petkov (AMD) CommitterDate: Mon, 07 Jul 2025 22:26:37 +02:00 platform/x86: hfi: Add power management callback Introduce power management callbacks for the `amd_hfi` driver. Specificall= y, add the `suspend` and `resume` callbacks to handle the necessary operations during system low power states and wake-up. Signed-off-by: Perry Yuan Co-developed-by: Mario Limonciello Signed-off-by: Mario Limonciello Signed-off-by: Borislav Petkov (AMD) Reviewed-by: Gautham R. Shenoy Acked-by: Ilpo J=C3=A4rvinen Link: https://lore.kernel.org/20250609200518.3616080-9-superm1@kernel.org --- drivers/platform/x86/amd/hfi/hfi.c | 33 +++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+) diff --git a/drivers/platform/x86/amd/hfi/hfi.c b/drivers/platform/x86/amd/= hfi/hfi.c index 28ef721..b0a5840 100644 --- a/drivers/platform/x86/amd/hfi/hfi.c +++ b/drivers/platform/x86/amd/hfi/hfi.c @@ -385,6 +385,38 @@ static int amd_hfi_metadata_parser(struct platform_dev= ice *pdev, return ret; } =20 +static int amd_hfi_pm_resume(struct device *dev) +{ + int ret, cpu; + + for_each_online_cpu(cpu) { + ret =3D amd_hfi_set_state(cpu, true); + if (ret < 0) { + dev_err(dev, "failed to enable workload class config: %d\n", ret); + return ret; + } + } + + return 0; +} + +static int amd_hfi_pm_suspend(struct device *dev) +{ + int ret, cpu; + + for_each_online_cpu(cpu) { + ret =3D amd_hfi_set_state(cpu, false); + if (ret < 0) { + dev_err(dev, "failed to disable workload class config: %d\n", ret); + return ret; + } + } + + return 0; +} + +static DEFINE_SIMPLE_DEV_PM_OPS(amd_hfi_pm_ops, amd_hfi_pm_suspend, amd_hf= i_pm_resume); + static const struct acpi_device_id amd_hfi_platform_match[] =3D { {"AMDI0104", 0}, { } @@ -434,6 +466,7 @@ static struct platform_driver amd_hfi_driver =3D { .driver =3D { .name =3D AMD_HFI_DRIVER, .owner =3D THIS_MODULE, + .pm =3D &amd_hfi_pm_ops, .acpi_match_table =3D ACPI_PTR(amd_hfi_platform_match), }, .probe =3D amd_hfi_probe,