cpci_hotplug_core.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722
  1. /*
  2. * CompactPCI Hot Plug Driver
  3. *
  4. * Copyright (C) 2002,2005 SOMA Networks, Inc.
  5. * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
  6. * Copyright (C) 2001 IBM Corp.
  7. *
  8. * All rights reserved.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or (at
  13. * your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
  18. * NON INFRINGEMENT. See the GNU General Public License for more
  19. * details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24. *
  25. * Send feedback to <scottm@somanetworks.com>
  26. */
  27. #include <linux/module.h>
  28. #include <linux/kernel.h>
  29. #include <linux/sched/signal.h>
  30. #include <linux/slab.h>
  31. #include <linux/pci.h>
  32. #include <linux/pci_hotplug.h>
  33. #include <linux/init.h>
  34. #include <linux/interrupt.h>
  35. #include <linux/atomic.h>
  36. #include <linux/delay.h>
  37. #include <linux/kthread.h>
  38. #include "cpci_hotplug.h"
  39. #define DRIVER_AUTHOR "Scott Murray <scottm@somanetworks.com>"
  40. #define DRIVER_DESC "CompactPCI Hot Plug Core"
  41. #define MY_NAME "cpci_hotplug"
  42. #define dbg(format, arg...) \
  43. do { \
  44. if (cpci_debug) \
  45. printk(KERN_DEBUG "%s: " format "\n", \
  46. MY_NAME, ## arg); \
  47. } while (0)
  48. #define err(format, arg...) printk(KERN_ERR "%s: " format "\n", MY_NAME, ## arg)
  49. #define info(format, arg...) printk(KERN_INFO "%s: " format "\n", MY_NAME, ## arg)
  50. #define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n", MY_NAME, ## arg)
  51. /* local variables */
  52. static DECLARE_RWSEM(list_rwsem);
  53. static LIST_HEAD(slot_list);
  54. static int slots;
  55. static atomic_t extracting;
  56. int cpci_debug;
  57. static struct cpci_hp_controller *controller;
  58. static struct task_struct *cpci_thread;
  59. static int thread_finished;
  60. static int enable_slot(struct hotplug_slot *slot);
  61. static int disable_slot(struct hotplug_slot *slot);
  62. static int set_attention_status(struct hotplug_slot *slot, u8 value);
  63. static int get_power_status(struct hotplug_slot *slot, u8 *value);
  64. static int get_attention_status(struct hotplug_slot *slot, u8 *value);
  65. static int get_adapter_status(struct hotplug_slot *slot, u8 *value);
  66. static int get_latch_status(struct hotplug_slot *slot, u8 *value);
  67. static struct hotplug_slot_ops cpci_hotplug_slot_ops = {
  68. .enable_slot = enable_slot,
  69. .disable_slot = disable_slot,
  70. .set_attention_status = set_attention_status,
  71. .get_power_status = get_power_status,
  72. .get_attention_status = get_attention_status,
  73. .get_adapter_status = get_adapter_status,
  74. .get_latch_status = get_latch_status,
  75. };
  76. static int
  77. update_latch_status(struct hotplug_slot *hotplug_slot, u8 value)
  78. {
  79. struct hotplug_slot_info info;
  80. memcpy(&info, hotplug_slot->info, sizeof(struct hotplug_slot_info));
  81. info.latch_status = value;
  82. return pci_hp_change_slot_info(hotplug_slot, &info);
  83. }
  84. static int
  85. update_adapter_status(struct hotplug_slot *hotplug_slot, u8 value)
  86. {
  87. struct hotplug_slot_info info;
  88. memcpy(&info, hotplug_slot->info, sizeof(struct hotplug_slot_info));
  89. info.adapter_status = value;
  90. return pci_hp_change_slot_info(hotplug_slot, &info);
  91. }
  92. static int
  93. enable_slot(struct hotplug_slot *hotplug_slot)
  94. {
  95. struct slot *slot = hotplug_slot->private;
  96. int retval = 0;
  97. dbg("%s - physical_slot = %s", __func__, slot_name(slot));
  98. if (controller->ops->set_power)
  99. retval = controller->ops->set_power(slot, 1);
  100. return retval;
  101. }
  102. static int
  103. disable_slot(struct hotplug_slot *hotplug_slot)
  104. {
  105. struct slot *slot = hotplug_slot->private;
  106. int retval = 0;
  107. dbg("%s - physical_slot = %s", __func__, slot_name(slot));
  108. down_write(&list_rwsem);
  109. /* Unconfigure device */
  110. dbg("%s - unconfiguring slot %s", __func__, slot_name(slot));
  111. retval = cpci_unconfigure_slot(slot);
  112. if (retval) {
  113. err("%s - could not unconfigure slot %s",
  114. __func__, slot_name(slot));
  115. goto disable_error;
  116. }
  117. dbg("%s - finished unconfiguring slot %s", __func__, slot_name(slot));
  118. /* Clear EXT (by setting it) */
  119. if (cpci_clear_ext(slot)) {
  120. err("%s - could not clear EXT for slot %s",
  121. __func__, slot_name(slot));
  122. retval = -ENODEV;
  123. goto disable_error;
  124. }
  125. cpci_led_on(slot);
  126. if (controller->ops->set_power) {
  127. retval = controller->ops->set_power(slot, 0);
  128. if (retval)
  129. goto disable_error;
  130. }
  131. if (update_adapter_status(slot->hotplug_slot, 0))
  132. warn("failure to update adapter file");
  133. if (slot->extracting) {
  134. slot->extracting = 0;
  135. atomic_dec(&extracting);
  136. }
  137. disable_error:
  138. up_write(&list_rwsem);
  139. return retval;
  140. }
  141. static u8
  142. cpci_get_power_status(struct slot *slot)
  143. {
  144. u8 power = 1;
  145. if (controller->ops->get_power)
  146. power = controller->ops->get_power(slot);
  147. return power;
  148. }
  149. static int
  150. get_power_status(struct hotplug_slot *hotplug_slot, u8 *value)
  151. {
  152. struct slot *slot = hotplug_slot->private;
  153. *value = cpci_get_power_status(slot);
  154. return 0;
  155. }
  156. static int
  157. get_attention_status(struct hotplug_slot *hotplug_slot, u8 *value)
  158. {
  159. struct slot *slot = hotplug_slot->private;
  160. *value = cpci_get_attention_status(slot);
  161. return 0;
  162. }
  163. static int
  164. set_attention_status(struct hotplug_slot *hotplug_slot, u8 status)
  165. {
  166. return cpci_set_attention_status(hotplug_slot->private, status);
  167. }
  168. static int
  169. get_adapter_status(struct hotplug_slot *hotplug_slot, u8 *value)
  170. {
  171. *value = hotplug_slot->info->adapter_status;
  172. return 0;
  173. }
  174. static int
  175. get_latch_status(struct hotplug_slot *hotplug_slot, u8 *value)
  176. {
  177. *value = hotplug_slot->info->latch_status;
  178. return 0;
  179. }
  180. static void release_slot(struct hotplug_slot *hotplug_slot)
  181. {
  182. struct slot *slot = hotplug_slot->private;
  183. kfree(slot->hotplug_slot->info);
  184. kfree(slot->hotplug_slot);
  185. pci_dev_put(slot->dev);
  186. kfree(slot);
  187. }
  188. #define SLOT_NAME_SIZE 6
  189. int
  190. cpci_hp_register_bus(struct pci_bus *bus, u8 first, u8 last)
  191. {
  192. struct slot *slot;
  193. struct hotplug_slot *hotplug_slot;
  194. struct hotplug_slot_info *info;
  195. char name[SLOT_NAME_SIZE];
  196. int status;
  197. int i;
  198. if (!(controller && bus))
  199. return -ENODEV;
  200. /*
  201. * Create a structure for each slot, and register that slot
  202. * with the pci_hotplug subsystem.
  203. */
  204. for (i = first; i <= last; ++i) {
  205. slot = kzalloc(sizeof(struct slot), GFP_KERNEL);
  206. if (!slot) {
  207. status = -ENOMEM;
  208. goto error;
  209. }
  210. hotplug_slot =
  211. kzalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
  212. if (!hotplug_slot) {
  213. status = -ENOMEM;
  214. goto error_slot;
  215. }
  216. slot->hotplug_slot = hotplug_slot;
  217. info = kzalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
  218. if (!info) {
  219. status = -ENOMEM;
  220. goto error_hpslot;
  221. }
  222. hotplug_slot->info = info;
  223. slot->bus = bus;
  224. slot->number = i;
  225. slot->devfn = PCI_DEVFN(i, 0);
  226. snprintf(name, SLOT_NAME_SIZE, "%02x:%02x", bus->number, i);
  227. hotplug_slot->private = slot;
  228. hotplug_slot->release = &release_slot;
  229. hotplug_slot->ops = &cpci_hotplug_slot_ops;
  230. /*
  231. * Initialize the slot info structure with some known
  232. * good values.
  233. */
  234. dbg("initializing slot %s", name);
  235. info->power_status = cpci_get_power_status(slot);
  236. info->attention_status = cpci_get_attention_status(slot);
  237. dbg("registering slot %s", name);
  238. status = pci_hp_register(slot->hotplug_slot, bus, i, name);
  239. if (status) {
  240. err("pci_hp_register failed with error %d", status);
  241. goto error_info;
  242. }
  243. dbg("slot registered with name: %s", slot_name(slot));
  244. /* Add slot to our internal list */
  245. down_write(&list_rwsem);
  246. list_add(&slot->slot_list, &slot_list);
  247. slots++;
  248. up_write(&list_rwsem);
  249. }
  250. return 0;
  251. error_info:
  252. kfree(info);
  253. error_hpslot:
  254. kfree(hotplug_slot);
  255. error_slot:
  256. kfree(slot);
  257. error:
  258. return status;
  259. }
  260. EXPORT_SYMBOL_GPL(cpci_hp_register_bus);
  261. int
  262. cpci_hp_unregister_bus(struct pci_bus *bus)
  263. {
  264. struct slot *slot;
  265. struct slot *tmp;
  266. int status = 0;
  267. down_write(&list_rwsem);
  268. if (!slots) {
  269. up_write(&list_rwsem);
  270. return -1;
  271. }
  272. list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) {
  273. if (slot->bus == bus) {
  274. list_del(&slot->slot_list);
  275. slots--;
  276. dbg("deregistering slot %s", slot_name(slot));
  277. status = pci_hp_deregister(slot->hotplug_slot);
  278. if (status) {
  279. err("pci_hp_deregister failed with error %d",
  280. status);
  281. break;
  282. }
  283. }
  284. }
  285. up_write(&list_rwsem);
  286. return status;
  287. }
  288. EXPORT_SYMBOL_GPL(cpci_hp_unregister_bus);
  289. /* This is the interrupt mode interrupt handler */
  290. static irqreturn_t
  291. cpci_hp_intr(int irq, void *data)
  292. {
  293. dbg("entered cpci_hp_intr");
  294. /* Check to see if it was our interrupt */
  295. if ((controller->irq_flags & IRQF_SHARED) &&
  296. !controller->ops->check_irq(controller->dev_id)) {
  297. dbg("exited cpci_hp_intr, not our interrupt");
  298. return IRQ_NONE;
  299. }
  300. /* Disable ENUM interrupt */
  301. controller->ops->disable_irq();
  302. /* Trigger processing by the event thread */
  303. wake_up_process(cpci_thread);
  304. return IRQ_HANDLED;
  305. }
  306. /*
  307. * According to PICMG 2.1 R2.0, section 6.3.2, upon
  308. * initialization, the system driver shall clear the
  309. * INS bits of the cold-inserted devices.
  310. */
  311. static int
  312. init_slots(int clear_ins)
  313. {
  314. struct slot *slot;
  315. struct pci_dev *dev;
  316. dbg("%s - enter", __func__);
  317. down_read(&list_rwsem);
  318. if (!slots) {
  319. up_read(&list_rwsem);
  320. return -1;
  321. }
  322. list_for_each_entry(slot, &slot_list, slot_list) {
  323. dbg("%s - looking at slot %s", __func__, slot_name(slot));
  324. if (clear_ins && cpci_check_and_clear_ins(slot))
  325. dbg("%s - cleared INS for slot %s",
  326. __func__, slot_name(slot));
  327. dev = pci_get_slot(slot->bus, PCI_DEVFN(slot->number, 0));
  328. if (dev) {
  329. if (update_adapter_status(slot->hotplug_slot, 1))
  330. warn("failure to update adapter file");
  331. if (update_latch_status(slot->hotplug_slot, 1))
  332. warn("failure to update latch file");
  333. slot->dev = dev;
  334. }
  335. }
  336. up_read(&list_rwsem);
  337. dbg("%s - exit", __func__);
  338. return 0;
  339. }
  340. static int
  341. check_slots(void)
  342. {
  343. struct slot *slot;
  344. int extracted;
  345. int inserted;
  346. u16 hs_csr;
  347. down_read(&list_rwsem);
  348. if (!slots) {
  349. up_read(&list_rwsem);
  350. err("no slots registered, shutting down");
  351. return -1;
  352. }
  353. extracted = inserted = 0;
  354. list_for_each_entry(slot, &slot_list, slot_list) {
  355. dbg("%s - looking at slot %s", __func__, slot_name(slot));
  356. if (cpci_check_and_clear_ins(slot)) {
  357. /*
  358. * Some broken hardware (e.g. PLX 9054AB) asserts
  359. * ENUM# twice...
  360. */
  361. if (slot->dev) {
  362. warn("slot %s already inserted",
  363. slot_name(slot));
  364. inserted++;
  365. continue;
  366. }
  367. /* Process insertion */
  368. dbg("%s - slot %s inserted", __func__, slot_name(slot));
  369. /* GSM, debug */
  370. hs_csr = cpci_get_hs_csr(slot);
  371. dbg("%s - slot %s HS_CSR (1) = %04x",
  372. __func__, slot_name(slot), hs_csr);
  373. /* Configure device */
  374. dbg("%s - configuring slot %s",
  375. __func__, slot_name(slot));
  376. if (cpci_configure_slot(slot)) {
  377. err("%s - could not configure slot %s",
  378. __func__, slot_name(slot));
  379. continue;
  380. }
  381. dbg("%s - finished configuring slot %s",
  382. __func__, slot_name(slot));
  383. /* GSM, debug */
  384. hs_csr = cpci_get_hs_csr(slot);
  385. dbg("%s - slot %s HS_CSR (2) = %04x",
  386. __func__, slot_name(slot), hs_csr);
  387. if (update_latch_status(slot->hotplug_slot, 1))
  388. warn("failure to update latch file");
  389. if (update_adapter_status(slot->hotplug_slot, 1))
  390. warn("failure to update adapter file");
  391. cpci_led_off(slot);
  392. /* GSM, debug */
  393. hs_csr = cpci_get_hs_csr(slot);
  394. dbg("%s - slot %s HS_CSR (3) = %04x",
  395. __func__, slot_name(slot), hs_csr);
  396. inserted++;
  397. } else if (cpci_check_ext(slot)) {
  398. /* Process extraction request */
  399. dbg("%s - slot %s extracted",
  400. __func__, slot_name(slot));
  401. /* GSM, debug */
  402. hs_csr = cpci_get_hs_csr(slot);
  403. dbg("%s - slot %s HS_CSR = %04x",
  404. __func__, slot_name(slot), hs_csr);
  405. if (!slot->extracting) {
  406. if (update_latch_status(slot->hotplug_slot, 0))
  407. warn("failure to update latch file");
  408. slot->extracting = 1;
  409. atomic_inc(&extracting);
  410. }
  411. extracted++;
  412. } else if (slot->extracting) {
  413. hs_csr = cpci_get_hs_csr(slot);
  414. if (hs_csr == 0xffff) {
  415. /*
  416. * Hmmm, we're likely hosed at this point, should we
  417. * bother trying to tell the driver or not?
  418. */
  419. err("card in slot %s was improperly removed",
  420. slot_name(slot));
  421. if (update_adapter_status(slot->hotplug_slot, 0))
  422. warn("failure to update adapter file");
  423. slot->extracting = 0;
  424. atomic_dec(&extracting);
  425. }
  426. }
  427. }
  428. up_read(&list_rwsem);
  429. dbg("inserted=%d, extracted=%d, extracting=%d",
  430. inserted, extracted, atomic_read(&extracting));
  431. if (inserted || extracted)
  432. return extracted;
  433. else if (!atomic_read(&extracting)) {
  434. err("cannot find ENUM# source, shutting down");
  435. return -1;
  436. }
  437. return 0;
  438. }
  439. /* This is the interrupt mode worker thread body */
  440. static int
  441. event_thread(void *data)
  442. {
  443. int rc;
  444. dbg("%s - event thread started", __func__);
  445. while (1) {
  446. dbg("event thread sleeping");
  447. set_current_state(TASK_INTERRUPTIBLE);
  448. schedule();
  449. if (kthread_should_stop())
  450. break;
  451. do {
  452. rc = check_slots();
  453. if (rc > 0) {
  454. /* Give userspace a chance to handle extraction */
  455. msleep(500);
  456. } else if (rc < 0) {
  457. dbg("%s - error checking slots", __func__);
  458. thread_finished = 1;
  459. goto out;
  460. }
  461. } while (atomic_read(&extracting) && !kthread_should_stop());
  462. if (kthread_should_stop())
  463. break;
  464. /* Re-enable ENUM# interrupt */
  465. dbg("%s - re-enabling irq", __func__);
  466. controller->ops->enable_irq();
  467. }
  468. out:
  469. return 0;
  470. }
  471. /* This is the polling mode worker thread body */
  472. static int
  473. poll_thread(void *data)
  474. {
  475. int rc;
  476. while (1) {
  477. if (kthread_should_stop() || signal_pending(current))
  478. break;
  479. if (controller->ops->query_enum()) {
  480. do {
  481. rc = check_slots();
  482. if (rc > 0) {
  483. /* Give userspace a chance to handle extraction */
  484. msleep(500);
  485. } else if (rc < 0) {
  486. dbg("%s - error checking slots", __func__);
  487. thread_finished = 1;
  488. goto out;
  489. }
  490. } while (atomic_read(&extracting) && !kthread_should_stop());
  491. }
  492. msleep(100);
  493. }
  494. out:
  495. return 0;
  496. }
  497. static int
  498. cpci_start_thread(void)
  499. {
  500. if (controller->irq)
  501. cpci_thread = kthread_run(event_thread, NULL, "cpci_hp_eventd");
  502. else
  503. cpci_thread = kthread_run(poll_thread, NULL, "cpci_hp_polld");
  504. if (IS_ERR(cpci_thread)) {
  505. err("Can't start up our thread");
  506. return PTR_ERR(cpci_thread);
  507. }
  508. thread_finished = 0;
  509. return 0;
  510. }
  511. static void
  512. cpci_stop_thread(void)
  513. {
  514. kthread_stop(cpci_thread);
  515. thread_finished = 1;
  516. }
  517. int
  518. cpci_hp_register_controller(struct cpci_hp_controller *new_controller)
  519. {
  520. int status = 0;
  521. if (controller)
  522. return -1;
  523. if (!(new_controller && new_controller->ops))
  524. return -EINVAL;
  525. if (new_controller->irq) {
  526. if (!(new_controller->ops->enable_irq &&
  527. new_controller->ops->disable_irq))
  528. status = -EINVAL;
  529. if (request_irq(new_controller->irq,
  530. cpci_hp_intr,
  531. new_controller->irq_flags,
  532. MY_NAME,
  533. new_controller->dev_id)) {
  534. err("Can't get irq %d for the hotplug cPCI controller",
  535. new_controller->irq);
  536. status = -ENODEV;
  537. }
  538. dbg("%s - acquired controller irq %d",
  539. __func__, new_controller->irq);
  540. }
  541. if (!status)
  542. controller = new_controller;
  543. return status;
  544. }
  545. EXPORT_SYMBOL_GPL(cpci_hp_register_controller);
  546. static void
  547. cleanup_slots(void)
  548. {
  549. struct slot *slot;
  550. struct slot *tmp;
  551. /*
  552. * Unregister all of our slots with the pci_hotplug subsystem,
  553. * and free up all memory that we had allocated.
  554. */
  555. down_write(&list_rwsem);
  556. if (!slots)
  557. goto cleanup_null;
  558. list_for_each_entry_safe(slot, tmp, &slot_list, slot_list) {
  559. list_del(&slot->slot_list);
  560. pci_hp_deregister(slot->hotplug_slot);
  561. }
  562. cleanup_null:
  563. up_write(&list_rwsem);
  564. return;
  565. }
  566. int
  567. cpci_hp_unregister_controller(struct cpci_hp_controller *old_controller)
  568. {
  569. int status = 0;
  570. if (controller) {
  571. if (!thread_finished)
  572. cpci_stop_thread();
  573. if (controller->irq)
  574. free_irq(controller->irq, controller->dev_id);
  575. controller = NULL;
  576. cleanup_slots();
  577. } else
  578. status = -ENODEV;
  579. return status;
  580. }
  581. EXPORT_SYMBOL_GPL(cpci_hp_unregister_controller);
  582. int
  583. cpci_hp_start(void)
  584. {
  585. static int first = 1;
  586. int status;
  587. dbg("%s - enter", __func__);
  588. if (!controller)
  589. return -ENODEV;
  590. down_read(&list_rwsem);
  591. if (list_empty(&slot_list)) {
  592. up_read(&list_rwsem);
  593. return -ENODEV;
  594. }
  595. up_read(&list_rwsem);
  596. status = init_slots(first);
  597. if (first)
  598. first = 0;
  599. if (status)
  600. return status;
  601. status = cpci_start_thread();
  602. if (status)
  603. return status;
  604. dbg("%s - thread started", __func__);
  605. if (controller->irq) {
  606. /* Start enum interrupt processing */
  607. dbg("%s - enabling irq", __func__);
  608. controller->ops->enable_irq();
  609. }
  610. dbg("%s - exit", __func__);
  611. return 0;
  612. }
  613. EXPORT_SYMBOL_GPL(cpci_hp_start);
  614. int
  615. cpci_hp_stop(void)
  616. {
  617. if (!controller)
  618. return -ENODEV;
  619. if (controller->irq) {
  620. /* Stop enum interrupt processing */
  621. dbg("%s - disabling irq", __func__);
  622. controller->ops->disable_irq();
  623. }
  624. cpci_stop_thread();
  625. return 0;
  626. }
  627. EXPORT_SYMBOL_GPL(cpci_hp_stop);
  628. int __init
  629. cpci_hotplug_init(int debug)
  630. {
  631. cpci_debug = debug;
  632. return 0;
  633. }