<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/drivers/gpu, branch v3.16.81</title>
<subtitle>Clone of https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git</subtitle>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/'/>
<entry>
<title>drm/radeon: fix si_enable_smc_cac() failed issue</title>
<updated>2019-12-19T15:58:58+00:00</updated>
<author>
<name>Alex Deucher</name>
<email>alexander.deucher@amd.com</email>
</author>
<published>2019-10-30T14:21:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=f8248efc24768d019f6f782cb16019df68f28876'/>
<id>f8248efc24768d019f6f782cb16019df68f28876</id>
<content type='text'>
commit 2c409ba81be25516afe05ae27a4a15da01740b01 upstream.

Need to set the dte flag on this asic.

Port the fix from amdgpu:
5cb818b861be114 ("drm/amd/amdgpu: fix si_enable_smc_cac() failed issue")

Reviewed-by: Yong Zhao &lt;yong.zhao@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2c409ba81be25516afe05ae27a4a15da01740b01 upstream.

Need to set the dte flag on this asic.

Port the fix from amdgpu:
5cb818b861be114 ("drm/amd/amdgpu: fix si_enable_smc_cac() failed issue")

Reviewed-by: Yong Zhao &lt;yong.zhao@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/i915/gen8+: Add RC6 CTX corruption WA</title>
<updated>2019-11-15T00:56:52+00:00</updated>
<author>
<name>Imre Deak</name>
<email>imre.deak@intel.com</email>
</author>
<published>2018-07-09T15:24:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=5013e6d917ac9f3df823d94d17e9cfe99c003517'/>
<id>5013e6d917ac9f3df823d94d17e9cfe99c003517</id>
<content type='text'>
commit 7e34f4e4aad3fd34c02b294a3cf2321adf5b4438 upstream.

In some circumstances the RC6 context can get corrupted. We can detect
this and take the required action, that is disable RC6 and runtime PM.
The HW recovers from the corrupted state after a system suspend/resume
cycle, so detect the recovery and re-enable RC6 and runtime PM.

v2: rebase (Mika)
v3:
- Move intel_suspend_gt_powersave() to the end of the GEM suspend
  sequence.
- Add commit message.
v4:
- Rebased on intel_uncore_forcewake_put(i915-&gt;uncore, ...) API
  change.
v5:
- Rebased on latest upstream gt_pm refactoring.

Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Signed-off-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7e34f4e4aad3fd34c02b294a3cf2321adf5b4438 upstream.

In some circumstances the RC6 context can get corrupted. We can detect
this and take the required action, that is disable RC6 and runtime PM.
The HW recovers from the corrupted state after a system suspend/resume
cycle, so detect the recovery and re-enable RC6 and runtime PM.

v2: rebase (Mika)
v3:
- Move intel_suspend_gt_powersave() to the end of the GEM suspend
  sequence.
- Add commit message.
v4:
- Rebased on intel_uncore_forcewake_put(i915-&gt;uncore, ...) API
  change.
v5:
- Rebased on latest upstream gt_pm refactoring.

Signed-off-by: Imre Deak &lt;imre.deak@intel.com&gt;
Signed-off-by: Mika Kuoppala &lt;mika.kuoppala@linux.intel.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/gma500/cdv: Check vbt config bits when detecting lvds panels</title>
<updated>2019-10-05T15:19:39+00:00</updated>
<author>
<name>Patrik Jakobsson</name>
<email>patrik.r.jakobsson@gmail.com</email>
</author>
<published>2019-04-16T11:46:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=e119a9b14c181bb2a2310756cc8a07f6331032b6'/>
<id>e119a9b14c181bb2a2310756cc8a07f6331032b6</id>
<content type='text'>
commit 7c420636860a719049fae9403e2c87804f53bdde upstream.

Some machines have an lvds child device in vbt even though a panel is
not attached. To make detection more reliable we now also check the lvds
config bits available in the vbt.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1665766
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Patrik Jakobsson &lt;patrik.r.jakobsson@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190416114607.1072-1-patrik.r.jakobsson@gmail.com
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7c420636860a719049fae9403e2c87804f53bdde upstream.

