Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d043835d authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'drm-misc-fixes-2016-12-22' of git://anongit.freedesktop.org/git/drm-misc into drm-fixes

Here's the one lonely bugfix I talked about on irc.

* tag 'drm-misc-fixes-2016-12-22' of git://anongit.freedesktop.org/git/drm-misc:
  drivers/gpu/drm/ast: Fix infinite loop if read fails
parents 6df383cf 298360af
Loading
Loading
Loading
Loading
+5 −2
Original line number Original line Diff line number Diff line
@@ -223,7 +223,8 @@ static int ast_get_dram_info(struct drm_device *dev)
	ast_write32(ast, 0x10000, 0xfc600309);
	ast_write32(ast, 0x10000, 0xfc600309);


	do {
	do {
		;
		if (pci_channel_offline(dev->pdev))
			return -EIO;
	} while (ast_read32(ast, 0x10000) != 0x01);
	} while (ast_read32(ast, 0x10000) != 0x01);
	data = ast_read32(ast, 0x10004);
	data = ast_read32(ast, 0x10004);


@@ -428,7 +429,9 @@ int ast_driver_load(struct drm_device *dev, unsigned long flags)
	ast_detect_chip(dev, &need_post);
	ast_detect_chip(dev, &need_post);


	if (ast->chip != AST1180) {
	if (ast->chip != AST1180) {
		ast_get_dram_info(dev);
		ret = ast_get_dram_info(dev);
		if (ret)
			goto out_free;
		ast->vram_size = ast_get_vram_info(dev);
		ast->vram_size = ast_get_vram_info(dev);
		DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size);
		DRM_INFO("dram %d %d %d %08x\n", ast->mclk, ast->dram_type, ast->dram_bus_width, ast->vram_size);
	}
	}