mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
sensor:sometimes avc error after reboot
Issue:
Sometimes avc error after reboot:
avc: denied { write } for comm="capsense_reset" name="reset"
dev="sysfs" ino=54780 scontext=u:r:capsense_reset:s0 tcontext
=u:object_r:sysfs:s0 tclass=file permissive=0 pkg=""
Rootcause:
class_register logic:
-create sysfs dir 'capsense'
-send uevent 'add' to hal
-create sysfs file 'reset'
Most of times sysfs file haven't create while ueventd monitor 'ADD'
to fresh sys/class/capsense label as 'sysfs_capsense',file under
capsense will inherit /sys label ,which is 'sysfs'.
Fix:
Send uevent 'CHANGE' again to HAL,so that relabeling
'/sys/class/capsense/*'.
Change-Id: If6ddf3205a9f299e0617814d341827357ecb126f
Signed-off-by: Jiacheng Ou <oujc1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1434771
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
Conflicts:
drivers/misc/sx933x/Kbuild
Change-Id: I95404ee83cee74369af2c5b1a8e8152d3699300d
Reviewed-on: https://gerrit.mot.com/1435914
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Tested-by: Jira Key
Reviewed-by: Jiacheng Ou <oujc1@motorola.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
parent
80dc7b44f2
commit
01ea848b31
2 changed files with 9 additions and 0 deletions
|
|
@ -1,3 +1,7 @@
|
|||
KERNEL_DIR_PATH = $(shell find $(TOP)/kernel/ -name "msm-*" | head -1)
|
||||
|
||||
KERNEL_VERSION_NAME = $(shell basename $(KERNEL_DIR_PATH))
|
||||
|
||||
# add -Wall to try to catch everything we can.
|
||||
EXTRA_CFLAGS += -Wall
|
||||
EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include
|
||||
|
|
@ -32,6 +36,7 @@ ifneq (,$(filter burton%,$(TARGET_PRODUCT)))
|
|||
EXTRA_CFLAGS += -DCONFIG_CAPSENSE_USB_CAL
|
||||
endif
|
||||
|
||||
EXTRA_CFLAGS += -I$(TOP)/kernel/$(KERNEL_VERSION_NAME)/drivers/base
|
||||
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../sensors/Module.symvers
|
||||
|
||||
sx932x_sar-y := sx933x_sar.o
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include <linux/power_supply.h>
|
||||
#include <linux/sensors.h>
|
||||
#include "../../../include/linux/input/sx933x.h" /* main struct, interrupt,init,pointers */
|
||||
#include "base.h"
|
||||
|
||||
#define SX933x_DEBUG 0
|
||||
#define LOG_TAG "[sar SX933x]: "
|
||||
|
|
@ -1001,6 +1002,9 @@ static int sx933x_probe(struct i2c_client *client, const struct i2c_device_id *i
|
|||
return err;
|
||||
}
|
||||
|
||||
/*restore sys/class/capsense label*/
|
||||
kobject_uevent(&capsense_class.p->subsys.kobj, KOBJ_CHANGE);
|
||||
|
||||
/* Add Pointer to main platform data struct */
|
||||
pDevice->hw = pplatData;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue