From owner-svn-src-stable-11@freebsd.org Tue Mar 21 08:36:26 2017 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EDAB9D16D88; Tue, 21 Mar 2017 08:36:26 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A257216B6; Tue, 21 Mar 2017 08:36:26 +0000 (UTC) (envelope-from royger@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v2L8aPAU006038; Tue, 21 Mar 2017 08:36:25 GMT (envelope-from royger@FreeBSD.org) Received: (from royger@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v2L8aPrv006035; Tue, 21 Mar 2017 08:36:25 GMT (envelope-from royger@FreeBSD.org) Message-Id: <201703210836.v2L8aPrv006035@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: royger set sender to royger@FreeBSD.org using -f From: =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= Date: Tue, 21 Mar 2017 08:36:25 +0000 (UTC) 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 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Mar 2017 08:36:27 -0000 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 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 */ +