Some machines have an lvds child device in vbt even though a panel is
not attached. To make detection more reliable we now also check the lvds
config bits available in the vbt.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1665766
Reviewed-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
Signed-off-by: Patrik Jakobsson &lt;patrik.r.jakobsson@gmail.com&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190416114607.1072-1-patrik.r.jakobsson@gmail.com
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/radeon: prefer lower reference dividers</title>
<updated>2019-09-23T20:12:04+00:00</updated>
<author>
<name>Christian König</name>
<email>christian.koenig@amd.com</email>
</author>
<published>2019-05-06T17:57:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=afa9b5186c1bf4b8a828af1899231642a1cf5a39'/>
<id>afa9b5186c1bf4b8a828af1899231642a1cf5a39</id>
<content type='text'>
commit 2e26ccb119bde03584be53406bbd22e711b0d6e6 upstream.

Instead of the closest reference divider prefer the lowest,
this fixes flickering issues on HP Compaq nx9420.

Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=108514
Suggested-by: Paul Dufresne &lt;dufresnep@gmail.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2e26ccb119bde03584be53406bbd22e711b0d6e6 upstream.

Instead of the closest reference divider prefer the lowest,
this fixes flickering issues on HP Compaq nx9420.

Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=108514
Suggested-by: Paul Dufresne &lt;dufresnep@gmail.com&gt;
Signed-off-by: Christian König &lt;christian.koenig@amd.com&gt;
Acked-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/fb-helper: dpms_legacy(): Only set on connectors in use</title>
<updated>2019-09-23T20:11:37+00:00</updated>
<author>
<name>Noralf Trønnes</name>
<email>noralf@tronnes.org</email>
</author>
<published>2019-03-26T17:55:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=b4795ca5f5d01433dbb4be03179e4605178bc12a'/>
<id>b4795ca5f5d01433dbb4be03179e4605178bc12a</id>
<content type='text'>
commit 65a102f68005891d7f39354cfd79099908df6d51 upstream.

For each enabled crtc the functions sets dpms on all registered connectors.
Limit this to only doing it once and on the connectors actually in use.

Signed-off-by: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Fixes: 023eb571a1d0 ("drm: correctly update connector DPMS status in drm_fb_helper")
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190326175546.18126-3-noralf@tronnes.org
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 65a102f68005891d7f39354cfd79099908df6d51 upstream.

For each enabled crtc the functions sets dpms on all registered connectors.
Limit this to only doing it once and on the connectors actually in use.

Signed-off-by: Noralf Trønnes &lt;noralf@tronnes.org&gt;
Fixes: 023eb571a1d0 ("drm: correctly update connector DPMS status in drm_fb_helper")
Reviewed-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20190326175546.18126-3-noralf@tronnes.org
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/radeon/evergreen_cs: fix missing break in switch statement</title>
<updated>2019-07-09T21:04:03+00:00</updated>
<author>
<name>Gustavo A. R. Silva</name>
<email>gustavo@embeddedor.com</email>
</author>
<published>2019-02-15T20:29:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=d00f3bbd3062b3de78227ba27492c182282122ae'/>
<id>d00f3bbd3062b3de78227ba27492c182282122ae</id>
<content type='text'>
commit cc5034a5d293dd620484d1d836aa16c6764a1c8c upstream.

Add missing break statement in order to prevent the code from falling
through to case CB_TARGET_MASK.

This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.

Fixes: dd220a00e8bd ("drm/radeon/kms: add support for streamout v7")
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit cc5034a5d293dd620484d1d836aa16c6764a1c8c upstream.

Add missing break statement in order to prevent the code from falling
through to case CB_TARGET_MASK.

This bug was found thanks to the ongoing efforts to enable
-Wimplicit-fallthrough.

Fixes: dd220a00e8bd ("drm/radeon/kms: add support for streamout v7")
Signed-off-by: Gustavo A. R. Silva &lt;gustavo@embeddedor.com&gt;
Signed-off-by: Alex Deucher &lt;alexander.deucher@amd.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm: Fix error handling in drm_legacy_addctx</title>
<updated>2019-07-09T21:03:44+00:00</updated>
<author>
<name>YueHaibing</name>
<email>yuehaibing@huawei.com</email>
</author>
<published>2018-12-29T02:49:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=b429b68647312be7823b6eb17b40ad2f3fdca3f8'/>
<id>b429b68647312be7823b6eb17b40ad2f3fdca3f8</id>
<content type='text'>
commit c39191feed4540fed98badeb484833dcf659bb96 upstream.

