eeh_driver.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. /*
  2. * PCI Error Recovery Driver for RPA-compliant PPC64 platform.
  3. * Copyright IBM Corp. 2004 2005
  4. * Copyright Linas Vepstas <linas@linas.org> 2004, 2005
  5. *
  6. * All rights reserved.
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License, or (at
  11. * your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  16. * NON INFRINGEMENT. See the GNU General Public License for more
  17. * details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  22. *
  23. * Send comments and feedback to Linas Vepstas <linas@austin.ibm.com>
  24. */
  25. #include <linux/delay.h>
  26. #include <linux/interrupt.h>
  27. #include <linux/irq.h>
  28. #include <linux/module.h>
  29. #include <linux/pci.h>
  30. #include <asm/eeh.h>
  31. #include <asm/eeh_event.h>
  32. #include <asm/ppc-pci.h>
  33. #include <asm/pci-bridge.h>
  34. #include <asm/prom.h>
  35. #include <asm/rtas.h>
  36. /**
  37. * eeh_pcid_name - Retrieve name of PCI device driver
  38. * @pdev: PCI device
  39. *
  40. * This routine is used to retrieve the name of PCI device driver
  41. * if that's valid.
  42. */
  43. static inline const char *eeh_pcid_name(struct pci_dev *pdev)
  44. {
  45. if (pdev && pdev->dev.driver)
  46. return pdev->dev.driver->name;
  47. return "";
  48. }
  49. /**
  50. * eeh_pcid_get - Get the PCI device driver
  51. * @pdev: PCI device
  52. *
  53. * The function is used to retrieve the PCI device driver for
  54. * the indicated PCI device. Besides, we will increase the reference
  55. * of the PCI device driver to prevent that being unloaded on
  56. * the fly. Otherwise, kernel crash would be seen.
  57. */
  58. static inline struct pci_driver *eeh_pcid_get(struct pci_dev *pdev)
  59. {
  60. if (!pdev || !pdev->driver)
  61. return NULL;
  62. if (!try_module_get(pdev->driver->driver.owner))
  63. return NULL;
  64. return pdev->driver;
  65. }
  66. /**
  67. * eeh_pcid_put - Dereference on the PCI device driver
  68. * @pdev: PCI device
  69. *
  70. * The function is called to do dereference on the PCI device
  71. * driver of the indicated PCI device.
  72. */
  73. static inline void eeh_pcid_put(struct pci_dev *pdev)
  74. {
  75. if (!pdev || !pdev->driver)
  76. return;
  77. module_put(pdev->driver->driver.owner);
  78. }
  79. #if 0
  80. static void print_device_node_tree(struct pci_dn *pdn, int dent)
  81. {
  82. int i;
  83. struct device_node *pc;
  84. if (!pdn)
  85. return;
  86. for (i = 0; i < dent; i++)
  87. printk(" ");
  88. printk("dn=%s mode=%x \tcfg_addr=%x pe_addr=%x \tfull=%s\n",
  89. pdn->node->name, pdn->eeh_mode, pdn->eeh_config_addr,
  90. pdn->eeh_pe_config_addr, pdn->node->full_name);
  91. dent += 3;
  92. pc = pdn->node->child;
  93. while (pc) {
  94. print_device_node_tree(PCI_DN(pc), dent);
  95. pc = pc->sibling;
  96. }
  97. }
  98. #endif
  99. /**
  100. * eeh_disable_irq - Disable interrupt for the recovering device
  101. * @dev: PCI device
  102. *
  103. * This routine must be called when reporting temporary or permanent
  104. * error to the particular PCI device to disable interrupt of that
  105. * device. If the device has enabled MSI or MSI-X interrupt, we needn't
  106. * do real work because EEH should freeze DMA transfers for those PCI
  107. * devices encountering EEH errors, which includes MSI or MSI-X.
  108. */
  109. static void eeh_disable_irq(struct pci_dev *dev)
  110. {
  111. struct eeh_dev *edev = pci_dev_to_eeh_dev(dev);
  112. /* Don't disable MSI and MSI-X interrupts. They are
  113. * effectively disabled by the DMA Stopped state
  114. * when an EEH error occurs.
  115. */
  116. if (dev->msi_enabled || dev->msix_enabled)
  117. return;
  118. if (!irq_has_action(dev->irq))
  119. return;
  120. edev->mode |= EEH_DEV_IRQ_DISABLED;
  121. disable_irq_nosync(dev->irq);
  122. }
  123. /**
  124. * eeh_enable_irq - Enable interrupt for the recovering device
  125. * @dev: PCI device
  126. *
  127. * This routine must be called to enable interrupt while failed
  128. * device could be resumed.
  129. */
  130. static void eeh_enable_irq(struct pci_dev *dev)
  131. {
  132. struct eeh_dev *edev = pci_dev_to_eeh_dev(dev);
  133. if ((edev->mode) & EEH_DEV_IRQ_DISABLED) {
  134. edev->mode &= ~EEH_DEV_IRQ_DISABLED;
  135. enable_irq(dev->irq);
  136. }
  137. }
  138. /**
  139. * eeh_report_error - Report pci error to each device driver
  140. * @data: eeh device
  141. * @userdata: return value
  142. *
  143. * Report an EEH error to each device driver, collect up and
  144. * merge the device driver responses. Cumulative response
  145. * passed back in "userdata".
  146. */
  147. static void *eeh_report_error(void *data, void *userdata)
  148. {
  149. struct eeh_dev *edev = (struct eeh_dev *)data;
  150. struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
  151. enum pci_ers_result rc, *res = userdata;
  152. struct pci_driver *driver;
  153. /* We might not have the associated PCI device,
  154. * then we should continue for next one.
  155. */
  156. if (!dev) return NULL;
  157. dev->error_state = pci_channel_io_frozen;
  158. driver = eeh_pcid_get(dev);
  159. if (!driver) return NULL;
  160. eeh_disable_irq(dev);
  161. if (!driver->err_handler ||
  162. !driver->err_handler->error_detected) {
  163. eeh_pcid_put(dev);
  164. return NULL;
  165. }
  166. rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen);
  167. /* A driver that needs a reset trumps all others */
  168. if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
  169. if (*res == PCI_ERS_RESULT_NONE) *res = rc;
  170. eeh_pcid_put(dev);
  171. return NULL;
  172. }
  173. /**
  174. * eeh_report_mmio_enabled - Tell drivers that MMIO has been enabled
  175. * @data: eeh device
  176. * @userdata: return value
  177. *
  178. * Tells each device driver that IO ports, MMIO and config space I/O
  179. * are now enabled. Collects up and merges the device driver responses.
  180. * Cumulative response passed back in "userdata".
  181. */
  182. static void *eeh_report_mmio_enabled(void *data, void *userdata)
  183. {
  184. struct eeh_dev *edev = (struct eeh_dev *)data;
  185. struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
  186. enum pci_ers_result rc, *res = userdata;
  187. struct pci_driver *driver;
  188. driver = eeh_pcid_get(dev);
  189. if (!driver) return NULL;
  190. if (!driver->err_handler ||
  191. !driver->err_handler->mmio_enabled) {
  192. eeh_pcid_put(dev);
  193. return NULL;
  194. }
  195. rc = driver->err_handler->mmio_enabled(dev);
  196. /* A driver that needs a reset trumps all others */
  197. if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
  198. if (*res == PCI_ERS_RESULT_NONE) *res = rc;
  199. eeh_pcid_put(dev);
  200. return NULL;
  201. }
  202. /**
  203. * eeh_report_reset - Tell device that slot has been reset
  204. * @data: eeh device
  205. * @userdata: return value
  206. *
  207. * This routine must be called while EEH tries to reset particular
  208. * PCI device so that the associated PCI device driver could take
  209. * some actions, usually to save data the driver needs so that the
  210. * driver can work again while the device is recovered.
  211. */
  212. static void *eeh_report_reset(void *data, void *userdata)
  213. {
  214. struct eeh_dev *edev = (struct eeh_dev *)data;
  215. struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
  216. enum pci_ers_result rc, *res = userdata;
  217. struct pci_driver *driver;
  218. if (!dev) return NULL;
  219. dev->error_state = pci_channel_io_normal;
  220. driver = eeh_pcid_get(dev);
  221. if (!driver) return NULL;
  222. eeh_enable_irq(dev);
  223. if (!driver->err_handler ||
  224. !driver->err_handler->slot_reset) {
  225. eeh_pcid_put(dev);
  226. return NULL;
  227. }
  228. rc = driver->err_handler->slot_reset(dev);
  229. if ((*res == PCI_ERS_RESULT_NONE) ||
  230. (*res == PCI_ERS_RESULT_RECOVERED)) *res = rc;
  231. if (*res == PCI_ERS_RESULT_DISCONNECT &&
  232. rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
  233. eeh_pcid_put(dev);
  234. return NULL;
  235. }
  236. /**
  237. * eeh_report_resume - Tell device to resume normal operations
  238. * @data: eeh device
  239. * @userdata: return value
  240. *
  241. * This routine must be called to notify the device driver that it
  242. * could resume so that the device driver can do some initialization
  243. * to make the recovered device work again.
  244. */
  245. static void *eeh_report_resume(void *data, void *userdata)
  246. {
  247. struct eeh_dev *edev = (struct eeh_dev *)data;
  248. struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
  249. struct pci_driver *driver;
  250. if (!dev) return NULL;
  251. dev->error_state = pci_channel_io_normal;
  252. driver = eeh_pcid_get(dev);
  253. if (!driver) return NULL;
  254. eeh_enable_irq(dev);
  255. if (!driver->err_handler ||
  256. !driver->err_handler->resume) {
  257. eeh_pcid_put(dev);
  258. return NULL;
  259. }
  260. driver->err_handler->resume(dev);
  261. eeh_pcid_put(dev);
  262. return NULL;
  263. }
  264. /**
  265. * eeh_report_failure - Tell device driver that device is dead.
  266. * @data: eeh device
  267. * @userdata: return value
  268. *
  269. * This informs the device driver that the device is permanently
  270. * dead, and that no further recovery attempts will be made on it.
  271. */
  272. static void *eeh_report_failure(void *data, void *userdata)
  273. {
  274. struct eeh_dev *edev = (struct eeh_dev *)data;
  275. struct pci_dev *dev = eeh_dev_to_pci_dev(edev);
  276. struct pci_driver *driver;
  277. if (!dev) return NULL;
  278. dev->error_state = pci_channel_io_perm_failure;
  279. driver = eeh_pcid_get(dev);
  280. if (!driver) return NULL;
  281. eeh_disable_irq(dev);
  282. if (!driver->err_handler ||
  283. !driver->err_handler->error_detected) {
  284. eeh_pcid_put(dev);
  285. return NULL;
  286. }
  287. driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
  288. eeh_pcid_put(dev);
  289. return NULL;
  290. }
  291. /**
  292. * eeh_reset_device - Perform actual reset of a pci slot
  293. * @pe: EEH PE
  294. * @bus: PCI bus corresponding to the isolcated slot
  295. *
  296. * This routine must be called to do reset on the indicated PE.
  297. * During the reset, udev might be invoked because those affected
  298. * PCI devices will be removed and then added.
  299. */
  300. static int eeh_reset_device(struct eeh_pe *pe, struct pci_bus *bus)
  301. {
  302. struct timeval tstamp;
  303. int cnt, rc;
  304. /* pcibios will clear the counter; save the value */
  305. cnt = pe->freeze_count;
  306. tstamp = pe->tstamp;
  307. /*
  308. * We don't remove the corresponding PE instances because
  309. * we need the information afterwords. The attached EEH
  310. * devices are expected to be attached soon when calling
  311. * into pcibios_add_pci_devices().
  312. */
  313. if (bus)
  314. __pcibios_remove_pci_devices(bus, 0);
  315. /* Reset the pci controller. (Asserts RST#; resets config space).
  316. * Reconfigure bridges and devices. Don't try to bring the system
  317. * up if the reset failed for some reason.
  318. */
  319. rc = eeh_reset_pe(pe);
  320. if (rc)
  321. return rc;
  322. /* Restore PE */
  323. eeh_ops->configure_bridge(pe);
  324. eeh_pe_restore_bars(pe);
  325. /* Give the system 5 seconds to finish running the user-space
  326. * hotplug shutdown scripts, e.g. ifdown for ethernet. Yes,
  327. * this is a hack, but if we don't do this, and try to bring
  328. * the device up before the scripts have taken it down,
  329. * potentially weird things happen.
  330. */
  331. if (bus) {
  332. ssleep(5);
  333. pcibios_add_pci_devices(bus);
  334. }
  335. pe->tstamp = tstamp;
  336. pe->freeze_count = cnt;
  337. return 0;
  338. }
  339. /* The longest amount of time to wait for a pci device
  340. * to come back on line, in seconds.
  341. */
  342. #define MAX_WAIT_FOR_RECOVERY 150
  343. static void eeh_handle_normal_event(struct eeh_pe *pe)
  344. {
  345. struct pci_bus *frozen_bus;
  346. int rc = 0;
  347. enum pci_ers_result result = PCI_ERS_RESULT_NONE;
  348. frozen_bus = eeh_pe_bus_get(pe);
  349. if (!frozen_bus) {
  350. pr_err("%s: Cannot find PCI bus for PHB#%d-PE#%x\n",
  351. __func__, pe->phb->global_number, pe->addr);
  352. return;
  353. }
  354. eeh_pe_update_time_stamp(pe);
  355. pe->freeze_count++;
  356. if (pe->freeze_count > EEH_MAX_ALLOWED_FREEZES)
  357. goto excess_failures;
  358. pr_warning("EEH: This PCI device has failed %d times in the last hour\n",
  359. pe->freeze_count);
  360. /* Walk the various device drivers attached to this slot through
  361. * a reset sequence, giving each an opportunity to do what it needs
  362. * to accomplish the reset. Each child gets a report of the
  363. * status ... if any child can't handle the reset, then the entire
  364. * slot is dlpar removed and added.
  365. */
  366. eeh_pe_dev_traverse(pe, eeh_report_error, &result);
  367. /* Get the current PCI slot state. This can take a long time,
  368. * sometimes over 3 seconds for certain systems.
  369. */
  370. rc = eeh_ops->wait_state(pe, MAX_WAIT_FOR_RECOVERY*1000);
  371. if (rc < 0 || rc == EEH_STATE_NOT_SUPPORT) {
  372. printk(KERN_WARNING "EEH: Permanent failure\n");
  373. goto hard_fail;
  374. }
  375. /* Since rtas may enable MMIO when posting the error log,
  376. * don't post the error log until after all dev drivers
  377. * have been informed.
  378. */
  379. eeh_slot_error_detail(pe, EEH_LOG_TEMP);
  380. /* If all device drivers were EEH-unaware, then shut
  381. * down all of the device drivers, and hope they
  382. * go down willingly, without panicing the system.
  383. */
  384. if (result == PCI_ERS_RESULT_NONE) {
  385. rc = eeh_reset_device(pe, frozen_bus);
  386. if (rc) {
  387. printk(KERN_WARNING "EEH: Unable to reset, rc=%d\n", rc);
  388. goto hard_fail;
  389. }
  390. }
  391. /* If all devices reported they can proceed, then re-enable MMIO */
  392. if (result == PCI_ERS_RESULT_CAN_RECOVER) {
  393. rc = eeh_pci_enable(pe, EEH_OPT_THAW_MMIO);
  394. if (rc < 0)
  395. goto hard_fail;
  396. if (rc) {
  397. result = PCI_ERS_RESULT_NEED_RESET;
  398. } else {
  399. result = PCI_ERS_RESULT_NONE;
  400. eeh_pe_dev_traverse(pe, eeh_report_mmio_enabled, &result);
  401. }
  402. }
  403. /* If all devices reported they can proceed, then re-enable DMA */
  404. if (result == PCI_ERS_RESULT_CAN_RECOVER) {
  405. rc = eeh_pci_enable(pe, EEH_OPT_THAW_DMA);
  406. if (rc < 0)
  407. goto hard_fail;
  408. if (rc)
  409. result = PCI_ERS_RESULT_NEED_RESET;
  410. else
  411. result = PCI_ERS_RESULT_RECOVERED;
  412. }
  413. /* If any device has a hard failure, then shut off everything. */
  414. if (result == PCI_ERS_RESULT_DISCONNECT) {
  415. printk(KERN_WARNING "EEH: Device driver gave up\n");
  416. goto hard_fail;
  417. }
  418. /* If any device called out for a reset, then reset the slot */
  419. if (result == PCI_ERS_RESULT_NEED_RESET) {
  420. rc = eeh_reset_device(pe, NULL);
  421. if (rc) {
  422. printk(KERN_WARNING "EEH: Cannot reset, rc=%d\n", rc);
  423. goto hard_fail;
  424. }
  425. result = PCI_ERS_RESULT_NONE;
  426. eeh_pe_dev_traverse(pe, eeh_report_reset, &result);
  427. }
  428. /* All devices should claim they have recovered by now. */
  429. if ((result != PCI_ERS_RESULT_RECOVERED) &&
  430. (result != PCI_ERS_RESULT_NONE)) {
  431. printk(KERN_WARNING "EEH: Not recovered\n");
  432. goto hard_fail;
  433. }
  434. /* Tell all device drivers that they can resume operations */
  435. eeh_pe_dev_traverse(pe, eeh_report_resume, NULL);
  436. return;
  437. excess_failures:
  438. /*
  439. * About 90% of all real-life EEH failures in the field
  440. * are due to poorly seated PCI cards. Only 10% or so are
  441. * due to actual, failed cards.
  442. */
  443. pr_err("EEH: PHB#%d-PE#%x has failed %d times in the\n"
  444. "last hour and has been permanently disabled.\n"
  445. "Please try reseating or replacing it.\n",
  446. pe->phb->global_number, pe->addr,
  447. pe->freeze_count);
  448. goto perm_error;
  449. hard_fail:
  450. pr_err("EEH: Unable to recover from failure from PHB#%d-PE#%x.\n"
  451. "Please try reseating or replacing it\n",
  452. pe->phb->global_number, pe->addr);
  453. perm_error:
  454. eeh_slot_error_detail(pe, EEH_LOG_PERM);
  455. /* Notify all devices that they're about to go down. */
  456. eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);
  457. /* Shut down the device drivers for good. */
  458. if (frozen_bus)
  459. pcibios_remove_pci_devices(frozen_bus);
  460. }
  461. static void eeh_handle_special_event(void)
  462. {
  463. struct eeh_pe *pe, *phb_pe;
  464. struct pci_bus *bus;
  465. struct pci_controller *hose, *tmp;
  466. unsigned long flags;
  467. int rc = 0;
  468. /*
  469. * The return value from next_error() has been classified as follows.
  470. * It might be good to enumerate them. However, next_error() is only
  471. * supported by PowerNV platform for now. So it would be fine to use
  472. * integer directly:
  473. *
  474. * 4 - Dead IOC 3 - Dead PHB
  475. * 2 - Fenced PHB 1 - Frozen PE
  476. * 0 - No error found
  477. *
  478. */
  479. rc = eeh_ops->next_error(&pe);
  480. if (rc <= 0)
  481. return;
  482. switch (rc) {
  483. case 4:
  484. /* Mark all PHBs in dead state */
  485. eeh_serialize_lock(&flags);
  486. list_for_each_entry_safe(hose, tmp,
  487. &hose_list, list_node) {
  488. phb_pe = eeh_phb_pe_get(hose);
  489. if (!phb_pe) continue;
  490. eeh_pe_state_mark(phb_pe,
  491. EEH_PE_ISOLATED | EEH_PE_PHB_DEAD);
  492. }
  493. eeh_serialize_unlock(flags);
  494. /* Purge all events */
  495. eeh_remove_event(NULL);
  496. break;
  497. case 3:
  498. case 2:
  499. case 1:
  500. /* Mark the PE in fenced state */
  501. eeh_serialize_lock(&flags);
  502. if (rc == 3)
  503. eeh_pe_state_mark(pe,
  504. EEH_PE_ISOLATED | EEH_PE_PHB_DEAD);
  505. else
  506. eeh_pe_state_mark(pe,
  507. EEH_PE_ISOLATED | EEH_PE_RECOVERING);
  508. eeh_serialize_unlock(flags);
  509. /* Purge all events of the PHB */
  510. eeh_remove_event(pe);
  511. break;
  512. default:
  513. pr_err("%s: Invalid value %d from next_error()\n",
  514. __func__, rc);
  515. return;
  516. }
  517. /*
  518. * For fenced PHB and frozen PE, it's handled as normal
  519. * event. We have to remove the affected PHBs for dead
  520. * PHB and IOC
  521. */
  522. if (rc == 2 || rc == 1)
  523. eeh_handle_normal_event(pe);
  524. else {
  525. list_for_each_entry_safe(hose, tmp,
  526. &hose_list, list_node) {
  527. phb_pe = eeh_phb_pe_get(hose);
  528. if (!phb_pe || !(phb_pe->state & EEH_PE_PHB_DEAD))
  529. continue;
  530. bus = eeh_pe_bus_get(phb_pe);
  531. /* Notify all devices that they're about to go down. */
  532. eeh_pe_dev_traverse(pe, eeh_report_failure, NULL);
  533. pcibios_remove_pci_devices(bus);
  534. }
  535. }
  536. }
  537. /**
  538. * eeh_handle_event - Reset a PCI device after hard lockup.
  539. * @pe: EEH PE
  540. *
  541. * While PHB detects address or data parity errors on particular PCI
  542. * slot, the associated PE will be frozen. Besides, DMA's occurring
  543. * to wild addresses (which usually happen due to bugs in device
  544. * drivers or in PCI adapter firmware) can cause EEH error. #SERR,
  545. * #PERR or other misc PCI-related errors also can trigger EEH errors.
  546. *
  547. * Recovery process consists of unplugging the device driver (which
  548. * generated hotplug events to userspace), then issuing a PCI #RST to
  549. * the device, then reconfiguring the PCI config space for all bridges
  550. * & devices under this slot, and then finally restarting the device
  551. * drivers (which cause a second set of hotplug events to go out to
  552. * userspace).
  553. */
  554. void eeh_handle_event(struct eeh_pe *pe)
  555. {
  556. if (pe)
  557. eeh_handle_normal_event(pe);
  558. else
  559. eeh_handle_special_event();
  560. }