diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index c16154c51298..da84ee2d090b 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -1979,6 +1979,26 @@ qla2x00_mem_alloc(scsi_qla_host_t *ha) | |||
1979 | continue; | 1979 | continue; |
1980 | } | 1980 | } |
1981 | memset(ha->ct_sns, 0, sizeof(struct ct_sns_pkt)); | 1981 | memset(ha->ct_sns, 0, sizeof(struct ct_sns_pkt)); |
1982 | |||
1983 | if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { | ||
1984 | /* | ||
1985 | * Get consistent memory allocated for SFP | ||
1986 | * block. | ||
1987 | */ | ||
1988 | ha->sfp_data = dma_pool_alloc(ha->s_dma_pool, | ||
1989 | GFP_KERNEL, &ha->sfp_data_dma); | ||
1990 | if (ha->sfp_data == NULL) { | ||
1991 | qla_printk(KERN_WARNING, ha, | ||
1992 | "Memory Allocation failed - " | ||
1993 | "sfp_data\n"); | ||
1994 | |||
1995 | qla2x00_mem_free(ha); | ||
1996 | msleep(100); | ||
1997 | |||
1998 | continue; | ||
1999 | } | ||
2000 | memset(ha->sfp_data, 0, SFP_BLOCK_SIZE); | ||
2001 | } | ||
1982 | } | 2002 | } |
1983 | 2003 | ||
1984 | /* Done all allocations without any error. */ | 2004 | /* Done all allocations without any error. */ |
@@ -2034,6 +2054,9 @@ qla2x00_mem_free(scsi_qla_host_t *ha) | |||
2034 | dma_free_coherent(&ha->pdev->dev, sizeof(struct ct_sns_pkt), | 2054 | dma_free_coherent(&ha->pdev->dev, sizeof(struct ct_sns_pkt), |
2035 | ha->ct_sns, ha->ct_sns_dma); | 2055 | ha->ct_sns, ha->ct_sns_dma); |
2036 | 2056 | ||
2057 | if (ha->sfp_data) | ||
2058 | dma_pool_free(ha->s_dma_pool, ha->sfp_data, ha->sfp_data_dma); | ||
2059 | |||
2037 | if (ha->ms_iocb) | 2060 | if (ha->ms_iocb) |
2038 | dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma); | 2061 | dma_pool_free(ha->s_dma_pool, ha->ms_iocb, ha->ms_iocb_dma); |
2039 | 2062 | ||