From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Francois Dugast <francois.dugast@intel.com>
Cc: intel-xe@lists.freedesktop.org
Subject: Re: [Intel-xe] [PATCH] drm/xe/pm: Use PM functions only if CONFIG_PM_SLEEP is enabled
Date: Wed, 30 Aug 2023 17:14:22 -0400 [thread overview]
Message-ID: <ZO+xLmXJ4pyrm2Ky@intel.com> (raw)
In-Reply-To: <20230823091020.7-1-francois.dugast@intel.com>
On Wed, Aug 23, 2023 at 09:10:20AM +0000, Francois Dugast wrote:
> This fixes the build without CONFIG_PM_SLEEP such as for riscv.
>
> Signed-off-by: Francois Dugast <francois.dugast@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> drivers/gpu/drm/xe/xe_pci.c | 48 +++++++++++++++++++------------------
> 1 file changed, 25 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_pci.c b/drivers/gpu/drm/xe/xe_pci.c
> index f6bc6ae1c920..066bd12bf7b3 100644
> --- a/drivers/gpu/drm/xe/xe_pci.c
> +++ b/drivers/gpu/drm/xe/xe_pci.c
> @@ -31,28 +31,6 @@ enum toggle_d3cold {
> D3COLD_ENABLE,
> };
>
> -static void d3cold_toggle(struct pci_dev *pdev, enum toggle_d3cold toggle)
> -{
> - struct xe_device *xe = pdev_to_xe_device(pdev);
> - struct pci_dev *root_pdev;
> -
> - if (!xe->d3cold.capable)
> - return;
> -
> - root_pdev = pcie_find_root_port(pdev);
> - if (!root_pdev)
> - return;
> -
> - switch (toggle) {
> - case D3COLD_DISABLE:
> - pci_d3cold_disable(root_pdev);
> - break;
> - case D3COLD_ENABLE:
> - pci_d3cold_enable(root_pdev);
> - break;
> - }
> -}
> -
> struct xe_subplatform_desc {
> enum xe_subplatform subplatform;
> const char *name;
> @@ -730,6 +708,28 @@ static void xe_pci_shutdown(struct pci_dev *pdev)
> }
>
> #ifdef CONFIG_PM_SLEEP
> +static void d3cold_toggle(struct pci_dev *pdev, enum toggle_d3cold toggle)
> +{
> + struct xe_device *xe = pdev_to_xe_device(pdev);
> + struct pci_dev *root_pdev;
> +
> + if (!xe->d3cold.capable)
> + return;
> +
> + root_pdev = pcie_find_root_port(pdev);
> + if (!root_pdev)
> + return;
> +
> + switch (toggle) {
> + case D3COLD_DISABLE:
> + pci_d3cold_disable(root_pdev);
> + break;
> + case D3COLD_ENABLE:
> + pci_d3cold_enable(root_pdev);
> + break;
> + }
> +}
> +
> static int xe_pci_suspend(struct device *dev)
> {
> struct pci_dev *pdev = to_pci_dev(dev);
> @@ -834,12 +834,12 @@ static int xe_pci_runtime_idle(struct device *dev)
>
> return 0;
> }
> -#endif
>
> static const struct dev_pm_ops xe_pm_ops = {
> SET_SYSTEM_SLEEP_PM_OPS(xe_pci_suspend, xe_pci_resume)
> SET_RUNTIME_PM_OPS(xe_pci_runtime_suspend, xe_pci_runtime_resume, xe_pci_runtime_idle)
> };
> +#endif
>
> static struct pci_driver xe_pci_driver = {
> .name = DRIVER_NAME,
> @@ -847,7 +847,9 @@ static struct pci_driver xe_pci_driver = {
> .probe = xe_pci_probe,
> .remove = xe_pci_remove,
> .shutdown = xe_pci_shutdown,
> +#ifdef CONFIG_PM_SLEEP
> .driver.pm = &xe_pm_ops,
> +#endif
> };
>
> int xe_register_pci_driver(void)
> --
> 2.34.1
>
prev parent reply other threads:[~2023-08-30 21:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-23 9:10 [Intel-xe] [PATCH] drm/xe/pm: Use PM functions only if CONFIG_PM_SLEEP is enabled Francois Dugast
2023-08-23 9:33 ` [Intel-xe] ✓ CI.Patch_applied: success for " Patchwork
2023-08-23 9:33 ` [Intel-xe] ✗ CI.checkpatch: warning " Patchwork
2023-08-23 9:34 ` [Intel-xe] ✓ CI.KUnit: success " Patchwork
2023-08-23 9:38 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-08-23 9:38 ` [Intel-xe] ✓ CI.Hooks: " Patchwork
2023-08-23 9:39 ` [Intel-xe] ✗ CI.checksparse: warning " Patchwork
2023-08-23 10:05 ` [Intel-xe] ✓ CI.BAT: success " Patchwork
2023-08-30 21:14 ` Rodrigo Vivi [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=ZO+xLmXJ4pyrm2Ky@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=francois.dugast@intel.com \
--cc=intel-xe@lists.freedesktop.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