From: Dan Carpenter <dan.carpenter@oracle.com>
To: akhilpo@codeaurora.org
Cc: linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org
Subject: [bug report] drm/msm/a6xx: Fix llcc configuration for a660 gpu
Date: Tue, 12 Oct 2021 13:00:29 +0300 [thread overview]
Message-ID: <20211012100029.GA3379@kili> (raw)
Hello Akhil P Oommen,
The patch a6f24383f6c0: "drm/msm/a6xx: Fix llcc configuration for
a660 gpu" from Jul 30, 2021, leads to the following Smatch static
checker warning:
drivers/gpu/drm/msm/adreno/a6xx_gpu.c:1480 a6xx_llc_activate()
error: uninitialized symbol 'gpu_scid'.
drivers/gpu/drm/msm/adreno/a6xx_gpu.c
1423 static void a6xx_llc_activate(struct a6xx_gpu *a6xx_gpu)
1424 {
1425 struct adreno_gpu *adreno_gpu = &a6xx_gpu->base;
1426 struct msm_gpu *gpu = &adreno_gpu->base;
1427 u32 gpu_scid, cntl1_regval = 0;
1428
1429 if (IS_ERR(a6xx_gpu->llc_mmio))
1430 return;
1431
1432 if (!llcc_slice_activate(a6xx_gpu->llc_slice)) {
1433 gpu_scid = llcc_get_slice_id(a6xx_gpu->llc_slice);
1434
1435 gpu_scid &= 0x1f;
1436 cntl1_regval = (gpu_scid << 0) | (gpu_scid << 5) | (gpu_scid << 10) |
1437 (gpu_scid << 15) | (gpu_scid << 20);
1438 }
gpu_scid not initialized on the else path.
1439
1440 /*
1441 * For targets with a MMU500, activate the slice but don't program the
1442 * register. The XBL will take care of that.
1443 */
1444 if (!llcc_slice_activate(a6xx_gpu->htw_llc_slice)) {
1445 if (!a6xx_gpu->have_mmu500) {
1446 u32 gpuhtw_scid = llcc_get_slice_id(a6xx_gpu->htw_llc_slice);
1447
1448 gpuhtw_scid &= 0x1f;
1449 cntl1_regval |= FIELD_PREP(GENMASK(29, 25), gpuhtw_scid);
1450 }
1451 }
1452
1453 if (!cntl1_regval)
1454 return;
1455
1456 /*
1457 * Program the slice IDs for the various GPU blocks and GPU MMU
1458 * pagetables
1459 */
1460 if (!a6xx_gpu->have_mmu500) {
1461 a6xx_llc_write(a6xx_gpu,
1462 REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_1, cntl1_regval);
1463
1464 /*
1465 * Program cacheability overrides to not allocate cache
1466 * lines on a write miss
1467 */
1468 a6xx_llc_rmw(a6xx_gpu,
1469 REG_A6XX_CX_MISC_SYSTEM_CACHE_CNTL_0, 0xF, 0x03);
1470 return;
1471 }
1472
1473 gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL1, GENMASK(24, 0), cntl1_regval);
1474
1475 /* On A660, the SCID programming for UCHE traffic is done in
1476 * A6XX_GBIF_SCACHE_CNTL0[14:10]
1477 */
1478 if (adreno_is_a660_family(adreno_gpu))
1479 gpu_rmw(gpu, REG_A6XX_GBIF_SCACHE_CNTL0, (0x1f << 10) |
--> 1480 (1 << 8), (gpu_scid << 10) | (1 << 8));
^^^^^^^^^^^^^^
Used here.
1481 }
regards,
dan carpenter
next reply other threads:[~2021-10-12 10:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-12 10:00 Dan Carpenter [this message]
2021-10-14 6:21 ` [bug report] drm/msm/a6xx: Fix llcc configuration for a660 gpu Akhil P Oommen
-- strict thread matches above, loose matches on Subject: below --
2021-11-25 8:36 Dan Carpenter
2021-11-25 9:28 ` Akhil P Oommen
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=20211012100029.GA3379@kili \
--to=dan.carpenter@oracle.com \
--cc=akhilpo@codeaurora.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.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.