* [PATCH] drm/modes: Prevent division by zero htotal
@ 2019-01-23 7:28 Tina Zhang
2019-01-23 8:04 ` ✓ Fi.CI.BAT: success for " Patchwork
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Tina Zhang @ 2019-01-23 7:28 UTC (permalink / raw)
Cc: intel-gfx, dri-devel, Adam Jackson, Dave Airlie
This patch prevents division by zero htotal.
Signed-off-by: Tina Zhang <tina.zhang@intel.com>
Cc: Adam Jackson <ajax@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
drivers/gpu/drm/drm_modes.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
index adce9a2..59b92b1 100644
--- a/drivers/gpu/drm/drm_modes.c
+++ b/drivers/gpu/drm/drm_modes.c
@@ -751,7 +751,7 @@ int drm_mode_hsync(const struct drm_display_mode *mode)
if (mode->hsync)
return mode->hsync;
- if (mode->htotal < 0)
+ if (mode->htotal <= 0)
return 0;
calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* ✓ Fi.CI.BAT: success for drm/modes: Prevent division by zero htotal
2019-01-23 7:28 [PATCH] drm/modes: Prevent division by zero htotal Tina Zhang
@ 2019-01-23 8:04 ` Patchwork
2019-01-23 10:33 ` ✓ Fi.CI.IGT: " Patchwork
2019-01-23 10:56 ` [PATCH] " Daniel Vetter
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2019-01-23 8:04 UTC (permalink / raw)
To: Tina Zhang; +Cc: intel-gfx
== Series Details ==
Series: drm/modes: Prevent division by zero htotal
URL : https://patchwork.freedesktop.org/series/55610/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5468 -> Patchwork_12012
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/55610/revisions/1/mbox/
Known issues
------------
Here are the changes found in Patchwork_12012 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_selftest@live_hangcheck:
- fi-skl-iommu: PASS -> INCOMPLETE [fdo#108602] / [fdo#108744]
#### Possible fixes ####
* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: FAIL [fdo#108767] -> PASS
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
- fi-byt-clapper: FAIL [fdo#103191] / [fdo#107362] -> PASS +1
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#107362]: https://bugs.freedesktop.org/show_bug.cgi?id=107362
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
[fdo#108744]: https://bugs.freedesktop.org/show_bug.cgi?id=108744
[fdo#108767]: https://bugs.freedesktop.org/show_bug.cgi?id=108767
Participating hosts (46 -> 40)
------------------------------
Missing (6): fi-kbl-soraka fi-ilk-m540 fi-byt-squawks fi-bsw-cyan fi-ivb-3770 fi-snb-2600
Build changes
-------------
* Linux: CI_DRM_5468 -> Patchwork_12012
CI_DRM_5468: fc4e30d30d90ed5d5bd467de0439e9522d34cdf0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4784: 1c5a4432293369f85859c748c08155e79d92c4ce @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12012: daea462cce0cd3d56ab143701960bf39acef551c @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
daea462cce0c drm/modes: Prevent division by zero htotal
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12012/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.IGT: success for drm/modes: Prevent division by zero htotal
2019-01-23 7:28 [PATCH] drm/modes: Prevent division by zero htotal Tina Zhang
2019-01-23 8:04 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2019-01-23 10:33 ` Patchwork
2019-01-23 10:56 ` [PATCH] " Daniel Vetter
2 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2019-01-23 10:33 UTC (permalink / raw)
To: Tina Zhang; +Cc: intel-gfx
== Series Details ==
Series: drm/modes: Prevent division by zero htotal
URL : https://patchwork.freedesktop.org/series/55610/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5468_full -> Patchwork_12012_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_12012_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_wait@write-busy-bsd:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]
* igt@kms_cursor_crc@cursor-256x85-onscreen:
- shard-glk: PASS -> FAIL [fdo#103232] +1
* igt@kms_flip@2x-modeset-vs-vblank-race:
- shard-hsw: PASS -> DMESG-WARN [fdo#102614]
* igt@kms_plane@pixel-format-pipe-c-planes-source-clamping:
- shard-glk: PASS -> FAIL [fdo#108948]
- shard-apl: PASS -> FAIL [fdo#108948]
* igt@kms_plane_multiple@atomic-pipe-a-tiling-y:
- shard-glk: PASS -> FAIL [fdo#103166]
#### Possible fixes ####
* igt@i915_suspend@forcewake:
- shard-kbl: INCOMPLETE [fdo#103665] -> PASS
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-c:
- shard-hsw: DMESG-WARN [fdo#107956] -> PASS
* igt@kms_cursor_crc@cursor-128x128-random:
- shard-glk: FAIL [fdo#103232] -> PASS
* igt@kms_flip@2x-flip-vs-expired-vblank:
- shard-glk: FAIL [fdo#105363] -> PASS +1
* igt@kms_flip@dpms-vs-vblank-race:
- shard-kbl: FAIL [fdo#103060] -> PASS
- shard-glk: FAIL [fdo#103060] -> PASS
* igt@kms_plane@plane-position-covered-pipe-c-planes:
- shard-apl: FAIL [fdo#103166] -> PASS +2
* igt@kms_plane_multiple@atomic-pipe-c-tiling-none:
- shard-glk: FAIL [fdo#103166] -> PASS
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-apl: DMESG-FAIL [fdo#108950] -> PASS
#### Warnings ####
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-glk: DMESG-FAIL [fdo#105763] / [fdo#106538] -> FAIL [fdo#109381]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102614]: https://bugs.freedesktop.org/show_bug.cgi?id=102614
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538
[fdo#107956]: https://bugs.freedesktop.org/show_bug.cgi?id=107956
[fdo#108948]: https://bugs.freedesktop.org/show_bug.cgi?id=108948
[fdo#108950]: https://bugs.freedesktop.org/show_bug.cgi?id=108950
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109381]: https://bugs.freedesktop.org/show_bug.cgi?id=109381
Participating hosts (7 -> 4)
------------------------------
Missing (3): shard-snb shard-skl shard-iclb
Build changes
-------------
* Linux: CI_DRM_5468 -> Patchwork_12012
CI_DRM_5468: fc4e30d30d90ed5d5bd467de0439e9522d34cdf0 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4784: 1c5a4432293369f85859c748c08155e79d92c4ce @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12012: daea462cce0cd3d56ab143701960bf39acef551c @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12012/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/modes: Prevent division by zero htotal
2019-01-23 7:28 [PATCH] drm/modes: Prevent division by zero htotal Tina Zhang
2019-01-23 8:04 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-01-23 10:33 ` ✓ Fi.CI.IGT: " Patchwork
@ 2019-01-23 10:56 ` Daniel Vetter
2019-01-24 7:11 ` Zhang, Tina
2 siblings, 1 reply; 6+ messages in thread
From: Daniel Vetter @ 2019-01-23 10:56 UTC (permalink / raw)
To: Tina Zhang; +Cc: Dave Airlie, intel-gfx, Adam Jackson, dri-devel
On Wed, Jan 23, 2019 at 03:28:59PM +0800, Tina Zhang wrote:
> This patch prevents division by zero htotal.
How did you manage to get here with htotal == 0? This needs backtraces
(or if this is just about static checkers, a mention of that).
-Daniel
>
> Signed-off-by: Tina Zhang <tina.zhang@intel.com>
> Cc: Adam Jackson <ajax@redhat.com>
> Cc: Dave Airlie <airlied@redhat.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
> drivers/gpu/drm/drm_modes.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> index adce9a2..59b92b1 100644
> --- a/drivers/gpu/drm/drm_modes.c
> +++ b/drivers/gpu/drm/drm_modes.c
> @@ -751,7 +751,7 @@ int drm_mode_hsync(const struct drm_display_mode *mode)
> if (mode->hsync)
> return mode->hsync;
>
> - if (mode->htotal < 0)
> + if (mode->htotal <= 0)
> return 0;
>
> calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */
> --
> 2.7.4
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH] drm/modes: Prevent division by zero htotal
2019-01-23 10:56 ` [PATCH] " Daniel Vetter
@ 2019-01-24 7:11 ` Zhang, Tina
2019-01-24 9:59 ` Daniel Vetter
0 siblings, 1 reply; 6+ messages in thread
From: Zhang, Tina @ 2019-01-24 7:11 UTC (permalink / raw)
To: Daniel Vetter
Cc: Dave Airlie, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
> -----Original Message-----
> From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel Vetter
> Sent: Wednesday, January 23, 2019 6:56 PM
> To: Zhang, Tina <tina.zhang@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; Adam
> Jackson <ajax@redhat.com>; Dave Airlie <airlied@redhat.com>; Daniel Vetter
> <daniel@ffwll.ch>
> Subject: Re: [PATCH] drm/modes: Prevent division by zero htotal
>
> On Wed, Jan 23, 2019 at 03:28:59PM +0800, Tina Zhang wrote:
> > This patch prevents division by zero htotal.
>
> How did you manage to get here with htotal == 0? This needs backtraces (or if
> this is just about static checkers, a mention of that).
> -Daniel
In GVT-g, we are trying to enable a virtual display w/o setting timings for a pipe
(a.k.a htotal=0), then we met the following kernel panic:
[ 32.832048] divide error: 0000 [#1] SMP PTI
[ 32.833614] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc4-sriov+ #33
[ 32.834438] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.10.1-0-g8891697-dirty-20180511_165818-tinazhang-linux-1 04/01/2014
[ 32.835901] RIP: 0010:drm_mode_hsync+0x1e/0x40
[ 32.836004] Code: 31 c0 c3 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 8b 87 d8 00 00 00 85 c0 75 22 8b 4f 68 85 c9 78 1b 69 47 58 e8 03 00 00 99 <f7> f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
[ 32.836004] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
[ 32.836004] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
[ 32.836004] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
[ 32.836004] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
[ 32.836004] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
[ 32.836004] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
[ 32.836004] FS: 0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
[ 32.836004] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 32.836004] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
[ 32.836004] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 32.836004] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 32.836004] Call Trace:
[ 32.836004] intel_mode_from_pipe_config+0x72/0x90
[ 32.836004] intel_modeset_setup_hw_state+0x569/0xf90
[ 32.836004] intel_modeset_init+0x905/0x1db0
[ 32.836004] i915_driver_load+0xb8c/0x1120
[ 32.836004] i915_pci_probe+0x4d/0xb0
[ 32.836004] local_pci_probe+0x44/0xa0
[ 32.836004] ? pci_assign_irq+0x27/0x130
[ 32.836004] pci_device_probe+0x102/0x1c0
[ 32.836004] driver_probe_device+0x2b8/0x480
[ 32.836004] __driver_attach+0x109/0x110
[ 32.836004] ? driver_probe_device+0x480/0x480
[ 32.836004] bus_for_each_dev+0x67/0xc0
[ 32.836004] ? klist_add_tail+0x3b/0x70
[ 32.836004] bus_add_driver+0x1e8/0x260
[ 32.836004] driver_register+0x5b/0xe0
[ 32.836004] ? mipi_dsi_bus_init+0x11/0x11
[ 32.836004] do_one_initcall+0x4d/0x1eb
[ 32.836004] kernel_init_freeable+0x197/0x237
[ 32.836004] ? rest_init+0xd0/0xd0
[ 32.836004] kernel_init+0xa/0x110
[ 32.836004] ret_from_fork+0x35/0x40
[ 32.836004] Modules linked in:
[ 32.859183] ---[ end trace 525608b0ed0e8665 ]---
[ 32.859722] RIP: 0010:drm_mode_hsync+0x1e/0x40
[ 32.860287] Code: 31 c0 c3 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 8b 87 d8 00 00 00 85 c0 75 22 8b 4f 68 85 c9 78 1b 69 47 58 e8 03 00 00 99 <f7> f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
[ 32.862680] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
[ 32.863309] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
[ 32.864182] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
[ 32.865206] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
[ 32.866359] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
[ 32.867213] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
[ 32.868075] FS: 0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
[ 32.868983] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 32.869659] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
[ 32.870599] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 32.871598] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
[ 32.872549] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
Since drm_mode_hsync() has the logic to check mode->htotal, I just extend it to cover the case htotal==0.
Thanks.
BR,
Tina
>
> >
> > Signed-off-by: Tina Zhang <tina.zhang@intel.com>
> > Cc: Adam Jackson <ajax@redhat.com>
> > Cc: Dave Airlie <airlied@redhat.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > ---
> > drivers/gpu/drm/drm_modes.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > index adce9a2..59b92b1 100644
> > --- a/drivers/gpu/drm/drm_modes.c
> > +++ b/drivers/gpu/drm/drm_modes.c
> > @@ -751,7 +751,7 @@ int drm_mode_hsync(const struct
> drm_display_mode *mode)
> > if (mode->hsync)
> > return mode->hsync;
> >
> > - if (mode->htotal < 0)
> > + if (mode->htotal <= 0)
> > return 0;
> >
> > calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */
> > --
> > 2.7.4
> >
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/modes: Prevent division by zero htotal
2019-01-24 7:11 ` Zhang, Tina
@ 2019-01-24 9:59 ` Daniel Vetter
0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2019-01-24 9:59 UTC (permalink / raw)
To: Zhang, Tina
Cc: Dave Airlie, intel-gfx@lists.freedesktop.org, Adam Jackson,
dri-devel@lists.freedesktop.org
On Thu, Jan 24, 2019 at 07:11:53AM +0000, Zhang, Tina wrote:
>
>
> > -----Original Message-----
> > From: Daniel Vetter [mailto:daniel.vetter@ffwll.ch] On Behalf Of Daniel Vetter
> > Sent: Wednesday, January 23, 2019 6:56 PM
> > To: Zhang, Tina <tina.zhang@intel.com>
> > Cc: intel-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org; Adam
> > Jackson <ajax@redhat.com>; Dave Airlie <airlied@redhat.com>; Daniel Vetter
> > <daniel@ffwll.ch>
> > Subject: Re: [PATCH] drm/modes: Prevent division by zero htotal
> >
> > On Wed, Jan 23, 2019 at 03:28:59PM +0800, Tina Zhang wrote:
> > > This patch prevents division by zero htotal.
> >
> > How did you manage to get here with htotal == 0? This needs backtraces (or if
> > this is just about static checkers, a mention of that).
> > -Daniel
>
> In GVT-g, we are trying to enable a virtual display w/o setting timings for a pipe
> (a.k.a htotal=0), then we met the following kernel panic:
>
> [ 32.832048] divide error: 0000 [#1] SMP PTI
> [ 32.833614] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc4-sriov+ #33
> [ 32.834438] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.10.1-0-g8891697-dirty-20180511_165818-tinazhang-linux-1 04/01/2014
> [ 32.835901] RIP: 0010:drm_mode_hsync+0x1e/0x40
> [ 32.836004] Code: 31 c0 c3 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 8b 87 d8 00 00 00 85 c0 75 22 8b 4f 68 85 c9 78 1b 69 47 58 e8 03 00 00 99 <f7> f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
> [ 32.836004] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
> [ 32.836004] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
> [ 32.836004] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
> [ 32.836004] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
> [ 32.836004] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
> [ 32.836004] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
> [ 32.836004] FS: 0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
> [ 32.836004] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 32.836004] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
> [ 32.836004] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 32.836004] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [ 32.836004] Call Trace:
> [ 32.836004] intel_mode_from_pipe_config+0x72/0x90
> [ 32.836004] intel_modeset_setup_hw_state+0x569/0xf90
> [ 32.836004] intel_modeset_init+0x905/0x1db0
> [ 32.836004] i915_driver_load+0xb8c/0x1120
> [ 32.836004] i915_pci_probe+0x4d/0xb0
> [ 32.836004] local_pci_probe+0x44/0xa0
> [ 32.836004] ? pci_assign_irq+0x27/0x130
> [ 32.836004] pci_device_probe+0x102/0x1c0
> [ 32.836004] driver_probe_device+0x2b8/0x480
> [ 32.836004] __driver_attach+0x109/0x110
> [ 32.836004] ? driver_probe_device+0x480/0x480
> [ 32.836004] bus_for_each_dev+0x67/0xc0
> [ 32.836004] ? klist_add_tail+0x3b/0x70
> [ 32.836004] bus_add_driver+0x1e8/0x260
> [ 32.836004] driver_register+0x5b/0xe0
> [ 32.836004] ? mipi_dsi_bus_init+0x11/0x11
> [ 32.836004] do_one_initcall+0x4d/0x1eb
> [ 32.836004] kernel_init_freeable+0x197/0x237
> [ 32.836004] ? rest_init+0xd0/0xd0
> [ 32.836004] kernel_init+0xa/0x110
> [ 32.836004] ret_from_fork+0x35/0x40
> [ 32.836004] Modules linked in:
> [ 32.859183] ---[ end trace 525608b0ed0e8665 ]---
> [ 32.859722] RIP: 0010:drm_mode_hsync+0x1e/0x40
> [ 32.860287] Code: 31 c0 c3 90 90 90 90 90 90 90 90 90 0f 1f 44 00 00 8b 87 d8 00 00 00 85 c0 75 22 8b 4f 68 85 c9 78 1b 69 47 58 e8 03 00 00 99 <f7> f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
> [ 32.862680] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
> [ 32.863309] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
> [ 32.864182] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
> [ 32.865206] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
> [ 32.866359] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
> [ 32.867213] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
> [ 32.868075] FS: 0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
> [ 32.868983] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 32.869659] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
> [ 32.870599] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
> [ 32.871598] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
> [ 32.872549] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
>
> Since drm_mode_hsync() has the logic to check mode->htotal, I just extend it to cover the case htotal==0.
Hm ok, makes sense. And drm_mode_vrefresh also has that check. I'll add
your backtrace and merge the patch.
Thanks, Daniel
>
> Thanks.
>
> BR,
> Tina
> >
> > >
> > > Signed-off-by: Tina Zhang <tina.zhang@intel.com>
> > > Cc: Adam Jackson <ajax@redhat.com>
> > > Cc: Dave Airlie <airlied@redhat.com>
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > ---
> > > drivers/gpu/drm/drm_modes.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c
> > > index adce9a2..59b92b1 100644
> > > --- a/drivers/gpu/drm/drm_modes.c
> > > +++ b/drivers/gpu/drm/drm_modes.c
> > > @@ -751,7 +751,7 @@ int drm_mode_hsync(const struct
> > drm_display_mode *mode)
> > > if (mode->hsync)
> > > return mode->hsync;
> > >
> > > - if (mode->htotal < 0)
> > > + if (mode->htotal <= 0)
> > > return 0;
> > >
> > > calc_val = (mode->clock * 1000) / mode->htotal; /* hsync in Hz */
> > > --
> > > 2.7.4
> > >
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > http://blog.ffwll.ch
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-01-24 9:59 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-01-23 7:28 [PATCH] drm/modes: Prevent division by zero htotal Tina Zhang
2019-01-23 8:04 ` ✓ Fi.CI.BAT: success for " Patchwork
2019-01-23 10:33 ` ✓ Fi.CI.IGT: " Patchwork
2019-01-23 10:56 ` [PATCH] " Daniel Vetter
2019-01-24 7:11 ` Zhang, Tina
2019-01-24 9:59 ` Daniel Vetter
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox