qla_dfs.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. /*
  2. * QLogic Fibre Channel HBA Driver
  3. * Copyright (c) 2003-2014 QLogic Corporation
  4. *
  5. * See LICENSE.qla2xxx for copyright and licensing details.
  6. */
  7. #include "qla_def.h"
  8. #include <linux/debugfs.h>
  9. #include <linux/seq_file.h>
  10. static struct dentry *qla2x00_dfs_root;
  11. static atomic_t qla2x00_dfs_root_count;
  12. static int
  13. qla2x00_dfs_tgt_sess_show(struct seq_file *s, void *unused)
  14. {
  15. scsi_qla_host_t *vha = s->private;
  16. struct qla_hw_data *ha = vha->hw;
  17. unsigned long flags;
  18. struct fc_port *sess = NULL;
  19. struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
  20. seq_printf(s, "%s\n", vha->host_str);
  21. if (tgt) {
  22. seq_puts(s, "Port ID Port Name Handle\n");
  23. spin_lock_irqsave(&ha->tgt.sess_lock, flags);
  24. list_for_each_entry(sess, &vha->vp_fcports, list)
  25. seq_printf(s, "%02x:%02x:%02x %8phC %d\n",
  26. sess->d_id.b.domain, sess->d_id.b.area,
  27. sess->d_id.b.al_pa, sess->port_name,
  28. sess->loop_id);
  29. spin_unlock_irqrestore(&ha->tgt.sess_lock, flags);
  30. }
  31. return 0;
  32. }
  33. static int
  34. qla2x00_dfs_tgt_sess_open(struct inode *inode, struct file *file)
  35. {
  36. scsi_qla_host_t *vha = inode->i_private;
  37. return single_open(file, qla2x00_dfs_tgt_sess_show, vha);
  38. }
  39. static const struct file_operations dfs_tgt_sess_ops = {
  40. .open = qla2x00_dfs_tgt_sess_open,
  41. .read = seq_read,
  42. .llseek = seq_lseek,
  43. .release = single_release,
  44. };
  45. static int
  46. qla2x00_dfs_tgt_port_database_show(struct seq_file *s, void *unused)
  47. {
  48. scsi_qla_host_t *vha = s->private;
  49. struct qla_hw_data *ha = vha->hw;
  50. struct gid_list_info *gid_list;
  51. dma_addr_t gid_list_dma;
  52. fc_port_t fc_port;
  53. char *id_iter;
  54. int rc, i;
  55. uint16_t entries, loop_id;
  56. struct qla_tgt *tgt = vha->vha_tgt.qla_tgt;
  57. seq_printf(s, "%s\n", vha->host_str);
  58. if (tgt) {
  59. gid_list = dma_alloc_coherent(&ha->pdev->dev,
  60. qla2x00_gid_list_size(ha),
  61. &gid_list_dma, GFP_KERNEL);
  62. if (!gid_list) {
  63. ql_dbg(ql_dbg_user, vha, 0x7018,
  64. "DMA allocation failed for %u\n",
  65. qla2x00_gid_list_size(ha));
  66. return 0;
  67. }
  68. rc = qla24xx_gidlist_wait(vha, gid_list, gid_list_dma,
  69. &entries);
  70. if (rc != QLA_SUCCESS)
  71. goto out_free_id_list;
  72. id_iter = (char *)gid_list;
  73. seq_puts(s, "Port Name Port ID Loop ID\n");
  74. for (i = 0; i < entries; i++) {
  75. struct gid_list_info *gid =
  76. (struct gid_list_info *)id_iter;
  77. loop_id = le16_to_cpu(gid->loop_id);
  78. memset(&fc_port, 0, sizeof(fc_port_t));
  79. fc_port.loop_id = loop_id;
  80. rc = qla24xx_gpdb_wait(vha, &fc_port, 0);
  81. seq_printf(s, "%8phC %02x%02x%02x %d\n",
  82. fc_port.port_name, fc_port.d_id.b.domain,
  83. fc_port.d_id.b.area, fc_port.d_id.b.al_pa,
  84. fc_port.loop_id);
  85. id_iter += ha->gid_list_info_size;
  86. }
  87. out_free_id_list:
  88. dma_free_coherent(&ha->pdev->dev, qla2x00_gid_list_size(ha),
  89. gid_list, gid_list_dma);
  90. }
  91. return 0;
  92. }
  93. static int
  94. qla2x00_dfs_tgt_port_database_open(struct inode *inode, struct file *file)
  95. {
  96. scsi_qla_host_t *vha = inode->i_private;
  97. return single_open(file, qla2x00_dfs_tgt_port_database_show, vha);
  98. }
  99. static const struct file_operations dfs_tgt_port_database_ops = {
  100. .open = qla2x00_dfs_tgt_port_database_open,
  101. .read = seq_read,
  102. .llseek = seq_lseek,
  103. .release = single_release,
  104. };
  105. static int
  106. qla_dfs_fw_resource_cnt_show(struct seq_file *s, void *unused)
  107. {
  108. struct scsi_qla_host *vha = s->private;
  109. uint16_t mb[MAX_IOCB_MB_REG];
  110. int rc;
  111. rc = qla24xx_res_count_wait(vha, mb, SIZEOF_IOCB_MB_REG);
  112. if (rc != QLA_SUCCESS) {
  113. seq_printf(s, "Mailbox Command failed %d, mb %#x", rc, mb[0]);
  114. } else {
  115. seq_puts(s, "FW Resource count\n\n");
  116. seq_printf(s, "Original TGT exchg count[%d]\n", mb[1]);
  117. seq_printf(s, "current TGT exchg count[%d]\n", mb[2]);
  118. seq_printf(s, "original Initiator Exchange count[%d]\n", mb[3]);
  119. seq_printf(s, "Current Initiator Exchange count[%d]\n", mb[6]);
  120. seq_printf(s, "Original IOCB count[%d]\n", mb[7]);
  121. seq_printf(s, "Current IOCB count[%d]\n", mb[10]);
  122. seq_printf(s, "MAX VP count[%d]\n", mb[11]);
  123. seq_printf(s, "MAX FCF count[%d]\n", mb[12]);
  124. seq_printf(s, "Current free pageable XCB buffer cnt[%d]\n",
  125. mb[20]);
  126. seq_printf(s, "Original Initiator fast XCB buffer cnt[%d]\n",
  127. mb[21]);
  128. seq_printf(s, "Current free Initiator fast XCB buffer cnt[%d]\n",
  129. mb[22]);
  130. seq_printf(s, "Original Target fast XCB buffer cnt[%d]\n",
  131. mb[23]);
  132. }
  133. return 0;
  134. }
  135. static int
  136. qla_dfs_fw_resource_cnt_open(struct inode *inode, struct file *file)
  137. {
  138. struct scsi_qla_host *vha = inode->i_private;
  139. return single_open(file, qla_dfs_fw_resource_cnt_show, vha);
  140. }
  141. static const struct file_operations dfs_fw_resource_cnt_ops = {
  142. .open = qla_dfs_fw_resource_cnt_open,
  143. .read = seq_read,
  144. .llseek = seq_lseek,
  145. .release = single_release,
  146. };
  147. static int
  148. qla_dfs_tgt_counters_show(struct seq_file *s, void *unused)
  149. {
  150. struct scsi_qla_host *vha = s->private;
  151. struct qla_qpair *qpair = vha->hw->base_qpair;
  152. uint64_t qla_core_sbt_cmd, core_qla_que_buf, qla_core_ret_ctio,
  153. core_qla_snd_status, qla_core_ret_sta_ctio, core_qla_free_cmd,
  154. num_q_full_sent, num_alloc_iocb_failed, num_term_xchg_sent;
  155. u16 i;
  156. qla_core_sbt_cmd = qpair->tgt_counters.qla_core_sbt_cmd;
  157. core_qla_que_buf = qpair->tgt_counters.core_qla_que_buf;
  158. qla_core_ret_ctio = qpair->tgt_counters.qla_core_ret_ctio;
  159. core_qla_snd_status = qpair->tgt_counters.core_qla_snd_status;
  160. qla_core_ret_sta_ctio = qpair->tgt_counters.qla_core_ret_sta_ctio;
  161. core_qla_free_cmd = qpair->tgt_counters.core_qla_free_cmd;
  162. num_q_full_sent = qpair->tgt_counters.num_q_full_sent;
  163. num_alloc_iocb_failed = qpair->tgt_counters.num_alloc_iocb_failed;
  164. num_term_xchg_sent = qpair->tgt_counters.num_term_xchg_sent;
  165. for (i = 0; i < vha->hw->max_qpairs; i++) {
  166. qpair = vha->hw->queue_pair_map[i];
  167. qla_core_sbt_cmd += qpair->tgt_counters.qla_core_sbt_cmd;
  168. core_qla_que_buf += qpair->tgt_counters.core_qla_que_buf;
  169. qla_core_ret_ctio += qpair->tgt_counters.qla_core_ret_ctio;
  170. core_qla_snd_status += qpair->tgt_counters.core_qla_snd_status;
  171. qla_core_ret_sta_ctio +=
  172. qpair->tgt_counters.qla_core_ret_sta_ctio;
  173. core_qla_free_cmd += qpair->tgt_counters.core_qla_free_cmd;
  174. num_q_full_sent += qpair->tgt_counters.num_q_full_sent;
  175. num_alloc_iocb_failed +=
  176. qpair->tgt_counters.num_alloc_iocb_failed;
  177. num_term_xchg_sent += qpair->tgt_counters.num_term_xchg_sent;
  178. }
  179. seq_puts(s, "Target Counters\n");
  180. seq_printf(s, "qla_core_sbt_cmd = %lld\n",
  181. qla_core_sbt_cmd);
  182. seq_printf(s, "qla_core_ret_sta_ctio = %lld\n",
  183. qla_core_ret_sta_ctio);
  184. seq_printf(s, "qla_core_ret_ctio = %lld\n",
  185. qla_core_ret_ctio);
  186. seq_printf(s, "core_qla_que_buf = %lld\n",
  187. core_qla_que_buf);
  188. seq_printf(s, "core_qla_snd_status = %lld\n",
  189. core_qla_snd_status);
  190. seq_printf(s, "core_qla_free_cmd = %lld\n",
  191. core_qla_free_cmd);
  192. seq_printf(s, "num alloc iocb failed = %lld\n",
  193. num_alloc_iocb_failed);
  194. seq_printf(s, "num term exchange sent = %lld\n",
  195. num_term_xchg_sent);
  196. seq_printf(s, "num Q full sent = %lld\n",
  197. num_q_full_sent);
  198. /* DIF stats */
  199. seq_printf(s, "DIF Inp Bytes = %lld\n",
  200. vha->qla_stats.qla_dif_stats.dif_input_bytes);
  201. seq_printf(s, "DIF Outp Bytes = %lld\n",
  202. vha->qla_stats.qla_dif_stats.dif_output_bytes);
  203. seq_printf(s, "DIF Inp Req = %lld\n",
  204. vha->qla_stats.qla_dif_stats.dif_input_requests);
  205. seq_printf(s, "DIF Outp Req = %lld\n",
  206. vha->qla_stats.qla_dif_stats.dif_output_requests);
  207. seq_printf(s, "DIF Guard err = %d\n",
  208. vha->qla_stats.qla_dif_stats.dif_guard_err);
  209. seq_printf(s, "DIF Ref tag err = %d\n",
  210. vha->qla_stats.qla_dif_stats.dif_ref_tag_err);
  211. seq_printf(s, "DIF App tag err = %d\n",
  212. vha->qla_stats.qla_dif_stats.dif_app_tag_err);
  213. return 0;
  214. }
  215. static int
  216. qla_dfs_tgt_counters_open(struct inode *inode, struct file *file)
  217. {
  218. struct scsi_qla_host *vha = inode->i_private;
  219. return single_open(file, qla_dfs_tgt_counters_show, vha);
  220. }
  221. static const struct file_operations dfs_tgt_counters_ops = {
  222. .open = qla_dfs_tgt_counters_open,
  223. .read = seq_read,
  224. .llseek = seq_lseek,
  225. .release = single_release,
  226. };
  227. static int
  228. qla2x00_dfs_fce_show(struct seq_file *s, void *unused)
  229. {
  230. scsi_qla_host_t *vha = s->private;
  231. uint32_t cnt;
  232. uint32_t *fce;
  233. uint64_t fce_start;
  234. struct qla_hw_data *ha = vha->hw;
  235. mutex_lock(&ha->fce_mutex);
  236. seq_puts(s, "FCE Trace Buffer\n");
  237. seq_printf(s, "In Pointer = %llx\n\n", (unsigned long long)ha->fce_wr);
  238. seq_printf(s, "Base = %llx\n\n", (unsigned long long) ha->fce_dma);
  239. seq_puts(s, "FCE Enable Registers\n");
  240. seq_printf(s, "%08x %08x %08x %08x %08x %08x\n",
  241. ha->fce_mb[0], ha->fce_mb[2], ha->fce_mb[3], ha->fce_mb[4],
  242. ha->fce_mb[5], ha->fce_mb[6]);
  243. fce = (uint32_t *) ha->fce;
  244. fce_start = (unsigned long long) ha->fce_dma;
  245. for (cnt = 0; cnt < fce_calc_size(ha->fce_bufs) / 4; cnt++) {
  246. if (cnt % 8 == 0)
  247. seq_printf(s, "\n%llx: ",
  248. (unsigned long long)((cnt * 4) + fce_start));
  249. else
  250. seq_putc(s, ' ');
  251. seq_printf(s, "%08x", *fce++);
  252. }
  253. seq_puts(s, "\nEnd\n");
  254. mutex_unlock(&ha->fce_mutex);
  255. return 0;
  256. }
  257. static int
  258. qla2x00_dfs_fce_open(struct inode *inode, struct file *file)
  259. {
  260. scsi_qla_host_t *vha = inode->i_private;
  261. struct qla_hw_data *ha = vha->hw;
  262. int rval;
  263. if (!ha->flags.fce_enabled)
  264. goto out;
  265. mutex_lock(&ha->fce_mutex);
  266. /* Pause tracing to flush FCE buffers. */
  267. rval = qla2x00_disable_fce_trace(vha, &ha->fce_wr, &ha->fce_rd);
  268. if (rval)
  269. ql_dbg(ql_dbg_user, vha, 0x705c,
  270. "DebugFS: Unable to disable FCE (%d).\n", rval);
  271. ha->flags.fce_enabled = 0;
  272. mutex_unlock(&ha->fce_mutex);
  273. out:
  274. return single_open(file, qla2x00_dfs_fce_show, vha);
  275. }
  276. static int
  277. qla2x00_dfs_fce_release(struct inode *inode, struct file *file)
  278. {
  279. scsi_qla_host_t *vha = inode->i_private;
  280. struct qla_hw_data *ha = vha->hw;
  281. int rval;
  282. if (ha->flags.fce_enabled)
  283. goto out;
  284. mutex_lock(&ha->fce_mutex);
  285. /* Re-enable FCE tracing. */
  286. ha->flags.fce_enabled = 1;
  287. memset(ha->fce, 0, fce_calc_size(ha->fce_bufs));
  288. rval = qla2x00_enable_fce_trace(vha, ha->fce_dma, ha->fce_bufs,
  289. ha->fce_mb, &ha->fce_bufs);
  290. if (rval) {
  291. ql_dbg(ql_dbg_user, vha, 0x700d,
  292. "DebugFS: Unable to reinitialize FCE (%d).\n", rval);
  293. ha->flags.fce_enabled = 0;
  294. }
  295. mutex_unlock(&ha->fce_mutex);
  296. out:
  297. return single_release(inode, file);
  298. }
  299. static const struct file_operations dfs_fce_ops = {
  300. .open = qla2x00_dfs_fce_open,
  301. .read = seq_read,
  302. .llseek = seq_lseek,
  303. .release = qla2x00_dfs_fce_release,
  304. };
  305. static int
  306. qla_dfs_naqp_show(struct seq_file *s, void *unused)
  307. {
  308. struct scsi_qla_host *vha = s->private;
  309. struct qla_hw_data *ha = vha->hw;
  310. seq_printf(s, "%d\n", ha->tgt.num_act_qpairs);
  311. return 0;
  312. }
  313. static int
  314. qla_dfs_naqp_open(struct inode *inode, struct file *file)
  315. {
  316. struct scsi_qla_host *vha = inode->i_private;
  317. return single_open(file, qla_dfs_naqp_show, vha);
  318. }
  319. static ssize_t
  320. qla_dfs_naqp_write(struct file *file, const char __user *buffer,
  321. size_t count, loff_t *pos)
  322. {
  323. struct seq_file *s = file->private_data;
  324. struct scsi_qla_host *vha = s->private;
  325. struct qla_hw_data *ha = vha->hw;
  326. char *buf;
  327. int rc = 0;
  328. unsigned long num_act_qp;
  329. if (!(IS_QLA27XX(ha) || IS_QLA83XX(ha))) {
  330. pr_err("host%ld: this adapter does not support Multi Q.",
  331. vha->host_no);
  332. return -EINVAL;
  333. }
  334. if (!vha->flags.qpairs_available) {
  335. pr_err("host%ld: Driver is not setup with Multi Q.",
  336. vha->host_no);
  337. return -EINVAL;
  338. }
  339. buf = memdup_user_nul(buffer, count);
  340. if (IS_ERR(buf)) {
  341. pr_err("host%ld: fail to copy user buffer.",
  342. vha->host_no);
  343. return PTR_ERR(buf);
  344. }
  345. num_act_qp = simple_strtoul(buf, NULL, 0);
  346. if (num_act_qp >= vha->hw->max_qpairs) {
  347. pr_err("User set invalid number of qpairs %lu. Max = %d",
  348. num_act_qp, vha->hw->max_qpairs);
  349. rc = -EINVAL;
  350. goto out_free;
  351. }
  352. if (num_act_qp != ha->tgt.num_act_qpairs) {
  353. ha->tgt.num_act_qpairs = num_act_qp;
  354. qlt_clr_qp_table(vha);
  355. }
  356. rc = count;
  357. out_free:
  358. kfree(buf);
  359. return rc;
  360. }
  361. static const struct file_operations dfs_naqp_ops = {
  362. .open = qla_dfs_naqp_open,
  363. .read = seq_read,
  364. .llseek = seq_lseek,
  365. .release = single_release,
  366. .write = qla_dfs_naqp_write,
  367. };
  368. int
  369. qla2x00_dfs_setup(scsi_qla_host_t *vha)
  370. {
  371. struct qla_hw_data *ha = vha->hw;
  372. if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha) &&
  373. !IS_QLA27XX(ha))
  374. goto out;
  375. if (!ha->fce)
  376. goto out;
  377. if (qla2x00_dfs_root)
  378. goto create_dir;
  379. atomic_set(&qla2x00_dfs_root_count, 0);
  380. qla2x00_dfs_root = debugfs_create_dir(QLA2XXX_DRIVER_NAME, NULL);
  381. if (!qla2x00_dfs_root) {
  382. ql_log(ql_log_warn, vha, 0x00f7,
  383. "Unable to create debugfs root directory.\n");
  384. goto out;
  385. }
  386. create_dir:
  387. if (ha->dfs_dir)
  388. goto create_nodes;
  389. mutex_init(&ha->fce_mutex);
  390. ha->dfs_dir = debugfs_create_dir(vha->host_str, qla2x00_dfs_root);
  391. if (!ha->dfs_dir) {
  392. ql_log(ql_log_warn, vha, 0x00f8,
  393. "Unable to create debugfs ha directory.\n");
  394. goto out;
  395. }
  396. atomic_inc(&qla2x00_dfs_root_count);
  397. create_nodes:
  398. ha->dfs_fw_resource_cnt = debugfs_create_file("fw_resource_count",
  399. S_IRUSR, ha->dfs_dir, vha, &dfs_fw_resource_cnt_ops);
  400. if (!ha->dfs_fw_resource_cnt) {
  401. ql_log(ql_log_warn, vha, 0x00fd,
  402. "Unable to create debugFS fw_resource_count node.\n");
  403. goto out;
  404. }
  405. ha->dfs_tgt_counters = debugfs_create_file("tgt_counters", S_IRUSR,
  406. ha->dfs_dir, vha, &dfs_tgt_counters_ops);
  407. if (!ha->dfs_tgt_counters) {
  408. ql_log(ql_log_warn, vha, 0xd301,
  409. "Unable to create debugFS tgt_counters node.\n");
  410. goto out;
  411. }
  412. ha->tgt.dfs_tgt_port_database = debugfs_create_file("tgt_port_database",
  413. S_IRUSR, ha->dfs_dir, vha, &dfs_tgt_port_database_ops);
  414. if (!ha->tgt.dfs_tgt_port_database) {
  415. ql_log(ql_log_warn, vha, 0xd03f,
  416. "Unable to create debugFS tgt_port_database node.\n");
  417. goto out;
  418. }
  419. ha->dfs_fce = debugfs_create_file("fce", S_IRUSR, ha->dfs_dir, vha,
  420. &dfs_fce_ops);
  421. if (!ha->dfs_fce) {
  422. ql_log(ql_log_warn, vha, 0x00f9,
  423. "Unable to create debugfs fce node.\n");
  424. goto out;
  425. }
  426. ha->tgt.dfs_tgt_sess = debugfs_create_file("tgt_sess",
  427. S_IRUSR, ha->dfs_dir, vha, &dfs_tgt_sess_ops);
  428. if (!ha->tgt.dfs_tgt_sess) {
  429. ql_log(ql_log_warn, vha, 0xd040,
  430. "Unable to create debugFS tgt_sess node.\n");
  431. goto out;
  432. }
  433. if (IS_QLA27XX(ha) || IS_QLA83XX(ha)) {
  434. ha->tgt.dfs_naqp = debugfs_create_file("naqp",
  435. 0400, ha->dfs_dir, vha, &dfs_naqp_ops);
  436. if (!ha->tgt.dfs_naqp) {
  437. ql_log(ql_log_warn, vha, 0xd011,
  438. "Unable to create debugFS naqp node.\n");
  439. goto out;
  440. }
  441. }
  442. out:
  443. return 0;
  444. }
  445. int
  446. qla2x00_dfs_remove(scsi_qla_host_t *vha)
  447. {
  448. struct qla_hw_data *ha = vha->hw;
  449. if (ha->tgt.dfs_naqp) {
  450. debugfs_remove(ha->tgt.dfs_naqp);
  451. ha->tgt.dfs_naqp = NULL;
  452. }
  453. if (ha->tgt.dfs_tgt_sess) {
  454. debugfs_remove(ha->tgt.dfs_tgt_sess);
  455. ha->tgt.dfs_tgt_sess = NULL;
  456. }
  457. if (ha->tgt.dfs_tgt_port_database) {
  458. debugfs_remove(ha->tgt.dfs_tgt_port_database);
  459. ha->tgt.dfs_tgt_port_database = NULL;
  460. }
  461. if (ha->dfs_fw_resource_cnt) {
  462. debugfs_remove(ha->dfs_fw_resource_cnt);
  463. ha->dfs_fw_resource_cnt = NULL;
  464. }
  465. if (ha->dfs_tgt_counters) {
  466. debugfs_remove(ha->dfs_tgt_counters);
  467. ha->dfs_tgt_counters = NULL;
  468. }
  469. if (ha->dfs_fce) {
  470. debugfs_remove(ha->dfs_fce);
  471. ha->dfs_fce = NULL;
  472. }
  473. if (ha->dfs_dir) {
  474. debugfs_remove(ha->dfs_dir);
  475. ha->dfs_dir = NULL;
  476. atomic_dec(&qla2x00_dfs_root_count);
  477. }
  478. if (atomic_read(&qla2x00_dfs_root_count) == 0 &&
  479. qla2x00_dfs_root) {
  480. debugfs_remove(qla2x00_dfs_root);
  481. qla2x00_dfs_root = NULL;
  482. }
  483. return 0;
  484. }