All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: ben.goz@amd.com
Cc: dri-devel@lists.freedesktop.org
Subject: re: drm/amdkfd: Add support for VI in DQM
Date: Tue, 28 Jul 2015 19:00:12 +0300	[thread overview]
Message-ID: <20150728160012.GE25739@mwanda> (raw)

Hello Ben Goz,

The patch 914bea6329b2: "drm/amdkfd: Add support for VI in DQM" from
Jan 12, 2015, leads to the following static checker warning:

	drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c:158 init_sdma_vm()
	warn: should this be a bitwise op?

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c
   148  static void init_sdma_vm(struct device_queue_manager *dqm, struct queue *q,
   149                                  struct qcm_process_device *qpd)
   150  {
   151          uint32_t value = (1 << SDMA0_RLC0_VIRTUAL_ADDR__ATC__SHIFT);
   152  
   153          if (q->process->is_32bit_user_mode)
   154                  value |= (1 << SDMA0_RLC0_VIRTUAL_ADDR__PTR32__SHIFT) |
   155                                  get_sh_mem_bases_32(qpd_to_pdd(qpd));
   156          else
   157                  value |= ((get_sh_mem_bases_nybble_64(qpd_to_pdd(qpd))) <<
   158                                  SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE__SHIFT) &&
                                                                                     ^^
Probably logical AND was intended.

   159                                  SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE_MASK;
   160  
   161          q->properties.sdma_vm_addr = value;
   162  }

Also:

	drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c:146
	init_sdma_vm() warn: should this be a bitwise op?

drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
   136  static void init_sdma_vm(struct device_queue_manager *dqm, struct queue *q,
   137                                  struct qcm_process_device *qpd)
   138  {
   139          uint32_t value = (1 << SDMA0_RLC0_VIRTUAL_ADDR__ATC__SHIFT);
   140  
   141          if (q->process->is_32bit_user_mode)
   142                  value |= (1 << SDMA0_RLC0_VIRTUAL_ADDR__PTR32__SHIFT) |
   143                                  get_sh_mem_bases_32(qpd_to_pdd(qpd));
   144          else
   145                  value |= ((get_sh_mem_bases_nybble_64(qpd_to_pdd(qpd))) <<
   146                                  SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE__SHIFT) &&
                                                                                     ^
   147                                  SDMA0_RLC0_VIRTUAL_ADDR__SHARED_BASE_MASK;
   148  
   149          q->properties.sdma_vm_addr = value;
   150  }

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

             reply	other threads:[~2015-07-28 16:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-28 16:00 Dan Carpenter [this message]
2015-07-29  7:39 ` drm/amdkfd: Add support for VI in DQM Oded Gabbay

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=20150728160012.GE25739@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ben.goz@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.