All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Flora Cui <flora.cui@amd.com>
Cc: Ken Wang <Qingqing.Wang@amd.com>,
	dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org
Subject: Re: [bug report] drm/amdgpu/gfx6: clean up cu configuration
Date: Mon, 3 Apr 2017 16:54:38 +0300	[thread overview]
Message-ID: <20170403135438.GA4470@mwanda> (raw)
In-Reply-To: <20170401024344.GA4089@flora>

On Sat, Apr 01, 2017 at 10:43:46AM +0800, Flora Cui wrote:
> >   3727          for (i = 0; i < adev->gfx.config.max_shader_engines; i++) {
> >   3728                  for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) {
> >   3729                          mask = 1;
> >   3730                          ao_bitmap = 0;
> >   3731                          counter = 0;
> >   3732                          gfx_v6_0_select_se_sh(adev, i, j, 0xffffffff);
> >   3733                          if (i < 4 && j < 2)
> > 
> > If i == 4
> > 
> >   3734                                  gfx_v6_0_set_user_cu_inactive_bitmap(
> >   3735                                          adev, disable_masks[i * 2 + j]);
> >   3736                          bitmap = gfx_v6_0_get_cu_enabled(adev);
> >   3737                          cu_info->bitmap[i][j] = bitmap;
> > 
> > then we are beyond the end of this array.  Also, why was this patch even
> > applied when it has no commit message?  It's totally not clear to me
> > what the patch is trying to do or why it exists...
> adev->gfx.config.max_shader_engines is set in gfx_v6_0_gpu_init() and
> it must be < 4 so we'll never be beyond the end of the array.

Could you remove the condition then?  We should either check it always
or not at all.  We shouldn't check it half the time and assume it's
correct the other half.

regards,
dan carpenter

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

      reply	other threads:[~2017-04-03 13:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 15:13 [bug report] drm/amdgpu/gfx6: clean up cu configuration Dan Carpenter
2017-04-01  2:43 ` Flora Cui
2017-04-03 13:54   ` Dan Carpenter [this message]

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=20170403135438.GA4470@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=Qingqing.Wang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=flora.cui@amd.com \
    /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.