Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

soc/tegra: cbb: Use correct master_id mask for CBB NOC in Tegra194

In Tegra194 SoC, master_id bit range is different between cluster NOC
and CBB NOC. Currently same bit range is used which results in wrong
master_id value. Due to this, illegal accesses from the CCPLEX master
do not result in a crash as expected. Fix this by using the correct
range for the CBB NOC.

Finally, it is only necessary to extract the master_id when the
erd_mask_inband_err flag is set because when this is not set, a crash
is always triggered.

Fixes: b71344221466 ("soc/tegra: cbb: Add CBB 1.0 driver for Tegra194")
Fixes: fc2f151d2314 ("soc/tegra: cbb: Add driver for Tegra234 CBB 2.0")
Signed-off-by: Sumit Gupta <sumitg@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Sumit Gupta and committed by
Thierry Reding
33af51a6 bebf683b

+13 -14
+7 -7
drivers/soc/tegra/cbb/tegra194-cbb.c
··· 102 102 #define CLUSTER_NOC_VQC GENMASK(17, 16) 103 103 #define CLUSTER_NOC_MSTR_ID GENMASK(21, 18) 104 104 105 - #define USRBITS_MSTR_ID GENMASK(21, 18) 106 - 107 105 #define CBB_ERR_OPC GENMASK(4, 1) 108 106 #define CBB_ERR_ERRCODE GENMASK(10, 8) 109 107 #define CBB_ERR_LEN1 GENMASK(27, 16) ··· 2036 2038 smp_processor_id(), priv->noc->name, priv->res->start, 2037 2039 irq); 2038 2040 2039 - mstr_id = FIELD_GET(USRBITS_MSTR_ID, priv->errlog5) - 1; 2040 2041 is_fatal = print_errlog(NULL, priv, status); 2041 2042 2042 2043 /* 2043 - * If illegal request is from CCPLEX(0x1) 2044 - * initiator then call BUG() to crash system. 2044 + * If illegal request is from CCPLEX(0x1) initiator 2045 + * and error is fatal then call BUG() to crash system. 2045 2046 */ 2046 - if ((mstr_id == 0x1) && priv->noc->erd_mask_inband_err) 2047 - is_inband_err = 1; 2047 + if (priv->noc->erd_mask_inband_err) { 2048 + mstr_id = FIELD_GET(CBB_NOC_MSTR_ID, priv->errlog5); 2049 + if (mstr_id == 0x1) 2050 + is_inband_err = 1; 2051 + } 2048 2052 } 2049 2053 } 2050 2054
+6 -7
drivers/soc/tegra/cbb/tegra234-cbb.c
··· 92 92 struct tegra234_cbb_fabric { 93 93 const char *name; 94 94 phys_addr_t off_mask_erd; 95 - bool erd_mask_inband_err; 96 95 const char * const *master_id; 97 96 unsigned int notifier_offset; 98 97 const struct tegra_cbb_error *errors; ··· 524 525 if (err) 525 526 goto unlock; 526 527 527 - mstr_id = FIELD_GET(USRBITS_MSTR_ID, priv->mn_user_bits); 528 - 529 528 /* 530 - * If illegal request is from CCPLEX(id:0x1) master then call BUG() to 531 - * crash system. 529 + * If illegal request is from CCPLEX(id:0x1) master then call WARN() 532 530 */ 533 - if ((mstr_id == 0x1) && priv->fabric->off_mask_erd) 534 - is_inband_err = 1; 531 + if (priv->fabric->off_mask_erd) { 532 + mstr_id = FIELD_GET(USRBITS_MSTR_ID, priv->mn_user_bits); 533 + if (mstr_id == 0x1) 534 + is_inband_err = 1; 535 + } 535 536 } 536 537 } 537 538