Date: Tue, 21 Mar 2017 09:27: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-10@freebsd.org Subject: svn commit: r315675 - in stable/10/sys: dev/xen/control xen/xenstore Message-ID: <201703210927.v2L9RP8i027532@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: royger Date: Tue Mar 21 09:27:24 2017 New Revision: 315675 URL: https://svnweb.freebsd.org/changeset/base/315675 Log: MFC r314841: xenstore: fix suspension when using the xenstore device Submitted by: Liuyingdong <liuyingdong@huawei.com> Reviewed by: royger Modified: stable/10/sys/dev/xen/control/control.c stable/10/sys/xen/xenstore/xenstore.c stable/10/sys/xen/xenstore/xenstorevar.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/xen/control/control.c ============================================================================== --- stable/10/sys/dev/xen/control/control.c Tue Mar 21 09:24:07 2017 (r315674) +++ stable/10/sys/dev/xen/control/control.c Tue Mar 21 09:27:24 2017 (r315675) @@ -343,6 +343,10 @@ xctrl_suspend() #endif int suspend_cancelled; + EVENTHANDLER_INVOKE(power_suspend_early); + xs_lock(); + stop_all_proc(); + xs_unlock(); EVENTHANDLER_INVOKE(power_suspend); if (smp_started) { @@ -429,6 +433,8 @@ xctrl_suspend() thread_unlock(curthread); } + resume_all_proc(); + EVENTHANDLER_INVOKE(power_resume); if (bootverbose) Modified: stable/10/sys/xen/xenstore/xenstore.c ============================================================================== --- stable/10/sys/xen/xenstore/xenstore.c Tue Mar 21 09:24:07 2017 (r315674) +++ stable/10/sys/xen/xenstore/xenstore.c Tue Mar 21 09:27:24 2017 (r315675) @@ -1657,3 +1657,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/10/sys/xen/xenstore/xenstorevar.h ============================================================================== --- stable/10/sys/xen/xenstore/xenstorevar.h Tue Mar 21 09:24:07 2017 (r315674) +++ stable/10/sys/xen/xenstore/xenstorevar.h Tue Mar 21 09:27:24 2017 (r315675) @@ -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?201703210927.v2L9RP8i027532>