diff options
author | Daniel Walker <dwalker@mvista.com> | 2008-05-13 01:21:10 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-05-15 11:39:28 -0400 |
commit | e1e82b6f0df0c5175ddd3d4f8862507aa71da8e9 (patch) | |
tree | 4056e9980523bbd571e3d11ddf917fb66462dde1 /drivers/scsi/qla2xxx/qla_os.c | |
parent | 0e973a24f02ed8c627271b013d69683b4497828d (diff) |
[SCSI] qla2xxx: firmware semaphore to mutex
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index dd1e117aff53..9982ecd9c612 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/vmalloc.h> | 10 | #include <linux/vmalloc.h> |
11 | #include <linux/delay.h> | 11 | #include <linux/delay.h> |
12 | #include <linux/kthread.h> | 12 | #include <linux/kthread.h> |
13 | #include <linux/mutex.h> | ||
13 | 14 | ||
14 | #include <scsi/scsi_tcq.h> | 15 | #include <scsi/scsi_tcq.h> |
15 | #include <scsi/scsicam.h> | 16 | #include <scsi/scsicam.h> |
@@ -2634,7 +2635,7 @@ qla2x00_timer(scsi_qla_host_t *ha) | |||
2634 | #define FW_FILE_ISP24XX "ql2400_fw.bin" | 2635 | #define FW_FILE_ISP24XX "ql2400_fw.bin" |
2635 | #define FW_FILE_ISP25XX "ql2500_fw.bin" | 2636 | #define FW_FILE_ISP25XX "ql2500_fw.bin" |
2636 | 2637 | ||
2637 | static DECLARE_MUTEX(qla_fw_lock); | 2638 | static DEFINE_MUTEX(qla_fw_lock); |
2638 | 2639 | ||
2639 | static struct fw_blob qla_fw_blobs[FW_BLOBS] = { | 2640 | static struct fw_blob qla_fw_blobs[FW_BLOBS] = { |
2640 | { .name = FW_FILE_ISP21XX, .segs = { 0x1000, 0 }, }, | 2641 | { .name = FW_FILE_ISP21XX, .segs = { 0x1000, 0 }, }, |
@@ -2665,7 +2666,7 @@ qla2x00_request_firmware(scsi_qla_host_t *ha) | |||
2665 | blob = &qla_fw_blobs[FW_ISP25XX]; | 2666 | blob = &qla_fw_blobs[FW_ISP25XX]; |
2666 | } | 2667 | } |
2667 | 2668 | ||
2668 | down(&qla_fw_lock); | 2669 | mutex_lock(&qla_fw_lock); |
2669 | if (blob->fw) | 2670 | if (blob->fw) |
2670 | goto out; | 2671 | goto out; |
2671 | 2672 | ||
@@ -2678,7 +2679,7 @@ qla2x00_request_firmware(scsi_qla_host_t *ha) | |||
2678 | } | 2679 | } |
2679 | 2680 | ||
2680 | out: | 2681 | out: |
2681 | up(&qla_fw_lock); | 2682 | mutex_unlock(&qla_fw_lock); |
2682 | return blob; | 2683 | return blob; |
2683 | } | 2684 | } |
2684 | 2685 | ||
@@ -2687,11 +2688,11 @@ qla2x00_release_firmware(void) | |||
2687 | { | 2688 | { |
2688 | int idx; | 2689 | int idx; |
2689 | 2690 | ||
2690 | down(&qla_fw_lock); | 2691 | mutex_lock(&qla_fw_lock); |
2691 | for (idx = 0; idx < FW_BLOBS; idx++) | 2692 | for (idx = 0; idx < FW_BLOBS; idx++) |
2692 | if (qla_fw_blobs[idx].fw) | 2693 | if (qla_fw_blobs[idx].fw) |
2693 | release_firmware(qla_fw_blobs[idx].fw); | 2694 | release_firmware(qla_fw_blobs[idx].fw); |
2694 | up(&qla_fw_lock); | 2695 | mutex_unlock(&qla_fw_lock); |
2695 | } | 2696 | } |
2696 | 2697 | ||
2697 | static pci_ers_result_t | 2698 | static pci_ers_result_t |