diff options
author | Jing Huang <huangj@brocade.com> | 2010-07-08 22:50:38 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-07-27 13:04:09 -0400 |
commit | 7c8146510c9cacdaaeb273b5fef6b9201d933bc1 (patch) | |
tree | 2fb54cfb83cb02d5b180a3aa165860fa7b1d44f8 /drivers/scsi/bfa | |
parent | 4f1806bc3c409395de4dab5984f7a235dc4a0eda (diff) |
[SCSI] bfa: fix interrupt coalescing setting
Do not update the coalesce flag of the intr_attr struct in driver config area
on config response. This is to prevent the coalesce flag being reported as on
after an ioc disable/enable even if it was set to off before disable.
Signed-off-by: Jing Huang <huangj@brocade.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/bfa')
-rw-r--r-- | drivers/scsi/bfa/bfa_iocfc.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/drivers/scsi/bfa/bfa_iocfc.c b/drivers/scsi/bfa/bfa_iocfc.c index 6f54bea356c6..0776d74d40de 100644 --- a/drivers/scsi/bfa/bfa_iocfc.c +++ b/drivers/scsi/bfa/bfa_iocfc.c | |||
@@ -113,7 +113,6 @@ bfa_iocfc_send_cfg(void *bfa_arg) | |||
113 | bfa_assert(cfg->fwcfg.num_cqs <= BFI_IOC_MAX_CQS); | 113 | bfa_assert(cfg->fwcfg.num_cqs <= BFI_IOC_MAX_CQS); |
114 | bfa_trc(bfa, cfg->fwcfg.num_cqs); | 114 | bfa_trc(bfa, cfg->fwcfg.num_cqs); |
115 | 115 | ||
116 | iocfc->cfgdone = BFA_FALSE; | ||
117 | bfa_iocfc_reset_queues(bfa); | 116 | bfa_iocfc_reset_queues(bfa); |
118 | 117 | ||
119 | /** | 118 | /** |
@@ -145,6 +144,15 @@ bfa_iocfc_send_cfg(void *bfa_arg) | |||
145 | } | 144 | } |
146 | 145 | ||
147 | /** | 146 | /** |
147 | * Enable interrupt coalescing if it is driver init path | ||
148 | * and not ioc disable/enable path. | ||
149 | */ | ||
150 | if (!iocfc->cfgdone) | ||
151 | cfg_info->intr_attr.coalesce = BFA_TRUE; | ||
152 | |||
153 | iocfc->cfgdone = BFA_FALSE; | ||
154 | |||
155 | /** | ||
148 | * dma map IOC configuration itself | 156 | * dma map IOC configuration itself |
149 | */ | 157 | */ |
150 | bfi_h2i_set(cfg_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_CFG_REQ, | 158 | bfi_h2i_set(cfg_req.mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_CFG_REQ, |
@@ -364,7 +372,6 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) | |||
364 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | 372 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; |
365 | struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp; | 373 | struct bfi_iocfc_cfgrsp_s *cfgrsp = iocfc->cfgrsp; |
366 | struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg; | 374 | struct bfa_iocfc_fwcfg_s *fwcfg = &cfgrsp->fwcfg; |
367 | struct bfi_iocfc_cfg_s *cfginfo = iocfc->cfginfo; | ||
368 | 375 | ||
369 | fwcfg->num_cqs = fwcfg->num_cqs; | 376 | fwcfg->num_cqs = fwcfg->num_cqs; |
370 | fwcfg->num_ioim_reqs = bfa_os_ntohs(fwcfg->num_ioim_reqs); | 377 | fwcfg->num_ioim_reqs = bfa_os_ntohs(fwcfg->num_ioim_reqs); |
@@ -373,10 +380,6 @@ bfa_iocfc_cfgrsp(struct bfa_s *bfa) | |||
373 | fwcfg->num_uf_bufs = bfa_os_ntohs(fwcfg->num_uf_bufs); | 380 | fwcfg->num_uf_bufs = bfa_os_ntohs(fwcfg->num_uf_bufs); |
374 | fwcfg->num_rports = bfa_os_ntohs(fwcfg->num_rports); | 381 | fwcfg->num_rports = bfa_os_ntohs(fwcfg->num_rports); |
375 | 382 | ||
376 | cfginfo->intr_attr.coalesce = cfgrsp->intr_attr.coalesce; | ||
377 | cfginfo->intr_attr.delay = bfa_os_ntohs(cfgrsp->intr_attr.delay); | ||
378 | cfginfo->intr_attr.latency = bfa_os_ntohs(cfgrsp->intr_attr.latency); | ||
379 | |||
380 | iocfc->cfgdone = BFA_TRUE; | 383 | iocfc->cfgdone = BFA_TRUE; |
381 | 384 | ||
382 | /** | 385 | /** |
@@ -737,10 +740,20 @@ bfa_adapter_get_id(struct bfa_s *bfa) | |||
737 | void | 740 | void |
738 | bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr) | 741 | bfa_iocfc_get_attr(struct bfa_s *bfa, struct bfa_iocfc_attr_s *attr) |
739 | { | 742 | { |
740 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | 743 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; |
744 | |||
745 | attr->intr_attr.coalesce = iocfc->cfginfo->intr_attr.coalesce; | ||
746 | |||
747 | attr->intr_attr.delay = iocfc->cfginfo->intr_attr.delay ? | ||
748 | bfa_os_ntohs(iocfc->cfginfo->intr_attr.delay) : | ||
749 | bfa_os_ntohs(iocfc->cfgrsp->intr_attr.delay); | ||
750 | |||
751 | attr->intr_attr.latency = iocfc->cfginfo->intr_attr.latency ? | ||
752 | bfa_os_ntohs(iocfc->cfginfo->intr_attr.latency) : | ||
753 | bfa_os_ntohs(iocfc->cfgrsp->intr_attr.latency); | ||
754 | |||
755 | attr->config = iocfc->cfg; | ||
741 | 756 | ||
742 | attr->intr_attr = iocfc->cfginfo->intr_attr; | ||
743 | attr->config = iocfc->cfg; | ||
744 | } | 757 | } |
745 | 758 | ||
746 | bfa_status_t | 759 | bfa_status_t |
@@ -749,7 +762,10 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) | |||
749 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; | 762 | struct bfa_iocfc_s *iocfc = &bfa->iocfc; |
750 | struct bfi_iocfc_set_intr_req_s *m; | 763 | struct bfi_iocfc_set_intr_req_s *m; |
751 | 764 | ||
752 | iocfc->cfginfo->intr_attr = *attr; | 765 | iocfc->cfginfo->intr_attr.coalesce = attr->coalesce; |
766 | iocfc->cfginfo->intr_attr.delay = bfa_os_htons(attr->delay); | ||
767 | iocfc->cfginfo->intr_attr.latency = bfa_os_htons(attr->latency); | ||
768 | |||
753 | if (!bfa_iocfc_is_operational(bfa)) | 769 | if (!bfa_iocfc_is_operational(bfa)) |
754 | return BFA_STATUS_OK; | 770 | return BFA_STATUS_OK; |
755 | 771 | ||
@@ -759,9 +775,10 @@ bfa_iocfc_israttr_set(struct bfa_s *bfa, struct bfa_iocfc_intr_attr_s *attr) | |||
759 | 775 | ||
760 | bfi_h2i_set(m->mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_SET_INTR_REQ, | 776 | bfi_h2i_set(m->mh, BFI_MC_IOCFC, BFI_IOCFC_H2I_SET_INTR_REQ, |
761 | bfa_lpuid(bfa)); | 777 | bfa_lpuid(bfa)); |
762 | m->coalesce = attr->coalesce; | 778 | m->coalesce = iocfc->cfginfo->intr_attr.coalesce; |
763 | m->delay = bfa_os_htons(attr->delay); | 779 | m->delay = iocfc->cfginfo->intr_attr.delay; |
764 | m->latency = bfa_os_htons(attr->latency); | 780 | m->latency = iocfc->cfginfo->intr_attr.latency; |
781 | |||
765 | 782 | ||
766 | bfa_trc(bfa, attr->delay); | 783 | bfa_trc(bfa, attr->delay); |
767 | bfa_trc(bfa, attr->latency); | 784 | bfa_trc(bfa, attr->latency); |