diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-04-17 17:44:34 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-04-29 17:24:51 -0400 |
commit | 982cc4be05d6d0d8b15b1340416737ad60bddcae (patch) | |
tree | 0ad79bef5e1fa62702341387cfa8cfb247078716 | |
parent | 1956eee58872e622cfe03f060a5d8a20d24afe47 (diff) |
scsi: qla2xxx: Use an on-stack completion in qla24xx_control_vp()
This patch reduces the size of struct srb.
Cc: Himanshu Madhani <hmadhani@marvell.com>
Cc: Giridhar Malavali <gmalavali@marvell.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mid.c | 9 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index c9f0169b21ea..6dd2d41713c9 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -545,7 +545,7 @@ typedef struct srb { | |||
545 | u32 gen2; /* scratch */ | 545 | u32 gen2; /* scratch */ |
546 | int rc; | 546 | int rc; |
547 | int retry_count; | 547 | int retry_count; |
548 | struct completion comp; | 548 | struct completion *comp; |
549 | wait_queue_head_t *cwaitq; | 549 | wait_queue_head_t *cwaitq; |
550 | union { | 550 | union { |
551 | struct srb_iocb iocb_cmd; | 551 | struct srb_iocb iocb_cmd; |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 7ab157c079ca..60f6685cb342 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -2570,7 +2570,6 @@ void qla2x00_init_timer(srb_t *sp, unsigned long tmo) | |||
2570 | timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0); | 2570 | timer_setup(&sp->u.iocb_cmd.timer, qla2x00_sp_timeout, 0); |
2571 | sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ; | 2571 | sp->u.iocb_cmd.timer.expires = jiffies + tmo * HZ; |
2572 | sp->free = qla2x00_sp_free; | 2572 | sp->free = qla2x00_sp_free; |
2573 | init_completion(&sp->comp); | ||
2574 | if (IS_QLAFX00(sp->vha->hw) && sp->type == SRB_FXIOCB_DCMD) | 2573 | if (IS_QLAFX00(sp->vha->hw) && sp->type == SRB_FXIOCB_DCMD) |
2575 | init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp); | 2574 | init_completion(&sp->u.iocb_cmd.u.fxiocb.fxiocb_comp); |
2576 | add_timer(&sp->u.iocb_cmd.timer); | 2575 | add_timer(&sp->u.iocb_cmd.timer); |
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c index 099d8e9851cb..b2977e49356b 100644 --- a/drivers/scsi/qla2xxx/qla_mid.c +++ b/drivers/scsi/qla2xxx/qla_mid.c | |||
@@ -905,7 +905,8 @@ static void qla_ctrlvp_sp_done(void *s, int res) | |||
905 | { | 905 | { |
906 | struct srb *sp = s; | 906 | struct srb *sp = s; |
907 | 907 | ||
908 | complete(&sp->comp); | 908 | if (sp->comp) |
909 | complete(sp->comp); | ||
909 | /* don't free sp here. Let the caller do the free */ | 910 | /* don't free sp here. Let the caller do the free */ |
910 | } | 911 | } |
911 | 912 | ||
@@ -922,6 +923,7 @@ int qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) | |||
922 | struct qla_hw_data *ha = vha->hw; | 923 | struct qla_hw_data *ha = vha->hw; |
923 | int vp_index = vha->vp_idx; | 924 | int vp_index = vha->vp_idx; |
924 | struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); | 925 | struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev); |
926 | DECLARE_COMPLETION_ONSTACK(comp); | ||
925 | srb_t *sp; | 927 | srb_t *sp; |
926 | 928 | ||
927 | ql_dbg(ql_dbg_vport, vha, 0x10c1, | 929 | ql_dbg(ql_dbg_vport, vha, 0x10c1, |
@@ -936,6 +938,7 @@ int qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) | |||
936 | 938 | ||
937 | sp->type = SRB_CTRL_VP; | 939 | sp->type = SRB_CTRL_VP; |
938 | sp->name = "ctrl_vp"; | 940 | sp->name = "ctrl_vp"; |
941 | sp->comp = ∁ | ||
939 | sp->done = qla_ctrlvp_sp_done; | 942 | sp->done = qla_ctrlvp_sp_done; |
940 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; | 943 | sp->u.iocb_cmd.timeout = qla2x00_async_iocb_timeout; |
941 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); | 944 | qla2x00_init_timer(sp, qla2x00_get_async_timeout(vha) + 2); |
@@ -953,7 +956,9 @@ int qla24xx_control_vp(scsi_qla_host_t *vha, int cmd) | |||
953 | ql_dbg(ql_dbg_vport, vha, 0x113f, "%s hndl %x submitted\n", | 956 | ql_dbg(ql_dbg_vport, vha, 0x113f, "%s hndl %x submitted\n", |
954 | sp->name, sp->handle); | 957 | sp->name, sp->handle); |
955 | 958 | ||
956 | wait_for_completion(&sp->comp); | 959 | wait_for_completion(&comp); |
960 | sp->comp = NULL; | ||
961 | |||
957 | rval = sp->rc; | 962 | rval = sp->rc; |
958 | switch (rval) { | 963 | switch (rval) { |
959 | case QLA_FUNCTION_TIMEOUT: | 964 | case QLA_FUNCTION_TIMEOUT: |