@@ -2063,40 +2063,115 @@ static void a6xx_recover(struct msm_gpu *gpu)
20632063
20642064static const char * a6xx_uche_fault_block (struct msm_gpu * gpu , u32 mid )
20652065{
2066+ struct adreno_gpu * adreno_gpu = to_adreno_gpu (gpu );
20662067 static const char * uche_clients [7 ] = {
20672068 "VFD" , "SP" , "VSC" , "VPC" , "HLSQ" , "PC" , "LRZ" ,
20682069 };
20692070 u32 val ;
20702071
2071- if (mid < 1 || mid > 3 )
2072- return "UNKNOWN" ;
2072+ if (adreno_is_a7xx (adreno_gpu )) {
2073+ if (mid != 1 && mid != 2 && mid != 3 && mid != 8 )
2074+ return "UNKNOWN" ;
2075+ } else {
2076+ if (mid < 1 || mid > 3 )
2077+ return "UNKNOWN" ;
2078+ }
20732079
20742080 /*
20752081 * The source of the data depends on the mid ID read from FSYNR1.
20762082 * and the client ID read from the UCHE block
20772083 */
20782084 val = gpu_read (gpu , REG_A6XX_UCHE_CLIENT_PF );
20792085
2080- /* mid = 3 is most precise and refers to only one block per client */
2081- if (mid == 3 )
2082- return uche_clients [val & 7 ];
2086+ if (adreno_is_a7xx (adreno_gpu )) {
2087+ /* Bit 3 for mid=3 indicates BR or BV */
2088+ static const char * uche_clients_a7xx [16 ] = {
2089+ "BR_VFD" , "BR_SP" , "BR_VSC" , "BR_VPC" ,
2090+ "BR_HLSQ" , "BR_PC" , "BR_LRZ" , "BR_TP" ,
2091+ "BV_VFD" , "BV_SP" , "BV_VSC" , "BV_VPC" ,
2092+ "BV_HLSQ" , "BV_PC" , "BV_LRZ" , "BV_TP" ,
2093+ };
2094+
2095+ /* LPAC has the same clients as BR and BV, but because it is
2096+ * compute-only some of them do not exist and there are holes
2097+ * in the array.
2098+ */
2099+ static const char * uche_clients_lpac_a7xx [8 ] = {
2100+ "-" , "LPAC_SP" , "-" , "-" ,
2101+ "LPAC_HLSQ" , "-" , "-" , "LPAC_TP" ,
2102+ };
2103+
2104+ val &= GENMASK (6 , 0 );
2105+
2106+ /* mid=3 refers to BR or BV */
2107+ if (mid == 3 ) {
2108+ if (val < ARRAY_SIZE (uche_clients_a7xx ))
2109+ return uche_clients_a7xx [val ];
2110+ else
2111+ return "UCHE" ;
2112+ }
2113+
2114+ /* mid=8 refers to LPAC */
2115+ if (mid == 8 ) {
2116+ if (val < ARRAY_SIZE (uche_clients_lpac_a7xx ))
2117+ return uche_clients_lpac_a7xx [val ];
2118+ else
2119+ return "UCHE_LPAC" ;
2120+ }
20832121
2084- /* For mid=2 the source is TP or VFD except when the client id is 0 */
2085- if (mid == 2 )
2086- return ((val & 7 ) == 0 ) ? "TP" : "TP|VFD" ;
2122+ /* mid=2 is a catchall for everything else in LPAC */
2123+ if (mid == 2 )
2124+ return "UCHE_LPAC" ;
2125+
2126+ /* mid=1 is a catchall for everything else in BR/BV */
2127+ return "UCHE" ;
2128+ } else if (adreno_is_a660_family (adreno_gpu )) {
2129+ static const char * uche_clients_a660 [8 ] = {
2130+ "VFD" , "SP" , "VSC" , "VPC" , "HLSQ" , "PC" , "LRZ" , "TP" ,
2131+ };
20872132
2088- /* For mid=1 just return "UCHE" as a catchall for everything else */
2089- return "UCHE" ;
2133+ static const char * uche_clients_a660_not [8 ] = {
2134+ "not VFD" , "not SP" , "not VSC" , "not VPC" ,
2135+ "not HLSQ" , "not PC" , "not LRZ" , "not TP" ,
2136+ };
2137+
2138+ val &= GENMASK (6 , 0 );
2139+
2140+ if (mid == 3 && val < ARRAY_SIZE (uche_clients_a660 ))
2141+ return uche_clients_a660 [val ];
2142+
2143+ if (mid == 1 && val < ARRAY_SIZE (uche_clients_a660_not ))
2144+ return uche_clients_a660_not [val ];
2145+
2146+ return "UCHE" ;
2147+ } else {
2148+ /* mid = 3 is most precise and refers to only one block per client */
2149+ if (mid == 3 )
2150+ return uche_clients [val & 7 ];
2151+
2152+ /* For mid=2 the source is TP or VFD except when the client id is 0 */
2153+ if (mid == 2 )
2154+ return ((val & 7 ) == 0 ) ? "TP" : "TP|VFD" ;
2155+
2156+ /* For mid=1 just return "UCHE" as a catchall for everything else */
2157+ return "UCHE" ;
2158+ }
20902159}
20912160
20922161static const char * a6xx_fault_block (struct msm_gpu * gpu , u32 id )
20932162{
2163+ struct adreno_gpu * adreno_gpu = to_adreno_gpu (gpu );
2164+
20942165 if (id == 0 )
20952166 return "CP" ;
20962167 else if (id == 4 )
20972168 return "CCU" ;
20982169 else if (id == 6 )
20992170 return "CDP Prefetch" ;
2171+ else if (id == 7 )
2172+ return "GMU" ;
2173+ else if (id == 5 && adreno_is_a7xx (adreno_gpu ))
2174+ return "Flag cache" ;
21002175
21012176 return a6xx_uche_fault_block (gpu , id );
21022177}
0 commit comments