drm/i915: avoid division by zero on skl_calc_wrpll_link
authorYoung Xiao <YangX92@hotmail.com>
Mon, 17 Dec 2018 12:23:03 +0000 (12:23 +0000)
committerJani Nikula <jani.nikula@intel.com>
Fri, 28 Dec 2018 09:35:52 +0000 (11:35 +0200)
commitb8449c43c95b5ea40ced8824d4ddea997f77b911
treec8d192bf22bd498f3627690833370d04f4ce53a1
parent6879216897b7dd4cfeaaed8e80e0374f260fc594
drm/i915: avoid division by zero on skl_calc_wrpll_link

If for some unexpected reason the registers all read zero it's better
to WARN and return instead of dividing by zero and completely freezing
the machine.

See commit 0e005888b833 ("drm/i915: avoid division by zero on
cnl_calc_wrpll_link") for detail.

Signed-off-by: Young Xiao <YangX92@hotmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/SG2PR01MB2169F6E95BC8BB5E29477042ADBC0@SG2PR01MB2169.apcprd01.prod.exchangelabs.com
drivers/gpu/drm/i915/intel_ddi.c