Date: Tue, 21 Mar 2017 08:36:25 +0000 (UTC) From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r315667 - in stable/11/sys: dev/xen/control dev/xen/xenstore xen/xenstore Message-ID: <201703210836.v2L8aPrv006035@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: royger Date: Tue Mar 21 08:36:25 2017 New Revision: 315667 URL: https://svnweb.freebsd.org/changeset/base/315667 Log: MFC r314841: xenstore: fix suspension when using the xenstore device Submitted by: Liuyingdong <liuyingdong@huawei.com> Reviewed by: royger Modified: stable/11/sys/dev/xen/control/control.c stable/11/sys/dev/xen/xenstore/xenstore.c stable/11/sys/xen/xenstore/xenstorevar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/xen/control/control.c ============================================================================== --- stable/11/sys/dev/xen/control/control.c Tue Mar 21 08:34:41 2017 (r315666) +++ stable/11/sys/dev/xen/control/control.c Tue Mar 21 08:36:25 2017 (r315667) @@ -199,7 +199,9 @@ xctrl_suspend() int suspend_cancelled; EVENTHANDLER_INVOKE(power_suspend_early); + xs_lock(); stop_all_proc(); + xs_unlock(); EVENTHANDLER_INVOKE(power_suspend); #ifdef EARLY_AP_STARTUP Modified: stable/11/sys/dev/xen/xenstore/xenstore.c ============================================================================== --- stable/11/sys/dev/xen/xenstore/xenstore.c Tue Mar 21 08:34:41 2017 (r315666) +++ stable/11/sys/dev/xen/xenstore/xenstore.c Tue Mar 21 08:36:25 2017 (r315667) @@ -1699,3 +1699,20 @@ xs_unregister_watch(struct xs_watch *wat sx_xunlock(&xs.xenwatch_mutex); } } + +void +xs_lock(void) +{ + + sx_xlock(&xs.request_mutex); + return; +} + +void +xs_unlock(void) +{ + + sx_xunlock(&xs.request_mutex); + return; +} + Modified: stable/11/sys/xen/xenstore/xenstorevar.h ============================================================================== --- stable/11/sys/xen/xenstore/xenstorevar.h Tue Mar 21 08:34:41 2017 (r315666) +++ stable/11/sys/xen/xenstore/xenstorevar.h Tue Mar 21 08:36:25 2017 (r315667) @@ -338,4 +338,15 @@ void xs_unregister_watch(struct xs_watch */ struct sbuf *xs_join(const char *, const char *); +/** + * Lock the xenstore request mutex. + */ +void xs_lock(void); + +/** + * Unlock the xenstore request mutex. + */ +void xs_unlock(void); + #endif /* _XEN_XENSTORE_XENSTOREVAR_H */ +
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201703210836.v2L8aPrv006035>