'ctx-&gt;handle' is unsigned, it never less than zero.
This patch use int 'tmp_handle' to handle the err condition.

Fixes: 62968144e673 ("drm: convert drm context code to use Linux idr")
Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20181229024907.12852-1-yuehaibing@huawei.com
[bwh: Backported to 3.16: We only have the "legacy" driver type here]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c39191feed4540fed98badeb484833dcf659bb96 upstream.

'ctx-&gt;handle' is unsigned, it never less than zero.
This patch use int 'tmp_handle' to handle the err condition.

Fixes: 62968144e673 ("drm: convert drm context code to use Linux idr")
Signed-off-by: YueHaibing &lt;yuehaibing@huawei.com&gt;
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/20181229024907.12852-1-yuehaibing@huawei.com
[bwh: Backported to 3.16: We only have the "legacy" driver type here]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Fix setting of dma masks</title>
<updated>2019-05-02T20:41:39+00:00</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2019-01-28T09:31:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=5d482d24437ff7f73cc35a36575bfdf2945226ff'/>
<id>5d482d24437ff7f73cc35a36575bfdf2945226ff</id>
<content type='text'>
commit 4cbfa1e6c09e98450aab3240e5119b0ab2c9795b upstream.

Previously we set only the dma mask and not the coherent mask. Fix that.
Also, for clarity, make sure both are initially set to 64 bits.

Fixes: 0d00c488f3de: ("drm/vmwgfx: Fix the driver for large dma addresses")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 4cbfa1e6c09e98450aab3240e5119b0ab2c9795b upstream.

Previously we set only the dma mask and not the coherent mask. Fix that.
Also, for clarity, make sure both are initially set to 64 bits.

Fixes: 0d00c488f3de: ("drm/vmwgfx: Fix the driver for large dma addresses")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/vmwgfx: Return error code from vmw_execbuf_copy_fence_user</title>
<updated>2019-05-02T20:41:39+00:00</updated>
<author>
<name>Thomas Hellstrom</name>
<email>thellstrom@vmware.com</email>
</author>
<published>2019-01-31T09:55:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=fa830f1991405cff90c5ad8cdd3cdb74e741b397'/>
<id>fa830f1991405cff90c5ad8cdd3cdb74e741b397</id>
<content type='text'>
commit 728354c005c36eaf44b6e5552372b67e60d17f56 upstream.

The function was unconditionally returning 0, and a caller would have to
rely on the returned fence pointer being NULL to detect errors. However,
the function vmw_execbuf_copy_fence_user() would expect a non-zero error
code in that case and would BUG otherwise.

So make sure we return a proper non-zero error code if the fence pointer
returned is NULL.

Fixes: ae2a104058e2: ("vmwgfx: Implement fence objects")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 728354c005c36eaf44b6e5552372b67e60d17f56 upstream.

The function was unconditionally returning 0, and a caller would have to
rely on the returned fence pointer being NULL to detect errors. However,
the function vmw_execbuf_copy_fence_user() would expect a non-zero error
code in that case and would BUG otherwise.

So make sure we return a proper non-zero error code if the fence pointer
returned is NULL.

Fixes: ae2a104058e2: ("vmwgfx: Implement fence objects")
Signed-off-by: Thomas Hellstrom &lt;thellstrom@vmware.com&gt;
Reviewed-by: Deepak Rawat &lt;drawat@vmware.com&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>drm/modes: Prevent division by zero htotal</title>
<updated>2019-05-02T20:41:28+00:00</updated>
<author>
<name>Tina Zhang</name>
<email>tina.zhang@intel.com</email>
</author>
<published>2019-01-23T07:28:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.exis.tech/linux.git/commit/?id=cd6480f06acfcdb181d26488b4eeb098790c8b93'/>
<id>cd6480f06acfcdb181d26488b4eeb098790c8b93</id>
<content type='text'>
commit a2fcd5c84f7a7825e028381b10182439067aa90d upstream.

This patch prevents division by zero htotal.

In a follow-up mail Tina writes:

