Searched hist:"2 d94e5224e81c58986a8cf44a3bf4830ce5cb96e" (Results 1 – 2 of 2) sorted by relevance
/linux/include/linux/ |
H A D | hid-sensor-hub.h | diff 2d94e5224e81c58986a8cf44a3bf4830ce5cb96e Thu May 07 23:26:34 CEST 2015 Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> HID: hid-sensor-hub: Fix debug lock warning
When CONFIG_DEBUG_LOCK_ALLOC is defined, mutex magic is compared and warned for (l->magic != l), here l is the address of mutex pointer. In hid-sensor-hub as part of hsdev creation, a per hsdev mutex is initialized during MFD cell creation. This hsdev, which contains, mutex is part of platform data for the a cell. But platform_data is copied in platform_device_add_data() in platform.c. This copy will copy the whole hsdev structure including mutex. But once copied the magic will no longer match. So when client driver call sensor_hub_input_attr_get_raw_value, this will trigger mutex warning. So to avoid this allocate mutex dynamically. This will be same even after copy.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|
/linux/drivers/hid/ |
H A D | hid-sensor-hub.c | diff 2d94e5224e81c58986a8cf44a3bf4830ce5cb96e Thu May 07 23:26:34 CEST 2015 Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> HID: hid-sensor-hub: Fix debug lock warning
When CONFIG_DEBUG_LOCK_ALLOC is defined, mutex magic is compared and warned for (l->magic != l), here l is the address of mutex pointer. In hid-sensor-hub as part of hsdev creation, a per hsdev mutex is initialized during MFD cell creation. This hsdev, which contains, mutex is part of platform data for the a cell. But platform_data is copied in platform_device_add_data() in platform.c. This copy will copy the whole hsdev structure including mutex. But once copied the magic will no longer match. So when client driver call sensor_hub_input_attr_get_raw_value, this will trigger mutex warning. So to avoid this allocate mutex dynamically. This will be same even after copy.
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
|