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/radeon: add support mc ucode loading on CIK (v2)
Date: Wed, 5 Feb 2014 16:18:23 +0300	[thread overview]
Message-ID: <20140205131823.GA800@elgon.mountain> (raw)

Hello Alex Deucher,

The patch bc8273fe9701: "drm/radeon: add support mc ucode loading on
CIK (v2)" from Jun 29, 2012, leads to the following static checker
warning:

	drivers/gpu/drm/radeon/cik.c:1728 ci_mc_load_microcode()
	warn: we tested 'running' before and it was 'false'

drivers/gpu/drm/radeon/cik.c
  1727          if (running == 0) {
                    ^^^^^^^^^^^^
  1728                  if (running) {
                            ^^^^^^^
Never true condition.

  1729                          blackout = RREG32(MC_SHARED_BLACKOUT_CNTL);
  1730                          WREG32(MC_SHARED_BLACKOUT_CNTL, blackout | 1);
  1731                  }
  1732  
  1733                  /* reset the engine and set to writable */
  1734                  WREG32(MC_SEQ_SUP_CNTL, 0x00000008);
  1735                  WREG32(MC_SEQ_SUP_CNTL, 0x00000010);
  1736  
  1737                  /* load mc io regs */
  1738                  for (i = 0; i < regs_size; i++) {
  1739                          WREG32(MC_SEQ_IO_DEBUG_INDEX, io_mc_regs[(i << 1)]);
  1740                          WREG32(MC_SEQ_IO_DEBUG_DATA, io_mc_regs[(i << 1) + 1]);
  1741                  }
  1742                  /* load the MC ucode */
  1743                  fw_data = (const __be32 *)rdev->mc_fw->data;
  1744                  for (i = 0; i < ucode_size; i++)
  1745                          WREG32(MC_SEQ_SUP_PGM, be32_to_cpup(fw_data++));
  1746  
  1747                  /* put the engine back into the active state */
  1748                  WREG32(MC_SEQ_SUP_CNTL, 0x00000008);
  1749                  WREG32(MC_SEQ_SUP_CNTL, 0x00000004);
  1750                  WREG32(MC_SEQ_SUP_CNTL, 0x00000001);
  1751  
  1752                  /* wait for training to complete */
  1753                  for (i = 0; i < rdev->usec_timeout; i++) {
  1754                          if (RREG32(MC_SEQ_TRAIN_WAKEUP_CNTL) & TRAIN_DONE_D0)
  1755                                  break;
  1756                          udelay(1);
  1757                  }
  1758                  for (i = 0; i < rdev->usec_timeout; i++) {
  1759                          if (RREG32(MC_SEQ_TRAIN_WAKEUP_CNTL) & TRAIN_DONE_D1)
  1760                                  break;
  1761                          udelay(1);
  1762                  }
  1763  
  1764                  if (running)
                            ^^^^^^^
Same.

  1765                          WREG32(MC_SHARED_BLACKOUT_CNTL, blackout);
  1766          }

regards,
dan carpenter

                 reply	other threads:[~2014-02-05 13:18 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=20140205131823.GA800@elgon.mountain \
    --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