[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aF6SaLLw7HlSxagh@black.fi.intel.com>
Date: Fri, 27 Jun 2025 15:45:28 +0300
From: Raag Jadav <raag.jadav@...el.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: Lucas De Marchi <lucas.demarchi@...el.com>,
Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
Rodrigo Vivi <rodrigo.vivi@...el.com>,
Jarkko Nikula <jarkko.nikula@...ux.intel.com>,
David Airlie <airlied@...il.com>, Simona Vetter <simona@...ll.ch>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Jan Dabros <jsd@...ihalf.com>, Andi Shyti <andi.shyti@...nel.org>,
"Tauro, Riana" <riana.tauro@...el.com>,
"Adatrao, Srinivasa" <srinivasa.adatrao@...el.com>,
"Michael J. Ruhl" <michael.j.ruhl@...el.com>,
intel-xe@...ts.freedesktop.org, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org,
Karthik Poosa <karthik.poosa@...el.com>
Subject: Re: [PATCH v4 3/4] drm/xe/pm: Wire up suspend/resume for I2C
controller
Hi Heikki,
Thanks for picking this up.
On Thu, Jun 26, 2025 at 04:56:08PM +0300, Heikki Krogerus wrote:
> From: Raag Jadav <raag.jadav@...el.com>
>
> Wire up suspend/resume handles for I2C controller to match its power
> state with SGUnit.
...
> diff --git a/drivers/gpu/drm/xe/xe_i2c.c b/drivers/gpu/drm/xe/xe_i2c.c
> index bfbfe1de7f77..0227fcba2168 100644
> --- a/drivers/gpu/drm/xe/xe_i2c.c
> +++ b/drivers/gpu/drm/xe/xe_i2c.c
> @@ -227,6 +227,31 @@ static const struct regmap_config i2c_regmap_config = {
> .fast_io = true,
> };
>
> +void xe_i2c_pm_suspend(struct xe_device *xe)
> +{
> + struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +
> + if (!xe->i2c || xe->i2c->ep.cookie != XE_I2C_EP_COOKIE_DEVICE)
> + return;
> +
> + xe_mmio_rmw32(mmio, I2C_CONFIG_PMCSR, PCI_PM_CTRL_STATE_MASK, PCI_D3hot);
I just realized the power modes will need (__force u32) casting to make
sparse happy. If you're planning another version, can you please include
it? If not, we can have a quick fix later on.
> + drm_dbg(&xe->drm, "pmcsr: 0x%08x\n", xe_mmio_read32(mmio, I2C_CONFIG_PMCSR));
> +}
> +
> +void xe_i2c_pm_resume(struct xe_device *xe, bool d3cold)
> +{
> + struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> +
> + if (!xe->i2c || xe->i2c->ep.cookie != XE_I2C_EP_COOKIE_DEVICE)
> + return;
> +
> + if (d3cold)
> + xe_mmio_rmw32(mmio, I2C_CONFIG_CMD, 0, PCI_COMMAND_MEMORY);
> +
> + xe_mmio_rmw32(mmio, I2C_CONFIG_PMCSR, PCI_PM_CTRL_STATE_MASK, PCI_D0);
Ditto.
> + drm_dbg(&xe->drm, "pmcsr: 0x%08x\n", xe_mmio_read32(mmio, I2C_CONFIG_PMCSR));
> +}
Raag
Powered by blists - more mailing lists