From: Dan Carpenter Subject: re: drm/radeon/kms: add ucode loader for NI Date: Wed, 5 Feb 2014 16:18:55 +0300 Message-ID: <20140205131855.GB800@elgon.mountain> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) by gabe.freedesktop.org (Postfix) with ESMTP id 73B2B106EB2 for ; Wed, 5 Feb 2014 05:19:03 -0800 (PST) Content-Disposition: inline List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org To: alexdeucher@gmail.com Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org Hello Alex Deucher, The patch 0af62b016804: "drm/radeon/kms: add ucode loader for NI" from Jan 6, 2011, leads to the following static checker warning: drivers/gpu/drm/radeon/ni.c:646 ni_mc_load_microcode() warn: we tested 'running' before and it was 'false' drivers/gpu/drm/radeon/ni.c 643 running = RREG32(MC_SEQ_SUP_CNTL) & RUN_MASK; 644 645 if ((mem_type == MC_SEQ_MISC0_GDDR5_VALUE) && (running == 0)) { ^^^^^^^^^^^^ 646 if (running) { ^^^^^^^ Never true condition. 647 blackout = RREG32(MC_SHARED_BLACKOUT_CNTL); 648 WREG32(MC_SHARED_BLACKOUT_CNTL, 1); 649 } 650 651 /* reset the engine and set to writable */ 652 WREG32(MC_SEQ_SUP_CNTL, 0x00000008); 653 WREG32(MC_SEQ_SUP_CNTL, 0x00000010); 654 655 /* load mc io regs */ 656 for (i = 0; i < regs_size; i++) { 657 WREG32(MC_SEQ_IO_DEBUG_INDEX, io_mc_regs[(i << 1)]); 658 WREG32(MC_SEQ_IO_DEBUG_DATA, io_mc_regs[(i << 1) + 1]); 659 } 660 /* load the MC ucode */ 661 fw_data = (const __be32 *)rdev->mc_fw->data; 662 for (i = 0; i < ucode_size; i++) 663 WREG32(MC_SEQ_SUP_PGM, be32_to_cpup(fw_data++)); 664 665 /* put the engine back into the active state */ 666 WREG32(MC_SEQ_SUP_CNTL, 0x00000008); 667 WREG32(MC_SEQ_SUP_CNTL, 0x00000004); 668 WREG32(MC_SEQ_SUP_CNTL, 0x00000001); 669 670 /* wait for training to complete */ 671 for (i = 0; i < rdev->usec_timeout; i++) { 672 if (RREG32(MC_IO_PAD_CNTL_D0) & MEM_FALL_OUT_CMD) 673 break; 674 udelay(1); 675 } 676 677 if (running) ^^^^^^^ Again. 678 WREG32(MC_SHARED_BLACKOUT_CNTL, blackout); 679 } regards, dan carpenter