diff options
author | James Smart <james.smart@emulex.com> | 2012-06-12 13:54:27 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-07-20 03:58:27 -0400 |
commit | bbeb79b90e806da2e2338bd8d89c6fa8a1333357 (patch) | |
tree | ed4cab1c4653292194d6ce9e5b4cfe01894ac7c6 | |
parent | 3b3da6a974357887c73c5ee61988dbe3a8f62d88 (diff) |
[SCSI] lpfc 8.3.32: Correct host DIF configuration that hung system
Fix system hang due to bad protection module parameters (CR: 130769)
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 411ed48d79da..a79e2c21c5e4 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -5514,14 +5514,45 @@ lpfc_destroy_shost(struct lpfc_hba *phba) | |||
5514 | static void | 5514 | static void |
5515 | lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost) | 5515 | lpfc_setup_bg(struct lpfc_hba *phba, struct Scsi_Host *shost) |
5516 | { | 5516 | { |
5517 | uint32_t old_mask; | ||
5518 | uint32_t old_guard; | ||
5519 | |||
5517 | int pagecnt = 10; | 5520 | int pagecnt = 10; |
5518 | if (lpfc_prot_mask && lpfc_prot_guard) { | 5521 | if (lpfc_prot_mask && lpfc_prot_guard) { |
5519 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, | 5522 | lpfc_printf_log(phba, KERN_INFO, LOG_INIT, |
5520 | "1478 Registering BlockGuard with the " | 5523 | "1478 Registering BlockGuard with the " |
5521 | "SCSI layer\n"); | 5524 | "SCSI layer\n"); |
5522 | scsi_host_set_prot(shost, lpfc_prot_mask); | 5525 | |
5523 | scsi_host_set_guard(shost, lpfc_prot_guard); | 5526 | old_mask = lpfc_prot_mask; |
5527 | old_guard = lpfc_prot_guard; | ||
5528 | |||
5529 | /* Only allow supported values */ | ||
5530 | lpfc_prot_mask &= (SHOST_DIF_TYPE1_PROTECTION | | ||
5531 | SHOST_DIX_TYPE0_PROTECTION | | ||
5532 | SHOST_DIX_TYPE1_PROTECTION); | ||
5533 | lpfc_prot_guard &= (SHOST_DIX_GUARD_IP | SHOST_DIX_GUARD_CRC); | ||
5534 | |||
5535 | /* DIF Type 1 protection for profiles AST1/C1 is end to end */ | ||
5536 | if (lpfc_prot_mask == SHOST_DIX_TYPE1_PROTECTION) | ||
5537 | lpfc_prot_mask |= SHOST_DIF_TYPE1_PROTECTION; | ||
5538 | |||
5539 | if (lpfc_prot_mask && lpfc_prot_guard) { | ||
5540 | if ((old_mask != lpfc_prot_mask) || | ||
5541 | (old_guard != lpfc_prot_guard)) | ||
5542 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | ||
5543 | "1475 Registering BlockGuard with the " | ||
5544 | "SCSI layer: mask %d guard %d\n", | ||
5545 | lpfc_prot_mask, lpfc_prot_guard); | ||
5546 | |||
5547 | scsi_host_set_prot(shost, lpfc_prot_mask); | ||
5548 | scsi_host_set_guard(shost, lpfc_prot_guard); | ||
5549 | } else | ||
5550 | lpfc_printf_log(phba, KERN_ERR, LOG_INIT, | ||
5551 | "1479 Not Registering BlockGuard with the SCSI " | ||
5552 | "layer, Bad protection parameters: %d %d\n", | ||
5553 | old_mask, old_guard); | ||
5524 | } | 5554 | } |
5555 | |||
5525 | if (!_dump_buf_data) { | 5556 | if (!_dump_buf_data) { |
5526 | while (pagecnt) { | 5557 | while (pagecnt) { |
5527 | spin_lock_init(&_dump_buf_lock); | 5558 | spin_lock_init(&_dump_buf_lock); |