There is one race issue between mevent callback (which is called
in mevent_dispatch thread) and mevent_delete (which could be called
in dev thread). And the callback is called after mevent_delete.
libevent have the exactly same issue. The issue is decripted here:
https://github.com/libevent/libevent/blob/master/whatsnew-2.1.txt
The fixing is:
We introduce a teardown callback to mevent and make sure there is
no race issue between callback and teardown call.
This patch updates the mevent API and the caller as well.
Tracked-On: #1877
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Added edge triggered read and write events.
For mei mediator we need to detect changes in
sysfs files, it's not possible to do it via
level based triggers as the files are always
readable.
Tracked-On: #1417
Change-Id: Ib360ad31f30afa576b2b7b833f9bb139c269a030
Signed-off-by: Aviad Nissel <aviad.nissel@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
The vmname variable is missing 'export',
so it's probably only shadowing the already
exported variable from devicemodel/include/dm.h
Tracked-On: #1415
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Yu Wang <yu1.wang@intel.com>
Current, mevent cleanup path has issue. There are possible
following calling sequence happen when reboot/poweroff UOS:
1. mevent_dispatch() calls mevent_destroy
2. do_close_post calls some virtual device deinit to delete
mevent.
This patch introduce mevent init/deinit to make sure:
1. mevent init
2. mevent_add is called when init virtual device
3. mevent_del is called when deinit virtual device
4. mevent deinit
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
Reviewed-by: Zhao Yakui <yakui.zhao@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>