mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
mali_760_driver :
handle crash when accessing gpu nodes under /sys in cts test; upgrade rk_ko_ver to 12.
This commit is contained in:
@@ -99,7 +99,7 @@ EXPORT_SYMBOL(shared_kernel_test_data);
|
||||
|
||||
#define KBASE_DRV_NAME "mali"
|
||||
/** rk_ext : version of rk_ext on mali_ko, aka. rk_ko_ver. */
|
||||
#define ROCKCHIP_VERSION 0x0b
|
||||
#define ROCKCHIP_VERSION (12)
|
||||
|
||||
static const char kbase_drv_name[] = KBASE_DRV_NAME;
|
||||
|
||||
|
||||
222
drivers/gpu/arm/midgard/platform/rk/custom_log.h
Executable file
222
drivers/gpu/arm/midgard/platform/rk/custom_log.h
Executable file
@@ -0,0 +1,222 @@
|
||||
/* --------------------------------------------------------------------------------------------------------
|
||||
* File: custom_log.h
|
||||
*
|
||||
* Desc: ChenZhen ƫ<>õ<EFBFBD> log <20><><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD>ʵ<EFBFBD><CAB5>.
|
||||
*
|
||||
* -----------------------------------------------------------------------------------
|
||||
* < ϰ<><CFB0> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> > :
|
||||
*
|
||||
* -----------------------------------------------------------------------------------
|
||||
* Usage:
|
||||
*
|
||||
* Note:
|
||||
*
|
||||
* Author: ChenZhen
|
||||
*
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
* Version:
|
||||
* v1.0
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
* Log:
|
||||
----Fri Nov 19 15:20:28 2010 v1.0
|
||||
*
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __CUSTOM_LOG_H__
|
||||
#define __CUSTOM_LOG_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Include Files
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Macros Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/** <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> macro <20>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD>, <20><> ʹ<><CAB9> log <20><><EFBFBD><EFBFBD>. */
|
||||
// #define ENABLE_DEBUG_LOG
|
||||
|
||||
/** .! : <20><><EFBFBD><EFBFBD>Ҫȫ<D2AA>ֵعر<D8B9> D log, <20><><EFBFBD><EFBFBD>ʹ<EFBFBD><CAB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD>. */
|
||||
/*
|
||||
#undef ENABLE_DEBUG_LOG
|
||||
#warning "custom debug log is disabled globally!"
|
||||
*/
|
||||
|
||||
#define LOGD(fmt, args...) \
|
||||
printk(KERN_DEBUG fmt "\n", ## args)
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifdef ENABLE_VERBOSE_LOG
|
||||
/** Verbose log. */
|
||||
#define V(fmt, args...) \
|
||||
{ printk(KERN_DEBUG "V : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); }
|
||||
#else
|
||||
#define V(...) ((void)0)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef ENABLE_DEBUG_LOG
|
||||
/** Debug log. */
|
||||
#define D(fmt, args...) \
|
||||
{ printk(KERN_DEBUG "D : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); }
|
||||
#else
|
||||
#define D(...) ((void)0)
|
||||
#endif
|
||||
|
||||
#define I(fmt, args...) \
|
||||
{ printk(KERN_INFO "I : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); }
|
||||
|
||||
#define W(fmt, args...) \
|
||||
{ printk(KERN_WARNING "W : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); }
|
||||
|
||||
#define E(fmt, args...) \
|
||||
{ printk(KERN_ERR "E : [File] : %s; [Line] : %d; [Func] : %s(); " fmt "\n", __FILE__, __LINE__, __FUNCTION__, ## args); }
|
||||
|
||||
/*-------------------------------------------------------*/
|
||||
|
||||
/** ʹ<><CAB9> D(), <20><>ʮ<EFBFBD><CAAE><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ʽ<EFBFBD><CABD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD> 'var' <20><> value. */
|
||||
#define D_DEC(var) D(#var " = %d.", var);
|
||||
|
||||
#define E_DEC(var) E(#var " = %d.", var);
|
||||
|
||||
/** ʹ<><CAB9> D(), <20><>ʮ<EFBFBD><CAAE><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ʽ<EFBFBD><CABD>ӡ<EFBFBD><D3A1><EFBFBD><EFBFBD> 'var' <20><> value. */
|
||||
#define D_HEX(var) D(#var " = 0x%x.", var);
|
||||
|
||||
#define E_HEX(var) E(#var " = 0x%x.", var);
|
||||
|
||||
/** ʹ<><CAB9> D(), <20><>ʮ<EFBFBD><CAAE><EFBFBD><EFBFBD><EFBFBD>Ƶ<EFBFBD><C6B5><EFBFBD>ʽ <20><>ӡָ<D3A1><D6B8><EFBFBD><EFBFBD><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD> 'ptr' <20><> value. */
|
||||
#define D_PTR(ptr) D(#ptr " = %p.", ptr);
|
||||
|
||||
#define E_PTR(ptr) E(#ptr " = %p.", ptr);
|
||||
|
||||
/** ʹ<><CAB9> D(), <20><>ӡ char <20>ִ<EFBFBD>. */
|
||||
#define D_STR(pStr) \
|
||||
{\
|
||||
if ( NULL == pStr )\
|
||||
{\
|
||||
D(#pStr" = NULL.");\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
D(#pStr" = '%s'.", pStr);\
|
||||
}\
|
||||
}
|
||||
|
||||
#define E_STR(pStr) \
|
||||
{\
|
||||
if ( NULL == pStr )\
|
||||
{\
|
||||
E(#pStr" = NULL.");\
|
||||
}\
|
||||
else\
|
||||
{\
|
||||
E(#pStr" = '%s'.", pStr);\
|
||||
}\
|
||||
}
|
||||
|
||||
#ifdef ENABLE_DEBUG_LOG
|
||||
/**
|
||||
* log <20><> 'pStart' <20><>ַ<EFBFBD><D6B7>ʼ<EFBFBD><CABC> 'len' <20><><EFBFBD>ֽڵ<D6BD><DAB5><EFBFBD><EFBFBD><EFBFBD>.
|
||||
*/
|
||||
#define D_MEM(pStart, len) \
|
||||
{\
|
||||
int i = 0;\
|
||||
char* p = (char*)pStart;\
|
||||
D("dump memory from addr of '" #pStart "', from %p, length %d' : ", pStart, len); \
|
||||
printk("\t\t");\
|
||||
for ( i = 0; i < len ; i++ )\
|
||||
{\
|
||||
printk("0x%02x, ", p[i] );\
|
||||
}\
|
||||
printk("\n");\
|
||||
}
|
||||
#else
|
||||
#define D_MEM(...) ((void)0)
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------*/
|
||||
|
||||
#define EXIT_FOR_DEBUG \
|
||||
{\
|
||||
E("To exit for debug.");\
|
||||
return 1;\
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>ú<EFBFBD><C3BA><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>鷵<EFBFBD><E9B7B5>ֵ, <20><><EFBFBD>ݷ<EFBFBD><DDB7><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD>ת<EFBFBD><D7AA>ָ<EFBFBD><D6B8><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
* @param functionCall
|
||||
* <20><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD><C4B5><EFBFBD>, <20>ú<EFBFBD><C3BA><EFBFBD><EFBFBD>ķ<EFBFBD><C4B7><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ɹ<EFBFBD> or err <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
* <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>ú<EFBFBD><C3BA><EFBFBD> "<22><><EFBFBD><EFBFBD>" <20>DZ<EFBFBD><C7B1><EFBFBD><EFBFBD><EFBFBD>Ϊ "<22><><EFBFBD><EFBFBD> 0 <20><>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>".
|
||||
* @param result
|
||||
* <20><><EFBFBD>ڼ<EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ص<EFBFBD> error code <20><> <20><><EFBFBD>ͱ<EFBFBD><CDB1><EFBFBD>, ͨ<><CDA8><EFBFBD><EFBFBD> "ret" or "result" <20><>.
|
||||
* @param label
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ش<EFBFBD><D8B4><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ת<EFBFBD><D7AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "EXIT".
|
||||
*/
|
||||
#define CHECK_FUNC_CALL(functionCall, result, label) \
|
||||
{\
|
||||
if ( 0 != ( (result) = (functionCall) ) )\
|
||||
{\
|
||||
E("Function call returned error : " #result " = %d.", result);\
|
||||
goto label;\
|
||||
}\
|
||||
}
|
||||
|
||||
/**
|
||||
* <20><><EFBFBD>ض<EFBFBD><D8B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20>ж<EFBFBD> error <20><><EFBFBD><EFBFBD>, <20>Ա<EFBFBD><D4B1><EFBFBD> 'retVar' <20><><EFBFBD><EFBFBD> 'errCode',
|
||||
* Log <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6> Error Caution, Ȼ<><C8BB><EFBFBD><EFBFBD>ת 'label' ָ<><D6B8><EFBFBD>Ĵ<EFBFBD><C4B4>봦ִ<EBB4A6><D6B4>.
|
||||
* @param msg
|
||||
* <20><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>ʽ<EFBFBD><CABD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE>Ϣ.
|
||||
* @param retVar
|
||||
* <20><>ʶ<EFBFBD><CAB6><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4>״̬<D7B4><CCAC><EFBFBD>߽<EFBFBD><DFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>þ<EFBFBD><C3BE><EFBFBD><EFBFBD><EFBFBD> Error Code.
|
||||
* ͨ<><CDA8><EFBFBD><EFBFBD> 'ret' or 'result'.
|
||||
* @param errCode
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD> error <20>ij<EFBFBD><C4B3><EFBFBD><EFBFBD><EFBFBD>ʶ, ͨ<><CDA8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̬.
|
||||
* @param label
|
||||
* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><D2AA>ת<EFBFBD><D7AA><EFBFBD>Ĵ<EFBFBD><C4B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ı<EFBFBD><C4B1><EFBFBD>, ͨ<><CDA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 'EXIT'.
|
||||
* @param args...
|
||||
* <20><>Ӧ 'msgFmt' ʵ<><CAB5><EFBFBD><EFBFBD> '%s', '%d', ... <20><> ת<><D7AA>˵<EFBFBD><CBB5><EFBFBD><EFBFBD> <20>ľ<EFBFBD><C4BE><EFBFBD><EFBFBD>ɱ䳤ʵ<E4B3A4><CAB5>.
|
||||
*/
|
||||
#define SET_ERROR_AND_JUMP(msgFmt, retVar, errCode, label, args...) \
|
||||
{\
|
||||
E("To set '" #retVar "' to %d('" #errCode "'), because : " msgFmt, (errCode), ## args);\
|
||||
(retVar) = (errCode);\
|
||||
goto label;\
|
||||
}
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Types and Structures Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Global Functions' Prototype
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Inline Functions Implementation
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CUSTOM_LOG_H__ */
|
||||
|
||||
@@ -43,6 +43,10 @@
|
||||
|
||||
#include <linux/rockchip/dvfs.h>
|
||||
|
||||
#include "custom_log.h"
|
||||
|
||||
/* ############################################################################################# */
|
||||
|
||||
#define MALI_T7XX_DEFAULT_CLOCK 100000
|
||||
|
||||
|
||||
@@ -266,6 +270,14 @@ static ssize_t error_count_show(struct device *dev,struct device_attribute *attr
|
||||
struct kbase_device *kbdev = dev_get_drvdata(dev);
|
||||
ssize_t ret;
|
||||
|
||||
D_PTR(dev);
|
||||
if ( NULL == kbdev )
|
||||
{
|
||||
E("fail to get kbase_device instance.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
D_DEC(kbdev->kbase_group_error);
|
||||
ret = scnprintf(buf, PAGE_SIZE, "%d\n", kbdev->kbase_group_error);
|
||||
return ret;
|
||||
}
|
||||
@@ -837,10 +849,12 @@ int kbase_platform_create_sysfs_file(struct device *dev)
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* rk_ext : device will crash after "cat /sys/devices/ffa30000.gpu/dtlb".
|
||||
if (device_create_file(dev, &dev_attr_dtlb)) {
|
||||
dev_err(dev, "Couldn't create sysfs file [dtlb]\n");
|
||||
goto out;
|
||||
}
|
||||
*/
|
||||
|
||||
if (device_create_file(dev, &dev_attr_dvfs)) {
|
||||
dev_err(dev, "Couldn't create sysfs file [dvfs]\n");
|
||||
|
||||
Reference in New Issue
Block a user