All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Imre Deak <imre.deak@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Andrzej Hajda <andrzej.hajda@intel.com>
Subject: Re: [Intel-gfx] [PATCH v2 1/4] drm/i915: Fix system suspend without fbdev being initialized
Date: Tue, 14 Feb 2023 11:17:00 +0200	[thread overview]
Message-ID: <87r0ustxmb.fsf@intel.com> (raw)
In-Reply-To: <20230208114300.3123934-2-imre.deak@intel.com>

On Wed, 08 Feb 2023, Imre Deak <imre.deak@intel.com> wrote:
> If fbdev is not initialized for some reason - in practice on platforms
> without display - suspending fbdev should be skipped during system
> suspend, fix this up. While at it add an assert that suspending fbdev
> only happens with the display present.
>
> This fixes the following:
>
> [   91.227923] PM: suspend entry (s2idle)
> [   91.254598] Filesystems sync: 0.025 seconds
> [   91.270518] Freezing user space processes
> [   91.272266] Freezing user space processes completed (elapsed 0.001 seconds)
> [   91.272686] OOM killer disabled.
> [   91.272872] Freezing remaining freezable tasks
> [   91.274295] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
> [   91.659622] BUG: kernel NULL pointer dereference, address: 00000000000001c8
> [   91.659981] #PF: supervisor write access in kernel mode
> [   91.660252] #PF: error_code(0x0002) - not-present page
> [   91.660511] PGD 0 P4D 0
> [   91.660647] Oops: 0002 [#1] PREEMPT SMP NOPTI
> [   91.660875] CPU: 4 PID: 917 Comm: bash Not tainted 6.2.0-rc7+ #54
> [   91.661185] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS edk2-20221117gitfff6d81270b5-9.fc37 unknown
> [   91.661680] RIP: 0010:mutex_lock+0x19/0x30
> [   91.661914] Code: 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 53 48 89 fb e8 62 d3 ff ff 31 c0 65 48 8b 14 25 00 15 03 00 <f0> 48 0f b1 13 75 06 5b c3 cc cc cc cc 48 89 df 5b eb b4 0f 1f 40
> [   91.662840] RSP: 0018:ffffa1e8011ffc08 EFLAGS: 00010246
> [   91.663087] RAX: 0000000000000000 RBX: 00000000000001c8 RCX: 0000000000000000
> [   91.663440] RDX: ffff8be455eb0000 RSI: 0000000000000001 RDI: 00000000000001c8
> [   91.663802] RBP: ffff8be459440000 R08: ffff8be459441f08 R09: ffffffff8e1432c0
> [   91.664167] R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000001
> [   91.664532] R13: 00000000000001c8 R14: 0000000000000000 R15: ffff8be442f4fb20
> [   91.664905] FS:  00007f28ffc16740(0000) GS:ffff8be4bb900000(0000) knlGS:0000000000000000
> [   91.665334] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [   91.665626] CR2: 00000000000001c8 CR3: 0000000114926006 CR4: 0000000000770ee0
> [   91.665988] PKRU: 55555554
> [   91.666131] Call Trace:
> [   91.666265]  <TASK>
> [   91.666381]  intel_fbdev_set_suspend+0x97/0x1b0 [i915]
> [   91.666738]  i915_drm_suspend+0xb9/0x100 [i915]
> [   91.667029]  pci_pm_suspend+0x78/0x170
> [   91.667234]  ? __pfx_pci_pm_suspend+0x10/0x10
> [   91.667461]  dpm_run_callback+0x47/0x150
> [   91.667673]  __device_suspend+0x10a/0x4e0
> [   91.667880]  dpm_suspend+0x134/0x270
> [   91.668069]  dpm_suspend_start+0x79/0x80
> [   91.668272]  suspend_devices_and_enter+0x11b/0x890
> [   91.668526]  pm_suspend.cold+0x270/0x2fc
> [   91.668737]  state_store+0x46/0x90
> [   91.668916]  kernfs_fop_write_iter+0x11b/0x200
> [   91.669153]  vfs_write+0x1e1/0x3a0
> [   91.669336]  ksys_write+0x53/0xd0
> [   91.669510]  do_syscall_64+0x58/0xc0
> [   91.669699]  ? syscall_exit_to_user_mode_prepare+0x18e/0x1c0
> [   91.669980]  ? syscall_exit_to_user_mode_prepare+0x18e/0x1c0
> [   91.670278]  ? syscall_exit_to_user_mode+0x17/0x40
> [   91.670524]  ? do_syscall_64+0x67/0xc0
> [   91.670717]  ? __irq_exit_rcu+0x3d/0x140
> [   91.670931]  entry_SYSCALL_64_after_hwframe+0x72/0xdc
> [   91.671202] RIP: 0033:0x7f28ffd14284
>
> Fixes: f8cc091e0530 ("drm/i915/fbdev: suspend HPD before fbdev unregistration")
> References: https://gitlab.freedesktop.org/drm/intel/-/issues/8015
> Tested-by: iczero <iczero@hellomouse.net>
> Cc: Andrzej Hajda <andrzej.hajda@intel.com>
> Cc: iczero <iczero@hellomouse.net>
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Cc: <stable@vger.kernel.org> # v6.1+
Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_fbdev.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_fbdev.c b/drivers/gpu/drm/i915/display/intel_fbdev.c
> index 81b41148e592b..e719202d831f0 100644
> --- a/drivers/gpu/drm/i915/display/intel_fbdev.c
> +++ b/drivers/gpu/drm/i915/display/intel_fbdev.c
> @@ -632,7 +632,13 @@ void intel_fbdev_set_suspend(struct drm_device *dev, int state, bool synchronous
>  	struct intel_fbdev *ifbdev = dev_priv->display.fbdev.fbdev;
>  	struct fb_info *info;
>  
> -	if (!ifbdev || !ifbdev->vma)
> +	if (!ifbdev)
> +		return;
> +
> +	if (drm_WARN_ON(&dev_priv->drm, !HAS_DISPLAY(dev_priv)))
> +		return;
> +
> +	if (!ifbdev->vma)
>  		goto set_suspend;
>  
>  	info = ifbdev->helper.info;

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2023-02-14  9:17 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-08 11:42 [Intel-gfx] [PATCH v2 0/4] drm/i915/dg2: Fix platforms without display Imre Deak
2023-02-08 11:42 ` [Intel-gfx] [PATCH v2 1/4] drm/i915: Fix system suspend without fbdev being initialized Imre Deak
2023-02-14  9:17   ` Jani Nikula [this message]
2023-02-22  7:58   ` Andrzej Hajda
2023-02-08 11:42 ` [Intel-gfx] [PATCH v2 2/4] drm/i915: Move display power initialization during driver probing later Imre Deak
2023-02-14  9:25   ` Jani Nikula
2023-02-14 14:04     ` Imre Deak
2023-02-14 14:17       ` Jani Nikula
2023-02-15  9:59         ` Imre Deak
2023-02-08 11:42 ` [Intel-gfx] [PATCH v2 3/4] drm/i915/dgfx, mtl+: Disable display functionality if the display is not present Imre Deak
2023-02-14  9:18   ` Jani Nikula
2023-02-08 11:43 ` [Intel-gfx] [PATCH v2 4/4] drm/i915: Sanitize the display fused-off check on GEN7/8 Imre Deak
2023-02-14  9:18   ` Jani Nikula
2023-02-08 14:30 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for drm/i915/dg2: Fix platforms without display Patchwork
2023-02-08 18:58 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-09  7:26 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2023-02-14 16:32 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dg2: Fix platforms without display (rev2) Patchwork
2023-02-14 16:49 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2023-02-15  3:40 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=87r0ustxmb.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=andrzej.hajda@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@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 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.