mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xi Pardee <xi.pardee@linux.intel.com>
To: angellindo@gmail.com,
	"Rajneesh Bhardwaj" <irenic.rajneesh@gmail.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] platform/x86/intel/pmc: Add Sunrise Point-H support
Date: Mon, 16 Nov 2026 14:11:48 -0800	[thread overview]
Message-ID: <90493af0-6008-4447-8338-d6eced29c25c@linux.intel.com> (raw)
In-Reply-To: <20261005-intel-pmc-spt-h-v1-1-78c98e4f4620@gmail.com>

Hi Angel,

Thanks for the patch, and for the detailed testing notes.
The change looks reasonable to me. Without it, SPT-H systems fall into 
the Cannon Point path, and the debugfs output (e.g. ltr_show) is wrong. 
Your comparison against direct PWRMBASE reads is helpful.

A few comments:
1. Fixes tag: This adds support for a new device ID rather than fixing a 
regression introduced by 661405bd817b, so I'd drop the Fixes tag. It 
would also pull the patch into stable backports.
2. PFEAR map: As you note, spt_pfear_map is the SPT-LP layout and SPT-H 
has two more PCIe controllers (SPD/SPE). I couldn't find public 
documentation for the PCH-H PFEAR bits either, so I'm fine leaving the 
map as is. Please state in the commit message that the map is reused 
from SPT-LP and that SPD/SPE are not covered, so 
pch_ip_power_gating_status is incomplete for those controllers. If you 
can, a cross-check of PFEAR against the root ports present on your 
system would be useful, but it isn't required. A follow-up fixing the 
map is welcome once the bits can be confirmed.

With the Fixes tag dropped and the commit message updated, please send a 
v2. I'm happy to give a Reviewed-by after that.
Thanks,
Xi

On 10/5/2026 1:00 PM, Angel Lindo via B4 Relay wrote:
> From: Angel Lindo <angellindo@gmail.com>
>
> spt_core_init() decides between the Sunrise Point and Cannon Point
> register maps by looking for the Sunrise Point PMC PCI device, but only
> the SPT-LP ID (0x9d21) is listed. On Skylake-H/Kaby Lake-H systems with
> a Sunrise Point-H PCH (PMC 8086:a121), pci_dev_present() fails and the
> driver takes the Coffee Lake path, using cnp_pmc_dev. That map does not
> describe this PCH, so the debugfs output is wrong.
>
> Seen on a MacBookPro14,3 (i7-7820HQ, PCH-H, PMC 8086:a121). With the
> stock driver, ltr_show lists Cannon Point IP names (SOUTHPORT_A, CNV,
> EVA, ...) and every entry reads RAW 0xffffffff. I was debugging why
> the package never goes deeper than PC3 on this machine, and without a
> working PMC map there is no way to see which PCH IP blocks it.
>
> Add the SPT-H PMC ID to spt_pmc_pci_id[] so these systems use the
> Sunrise Point map.
>
> Tested on MacBookPro14,3 (Apple firmware 529.140.2.0.0), kernel 7.2.5,
> with the module built with this ID:
> - ltr_show lists the Sunrise Point IP names, and the values match a
>    direct read of the PWRMBASE registers through /dev/mem bit for bit.
> - pch_ip_power_gating_status follows device state: LPSS reads On while
>    the Bluetooth UART (00:1e.0) is bound and turns Off once it is
>    unbound and the UART enters D3hot.
> - No warnings on load.
>
> Limitations:
> - spt_pfear_map is the SPT-LP layout and is reused as is. SPT-H has
>    two more PCIe controllers (SPD and SPE). Bits 13 and 21 are RSVD in
>    the SPT map but SPD/SPE in the Cannon Point map; I could not verify
>    this on PCH-H, so the map is left unchanged.
> - slp_s0_residency_usec reads 0 on this machine.
>
> Fixes: 661405bd817b ("platform/x86: intel_pmc_core: Special case for Coffeelake")
> Assisted-by: claude-opus-5-5
> Signed-off-by: Angel Lindo <angellindo@gmail.com>
> ---
> On the same machine and firmware, macOS reaches PC10 (~81%) at idle,
> while Linux never goes deeper than PC3. This patch only fixes the PMC
> detection so pch_ip_power_gating_status and ltr_show become usable for
> that investigation. With it, the PCH IPs report gating states consistent
> with device state (LPSS confirmed by toggling the Bluetooth UART); PC6
> and SLP_S0 residency are still 0.
> I plan to send a separate report on the PC3 limit to linux-pm.
> ---
>   drivers/platform/x86/intel/pmc/core.h | 1 +
>   drivers/platform/x86/intel/pmc/spt.c  | 1 +
>   2 files changed, 2 insertions(+)
>
> diff --git a/drivers/platform/x86/intel/pmc/core.h b/drivers/platform/x86/intel/pmc/core.h
> index b4c7399f8..5822dbbda 100644
> --- a/drivers/platform/x86/intel/pmc/core.h
> +++ b/drivers/platform/x86/intel/pmc/core.h
> @@ -36,6 +36,7 @@ DEFINE_FREE(pmc_acpi_free, void *, if (_T) ACPI_FREE(_T))
>   
>   /* Sunrise Point Power Management Controller PCI Device ID */
>   #define SPT_PMC_PCI_DEVICE_ID			0x9d21
> +#define SPT_H_PMC_PCI_DEVICE_ID			0xa121
>   #define SPT_PMC_BASE_ADDR_OFFSET		0x48
>   #define SPT_PMC_SLP_S0_RES_COUNTER_OFFSET	0x13c
>   #define SPT_PMC_PM_CFG_OFFSET			0x18
> diff --git a/drivers/platform/x86/intel/pmc/spt.c b/drivers/platform/x86/intel/pmc/spt.c
> index b50534aa2..5c4b8d536 100644
> --- a/drivers/platform/x86/intel/pmc/spt.c
> +++ b/drivers/platform/x86/intel/pmc/spt.c
> @@ -138,6 +138,7 @@ static const struct pmc_reg_map spt_reg_map = {
>   
>   static const struct pci_device_id spt_pmc_pci_id[] = {
>   	{ PCI_VDEVICE(INTEL, SPT_PMC_PCI_DEVICE_ID) },
> +	{ PCI_VDEVICE(INTEL, SPT_H_PMC_PCI_DEVICE_ID) },
>   	{ }
>   };
>   
>
> ---
> base-commit: cf963c9359dd6c5d0bc6af16df5cf1f691bba4f3
> change-id: 20261005-intel-pmc-spt-h-3ebe43d206fb
>
> Best regards,
> --
> Angel Lindo <angellindo@gmail.com>

      reply	other threads:[~2026-11-16 22:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-05 20:00 Angel Lindo via B4 Relay
2026-11-16 22:11 ` Xi Pardee [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=90493af0-6008-4447-8338-d6eced29c25c@linux.intel.com \
    --to=xi.pardee@linux.intel.com \
    --cc=angellindo@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=irenic.rajneesh@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®