dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: alexander.deucher@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/amdgpu: Add initial VI support
Date: Wed, 10 Jun 2015 18:42:41 +0300	[thread overview]
Message-ID: <20150610154241.GF10549@mwanda> (raw)

Hello Alex Deucher,

The patch aaa36a976bbb: "drm/amdgpu: Add initial VI support" from Apr
20, 2015, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c:260 gmc_v8_0_mc_load_microcode()
	warn: we tested 'running' before and it was 'false'

drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c
   257          running = REG_GET_FIELD(RREG32(mmMC_SEQ_SUP_CNTL), MC_SEQ_SUP_CNTL, RUN);
   258  
   259          if (running == 0) {
                    ^^^^^^^^^^^^
   260                  if (running) {
                            ^^^^^^^
Never true.

   261                          blackout = RREG32(mmMC_SHARED_BLACKOUT_CNTL);
   262                          WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout | 1);
   263                  }
   264  
   265                  /* reset the engine and set to writable */
   266                  WREG32(mmMC_SEQ_SUP_CNTL, 0x00000008);
   267                  WREG32(mmMC_SEQ_SUP_CNTL, 0x00000010);
   268  
   269                  /* load mc io regs */
   270                  for (i = 0; i < regs_size; i++) {
   271                          WREG32(mmMC_SEQ_IO_DEBUG_INDEX, le32_to_cpup(io_mc_regs++));
   272                          WREG32(mmMC_SEQ_IO_DEBUG_DATA, le32_to_cpup(io_mc_regs++));
   273                  }
   274                  /* load the MC ucode */
   275                  for (i = 0; i < ucode_size; i++)
   276                          WREG32(mmMC_SEQ_SUP_PGM, le32_to_cpup(fw_data++));
   277  
   278                  /* put the engine back into the active state */
   279                  WREG32(mmMC_SEQ_SUP_CNTL, 0x00000008);
   280                  WREG32(mmMC_SEQ_SUP_CNTL, 0x00000004);
   281                  WREG32(mmMC_SEQ_SUP_CNTL, 0x00000001);
   282  
   283                  /* wait for training to complete */
   284                  for (i = 0; i < adev->usec_timeout; i++) {
   285                          if (REG_GET_FIELD(RREG32(mmMC_SEQ_TRAIN_WAKEUP_CNTL),
   286                                            MC_SEQ_TRAIN_WAKEUP_CNTL, TRAIN_DONE_D0))
   287                                  break;
   288                          udelay(1);
   289                  }
   290                  for (i = 0; i < adev->usec_timeout; i++) {
   291                          if (REG_GET_FIELD(RREG32(mmMC_SEQ_TRAIN_WAKEUP_CNTL),
   292                                            MC_SEQ_TRAIN_WAKEUP_CNTL, TRAIN_DONE_D1))
   293                                  break;
   294                          udelay(1);
   295                  }
   296  
   297                  if (running)
                            ^^^^^^^
Same.

   298                          WREG32(mmMC_SHARED_BLACKOUT_CNTL, blackout);
   299          }
   300  

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

                 reply	other threads:[~2015-06-10 15:42 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150610154241.GF10549@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=alexander.deucher@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox