diff options
author | Kashyap, Desai <kashyap.desai@lsi.com> | 2009-08-14 05:31:35 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-08-14 10:16:05 -0400 |
commit | 388ce4beb7135722c584b0af18f215e3ec657adf (patch) | |
tree | 2eee12456d42cd5e767e1ebadd7d3e196fb52e59 /drivers | |
parent | f9b14c9183b250cf128c7d2341e6b9bdbbcd8f35 (diff) |
[SCSI] mpt2sas: fix config request and diag reset deadlock
Moving the setting and clearing of the mutex's to
_config_request. There was a mutex deadlock when diag reset is called from
inside _config_request, so diag reset was moved to outside the mutexs.
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_config.c | 85 |
1 files changed, 20 insertions, 65 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_config.c b/drivers/scsi/mpt2sas/mpt2sas_config.c index 1c6658c60239..6ddee161beb3 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_config.c +++ b/drivers/scsi/mpt2sas/mpt2sas_config.c | |||
@@ -236,12 +236,14 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
236 | Mpi2ConfigRequest_t *config_request; | 236 | Mpi2ConfigRequest_t *config_request; |
237 | int r; | 237 | int r; |
238 | u8 retry_count; | 238 | u8 retry_count; |
239 | u8 issue_reset; | 239 | u8 issue_host_reset = 0; |
240 | u16 wait_state_count; | 240 | u16 wait_state_count; |
241 | 241 | ||
242 | mutex_lock(&ioc->config_cmds.mutex); | ||
242 | if (ioc->config_cmds.status != MPT2_CMD_NOT_USED) { | 243 | if (ioc->config_cmds.status != MPT2_CMD_NOT_USED) { |
243 | printk(MPT2SAS_ERR_FMT "%s: config_cmd in use\n", | 244 | printk(MPT2SAS_ERR_FMT "%s: config_cmd in use\n", |
244 | ioc->name, __func__); | 245 | ioc->name, __func__); |
246 | mutex_unlock(&ioc->config_cmds.mutex); | ||
245 | return -EAGAIN; | 247 | return -EAGAIN; |
246 | } | 248 | } |
247 | retry_count = 0; | 249 | retry_count = 0; |
@@ -260,8 +262,8 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
260 | printk(MPT2SAS_ERR_FMT | 262 | printk(MPT2SAS_ERR_FMT |
261 | "%s: failed due to ioc not operational\n", | 263 | "%s: failed due to ioc not operational\n", |
262 | ioc->name, __func__); | 264 | ioc->name, __func__); |
263 | ioc->config_cmds.status = MPT2_CMD_NOT_USED; | 265 | r = -EFAULT; |
264 | return -EFAULT; | 266 | goto out; |
265 | } | 267 | } |
266 | ssleep(1); | 268 | ssleep(1); |
267 | ioc_state = mpt2sas_base_get_iocstate(ioc, 1); | 269 | ioc_state = mpt2sas_base_get_iocstate(ioc, 1); |
@@ -277,8 +279,8 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
277 | if (!smid) { | 279 | if (!smid) { |
278 | printk(MPT2SAS_ERR_FMT "%s: failed obtaining a smid\n", | 280 | printk(MPT2SAS_ERR_FMT "%s: failed obtaining a smid\n", |
279 | ioc->name, __func__); | 281 | ioc->name, __func__); |
280 | ioc->config_cmds.status = MPT2_CMD_NOT_USED; | 282 | r = -EAGAIN; |
281 | return -EAGAIN; | 283 | goto out; |
282 | } | 284 | } |
283 | 285 | ||
284 | r = 0; | 286 | r = 0; |
@@ -298,9 +300,15 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
298 | ioc->name, __func__); | 300 | ioc->name, __func__); |
299 | _debug_dump_mf(mpi_request, | 301 | _debug_dump_mf(mpi_request, |
300 | sizeof(Mpi2ConfigRequest_t)/4); | 302 | sizeof(Mpi2ConfigRequest_t)/4); |
301 | if (!(ioc->config_cmds.status & MPT2_CMD_RESET)) | 303 | retry_count++; |
302 | issue_reset = 1; | 304 | if (ioc->config_cmds.smid == smid) |
303 | goto issue_host_reset; | 305 | mpt2sas_base_free_smid(ioc, smid); |
306 | if ((ioc->shost_recovery) || | ||
307 | (ioc->config_cmds.status & MPT2_CMD_RESET)) | ||
308 | goto retry_config; | ||
309 | issue_host_reset = 1; | ||
310 | r = -EFAULT; | ||
311 | goto out; | ||
304 | } | 312 | } |
305 | if (ioc->config_cmds.status & MPT2_CMD_REPLY_VALID) | 313 | if (ioc->config_cmds.status & MPT2_CMD_REPLY_VALID) |
306 | memcpy(mpi_reply, ioc->config_cmds.reply, | 314 | memcpy(mpi_reply, ioc->config_cmds.reply, |
@@ -308,21 +316,13 @@ _config_request(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigRequest_t | |||
308 | if (retry_count) | 316 | if (retry_count) |
309 | printk(MPT2SAS_INFO_FMT "%s: retry completed!!\n", | 317 | printk(MPT2SAS_INFO_FMT "%s: retry completed!!\n", |
310 | ioc->name, __func__); | 318 | ioc->name, __func__); |
319 | out: | ||
311 | ioc->config_cmds.status = MPT2_CMD_NOT_USED; | 320 | ioc->config_cmds.status = MPT2_CMD_NOT_USED; |
312 | return r; | 321 | mutex_unlock(&ioc->config_cmds.mutex); |
313 | 322 | if (issue_host_reset) | |
314 | issue_host_reset: | ||
315 | if (issue_reset) | ||
316 | mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP, | 323 | mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP, |
317 | FORCE_BIG_HAMMER); | 324 | FORCE_BIG_HAMMER); |
318 | ioc->config_cmds.status = MPT2_CMD_NOT_USED; | 325 | return r; |
319 | if (!retry_count) { | ||
320 | printk(MPT2SAS_INFO_FMT "%s: attempting retry\n", | ||
321 | ioc->name, __func__); | ||
322 | retry_count++; | ||
323 | goto retry_config; | ||
324 | } | ||
325 | return -EFAULT; | ||
326 | } | 326 | } |
327 | 327 | ||
328 | /** | 328 | /** |
@@ -381,7 +381,6 @@ mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, | |||
381 | int r; | 381 | int r; |
382 | struct config_request mem; | 382 | struct config_request mem; |
383 | 383 | ||
384 | mutex_lock(&ioc->config_cmds.mutex); | ||
385 | memset(config_page, 0, sizeof(Mpi2ManufacturingPage0_t)); | 384 | memset(config_page, 0, sizeof(Mpi2ManufacturingPage0_t)); |
386 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 385 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
387 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 386 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -423,7 +422,6 @@ mpt2sas_config_get_manufacturing_pg0(struct MPT2SAS_ADAPTER *ioc, | |||
423 | _config_free_config_dma_memory(ioc, &mem); | 422 | _config_free_config_dma_memory(ioc, &mem); |
424 | 423 | ||
425 | out: | 424 | out: |
426 | mutex_unlock(&ioc->config_cmds.mutex); | ||
427 | return r; | 425 | return r; |
428 | } | 426 | } |
429 | 427 | ||
@@ -444,7 +442,6 @@ mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, | |||
444 | int r; | 442 | int r; |
445 | struct config_request mem; | 443 | struct config_request mem; |
446 | 444 | ||
447 | mutex_lock(&ioc->config_cmds.mutex); | ||
448 | memset(config_page, 0, sizeof(Mpi2BiosPage2_t)); | 445 | memset(config_page, 0, sizeof(Mpi2BiosPage2_t)); |
449 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 446 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
450 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 447 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -486,7 +483,6 @@ mpt2sas_config_get_bios_pg2(struct MPT2SAS_ADAPTER *ioc, | |||
486 | _config_free_config_dma_memory(ioc, &mem); | 483 | _config_free_config_dma_memory(ioc, &mem); |
487 | 484 | ||
488 | out: | 485 | out: |
489 | mutex_unlock(&ioc->config_cmds.mutex); | ||
490 | return r; | 486 | return r; |
491 | } | 487 | } |
492 | 488 | ||
@@ -507,7 +503,6 @@ mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
507 | int r; | 503 | int r; |
508 | struct config_request mem; | 504 | struct config_request mem; |
509 | 505 | ||
510 | mutex_lock(&ioc->config_cmds.mutex); | ||
511 | memset(config_page, 0, sizeof(Mpi2BiosPage3_t)); | 506 | memset(config_page, 0, sizeof(Mpi2BiosPage3_t)); |
512 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 507 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
513 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 508 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -549,7 +544,6 @@ mpt2sas_config_get_bios_pg3(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
549 | _config_free_config_dma_memory(ioc, &mem); | 544 | _config_free_config_dma_memory(ioc, &mem); |
550 | 545 | ||
551 | out: | 546 | out: |
552 | mutex_unlock(&ioc->config_cmds.mutex); | ||
553 | return r; | 547 | return r; |
554 | } | 548 | } |
555 | 549 | ||
@@ -570,7 +564,6 @@ mpt2sas_config_get_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, | |||
570 | int r; | 564 | int r; |
571 | struct config_request mem; | 565 | struct config_request mem; |
572 | 566 | ||
573 | mutex_lock(&ioc->config_cmds.mutex); | ||
574 | memset(config_page, 0, sizeof(Mpi2IOUnitPage0_t)); | 567 | memset(config_page, 0, sizeof(Mpi2IOUnitPage0_t)); |
575 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 568 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
576 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 569 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -612,7 +605,6 @@ mpt2sas_config_get_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, | |||
612 | _config_free_config_dma_memory(ioc, &mem); | 605 | _config_free_config_dma_memory(ioc, &mem); |
613 | 606 | ||
614 | out: | 607 | out: |
615 | mutex_unlock(&ioc->config_cmds.mutex); | ||
616 | return r; | 608 | return r; |
617 | } | 609 | } |
618 | 610 | ||
@@ -633,7 +625,6 @@ mpt2sas_config_get_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, | |||
633 | int r; | 625 | int r; |
634 | struct config_request mem; | 626 | struct config_request mem; |
635 | 627 | ||
636 | mutex_lock(&ioc->config_cmds.mutex); | ||
637 | memset(config_page, 0, sizeof(Mpi2IOUnitPage1_t)); | 628 | memset(config_page, 0, sizeof(Mpi2IOUnitPage1_t)); |
638 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 629 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
639 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 630 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -675,7 +666,6 @@ mpt2sas_config_get_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, | |||
675 | _config_free_config_dma_memory(ioc, &mem); | 666 | _config_free_config_dma_memory(ioc, &mem); |
676 | 667 | ||
677 | out: | 668 | out: |
678 | mutex_unlock(&ioc->config_cmds.mutex); | ||
679 | return r; | 669 | return r; |
680 | } | 670 | } |
681 | 671 | ||
@@ -696,7 +686,6 @@ mpt2sas_config_set_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, | |||
696 | int r; | 686 | int r; |
697 | struct config_request mem; | 687 | struct config_request mem; |
698 | 688 | ||
699 | mutex_lock(&ioc->config_cmds.mutex); | ||
700 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 689 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
701 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 690 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
702 | mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER; | 691 | mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER; |
@@ -738,7 +727,6 @@ mpt2sas_config_set_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, | |||
738 | _config_free_config_dma_memory(ioc, &mem); | 727 | _config_free_config_dma_memory(ioc, &mem); |
739 | 728 | ||
740 | out: | 729 | out: |
741 | mutex_unlock(&ioc->config_cmds.mutex); | ||
742 | return r; | 730 | return r; |
743 | } | 731 | } |
744 | 732 | ||
@@ -759,7 +747,6 @@ mpt2sas_config_get_ioc_pg8(struct MPT2SAS_ADAPTER *ioc, | |||
759 | int r; | 747 | int r; |
760 | struct config_request mem; | 748 | struct config_request mem; |
761 | 749 | ||
762 | mutex_lock(&ioc->config_cmds.mutex); | ||
763 | memset(config_page, 0, sizeof(Mpi2IOCPage8_t)); | 750 | memset(config_page, 0, sizeof(Mpi2IOCPage8_t)); |
764 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 751 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
765 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 752 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -801,7 +788,6 @@ mpt2sas_config_get_ioc_pg8(struct MPT2SAS_ADAPTER *ioc, | |||
801 | _config_free_config_dma_memory(ioc, &mem); | 788 | _config_free_config_dma_memory(ioc, &mem); |
802 | 789 | ||
803 | out: | 790 | out: |
804 | mutex_unlock(&ioc->config_cmds.mutex); | ||
805 | return r; | 791 | return r; |
806 | } | 792 | } |
807 | 793 | ||
@@ -824,7 +810,6 @@ mpt2sas_config_get_sas_device_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
824 | int r; | 810 | int r; |
825 | struct config_request mem; | 811 | struct config_request mem; |
826 | 812 | ||
827 | mutex_lock(&ioc->config_cmds.mutex); | ||
828 | memset(config_page, 0, sizeof(Mpi2SasDevicePage0_t)); | 813 | memset(config_page, 0, sizeof(Mpi2SasDevicePage0_t)); |
829 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 814 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
830 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 815 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -869,7 +854,6 @@ mpt2sas_config_get_sas_device_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
869 | _config_free_config_dma_memory(ioc, &mem); | 854 | _config_free_config_dma_memory(ioc, &mem); |
870 | 855 | ||
871 | out: | 856 | out: |
872 | mutex_unlock(&ioc->config_cmds.mutex); | ||
873 | return r; | 857 | return r; |
874 | } | 858 | } |
875 | 859 | ||
@@ -892,7 +876,6 @@ mpt2sas_config_get_sas_device_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
892 | int r; | 876 | int r; |
893 | struct config_request mem; | 877 | struct config_request mem; |
894 | 878 | ||
895 | mutex_lock(&ioc->config_cmds.mutex); | ||
896 | memset(config_page, 0, sizeof(Mpi2SasDevicePage1_t)); | 879 | memset(config_page, 0, sizeof(Mpi2SasDevicePage1_t)); |
897 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 880 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
898 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 881 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -937,7 +920,6 @@ mpt2sas_config_get_sas_device_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
937 | _config_free_config_dma_memory(ioc, &mem); | 920 | _config_free_config_dma_memory(ioc, &mem); |
938 | 921 | ||
939 | out: | 922 | out: |
940 | mutex_unlock(&ioc->config_cmds.mutex); | ||
941 | return r; | 923 | return r; |
942 | } | 924 | } |
943 | 925 | ||
@@ -959,7 +941,6 @@ mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys) | |||
959 | Mpi2ConfigReply_t mpi_reply; | 941 | Mpi2ConfigReply_t mpi_reply; |
960 | Mpi2SasIOUnitPage0_t config_page; | 942 | Mpi2SasIOUnitPage0_t config_page; |
961 | 943 | ||
962 | mutex_lock(&ioc->config_cmds.mutex); | ||
963 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 944 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
964 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 945 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
965 | mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER; | 946 | mpi_request.Action = MPI2_CONFIG_ACTION_PAGE_HEADER; |
@@ -1008,7 +989,6 @@ mpt2sas_config_get_number_hba_phys(struct MPT2SAS_ADAPTER *ioc, u8 *num_phys) | |||
1008 | _config_free_config_dma_memory(ioc, &mem); | 989 | _config_free_config_dma_memory(ioc, &mem); |
1009 | 990 | ||
1010 | out: | 991 | out: |
1011 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1012 | return r; | 992 | return r; |
1013 | } | 993 | } |
1014 | 994 | ||
@@ -1032,8 +1012,6 @@ mpt2sas_config_get_sas_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1032 | Mpi2ConfigRequest_t mpi_request; | 1012 | Mpi2ConfigRequest_t mpi_request; |
1033 | int r; | 1013 | int r; |
1034 | struct config_request mem; | 1014 | struct config_request mem; |
1035 | |||
1036 | mutex_lock(&ioc->config_cmds.mutex); | ||
1037 | memset(config_page, 0, sz); | 1015 | memset(config_page, 0, sz); |
1038 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1016 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1039 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1017 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1076,7 +1054,6 @@ mpt2sas_config_get_sas_iounit_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1076 | _config_free_config_dma_memory(ioc, &mem); | 1054 | _config_free_config_dma_memory(ioc, &mem); |
1077 | 1055 | ||
1078 | out: | 1056 | out: |
1079 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1080 | return r; | 1057 | return r; |
1081 | } | 1058 | } |
1082 | 1059 | ||
@@ -1101,7 +1078,6 @@ mpt2sas_config_get_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1101 | int r; | 1078 | int r; |
1102 | struct config_request mem; | 1079 | struct config_request mem; |
1103 | 1080 | ||
1104 | mutex_lock(&ioc->config_cmds.mutex); | ||
1105 | memset(config_page, 0, sz); | 1081 | memset(config_page, 0, sz); |
1106 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1082 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1107 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1083 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1144,7 +1120,6 @@ mpt2sas_config_get_sas_iounit_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1144 | _config_free_config_dma_memory(ioc, &mem); | 1120 | _config_free_config_dma_memory(ioc, &mem); |
1145 | 1121 | ||
1146 | out: | 1122 | out: |
1147 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1148 | return r; | 1123 | return r; |
1149 | } | 1124 | } |
1150 | 1125 | ||
@@ -1167,7 +1142,6 @@ mpt2sas_config_get_expander_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1167 | int r; | 1142 | int r; |
1168 | struct config_request mem; | 1143 | struct config_request mem; |
1169 | 1144 | ||
1170 | mutex_lock(&ioc->config_cmds.mutex); | ||
1171 | memset(config_page, 0, sizeof(Mpi2ExpanderPage0_t)); | 1145 | memset(config_page, 0, sizeof(Mpi2ExpanderPage0_t)); |
1172 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1146 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1173 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1147 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1212,7 +1186,6 @@ mpt2sas_config_get_expander_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1212 | _config_free_config_dma_memory(ioc, &mem); | 1186 | _config_free_config_dma_memory(ioc, &mem); |
1213 | 1187 | ||
1214 | out: | 1188 | out: |
1215 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1216 | return r; | 1189 | return r; |
1217 | } | 1190 | } |
1218 | 1191 | ||
@@ -1236,7 +1209,6 @@ mpt2sas_config_get_expander_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1236 | int r; | 1209 | int r; |
1237 | struct config_request mem; | 1210 | struct config_request mem; |
1238 | 1211 | ||
1239 | mutex_lock(&ioc->config_cmds.mutex); | ||
1240 | memset(config_page, 0, sizeof(Mpi2ExpanderPage1_t)); | 1212 | memset(config_page, 0, sizeof(Mpi2ExpanderPage1_t)); |
1241 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1213 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1242 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1214 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1283,7 +1255,6 @@ mpt2sas_config_get_expander_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1283 | _config_free_config_dma_memory(ioc, &mem); | 1255 | _config_free_config_dma_memory(ioc, &mem); |
1284 | 1256 | ||
1285 | out: | 1257 | out: |
1286 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1287 | return r; | 1258 | return r; |
1288 | } | 1259 | } |
1289 | 1260 | ||
@@ -1306,7 +1277,6 @@ mpt2sas_config_get_enclosure_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1306 | int r; | 1277 | int r; |
1307 | struct config_request mem; | 1278 | struct config_request mem; |
1308 | 1279 | ||
1309 | mutex_lock(&ioc->config_cmds.mutex); | ||
1310 | memset(config_page, 0, sizeof(Mpi2SasEnclosurePage0_t)); | 1280 | memset(config_page, 0, sizeof(Mpi2SasEnclosurePage0_t)); |
1311 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1281 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1312 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1282 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1351,7 +1321,6 @@ mpt2sas_config_get_enclosure_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1351 | _config_free_config_dma_memory(ioc, &mem); | 1321 | _config_free_config_dma_memory(ioc, &mem); |
1352 | 1322 | ||
1353 | out: | 1323 | out: |
1354 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1355 | return r; | 1324 | return r; |
1356 | } | 1325 | } |
1357 | 1326 | ||
@@ -1373,7 +1342,6 @@ mpt2sas_config_get_phy_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1373 | int r; | 1342 | int r; |
1374 | struct config_request mem; | 1343 | struct config_request mem; |
1375 | 1344 | ||
1376 | mutex_lock(&ioc->config_cmds.mutex); | ||
1377 | memset(config_page, 0, sizeof(Mpi2SasPhyPage0_t)); | 1345 | memset(config_page, 0, sizeof(Mpi2SasPhyPage0_t)); |
1378 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1346 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1379 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1347 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1419,7 +1387,6 @@ mpt2sas_config_get_phy_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1419 | _config_free_config_dma_memory(ioc, &mem); | 1387 | _config_free_config_dma_memory(ioc, &mem); |
1420 | 1388 | ||
1421 | out: | 1389 | out: |
1422 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1423 | return r; | 1390 | return r; |
1424 | } | 1391 | } |
1425 | 1392 | ||
@@ -1441,7 +1408,6 @@ mpt2sas_config_get_phy_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1441 | int r; | 1408 | int r; |
1442 | struct config_request mem; | 1409 | struct config_request mem; |
1443 | 1410 | ||
1444 | mutex_lock(&ioc->config_cmds.mutex); | ||
1445 | memset(config_page, 0, sizeof(Mpi2SasPhyPage1_t)); | 1411 | memset(config_page, 0, sizeof(Mpi2SasPhyPage1_t)); |
1446 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1412 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1447 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1413 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1487,7 +1453,6 @@ mpt2sas_config_get_phy_pg1(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1487 | _config_free_config_dma_memory(ioc, &mem); | 1453 | _config_free_config_dma_memory(ioc, &mem); |
1488 | 1454 | ||
1489 | out: | 1455 | out: |
1490 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1491 | return r; | 1456 | return r; |
1492 | } | 1457 | } |
1493 | 1458 | ||
@@ -1511,7 +1476,6 @@ mpt2sas_config_get_raid_volume_pg1(struct MPT2SAS_ADAPTER *ioc, | |||
1511 | int r; | 1476 | int r; |
1512 | struct config_request mem; | 1477 | struct config_request mem; |
1513 | 1478 | ||
1514 | mutex_lock(&ioc->config_cmds.mutex); | ||
1515 | memset(config_page, 0, sizeof(Mpi2RaidVolPage1_t)); | 1479 | memset(config_page, 0, sizeof(Mpi2RaidVolPage1_t)); |
1516 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1480 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1517 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1481 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1554,7 +1518,6 @@ mpt2sas_config_get_raid_volume_pg1(struct MPT2SAS_ADAPTER *ioc, | |||
1554 | _config_free_config_dma_memory(ioc, &mem); | 1518 | _config_free_config_dma_memory(ioc, &mem); |
1555 | 1519 | ||
1556 | out: | 1520 | out: |
1557 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1558 | return r; | 1521 | return r; |
1559 | } | 1522 | } |
1560 | 1523 | ||
@@ -1578,7 +1541,6 @@ mpt2sas_config_get_number_pds(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
1578 | struct config_request mem; | 1541 | struct config_request mem; |
1579 | u16 ioc_status; | 1542 | u16 ioc_status; |
1580 | 1543 | ||
1581 | mutex_lock(&ioc->config_cmds.mutex); | ||
1582 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1544 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1583 | *num_pds = 0; | 1545 | *num_pds = 0; |
1584 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1546 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1626,7 +1588,6 @@ mpt2sas_config_get_number_pds(struct MPT2SAS_ADAPTER *ioc, u16 handle, | |||
1626 | _config_free_config_dma_memory(ioc, &mem); | 1588 | _config_free_config_dma_memory(ioc, &mem); |
1627 | 1589 | ||
1628 | out: | 1590 | out: |
1629 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1630 | return r; | 1591 | return r; |
1631 | } | 1592 | } |
1632 | 1593 | ||
@@ -1651,7 +1612,6 @@ mpt2sas_config_get_raid_volume_pg0(struct MPT2SAS_ADAPTER *ioc, | |||
1651 | int r; | 1612 | int r; |
1652 | struct config_request mem; | 1613 | struct config_request mem; |
1653 | 1614 | ||
1654 | mutex_lock(&ioc->config_cmds.mutex); | ||
1655 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1615 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1656 | memset(config_page, 0, sz); | 1616 | memset(config_page, 0, sz); |
1657 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1617 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1693,7 +1653,6 @@ mpt2sas_config_get_raid_volume_pg0(struct MPT2SAS_ADAPTER *ioc, | |||
1693 | _config_free_config_dma_memory(ioc, &mem); | 1653 | _config_free_config_dma_memory(ioc, &mem); |
1694 | 1654 | ||
1695 | out: | 1655 | out: |
1696 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1697 | return r; | 1656 | return r; |
1698 | } | 1657 | } |
1699 | 1658 | ||
@@ -1717,7 +1676,6 @@ mpt2sas_config_get_phys_disk_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1717 | int r; | 1676 | int r; |
1718 | struct config_request mem; | 1677 | struct config_request mem; |
1719 | 1678 | ||
1720 | mutex_lock(&ioc->config_cmds.mutex); | ||
1721 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1679 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1722 | memset(config_page, 0, sizeof(Mpi2RaidPhysDiskPage0_t)); | 1680 | memset(config_page, 0, sizeof(Mpi2RaidPhysDiskPage0_t)); |
1723 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1681 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1760,7 +1718,6 @@ mpt2sas_config_get_phys_disk_pg0(struct MPT2SAS_ADAPTER *ioc, Mpi2ConfigReply_t | |||
1760 | _config_free_config_dma_memory(ioc, &mem); | 1718 | _config_free_config_dma_memory(ioc, &mem); |
1761 | 1719 | ||
1762 | out: | 1720 | out: |
1763 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1764 | return r; | 1721 | return r; |
1765 | } | 1722 | } |
1766 | 1723 | ||
@@ -1784,7 +1741,6 @@ mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle, | |||
1784 | struct config_request mem; | 1741 | struct config_request mem; |
1785 | u16 ioc_status; | 1742 | u16 ioc_status; |
1786 | 1743 | ||
1787 | mutex_lock(&ioc->config_cmds.mutex); | ||
1788 | *volume_handle = 0; | 1744 | *volume_handle = 0; |
1789 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); | 1745 | memset(&mpi_request, 0, sizeof(Mpi2ConfigRequest_t)); |
1790 | mpi_request.Function = MPI2_FUNCTION_CONFIG; | 1746 | mpi_request.Function = MPI2_FUNCTION_CONFIG; |
@@ -1848,7 +1804,6 @@ mpt2sas_config_get_volume_handle(struct MPT2SAS_ADAPTER *ioc, u16 pd_handle, | |||
1848 | _config_free_config_dma_memory(ioc, &mem); | 1804 | _config_free_config_dma_memory(ioc, &mem); |
1849 | 1805 | ||
1850 | out: | 1806 | out: |
1851 | mutex_unlock(&ioc->config_cmds.mutex); | ||
1852 | return r; | 1807 | return r; |
1853 | } | 1808 | } |
1854 | 1809 | ||