drivers/gpu/drm/ast: Fix infinite loop if read fails
authorRussell Currey <ruscur@russell.cc>
Thu, 15 Dec 2016 05:12:41 +0000 (16:12 +1100)
committerSasha Levin <alexander.levin@verizon.com>
Sun, 15 Jan 2017 14:49:52 +0000 (09:49 -0500)
commit1eb7f3ea461455c2c019ee8bdd4a72042681aef7
treec58fb4f7512e8f48b9cb2f19291a5bbeb0edcf08
parentfcc5da2cf67993e96c9a9b3132775af11c0104ce
drivers/gpu/drm/ast: Fix infinite loop if read fails

[ Upstream commit 298360af3dab45659810fdc51aba0c9f4097e4f6 ]

ast_get_dram_info() configures a window in order to access BMC memory.
A BMC register can be configured to disallow this, and if so, causes
an infinite loop in the ast driver which renders the system unusable.

Fix this by erroring out if an error is detected.  On powerpc systems with
EEH, this leads to the device being fenced and the system continuing to
operate.

Cc: <stable@vger.kernel.org> # 3.10+
Signed-off-by: Russell Currey <ruscur@russell.cc>
Reviewed-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161215051241.20815-1-ruscur@russell.cc
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
drivers/gpu/drm/ast/ast_main.c