xpc_main.c 34 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (c) 2004-2005 Silicon Graphics, Inc. All Rights Reserved.
  7. */
  8. /*
  9. * Cross Partition Communication (XPC) support - standard version.
  10. *
  11. * XPC provides a message passing capability that crosses partition
  12. * boundaries. This module is made up of two parts:
  13. *
  14. * partition This part detects the presence/absence of other
  15. * partitions. It provides a heartbeat and monitors
  16. * the heartbeats of other partitions.
  17. *
  18. * channel This part manages the channels and sends/receives
  19. * messages across them to/from other partitions.
  20. *
  21. * There are a couple of additional functions residing in XP, which
  22. * provide an interface to XPC for its users.
  23. *
  24. *
  25. * Caveats:
  26. *
  27. * . We currently have no way to determine which nasid an IPI came
  28. * from. Thus, xpc_IPI_send() does a remote AMO write followed by
  29. * an IPI. The AMO indicates where data is to be pulled from, so
  30. * after the IPI arrives, the remote partition checks the AMO word.
  31. * The IPI can actually arrive before the AMO however, so other code
  32. * must periodically check for this case. Also, remote AMO operations
  33. * do not reliably time out. Thus we do a remote PIO read solely to
  34. * know whether the remote partition is down and whether we should
  35. * stop sending IPIs to it. This remote PIO read operation is set up
  36. * in a special nofault region so SAL knows to ignore (and cleanup)
  37. * any errors due to the remote AMO write, PIO read, and/or PIO
  38. * write operations.
  39. *
  40. * If/when new hardware solves this IPI problem, we should abandon
  41. * the current approach.
  42. *
  43. */
  44. #include <linux/kernel.h>
  45. #include <linux/module.h>
  46. #include <linux/init.h>
  47. #include <linux/sched.h>
  48. #include <linux/syscalls.h>
  49. #include <linux/cache.h>
  50. #include <linux/interrupt.h>
  51. #include <linux/slab.h>
  52. #include <linux/delay.h>
  53. #include <linux/reboot.h>
  54. #include <asm/sn/intr.h>
  55. #include <asm/sn/sn_sal.h>
  56. #include <asm/kdebug.h>
  57. #include <asm/uaccess.h>
  58. #include "xpc.h"
  59. /* define two XPC debug device structures to be used with dev_dbg() et al */
  60. struct device_driver xpc_dbg_name = {
  61. .name = "xpc"
  62. };
  63. struct device xpc_part_dbg_subname = {
  64. .bus_id = {0}, /* set to "part" at xpc_init() time */
  65. .driver = &xpc_dbg_name
  66. };
  67. struct device xpc_chan_dbg_subname = {
  68. .bus_id = {0}, /* set to "chan" at xpc_init() time */
  69. .driver = &xpc_dbg_name
  70. };
  71. struct device *xpc_part = &xpc_part_dbg_subname;
  72. struct device *xpc_chan = &xpc_chan_dbg_subname;
  73. /* systune related variables for /proc/sys directories */
  74. static int xpc_hb_interval = XPC_HB_DEFAULT_INTERVAL;
  75. static int xpc_hb_min_interval = 1;
  76. static int xpc_hb_max_interval = 10;
  77. static int xpc_hb_check_interval = XPC_HB_CHECK_DEFAULT_INTERVAL;
  78. static int xpc_hb_check_min_interval = 10;
  79. static int xpc_hb_check_max_interval = 120;
  80. int xpc_disengage_request_timelimit = XPC_DISENGAGE_REQUEST_DEFAULT_TIMELIMIT;
  81. static int xpc_disengage_request_min_timelimit = 0;
  82. static int xpc_disengage_request_max_timelimit = 120;
  83. static ctl_table xpc_sys_xpc_hb_dir[] = {
  84. {
  85. 1,
  86. "hb_interval",
  87. &xpc_hb_interval,
  88. sizeof(int),
  89. 0644,
  90. NULL,
  91. &proc_dointvec_minmax,
  92. &sysctl_intvec,
  93. NULL,
  94. &xpc_hb_min_interval,
  95. &xpc_hb_max_interval
  96. },
  97. {
  98. 2,
  99. "hb_check_interval",
  100. &xpc_hb_check_interval,
  101. sizeof(int),
  102. 0644,
  103. NULL,
  104. &proc_dointvec_minmax,
  105. &sysctl_intvec,
  106. NULL,
  107. &xpc_hb_check_min_interval,
  108. &xpc_hb_check_max_interval
  109. },
  110. {0}
  111. };
  112. static ctl_table xpc_sys_xpc_dir[] = {
  113. {
  114. 1,
  115. "hb",
  116. NULL,
  117. 0,
  118. 0555,
  119. xpc_sys_xpc_hb_dir
  120. },
  121. {
  122. 2,
  123. "disengage_request_timelimit",
  124. &xpc_disengage_request_timelimit,
  125. sizeof(int),
  126. 0644,
  127. NULL,
  128. &proc_dointvec_minmax,
  129. &sysctl_intvec,
  130. NULL,
  131. &xpc_disengage_request_min_timelimit,
  132. &xpc_disengage_request_max_timelimit
  133. },
  134. {0}
  135. };
  136. static ctl_table xpc_sys_dir[] = {
  137. {
  138. 1,
  139. "xpc",
  140. NULL,
  141. 0,
  142. 0555,
  143. xpc_sys_xpc_dir
  144. },
  145. {0}
  146. };
  147. static struct ctl_table_header *xpc_sysctl;
  148. /* #of IRQs received */
  149. static atomic_t xpc_act_IRQ_rcvd;
  150. /* IRQ handler notifies this wait queue on receipt of an IRQ */
  151. static DECLARE_WAIT_QUEUE_HEAD(xpc_act_IRQ_wq);
  152. static unsigned long xpc_hb_check_timeout;
  153. /* notification that the xpc_hb_checker thread has exited */
  154. static DECLARE_MUTEX_LOCKED(xpc_hb_checker_exited);
  155. /* notification that the xpc_discovery thread has exited */
  156. static DECLARE_MUTEX_LOCKED(xpc_discovery_exited);
  157. static struct timer_list xpc_hb_timer;
  158. static void xpc_kthread_waitmsgs(struct xpc_partition *, struct xpc_channel *);
  159. static int xpc_system_reboot(struct notifier_block *, unsigned long, void *);
  160. static struct notifier_block xpc_reboot_notifier = {
  161. .notifier_call = xpc_system_reboot,
  162. };
  163. static int xpc_system_die(struct notifier_block *, unsigned long, void *);
  164. static struct notifier_block xpc_die_notifier = {
  165. .notifier_call = xpc_system_die,
  166. };
  167. /*
  168. * Timer function to enforce the timelimit on the partition disengage request.
  169. */
  170. static void
  171. xpc_timeout_partition_disengage_request(unsigned long data)
  172. {
  173. struct xpc_partition *part = (struct xpc_partition *) data;
  174. DBUG_ON(jiffies < part->disengage_request_timeout);
  175. (void) xpc_partition_disengaged(part);
  176. DBUG_ON(part->disengage_request_timeout != 0);
  177. DBUG_ON(xpc_partition_engaged(1UL << XPC_PARTID(part)) != 0);
  178. }
  179. /*
  180. * Notify the heartbeat check thread that an IRQ has been received.
  181. */
  182. static irqreturn_t
  183. xpc_act_IRQ_handler(int irq, void *dev_id, struct pt_regs *regs)
  184. {
  185. atomic_inc(&xpc_act_IRQ_rcvd);
  186. wake_up_interruptible(&xpc_act_IRQ_wq);
  187. return IRQ_HANDLED;
  188. }
  189. /*
  190. * Timer to produce the heartbeat. The timer structures function is
  191. * already set when this is initially called. A tunable is used to
  192. * specify when the next timeout should occur.
  193. */
  194. static void
  195. xpc_hb_beater(unsigned long dummy)
  196. {
  197. xpc_vars->heartbeat++;
  198. if (jiffies >= xpc_hb_check_timeout) {
  199. wake_up_interruptible(&xpc_act_IRQ_wq);
  200. }
  201. xpc_hb_timer.expires = jiffies + (xpc_hb_interval * HZ);
  202. add_timer(&xpc_hb_timer);
  203. }
  204. /*
  205. * This thread is responsible for nearly all of the partition
  206. * activation/deactivation.
  207. */
  208. static int
  209. xpc_hb_checker(void *ignore)
  210. {
  211. int last_IRQ_count = 0;
  212. int new_IRQ_count;
  213. int force_IRQ=0;
  214. /* this thread was marked active by xpc_hb_init() */
  215. daemonize(XPC_HB_CHECK_THREAD_NAME);
  216. set_cpus_allowed(current, cpumask_of_cpu(XPC_HB_CHECK_CPU));
  217. xpc_hb_check_timeout = jiffies + (xpc_hb_check_interval * HZ);
  218. while (!(volatile int) xpc_exiting) {
  219. dev_dbg(xpc_part, "woke up with %d ticks rem; %d IRQs have "
  220. "been received\n",
  221. (int) (xpc_hb_check_timeout - jiffies),
  222. atomic_read(&xpc_act_IRQ_rcvd) - last_IRQ_count);
  223. /* checking of remote heartbeats is skewed by IRQ handling */
  224. if (jiffies >= xpc_hb_check_timeout) {
  225. dev_dbg(xpc_part, "checking remote heartbeats\n");
  226. xpc_check_remote_hb();
  227. /*
  228. * We need to periodically recheck to ensure no
  229. * IPI/AMO pairs have been missed. That check
  230. * must always reset xpc_hb_check_timeout.
  231. */
  232. force_IRQ = 1;
  233. }
  234. /* check for outstanding IRQs */
  235. new_IRQ_count = atomic_read(&xpc_act_IRQ_rcvd);
  236. if (last_IRQ_count < new_IRQ_count || force_IRQ != 0) {
  237. force_IRQ = 0;
  238. dev_dbg(xpc_part, "found an IRQ to process; will be "
  239. "resetting xpc_hb_check_timeout\n");
  240. last_IRQ_count += xpc_identify_act_IRQ_sender();
  241. if (last_IRQ_count < new_IRQ_count) {
  242. /* retry once to help avoid missing AMO */
  243. (void) xpc_identify_act_IRQ_sender();
  244. }
  245. last_IRQ_count = new_IRQ_count;
  246. xpc_hb_check_timeout = jiffies +
  247. (xpc_hb_check_interval * HZ);
  248. }
  249. /* wait for IRQ or timeout */
  250. (void) wait_event_interruptible(xpc_act_IRQ_wq,
  251. (last_IRQ_count < atomic_read(&xpc_act_IRQ_rcvd) ||
  252. jiffies >= xpc_hb_check_timeout ||
  253. (volatile int) xpc_exiting));
  254. }
  255. dev_dbg(xpc_part, "heartbeat checker is exiting\n");
  256. /* mark this thread as having exited */
  257. up(&xpc_hb_checker_exited);
  258. return 0;
  259. }
  260. /*
  261. * This thread will attempt to discover other partitions to activate
  262. * based on info provided by SAL. This new thread is short lived and
  263. * will exit once discovery is complete.
  264. */
  265. static int
  266. xpc_initiate_discovery(void *ignore)
  267. {
  268. daemonize(XPC_DISCOVERY_THREAD_NAME);
  269. xpc_discovery();
  270. dev_dbg(xpc_part, "discovery thread is exiting\n");
  271. /* mark this thread as having exited */
  272. up(&xpc_discovery_exited);
  273. return 0;
  274. }
  275. /*
  276. * Establish first contact with the remote partititon. This involves pulling
  277. * the XPC per partition variables from the remote partition and waiting for
  278. * the remote partition to pull ours.
  279. */
  280. static enum xpc_retval
  281. xpc_make_first_contact(struct xpc_partition *part)
  282. {
  283. enum xpc_retval ret;
  284. while ((ret = xpc_pull_remote_vars_part(part)) != xpcSuccess) {
  285. if (ret != xpcRetry) {
  286. XPC_DEACTIVATE_PARTITION(part, ret);
  287. return ret;
  288. }
  289. dev_dbg(xpc_chan, "waiting to make first contact with "
  290. "partition %d\n", XPC_PARTID(part));
  291. /* wait a 1/4 of a second or so */
  292. (void) msleep_interruptible(250);
  293. if (part->act_state == XPC_P_DEACTIVATING) {
  294. return part->reason;
  295. }
  296. }
  297. return xpc_mark_partition_active(part);
  298. }
  299. /*
  300. * The first kthread assigned to a newly activated partition is the one
  301. * created by XPC HB with which it calls xpc_partition_up(). XPC hangs on to
  302. * that kthread until the partition is brought down, at which time that kthread
  303. * returns back to XPC HB. (The return of that kthread will signify to XPC HB
  304. * that XPC has dismantled all communication infrastructure for the associated
  305. * partition.) This kthread becomes the channel manager for that partition.
  306. *
  307. * Each active partition has a channel manager, who, besides connecting and
  308. * disconnecting channels, will ensure that each of the partition's connected
  309. * channels has the required number of assigned kthreads to get the work done.
  310. */
  311. static void
  312. xpc_channel_mgr(struct xpc_partition *part)
  313. {
  314. while (part->act_state != XPC_P_DEACTIVATING ||
  315. atomic_read(&part->nchannels_active) > 0 ||
  316. !xpc_partition_disengaged(part)) {
  317. xpc_process_channel_activity(part);
  318. /*
  319. * Wait until we've been requested to activate kthreads or
  320. * all of the channel's message queues have been torn down or
  321. * a signal is pending.
  322. *
  323. * The channel_mgr_requests is set to 1 after being awakened,
  324. * This is done to prevent the channel mgr from making one pass
  325. * through the loop for each request, since he will
  326. * be servicing all the requests in one pass. The reason it's
  327. * set to 1 instead of 0 is so that other kthreads will know
  328. * that the channel mgr is running and won't bother trying to
  329. * wake him up.
  330. */
  331. atomic_dec(&part->channel_mgr_requests);
  332. (void) wait_event_interruptible(part->channel_mgr_wq,
  333. (atomic_read(&part->channel_mgr_requests) > 0 ||
  334. (volatile u64) part->local_IPI_amo != 0 ||
  335. ((volatile u8) part->act_state ==
  336. XPC_P_DEACTIVATING &&
  337. atomic_read(&part->nchannels_active) == 0 &&
  338. xpc_partition_disengaged(part))));
  339. atomic_set(&part->channel_mgr_requests, 1);
  340. // >>> Does it need to wakeup periodically as well? In case we
  341. // >>> miscalculated the #of kthreads to wakeup or create?
  342. }
  343. }
  344. /*
  345. * When XPC HB determines that a partition has come up, it will create a new
  346. * kthread and that kthread will call this function to attempt to set up the
  347. * basic infrastructure used for Cross Partition Communication with the newly
  348. * upped partition.
  349. *
  350. * The kthread that was created by XPC HB and which setup the XPC
  351. * infrastructure will remain assigned to the partition until the partition
  352. * goes down. At which time the kthread will teardown the XPC infrastructure
  353. * and then exit.
  354. *
  355. * XPC HB will put the remote partition's XPC per partition specific variables
  356. * physical address into xpc_partitions[partid].remote_vars_part_pa prior to
  357. * calling xpc_partition_up().
  358. */
  359. static void
  360. xpc_partition_up(struct xpc_partition *part)
  361. {
  362. DBUG_ON(part->channels != NULL);
  363. dev_dbg(xpc_chan, "activating partition %d\n", XPC_PARTID(part));
  364. if (xpc_setup_infrastructure(part) != xpcSuccess) {
  365. return;
  366. }
  367. /*
  368. * The kthread that XPC HB called us with will become the
  369. * channel manager for this partition. It will not return
  370. * back to XPC HB until the partition's XPC infrastructure
  371. * has been dismantled.
  372. */
  373. (void) xpc_part_ref(part); /* this will always succeed */
  374. if (xpc_make_first_contact(part) == xpcSuccess) {
  375. xpc_channel_mgr(part);
  376. }
  377. xpc_part_deref(part);
  378. xpc_teardown_infrastructure(part);
  379. }
  380. static int
  381. xpc_activating(void *__partid)
  382. {
  383. partid_t partid = (u64) __partid;
  384. struct xpc_partition *part = &xpc_partitions[partid];
  385. unsigned long irq_flags;
  386. struct sched_param param = { sched_priority: MAX_RT_PRIO - 1 };
  387. int ret;
  388. DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS);
  389. spin_lock_irqsave(&part->act_lock, irq_flags);
  390. if (part->act_state == XPC_P_DEACTIVATING) {
  391. part->act_state = XPC_P_INACTIVE;
  392. spin_unlock_irqrestore(&part->act_lock, irq_flags);
  393. part->remote_rp_pa = 0;
  394. return 0;
  395. }
  396. /* indicate the thread is activating */
  397. DBUG_ON(part->act_state != XPC_P_ACTIVATION_REQ);
  398. part->act_state = XPC_P_ACTIVATING;
  399. XPC_SET_REASON(part, 0, 0);
  400. spin_unlock_irqrestore(&part->act_lock, irq_flags);
  401. dev_dbg(xpc_part, "bringing partition %d up\n", partid);
  402. daemonize("xpc%02d", partid);
  403. /*
  404. * This thread needs to run at a realtime priority to prevent a
  405. * significant performance degradation.
  406. */
  407. ret = sched_setscheduler(current, SCHED_FIFO, &param);
  408. if (ret != 0) {
  409. dev_warn(xpc_part, "unable to set pid %d to a realtime "
  410. "priority, ret=%d\n", current->pid, ret);
  411. }
  412. /* allow this thread and its children to run on any CPU */
  413. set_cpus_allowed(current, CPU_MASK_ALL);
  414. /*
  415. * Register the remote partition's AMOs with SAL so it can handle
  416. * and cleanup errors within that address range should the remote
  417. * partition go down. We don't unregister this range because it is
  418. * difficult to tell when outstanding writes to the remote partition
  419. * are finished and thus when it is safe to unregister. This should
  420. * not result in wasted space in the SAL xp_addr_region table because
  421. * we should get the same page for remote_amos_page_pa after module
  422. * reloads and system reboots.
  423. */
  424. if (sn_register_xp_addr_region(part->remote_amos_page_pa,
  425. PAGE_SIZE, 1) < 0) {
  426. dev_warn(xpc_part, "xpc_partition_up(%d) failed to register "
  427. "xp_addr region\n", partid);
  428. spin_lock_irqsave(&part->act_lock, irq_flags);
  429. part->act_state = XPC_P_INACTIVE;
  430. XPC_SET_REASON(part, xpcPhysAddrRegFailed, __LINE__);
  431. spin_unlock_irqrestore(&part->act_lock, irq_flags);
  432. part->remote_rp_pa = 0;
  433. return 0;
  434. }
  435. xpc_allow_hb(partid, xpc_vars);
  436. xpc_IPI_send_activated(part);
  437. /*
  438. * xpc_partition_up() holds this thread and marks this partition as
  439. * XPC_P_ACTIVE by calling xpc_hb_mark_active().
  440. */
  441. (void) xpc_partition_up(part);
  442. xpc_disallow_hb(partid, xpc_vars);
  443. xpc_mark_partition_inactive(part);
  444. if (part->reason == xpcReactivating) {
  445. /* interrupting ourselves results in activating partition */
  446. xpc_IPI_send_reactivate(part);
  447. }
  448. return 0;
  449. }
  450. void
  451. xpc_activate_partition(struct xpc_partition *part)
  452. {
  453. partid_t partid = XPC_PARTID(part);
  454. unsigned long irq_flags;
  455. pid_t pid;
  456. spin_lock_irqsave(&part->act_lock, irq_flags);
  457. pid = kernel_thread(xpc_activating, (void *) ((u64) partid), 0);
  458. DBUG_ON(part->act_state != XPC_P_INACTIVE);
  459. if (pid > 0) {
  460. part->act_state = XPC_P_ACTIVATION_REQ;
  461. XPC_SET_REASON(part, xpcCloneKThread, __LINE__);
  462. } else {
  463. XPC_SET_REASON(part, xpcCloneKThreadFailed, __LINE__);
  464. }
  465. spin_unlock_irqrestore(&part->act_lock, irq_flags);
  466. }
  467. /*
  468. * Handle the receipt of a SGI_XPC_NOTIFY IRQ by seeing whether the specified
  469. * partition actually sent it. Since SGI_XPC_NOTIFY IRQs may be shared by more
  470. * than one partition, we use an AMO_t structure per partition to indicate
  471. * whether a partition has sent an IPI or not. >>> If it has, then wake up the
  472. * associated kthread to handle it.
  473. *
  474. * All SGI_XPC_NOTIFY IRQs received by XPC are the result of IPIs sent by XPC
  475. * running on other partitions.
  476. *
  477. * Noteworthy Arguments:
  478. *
  479. * irq - Interrupt ReQuest number. NOT USED.
  480. *
  481. * dev_id - partid of IPI's potential sender.
  482. *
  483. * regs - processor's context before the processor entered
  484. * interrupt code. NOT USED.
  485. */
  486. irqreturn_t
  487. xpc_notify_IRQ_handler(int irq, void *dev_id, struct pt_regs *regs)
  488. {
  489. partid_t partid = (partid_t) (u64) dev_id;
  490. struct xpc_partition *part = &xpc_partitions[partid];
  491. DBUG_ON(partid <= 0 || partid >= XP_MAX_PARTITIONS);
  492. if (xpc_part_ref(part)) {
  493. xpc_check_for_channel_activity(part);
  494. xpc_part_deref(part);
  495. }
  496. return IRQ_HANDLED;
  497. }
  498. /*
  499. * Check to see if xpc_notify_IRQ_handler() dropped any IPIs on the floor
  500. * because the write to their associated IPI amo completed after the IRQ/IPI
  501. * was received.
  502. */
  503. void
  504. xpc_dropped_IPI_check(struct xpc_partition *part)
  505. {
  506. if (xpc_part_ref(part)) {
  507. xpc_check_for_channel_activity(part);
  508. part->dropped_IPI_timer.expires = jiffies +
  509. XPC_P_DROPPED_IPI_WAIT;
  510. add_timer(&part->dropped_IPI_timer);
  511. xpc_part_deref(part);
  512. }
  513. }
  514. void
  515. xpc_activate_kthreads(struct xpc_channel *ch, int needed)
  516. {
  517. int idle = atomic_read(&ch->kthreads_idle);
  518. int assigned = atomic_read(&ch->kthreads_assigned);
  519. int wakeup;
  520. DBUG_ON(needed <= 0);
  521. if (idle > 0) {
  522. wakeup = (needed > idle) ? idle : needed;
  523. needed -= wakeup;
  524. dev_dbg(xpc_chan, "wakeup %d idle kthreads, partid=%d, "
  525. "channel=%d\n", wakeup, ch->partid, ch->number);
  526. /* only wakeup the requested number of kthreads */
  527. wake_up_nr(&ch->idle_wq, wakeup);
  528. }
  529. if (needed <= 0) {
  530. return;
  531. }
  532. if (needed + assigned > ch->kthreads_assigned_limit) {
  533. needed = ch->kthreads_assigned_limit - assigned;
  534. // >>>should never be less than 0
  535. if (needed <= 0) {
  536. return;
  537. }
  538. }
  539. dev_dbg(xpc_chan, "create %d new kthreads, partid=%d, channel=%d\n",
  540. needed, ch->partid, ch->number);
  541. xpc_create_kthreads(ch, needed);
  542. }
  543. /*
  544. * This function is where XPC's kthreads wait for messages to deliver.
  545. */
  546. static void
  547. xpc_kthread_waitmsgs(struct xpc_partition *part, struct xpc_channel *ch)
  548. {
  549. do {
  550. /* deliver messages to their intended recipients */
  551. while ((volatile s64) ch->w_local_GP.get <
  552. (volatile s64) ch->w_remote_GP.put &&
  553. !((volatile u32) ch->flags &
  554. XPC_C_DISCONNECTING)) {
  555. xpc_deliver_msg(ch);
  556. }
  557. if (atomic_inc_return(&ch->kthreads_idle) >
  558. ch->kthreads_idle_limit) {
  559. /* too many idle kthreads on this channel */
  560. atomic_dec(&ch->kthreads_idle);
  561. break;
  562. }
  563. dev_dbg(xpc_chan, "idle kthread calling "
  564. "wait_event_interruptible_exclusive()\n");
  565. (void) wait_event_interruptible_exclusive(ch->idle_wq,
  566. ((volatile s64) ch->w_local_GP.get <
  567. (volatile s64) ch->w_remote_GP.put ||
  568. ((volatile u32) ch->flags &
  569. XPC_C_DISCONNECTING)));
  570. atomic_dec(&ch->kthreads_idle);
  571. } while (!((volatile u32) ch->flags & XPC_C_DISCONNECTING));
  572. }
  573. static int
  574. xpc_daemonize_kthread(void *args)
  575. {
  576. partid_t partid = XPC_UNPACK_ARG1(args);
  577. u16 ch_number = XPC_UNPACK_ARG2(args);
  578. struct xpc_partition *part = &xpc_partitions[partid];
  579. struct xpc_channel *ch;
  580. int n_needed;
  581. unsigned long irq_flags;
  582. daemonize("xpc%02dc%d", partid, ch_number);
  583. dev_dbg(xpc_chan, "kthread starting, partid=%d, channel=%d\n",
  584. partid, ch_number);
  585. ch = &part->channels[ch_number];
  586. if (!(ch->flags & XPC_C_DISCONNECTING)) {
  587. /* let registerer know that connection has been established */
  588. spin_lock_irqsave(&ch->lock, irq_flags);
  589. if (!(ch->flags & XPC_C_CONNECTCALLOUT)) {
  590. ch->flags |= XPC_C_CONNECTCALLOUT;
  591. spin_unlock_irqrestore(&ch->lock, irq_flags);
  592. xpc_connected_callout(ch);
  593. /*
  594. * It is possible that while the callout was being
  595. * made that the remote partition sent some messages.
  596. * If that is the case, we may need to activate
  597. * additional kthreads to help deliver them. We only
  598. * need one less than total #of messages to deliver.
  599. */
  600. n_needed = ch->w_remote_GP.put - ch->w_local_GP.get - 1;
  601. if (n_needed > 0 &&
  602. !(ch->flags & XPC_C_DISCONNECTING)) {
  603. xpc_activate_kthreads(ch, n_needed);
  604. }
  605. } else {
  606. spin_unlock_irqrestore(&ch->lock, irq_flags);
  607. }
  608. xpc_kthread_waitmsgs(part, ch);
  609. }
  610. if (atomic_dec_return(&ch->kthreads_assigned) == 0) {
  611. spin_lock_irqsave(&ch->lock, irq_flags);
  612. if ((ch->flags & XPC_C_CONNECTCALLOUT) &&
  613. !(ch->flags & XPC_C_DISCONNECTCALLOUT)) {
  614. ch->flags |= XPC_C_DISCONNECTCALLOUT;
  615. spin_unlock_irqrestore(&ch->lock, irq_flags);
  616. xpc_disconnecting_callout(ch);
  617. } else {
  618. spin_unlock_irqrestore(&ch->lock, irq_flags);
  619. }
  620. if (atomic_dec_return(&part->nchannels_engaged) == 0) {
  621. xpc_mark_partition_disengaged(part);
  622. xpc_IPI_send_disengage(part);
  623. }
  624. }
  625. xpc_msgqueue_deref(ch);
  626. dev_dbg(xpc_chan, "kthread exiting, partid=%d, channel=%d\n",
  627. partid, ch_number);
  628. xpc_part_deref(part);
  629. return 0;
  630. }
  631. /*
  632. * For each partition that XPC has established communications with, there is
  633. * a minimum of one kernel thread assigned to perform any operation that
  634. * may potentially sleep or block (basically the callouts to the asynchronous
  635. * functions registered via xpc_connect()).
  636. *
  637. * Additional kthreads are created and destroyed by XPC as the workload
  638. * demands.
  639. *
  640. * A kthread is assigned to one of the active channels that exists for a given
  641. * partition.
  642. */
  643. void
  644. xpc_create_kthreads(struct xpc_channel *ch, int needed)
  645. {
  646. unsigned long irq_flags;
  647. pid_t pid;
  648. u64 args = XPC_PACK_ARGS(ch->partid, ch->number);
  649. struct xpc_partition *part = &xpc_partitions[ch->partid];
  650. while (needed-- > 0) {
  651. /*
  652. * The following is done on behalf of the newly created
  653. * kthread. That kthread is responsible for doing the
  654. * counterpart to the following before it exits.
  655. */
  656. (void) xpc_part_ref(part);
  657. xpc_msgqueue_ref(ch);
  658. if (atomic_inc_return(&ch->kthreads_assigned) == 1 &&
  659. atomic_inc_return(&part->nchannels_engaged) == 1) {
  660. xpc_mark_partition_engaged(part);
  661. }
  662. pid = kernel_thread(xpc_daemonize_kthread, (void *) args, 0);
  663. if (pid < 0) {
  664. /* the fork failed */
  665. if (atomic_dec_return(&ch->kthreads_assigned) == 0 &&
  666. atomic_dec_return(&part->nchannels_engaged) == 0) {
  667. xpc_mark_partition_disengaged(part);
  668. xpc_IPI_send_disengage(part);
  669. }
  670. xpc_msgqueue_deref(ch);
  671. xpc_part_deref(part);
  672. if (atomic_read(&ch->kthreads_assigned) <
  673. ch->kthreads_idle_limit) {
  674. /*
  675. * Flag this as an error only if we have an
  676. * insufficient #of kthreads for the channel
  677. * to function.
  678. *
  679. * No xpc_msgqueue_ref() is needed here since
  680. * the channel mgr is doing this.
  681. */
  682. spin_lock_irqsave(&ch->lock, irq_flags);
  683. XPC_DISCONNECT_CHANNEL(ch, xpcLackOfResources,
  684. &irq_flags);
  685. spin_unlock_irqrestore(&ch->lock, irq_flags);
  686. }
  687. break;
  688. }
  689. ch->kthreads_created++; // >>> temporary debug only!!!
  690. }
  691. }
  692. void
  693. xpc_disconnect_wait(int ch_number)
  694. {
  695. unsigned long irq_flags;
  696. partid_t partid;
  697. struct xpc_partition *part;
  698. struct xpc_channel *ch;
  699. int wakeup_channel_mgr;
  700. /* now wait for all callouts to the caller's function to cease */
  701. for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
  702. part = &xpc_partitions[partid];
  703. if (!xpc_part_ref(part)) {
  704. continue;
  705. }
  706. ch = &part->channels[ch_number];
  707. if (!(ch->flags & XPC_C_WDISCONNECT)) {
  708. xpc_part_deref(part);
  709. continue;
  710. }
  711. (void) down(&ch->wdisconnect_sema);
  712. spin_lock_irqsave(&ch->lock, irq_flags);
  713. DBUG_ON(!(ch->flags & XPC_C_DISCONNECTED));
  714. wakeup_channel_mgr = 0;
  715. if (ch->delayed_IPI_flags) {
  716. if (part->act_state != XPC_P_DEACTIVATING) {
  717. spin_lock(&part->IPI_lock);
  718. XPC_SET_IPI_FLAGS(part->local_IPI_amo,
  719. ch->number, ch->delayed_IPI_flags);
  720. spin_unlock(&part->IPI_lock);
  721. wakeup_channel_mgr = 1;
  722. }
  723. ch->delayed_IPI_flags = 0;
  724. }
  725. ch->flags &= ~XPC_C_WDISCONNECT;
  726. spin_unlock_irqrestore(&ch->lock, irq_flags);
  727. if (wakeup_channel_mgr) {
  728. xpc_wakeup_channel_mgr(part);
  729. }
  730. xpc_part_deref(part);
  731. }
  732. }
  733. static void
  734. xpc_do_exit(enum xpc_retval reason)
  735. {
  736. partid_t partid;
  737. int active_part_count;
  738. struct xpc_partition *part;
  739. unsigned long printmsg_time;
  740. /* a 'rmmod XPC' and a 'reboot' cannot both end up here together */
  741. DBUG_ON(xpc_exiting == 1);
  742. /*
  743. * Let the heartbeat checker thread and the discovery thread
  744. * (if one is running) know that they should exit. Also wake up
  745. * the heartbeat checker thread in case it's sleeping.
  746. */
  747. xpc_exiting = 1;
  748. wake_up_interruptible(&xpc_act_IRQ_wq);
  749. /* ignore all incoming interrupts */
  750. free_irq(SGI_XPC_ACTIVATE, NULL);
  751. /* wait for the discovery thread to exit */
  752. down(&xpc_discovery_exited);
  753. /* wait for the heartbeat checker thread to exit */
  754. down(&xpc_hb_checker_exited);
  755. /* sleep for a 1/3 of a second or so */
  756. (void) msleep_interruptible(300);
  757. /* wait for all partitions to become inactive */
  758. printmsg_time = jiffies;
  759. do {
  760. active_part_count = 0;
  761. for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
  762. part = &xpc_partitions[partid];
  763. if (xpc_partition_disengaged(part) &&
  764. part->act_state == XPC_P_INACTIVE) {
  765. continue;
  766. }
  767. active_part_count++;
  768. XPC_DEACTIVATE_PARTITION(part, reason);
  769. }
  770. if (active_part_count == 0) {
  771. break;
  772. }
  773. if (jiffies >= printmsg_time) {
  774. dev_info(xpc_part, "waiting for partitions to "
  775. "deactivate/disengage, active count=%d, remote "
  776. "engaged=0x%lx\n", active_part_count,
  777. xpc_partition_engaged(1UL << partid));
  778. printmsg_time = jiffies +
  779. (XPC_DISENGAGE_PRINTMSG_INTERVAL * HZ);
  780. }
  781. /* sleep for a 1/3 of a second or so */
  782. (void) msleep_interruptible(300);
  783. } while (1);
  784. DBUG_ON(xpc_partition_engaged(-1UL));
  785. /* indicate to others that our reserved page is uninitialized */
  786. xpc_rsvd_page->vars_pa = 0;
  787. /* now it's time to eliminate our heartbeat */
  788. del_timer_sync(&xpc_hb_timer);
  789. DBUG_ON(xpc_vars->heartbeating_to_mask != 0);
  790. /* take ourselves off of the reboot_notifier_list */
  791. (void) unregister_reboot_notifier(&xpc_reboot_notifier);
  792. /* take ourselves off of the die_notifier list */
  793. (void) unregister_die_notifier(&xpc_die_notifier);
  794. /* close down protections for IPI operations */
  795. xpc_restrict_IPI_ops();
  796. /* clear the interface to XPC's functions */
  797. xpc_clear_interface();
  798. if (xpc_sysctl) {
  799. unregister_sysctl_table(xpc_sysctl);
  800. }
  801. }
  802. /*
  803. * Called when the system is about to be either restarted or halted.
  804. */
  805. static void
  806. xpc_die_disengage(void)
  807. {
  808. struct xpc_partition *part;
  809. partid_t partid;
  810. unsigned long engaged;
  811. long time, print_time, disengage_request_timeout;
  812. /* keep xpc_hb_checker thread from doing anything (just in case) */
  813. xpc_exiting = 1;
  814. xpc_vars->heartbeating_to_mask = 0; /* indicate we're deactivated */
  815. for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
  816. part = &xpc_partitions[partid];
  817. if (!XPC_SUPPORTS_DISENGAGE_REQUEST(part->
  818. remote_vars_version)) {
  819. /* just in case it was left set by an earlier XPC */
  820. xpc_clear_partition_engaged(1UL << partid);
  821. continue;
  822. }
  823. if (xpc_partition_engaged(1UL << partid) ||
  824. part->act_state != XPC_P_INACTIVE) {
  825. xpc_request_partition_disengage(part);
  826. xpc_mark_partition_disengaged(part);
  827. xpc_IPI_send_disengage(part);
  828. }
  829. }
  830. print_time = rtc_time();
  831. disengage_request_timeout = print_time +
  832. (xpc_disengage_request_timelimit * sn_rtc_cycles_per_second);
  833. /* wait for all other partitions to disengage from us */
  834. while ((engaged = xpc_partition_engaged(-1UL)) &&
  835. (time = rtc_time()) < disengage_request_timeout) {
  836. if (time >= print_time) {
  837. dev_info(xpc_part, "waiting for remote partitions to "
  838. "disengage, engaged=0x%lx\n", engaged);
  839. print_time = time + (XPC_DISENGAGE_PRINTMSG_INTERVAL *
  840. sn_rtc_cycles_per_second);
  841. }
  842. }
  843. dev_info(xpc_part, "finished waiting for remote partitions to "
  844. "disengage, engaged=0x%lx\n", engaged);
  845. }
  846. /*
  847. * This function is called when the system is being rebooted.
  848. */
  849. static int
  850. xpc_system_reboot(struct notifier_block *nb, unsigned long event, void *unused)
  851. {
  852. enum xpc_retval reason;
  853. switch (event) {
  854. case SYS_RESTART:
  855. reason = xpcSystemReboot;
  856. break;
  857. case SYS_HALT:
  858. reason = xpcSystemHalt;
  859. break;
  860. case SYS_POWER_OFF:
  861. reason = xpcSystemPoweroff;
  862. break;
  863. default:
  864. reason = xpcSystemGoingDown;
  865. }
  866. xpc_do_exit(reason);
  867. return NOTIFY_DONE;
  868. }
  869. /*
  870. * This function is called when the system is being rebooted.
  871. */
  872. static int
  873. xpc_system_die(struct notifier_block *nb, unsigned long event, void *unused)
  874. {
  875. switch (event) {
  876. case DIE_MACHINE_RESTART:
  877. case DIE_MACHINE_HALT:
  878. xpc_die_disengage();
  879. break;
  880. case DIE_MCA_MONARCH_ENTER:
  881. case DIE_INIT_MONARCH_ENTER:
  882. xpc_vars->heartbeat++;
  883. xpc_vars->heartbeat_offline = 1;
  884. break;
  885. case DIE_MCA_MONARCH_LEAVE:
  886. case DIE_INIT_MONARCH_LEAVE:
  887. xpc_vars->heartbeat++;
  888. xpc_vars->heartbeat_offline = 0;
  889. break;
  890. }
  891. return NOTIFY_DONE;
  892. }
  893. int __init
  894. xpc_init(void)
  895. {
  896. int ret;
  897. partid_t partid;
  898. struct xpc_partition *part;
  899. pid_t pid;
  900. if (!ia64_platform_is("sn2")) {
  901. return -ENODEV;
  902. }
  903. /*
  904. * xpc_remote_copy_buffer is used as a temporary buffer for bte_copy'ng
  905. * various portions of a partition's reserved page. Its size is based
  906. * on the size of the reserved page header and part_nasids mask. So we
  907. * need to ensure that the other items will fit as well.
  908. */
  909. if (XPC_RP_VARS_SIZE > XPC_RP_HEADER_SIZE + XP_NASID_MASK_BYTES) {
  910. dev_err(xpc_part, "xpc_remote_copy_buffer is not big enough\n");
  911. return -EPERM;
  912. }
  913. DBUG_ON((u64) xpc_remote_copy_buffer !=
  914. L1_CACHE_ALIGN((u64) xpc_remote_copy_buffer));
  915. snprintf(xpc_part->bus_id, BUS_ID_SIZE, "part");
  916. snprintf(xpc_chan->bus_id, BUS_ID_SIZE, "chan");
  917. xpc_sysctl = register_sysctl_table(xpc_sys_dir, 1);
  918. /*
  919. * The first few fields of each entry of xpc_partitions[] need to
  920. * be initialized now so that calls to xpc_connect() and
  921. * xpc_disconnect() can be made prior to the activation of any remote
  922. * partition. NOTE THAT NONE OF THE OTHER FIELDS BELONGING TO THESE
  923. * ENTRIES ARE MEANINGFUL UNTIL AFTER AN ENTRY'S CORRESPONDING
  924. * PARTITION HAS BEEN ACTIVATED.
  925. */
  926. for (partid = 1; partid < XP_MAX_PARTITIONS; partid++) {
  927. part = &xpc_partitions[partid];
  928. DBUG_ON((u64) part != L1_CACHE_ALIGN((u64) part));
  929. part->act_IRQ_rcvd = 0;
  930. spin_lock_init(&part->act_lock);
  931. part->act_state = XPC_P_INACTIVE;
  932. XPC_SET_REASON(part, 0, 0);
  933. init_timer(&part->disengage_request_timer);
  934. part->disengage_request_timer.function =
  935. xpc_timeout_partition_disengage_request;
  936. part->disengage_request_timer.data = (unsigned long) part;
  937. part->setup_state = XPC_P_UNSET;
  938. init_waitqueue_head(&part->teardown_wq);
  939. atomic_set(&part->references, 0);
  940. }
  941. /*
  942. * Open up protections for IPI operations (and AMO operations on
  943. * Shub 1.1 systems).
  944. */
  945. xpc_allow_IPI_ops();
  946. /*
  947. * Interrupts being processed will increment this atomic variable and
  948. * awaken the heartbeat thread which will process the interrupts.
  949. */
  950. atomic_set(&xpc_act_IRQ_rcvd, 0);
  951. /*
  952. * This is safe to do before the xpc_hb_checker thread has started
  953. * because the handler releases a wait queue. If an interrupt is
  954. * received before the thread is waiting, it will not go to sleep,
  955. * but rather immediately process the interrupt.
  956. */
  957. ret = request_irq(SGI_XPC_ACTIVATE, xpc_act_IRQ_handler, 0,
  958. "xpc hb", NULL);
  959. if (ret != 0) {
  960. dev_err(xpc_part, "can't register ACTIVATE IRQ handler, "
  961. "errno=%d\n", -ret);
  962. xpc_restrict_IPI_ops();
  963. if (xpc_sysctl) {
  964. unregister_sysctl_table(xpc_sysctl);
  965. }
  966. return -EBUSY;
  967. }
  968. /*
  969. * Fill the partition reserved page with the information needed by
  970. * other partitions to discover we are alive and establish initial
  971. * communications.
  972. */
  973. xpc_rsvd_page = xpc_rsvd_page_init();
  974. if (xpc_rsvd_page == NULL) {
  975. dev_err(xpc_part, "could not setup our reserved page\n");
  976. free_irq(SGI_XPC_ACTIVATE, NULL);
  977. xpc_restrict_IPI_ops();
  978. if (xpc_sysctl) {
  979. unregister_sysctl_table(xpc_sysctl);
  980. }
  981. return -EBUSY;
  982. }
  983. /* add ourselves to the reboot_notifier_list */
  984. ret = register_reboot_notifier(&xpc_reboot_notifier);
  985. if (ret != 0) {
  986. dev_warn(xpc_part, "can't register reboot notifier\n");
  987. }
  988. /* add ourselves to the die_notifier list (i.e., ia64die_chain) */
  989. ret = register_die_notifier(&xpc_die_notifier);
  990. if (ret != 0) {
  991. dev_warn(xpc_part, "can't register die notifier\n");
  992. }
  993. /*
  994. * Set the beating to other partitions into motion. This is
  995. * the last requirement for other partitions' discovery to
  996. * initiate communications with us.
  997. */
  998. init_timer(&xpc_hb_timer);
  999. xpc_hb_timer.function = xpc_hb_beater;
  1000. xpc_hb_beater(0);
  1001. /*
  1002. * The real work-horse behind xpc. This processes incoming
  1003. * interrupts and monitors remote heartbeats.
  1004. */
  1005. pid = kernel_thread(xpc_hb_checker, NULL, 0);
  1006. if (pid < 0) {
  1007. dev_err(xpc_part, "failed while forking hb check thread\n");
  1008. /* indicate to others that our reserved page is uninitialized */
  1009. xpc_rsvd_page->vars_pa = 0;
  1010. /* take ourselves off of the reboot_notifier_list */
  1011. (void) unregister_reboot_notifier(&xpc_reboot_notifier);
  1012. /* take ourselves off of the die_notifier list */
  1013. (void) unregister_die_notifier(&xpc_die_notifier);
  1014. del_timer_sync(&xpc_hb_timer);
  1015. free_irq(SGI_XPC_ACTIVATE, NULL);
  1016. xpc_restrict_IPI_ops();
  1017. if (xpc_sysctl) {
  1018. unregister_sysctl_table(xpc_sysctl);
  1019. }
  1020. return -EBUSY;
  1021. }
  1022. /*
  1023. * Startup a thread that will attempt to discover other partitions to
  1024. * activate based on info provided by SAL. This new thread is short
  1025. * lived and will exit once discovery is complete.
  1026. */
  1027. pid = kernel_thread(xpc_initiate_discovery, NULL, 0);
  1028. if (pid < 0) {
  1029. dev_err(xpc_part, "failed while forking discovery thread\n");
  1030. /* mark this new thread as a non-starter */
  1031. up(&xpc_discovery_exited);
  1032. xpc_do_exit(xpcUnloading);
  1033. return -EBUSY;
  1034. }
  1035. /* set the interface to point at XPC's functions */
  1036. xpc_set_interface(xpc_initiate_connect, xpc_initiate_disconnect,
  1037. xpc_initiate_allocate, xpc_initiate_send,
  1038. xpc_initiate_send_notify, xpc_initiate_received,
  1039. xpc_initiate_partid_to_nasids);
  1040. return 0;
  1041. }
  1042. module_init(xpc_init);
  1043. void __exit
  1044. xpc_exit(void)
  1045. {
  1046. xpc_do_exit(xpcUnloading);
  1047. }
  1048. module_exit(xpc_exit);
  1049. MODULE_AUTHOR("Silicon Graphics, Inc.");
  1050. MODULE_DESCRIPTION("Cross Partition Communication (XPC) support");
  1051. MODULE_LICENSE("GPL");
  1052. module_param(xpc_hb_interval, int, 0);
  1053. MODULE_PARM_DESC(xpc_hb_interval, "Number of seconds between "
  1054. "heartbeat increments.");
  1055. module_param(xpc_hb_check_interval, int, 0);
  1056. MODULE_PARM_DESC(xpc_hb_check_interval, "Number of seconds between "
  1057. "heartbeat checks.");
  1058. module_param(xpc_disengage_request_timelimit, int, 0);
  1059. MODULE_PARM_DESC(xpc_disengage_request_timelimit, "Number of seconds to wait "
  1060. "for disengage request to complete.");