All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tzung-Bi Shih <tzungbi@kernel.org>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Rajneesh Bhardwaj <irenic.rajneesh@gmail.com>,
	Xi Pardee <xi.pardee@linux.intel.com>,
	Hans de Goede <hansg@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	tfiga@chromium.org
Subject: Re: [PATCH] platform/x86/intel/pmc: Disable ACPI PM timer during suspend on Panther Lake
Date: Fri, 16 Oct 2026 07:56:18 +0000	[thread overview]
Message-ID: <atHYognzBSwCrF1f@google.com> (raw)
In-Reply-To: <6075cb9a-b739-644a-2dac-998e7893ec31@linux.intel.com>

On Thu, Oct 15, 2026 at 11:52:05AM +0300, Ilpo Järvinen wrote:
> > diff --git a/drivers/platform/x86/intel/pmc/ptl.c b/drivers/platform/x86/intel/pmc/ptl.c
> > index a7d5d4f77934..8c32f9be9302 100644
> > --- a/drivers/platform/x86/intel/pmc/ptl.c
> > +++ b/drivers/platform/x86/intel/pmc/ptl.c
> > @@ -6,6 +6,7 @@
> >   * Copyright (c) 2025, Intel Corporation.
> >   */
> >  
> > +#include <linux/io.h>
> >  #include <linux/pci.h>
> >  
> >  #include "core.h"
> > @@ -548,6 +549,9 @@ static const u8 ptl_pmc_list[] = {PMC_IDX_MAIN};
> >  #define PTL_NPU_PCI_DEV                0xb03e
> >  #define PTL_IPU_PCI_DEV                0xb05d
> >  
> > +#define ACPI_TMR_CTL_OFFSET            0x18fc
> > +#define ACPI_TIM_DIS                   BIT(1)
> 
> Please add include for this as well.

Ack, fixed in v2.

> > +static void ptl_set_acpi_pm_timer_on_suspend(struct pmc_dev *pmcdev, bool suspend)
> > +{
> > +	struct pmc *pmc = pmcdev->pmcs[PMC_IDX_MAIN];
> > +	bool enabled;
> > +	u8 val;
> > +
> > +	if (!pmc || !pmc->regbase)
> > +		return;
> > +
> > +	if (!suspend && !pmcdev->pm_timer_enabled)
> > +		return;
> > +
> > +	val = readb(pmc->regbase + ACPI_TMR_CTL_OFFSET);
> > +	enabled = !(val & ACPI_TIM_DIS);
> > +	if (suspend && enabled)
> > +		writeb(val | ACPI_TIM_DIS, pmc->regbase + ACPI_TMR_CTL_OFFSET);
> > +	else if (!suspend)
> > +		writeb(val & ~ACPI_TIM_DIS, pmc->regbase + ACPI_TMR_CTL_OFFSET);
> 
> Change val on a separate line for clarity.
> 
> How about using this alternative:
> 
> 	old_val = val;
> 	if (...)
> 		val |= ACPI_TIM_DIS;
> 	else if (...)
> 		val &= ~ACPI_TIM_DIS;
> 	if (val != old_val)
> 		writeb(...);

Ack, tried something similar in v2.

      reply	other threads:[~2026-10-16  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  3:57 [PATCH] platform/x86/intel/pmc: Disable ACPI PM timer during suspend on Panther Lake Tzung-Bi Shih
2026-10-15  8:52 ` Ilpo Järvinen
2026-10-16  7:56   ` Tzung-Bi Shih [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=atHYognzBSwCrF1f@google.com \
    --to=tzungbi@kernel.org \
    --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 \
    --cc=tfiga@chromium.org \
    --cc=xi.pardee@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.