&gt; &gt; How did you manage to get here with htotal == 0? This needs backtraces (or if
&gt; &gt; this is just about static checkers, a mention of that).
&gt; &gt; -Daniel
&gt;
&gt; In GVT-g, we are trying to enable a virtual display w/o setting timings for a pipe
&gt; (a.k.a htotal=0), then we met the following kernel panic:
&gt;
&gt; [   32.832048] divide error: 0000 [#1] SMP PTI
&gt; [   32.833614] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc4-sriov+ #33
&gt; [   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
&gt; [   32.835901] RIP: 0010:drm_mode_hsync+0x1e/0x40
&gt; [   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 &lt;f7&gt; f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
&gt; [   32.836004] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
&gt; [   32.836004] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
&gt; [   32.836004] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
&gt; [   32.836004] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
&gt; [   32.836004] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
&gt; [   32.836004] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
&gt; [   32.836004] FS:  0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
&gt; [   32.836004] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&gt; [   32.836004] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
&gt; [   32.836004] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
&gt; [   32.836004] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
&gt; [   32.836004] Call Trace:
&gt; [   32.836004]  intel_mode_from_pipe_config+0x72/0x90
&gt; [   32.836004]  intel_modeset_setup_hw_state+0x569/0xf90
&gt; [   32.836004]  intel_modeset_init+0x905/0x1db0
&gt; [   32.836004]  i915_driver_load+0xb8c/0x1120
&gt; [   32.836004]  i915_pci_probe+0x4d/0xb0
&gt; [   32.836004]  local_pci_probe+0x44/0xa0
&gt; [   32.836004]  ? pci_assign_irq+0x27/0x130
&gt; [   32.836004]  pci_device_probe+0x102/0x1c0
&gt; [   32.836004]  driver_probe_device+0x2b8/0x480
&gt; [   32.836004]  __driver_attach+0x109/0x110
&gt; [   32.836004]  ? driver_probe_device+0x480/0x480
&gt; [   32.836004]  bus_for_each_dev+0x67/0xc0
&gt; [   32.836004]  ? klist_add_tail+0x3b/0x70
&gt; [   32.836004]  bus_add_driver+0x1e8/0x260
&gt; [   32.836004]  driver_register+0x5b/0xe0
&gt; [   32.836004]  ? mipi_dsi_bus_init+0x11/0x11
&gt; [   32.836004]  do_one_initcall+0x4d/0x1eb
&gt; [   32.836004]  kernel_init_freeable+0x197/0x237
&gt; [   32.836004]  ? rest_init+0xd0/0xd0
&gt; [   32.836004]  kernel_init+0xa/0x110
&gt; [   32.836004]  ret_from_fork+0x35/0x40
&gt; [   32.836004] Modules linked in:
&gt; [   32.859183] ---[ end trace 525608b0ed0e8665 ]---
&gt; [   32.859722] RIP: 0010:drm_mode_hsync+0x1e/0x40
&gt; [   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 &lt;f7&gt; f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
&gt; [   32.862680] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
&gt; [   32.863309] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
&gt; [   32.864182] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
&gt; [   32.865206] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
&gt; [   32.866359] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
&gt; [   32.867213] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
&gt; [   32.868075] FS:  0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
&gt; [   32.868983] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&gt; [   32.869659] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
&gt; [   32.870599] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
&gt; [   32.871598] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
&gt; [   32.872549] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
&gt;
&gt; Since drm_mode_hsync() has the logic to check mode-&gt;htotal, I just extend it to cover the case htotal==0.

Signed-off-by: Tina Zhang &lt;tina.zhang@intel.com&gt;
Cc: Adam Jackson &lt;ajax@redhat.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
[danvet: Add additional explanations + cc: stable.]
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1548228539-3061-1-git-send-email-tina.zhang@intel.com
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit a2fcd5c84f7a7825e028381b10182439067aa90d upstream.

This patch prevents division by zero htotal.

In a follow-up mail Tina writes:

&gt; &gt; How did you manage to get here with htotal == 0? This needs backtraces (or if
&gt; &gt; this is just about static checkers, a mention of that).
&gt; &gt; -Daniel
&gt;
&gt; In GVT-g, we are trying to enable a virtual display w/o setting timings for a pipe
&gt; (a.k.a htotal=0), then we met the following kernel panic:
&gt;
&gt; [   32.832048] divide error: 0000 [#1] SMP PTI
&gt; [   32.833614] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.18.0-rc4-sriov+ #33
&gt; [   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
&gt; [   32.835901] RIP: 0010:drm_mode_hsync+0x1e/0x40
&gt; [   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 &lt;f7&gt; f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
&gt; [   32.836004] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
&gt; [   32.836004] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
&gt; [   32.836004] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
&gt; [   32.836004] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
&gt; [   32.836004] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
&gt; [   32.836004] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
&gt; [   32.836004] FS:  0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
&gt; [   32.836004] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&gt; [   32.836004] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
&gt; [   32.836004] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
&gt; [   32.836004] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
&gt; [   32.836004] Call Trace:
&gt; [   32.836004]  intel_mode_from_pipe_config+0x72/0x90
&gt; [   32.836004]  intel_modeset_setup_hw_state+0x569/0xf90
&gt; [   32.836004]  intel_modeset_init+0x905/0x1db0
&gt; [   32.836004]  i915_driver_load+0xb8c/0x1120
&gt; [   32.836004]  i915_pci_probe+0x4d/0xb0
&gt; [   32.836004]  local_pci_probe+0x44/0xa0
&gt; [   32.836004]  ? pci_assign_irq+0x27/0x130
&gt; [   32.836004]  pci_device_probe+0x102/0x1c0
&gt; [   32.836004]  driver_probe_device+0x2b8/0x480
&gt; [   32.836004]  __driver_attach+0x109/0x110
&gt; [   32.836004]  ? driver_probe_device+0x480/0x480
&gt; [   32.836004]  bus_for_each_dev+0x67/0xc0
&gt; [   32.836004]  ? klist_add_tail+0x3b/0x70
&gt; [   32.836004]  bus_add_driver+0x1e8/0x260
&gt; [   32.836004]  driver_register+0x5b/0xe0
&gt; [   32.836004]  ? mipi_dsi_bus_init+0x11/0x11
&gt; [   32.836004]  do_one_initcall+0x4d/0x1eb
&gt; [   32.836004]  kernel_init_freeable+0x197/0x237
&gt; [   32.836004]  ? rest_init+0xd0/0xd0
&gt; [   32.836004]  kernel_init+0xa/0x110
&gt; [   32.836004]  ret_from_fork+0x35/0x40
&gt; [   32.836004] Modules linked in:
&gt; [   32.859183] ---[ end trace 525608b0ed0e8665 ]---
&gt; [   32.859722] RIP: 0010:drm_mode_hsync+0x1e/0x40
&gt; [   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 &lt;f7&gt; f9 b9 d3 4d 62 10 05 f4 01 00 00 f7 e1 89 d0 c1 e8 06 f3 c3 66
&gt; [   32.862680] RSP: 0000:ffffc900000ebb90 EFLAGS: 00010206
&gt; [   32.863309] RAX: 0000000000000000 RBX: ffff88001c67c8a0 RCX: 0000000000000000
&gt; [   32.864182] RDX: 0000000000000000 RSI: ffff88001c67c000 RDI: ffff88001c67c8a0
&gt; [   32.865206] RBP: ffff88001c7d03a0 R08: ffff88001c67c8a0 R09: ffff88001c7d0330
&gt; [   32.866359] R10: ffffffff822c3a98 R11: 0000000000000001 R12: ffff88001c67c000
&gt; [   32.867213] R13: ffff88001c7d0370 R14: ffffffff8207eb78 R15: ffff88001c67c800
&gt; [   32.868075] FS:  0000000000000000(0000) GS:ffff88001da00000(0000) knlGS:0000000000000000
&gt; [   32.868983] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
&gt; [   32.869659] CR2: 0000000000000000 CR3: 000000000220a000 CR4: 00000000000006f0
&gt; [   32.870599] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
&gt; [   32.871598] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
&gt; [   32.872549] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
&gt;
&gt; Since drm_mode_hsync() has the logic to check mode-&gt;htotal, I just extend it to cover the case htotal==0.

Signed-off-by: Tina Zhang &lt;tina.zhang@intel.com&gt;
Cc: Adam Jackson &lt;ajax@redhat.com&gt;
Cc: Dave Airlie &lt;airlied@redhat.com&gt;
Cc: Daniel Vetter &lt;daniel@ffwll.ch&gt;
[danvet: Add additional explanations + cc: stable.]
Signed-off-by: Daniel Vetter &lt;daniel.vetter@ffwll.ch&gt;
Link: https://patchwork.freedesktop.org/patch/msgid/1548228539-3061-1-git-send-email-tina.zhang@intel.com
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
