dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* re: drm/radeon/kms: add support for MC ucode loading on SI
@ 2014-02-05 13:19 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2014-02-05 13:19 UTC (permalink / raw)
  To: alexander.deucher; +Cc: dri-devel

Hello Alex Deucher,

The patch 8b074dd64053: "drm/radeon/kms: add support for MC ucode
loading on SI" from Mar 20, 2012, leads to the following static
checker warning:

	drivers/gpu/drm/radeon/si.c:1507 si_mc_load_microcode()
	warn: we tested 'running' before and it was 'false'

drivers/gpu/drm/radeon/si.c
  1506          if (running == 0) {
                    ^^^^^^^^^^^^
  1507                  if (running) {
                            ^^^^^^^
Nope.

  1508                          blackout = RREG32(MC_SHARED_BLACKOUT_CNTL);
  1509                          WREG32(MC_SHARED_BLACKOUT_CNTL, blackout | 1);
  1510                  }
  1511  
  1512                  /* reset the engine and set to writable */
  1513                  WREG32(MC_SEQ_SUP_CNTL, 0x00000008);
  1514                  WREG32(MC_SEQ_SUP_CNTL, 0x00000010);
  1515  
  1516                  /* load mc io regs */
  1517                  for (i = 0; i < regs_size; i++) {
  1518                          WREG32(MC_SEQ_IO_DEBUG_INDEX, io_mc_regs[(i << 1)]);
  1519                          WREG32(MC_SEQ_IO_DEBUG_DATA, io_mc_regs[(i << 1) + 1]);
  1520                  }
  1521                  /* load the MC ucode */
  1522                  fw_data = (const __be32 *)rdev->mc_fw->data;
  1523                  for (i = 0; i < ucode_size; i++)
  1524                          WREG32(MC_SEQ_SUP_PGM, be32_to_cpup(fw_data++));
  1525  
  1526                  /* put the engine back into the active state */
  1527                  WREG32(MC_SEQ_SUP_CNTL, 0x00000008);
  1528                  WREG32(MC_SEQ_SUP_CNTL, 0x00000004);
  1529                  WREG32(MC_SEQ_SUP_CNTL, 0x00000001);
  1530  
  1531                  /* wait for training to complete */
  1532                  for (i = 0; i < rdev->usec_timeout; i++) {
  1533                          if (RREG32(MC_SEQ_TRAIN_WAKEUP_CNTL) & TRAIN_DONE_D0)
  1534                                  break;
  1535                          udelay(1);
  1536                  }
  1537                  for (i = 0; i < rdev->usec_timeout; i++) {
  1538                          if (RREG32(MC_SEQ_TRAIN_WAKEUP_CNTL) & TRAIN_DONE_D1)
  1539                                  break;
  1540                          udelay(1);
  1541                  }
  1542  
  1543                  if (running)
                            ^^^^^^^
False.

  1544                          WREG32(MC_SHARED_BLACKOUT_CNTL, blackout);
  1545          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-02-05 13:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-05 13:19 drm/radeon/kms: add support for MC ucode loading on SI Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox