diff options
author | matthias@kaehlcke.net <matthias@kaehlcke.net> | 2008-05-13 01:21:11 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-05-15 11:39:29 -0400 |
commit | 6c2f527cb84cbd7d2d8a668c979e70bf78980ccc (patch) | |
tree | 5674b1504695f593bab09a32663beac82d77a20a /drivers/scsi | |
parent | e1e82b6f0df0c5175ddd3d4f8862507aa71da8e9 (diff) |
[SCSI] qla2xxx: Convert vport_sem to a mutex
The semaphore vport_sem is used as a mutex. Convert it to the
mutex API.
Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 4 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 18 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 2caf841cbba9..48318d0f088f 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1176,10 +1176,10 @@ qla24xx_vport_delete(struct fc_vport *fc_vport) | |||
1176 | qla24xx_disable_vp(vha); | 1176 | qla24xx_disable_vp(vha); |
1177 | qla24xx_deallocate_vp_id(vha); | 1177 | qla24xx_deallocate_vp_id(vha); |
1178 | 1178 | ||
1179 | down(&ha->vport_sem); | 1179 | mutex_lock(&ha->vport_lock); |
1180 | ha->cur_vport_count--; | 1180 | ha->cur_vport_count--; |
1181 | clear_bit(vha->vp_idx, ha->vp_idx_map); | 1181 | clear_bit(vha->vp_idx, ha->vp_idx_map); |
1182 | up(&ha->vport_sem); | 1182 | mutex_unlock(&ha->vport_lock); |
1183 | 1183 | ||
1184 | kfree(vha->node_name); | 1184 | kfree(vha->node_name); |
1185 | kfree(vha->port_name); | 1185 | kfree(vha->port_name); |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 299eccf6cabd..8dd600013bd1 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2457,7 +2457,7 @@ typedef struct scsi_qla_host { | |||
2457 | #define MBX_INTR_WAIT 2 | 2457 | #define MBX_INTR_WAIT 2 |
2458 | #define MBX_UPDATE_FLASH_ACTIVE 3 | 2458 | #define MBX_UPDATE_FLASH_ACTIVE 3 |
2459 | 2459 | ||
2460 | struct semaphore vport_sem; /* Virtual port synchronization */ | 2460 | struct mutex vport_lock; /* Virtual port synchronization */ |
2461 | struct completion mbx_cmd_comp; /* Serialize mbx access */ | 2461 | struct completion mbx_cmd_comp; /* Serialize mbx access */ |
2462 | struct completion mbx_intr_comp; /* Used for completion notification */ | 2462 | struct completion mbx_intr_comp; /* Used for completion notification */ |
2463 | 2463 | ||
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 210060420809..3800876f96c3 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -2807,9 +2807,9 @@ qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) | |||
2807 | */ | 2807 | */ |
2808 | map = (vp_index - 1) / 8; | 2808 | map = (vp_index - 1) / 8; |
2809 | pos = (vp_index - 1) & 7; | 2809 | pos = (vp_index - 1) & 7; |
2810 | down(&ha->vport_sem); | 2810 | mutex_lock(&ha->vport_lock); |
2811 | vce->vp_idx_map[map] |= 1 << pos; | 2811 | vce->vp_idx_map[map] |= 1 << pos; |
2812 | up(&ha->vport_sem); | 2812 | mutex_unlock(&ha->vport_lock); |
2813 | 2813 | ||
2814 | rval = qla2x00_issue_iocb(ha, vce, vce_dma, 0); | 2814 | rval = qla2x00_issue_iocb(ha, vce, vce_dma, 0); |
2815 | if (rval != QLA_SUCCESS) { | 2815 | if (rval != QLA_SUCCESS) { |
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index f2b04979e5f0..fc55429dc914 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -32,12 +32,12 @@ qla24xx_allocate_vp_id(scsi_qla_host_t *vha) | |||
32 | scsi_qla_host_t *ha = vha->parent; | 32 | scsi_qla_host_t *ha = vha->parent; |
33 | 33 | ||
34 | /* Find an empty slot and assign an vp_id */ | 34 | /* Find an empty slot and assign an vp_id */ |
35 | down(&ha->vport_sem); | 35 | mutex_lock(&ha->vport_lock); |
36 | vp_id = find_first_zero_bit(ha->vp_idx_map, ha->max_npiv_vports + 1); | 36 | vp_id = find_first_zero_bit(ha->vp_idx_map, ha->max_npiv_vports + 1); |
37 | if (vp_id > ha->max_npiv_vports) { | 37 | if (vp_id > ha->max_npiv_vports) { |
38 | DEBUG15(printk ("vp_id %d is bigger than max-supported %d.\n", | 38 | DEBUG15(printk ("vp_id %d is bigger than max-supported %d.\n", |
39 | vp_id, ha->max_npiv_vports)); | 39 | vp_id, ha->max_npiv_vports)); |
40 | up(&ha->vport_sem); | 40 | mutex_unlock(&ha->vport_lock); |
41 | return vp_id; | 41 | return vp_id; |
42 | } | 42 | } |
43 | 43 | ||
@@ -45,7 +45,7 @@ qla24xx_allocate_vp_id(scsi_qla_host_t *vha) | |||
45 | ha->num_vhosts++; | 45 | ha->num_vhosts++; |
46 | vha->vp_idx = vp_id; | 46 | vha->vp_idx = vp_id; |
47 | list_add_tail(&vha->vp_list, &ha->vp_list); | 47 | list_add_tail(&vha->vp_list, &ha->vp_list); |
48 | up(&ha->vport_sem); | 48 | mutex_unlock(&ha->vport_lock); |
49 | return vp_id; | 49 | return vp_id; |
50 | } | 50 | } |
51 | 51 | ||
@@ -55,12 +55,12 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha) | |||
55 | uint16_t vp_id; | 55 | uint16_t vp_id; |
56 | scsi_qla_host_t *ha = vha->parent; | 56 | scsi_qla_host_t *ha = vha->parent; |
57 | 57 | ||
58 | down(&ha->vport_sem); | 58 | mutex_lock(&ha->vport_lock); |
59 | vp_id = vha->vp_idx; | 59 | vp_id = vha->vp_idx; |
60 | ha->num_vhosts--; | 60 | ha->num_vhosts--; |
61 | clear_bit(vp_id, ha->vp_idx_map); | 61 | clear_bit(vp_id, ha->vp_idx_map); |
62 | list_del(&vha->vp_list); | 62 | list_del(&vha->vp_list); |
63 | up(&ha->vport_sem); | 63 | mutex_unlock(&ha->vport_lock); |
64 | } | 64 | } |
65 | 65 | ||
66 | static scsi_qla_host_t * | 66 | static scsi_qla_host_t * |
@@ -145,9 +145,9 @@ qla24xx_enable_vp(scsi_qla_host_t *vha) | |||
145 | } | 145 | } |
146 | 146 | ||
147 | /* Initialize the new vport unless it is a persistent port */ | 147 | /* Initialize the new vport unless it is a persistent port */ |
148 | down(&ha->vport_sem); | 148 | mutex_lock(&ha->vport_lock); |
149 | ret = qla24xx_modify_vp_config(vha); | 149 | ret = qla24xx_modify_vp_config(vha); |
150 | up(&ha->vport_sem); | 150 | mutex_unlock(&ha->vport_lock); |
151 | 151 | ||
152 | if (ret != QLA_SUCCESS) { | 152 | if (ret != QLA_SUCCESS) { |
153 | fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED); | 153 | fc_vport_set_state(vha->fc_vport, FC_VPORT_FAILED); |
@@ -437,10 +437,10 @@ qla24xx_create_vhost(struct fc_vport *fc_vport) | |||
437 | vha->flags.init_done = 1; | 437 | vha->flags.init_done = 1; |
438 | num_hosts++; | 438 | num_hosts++; |
439 | 439 | ||
440 | down(&ha->vport_sem); | 440 | mutex_lock(&ha->vport_lock); |
441 | set_bit(vha->vp_idx, ha->vp_idx_map); | 441 | set_bit(vha->vp_idx, ha->vp_idx_map); |
442 | ha->cur_vport_count++; | 442 | ha->cur_vport_count++; |
443 | up(&ha->vport_sem); | 443 | mutex_unlock(&ha->vport_lock); |
444 | 444 | ||
445 | return vha; | 445 | return vha; |
446 | 446 | ||
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 9982ecd9c612..817f62fbdd83 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1632,7 +1632,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1632 | /* load the F/W, read paramaters, and init the H/W */ | 1632 | /* load the F/W, read paramaters, and init the H/W */ |
1633 | ha->instance = num_hosts; | 1633 | ha->instance = num_hosts; |
1634 | 1634 | ||
1635 | init_MUTEX(&ha->vport_sem); | 1635 | mutex_init(&ha->vport_lock); |
1636 | init_completion(&ha->mbx_cmd_comp); | 1636 | init_completion(&ha->mbx_cmd_comp); |
1637 | complete(&ha->mbx_cmd_comp); | 1637 | complete(&ha->mbx_cmd_comp); |
1638 | init_completion(&ha->mbx_intr_comp); | 1638 | init_completion(&ha->mbx_intr_comp); |