Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/komeda: Correct d71 register block counting

Per HW, d71->num_blocks includes reserved blocks but no PERIPH block,
correct the block counting accordingly.
D71 happens to only have one reserved block and periph block, which
hides this counting error.

Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com>
Reviewed-by: Mihail Atanassov <mihail.atanassov@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191210061015.25905-1-james.qian.wang@arm.com

+6 -3
+6 -3
drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c
··· 414 414 d71->pipes[i] = to_d71_pipeline(pipe); 415 415 } 416 416 417 - /* loop the register blks and probe */ 418 - i = 2; /* exclude GCU and PERIPH */ 417 + /* loop the register blks and probe. 418 + * NOTE: d71->num_blocks includes reserved blocks. 419 + * d71->num_blocks = GCU + valid blocks + reserved blocks 420 + */ 421 + i = 1; /* exclude GCU */ 419 422 offset = D71_BLOCK_SIZE; /* skip GCU */ 420 423 while (i < d71->num_blocks) { 421 424 blk_base = mdev->reg_base + (offset >> 2); ··· 428 425 err = d71_probe_block(d71, &blk, blk_base); 429 426 if (err) 430 427 goto err_cleanup; 431 - i++; 432 428 } 433 429 430 + i++; 434 431 offset += D71_BLOCK_SIZE; 435 432 } 436 433