diff options
| -rw-r--r-- | MAINTAINERS | 1 | ||||
| -rw-r--r-- | drivers/scsi/libiscsi.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/pm8001/pm8001_ctl.c | 144 | ||||
| -rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.c | 4 | ||||
| -rw-r--r-- | drivers/scsi/pm8001/pm8001_init.c | 39 | ||||
| -rw-r--r-- | drivers/scsi/qla4xxx/ql4_init.c | 6 | ||||
| -rw-r--r-- | drivers/scsi/qla4xxx/ql4_mbx.c | 14 | ||||
| -rw-r--r-- | drivers/scsi/qla4xxx/ql4_nx.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 16 | ||||
| -rw-r--r-- | drivers/scsi/scsi_transport_iscsi.c | 6 | ||||
| -rw-r--r-- | drivers/scsi/u14-34f.c | 4 | ||||
| -rw-r--r-- | include/scsi/iscsi_if.h | 1 |
12 files changed, 125 insertions, 114 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index 2f85f55c8fb8..3bf3fc26c891 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -7059,6 +7059,7 @@ F: drivers/scsi/pmcraid.* | |||
| 7059 | PMC SIERRA PM8001 DRIVER | 7059 | PMC SIERRA PM8001 DRIVER |
| 7060 | M: xjtuwjp@gmail.com | 7060 | M: xjtuwjp@gmail.com |
| 7061 | M: lindar_liu@usish.com | 7061 | M: lindar_liu@usish.com |
| 7062 | L: pmchba@pmcs.com | ||
| 7062 | L: linux-scsi@vger.kernel.org | 7063 | L: linux-scsi@vger.kernel.org |
| 7063 | S: Supported | 7064 | S: Supported |
| 7064 | F: drivers/scsi/pm8001/ | 7065 | F: drivers/scsi/pm8001/ |
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index f9f3a1224dfa..ea025e4806b6 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
| @@ -2097,7 +2097,7 @@ static void iscsi_check_transport_timeouts(unsigned long data) | |||
| 2097 | conn->ping_timeout, conn->recv_timeout, | 2097 | conn->ping_timeout, conn->recv_timeout, |
| 2098 | last_recv, conn->last_ping, jiffies); | 2098 | last_recv, conn->last_ping, jiffies); |
| 2099 | spin_unlock(&session->frwd_lock); | 2099 | spin_unlock(&session->frwd_lock); |
| 2100 | iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); | 2100 | iscsi_conn_failure(conn, ISCSI_ERR_NOP_TIMEDOUT); |
| 2101 | return; | 2101 | return; |
| 2102 | } | 2102 | } |
| 2103 | 2103 | ||
diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index d3a08aea0948..7abbf284da1a 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c | |||
| @@ -526,18 +526,19 @@ static int pm8001_set_nvmd(struct pm8001_hba_info *pm8001_ha) | |||
| 526 | { | 526 | { |
| 527 | struct pm8001_ioctl_payload *payload; | 527 | struct pm8001_ioctl_payload *payload; |
| 528 | DECLARE_COMPLETION_ONSTACK(completion); | 528 | DECLARE_COMPLETION_ONSTACK(completion); |
| 529 | u8 *ioctlbuffer = NULL; | 529 | u8 *ioctlbuffer; |
| 530 | u32 length = 0; | 530 | u32 ret; |
| 531 | u32 ret = 0; | 531 | u32 length = 1024 * 5 + sizeof(*payload) - 1; |
| 532 | |||
| 533 | if (pm8001_ha->fw_image->size > 4096) { | ||
| 534 | pm8001_ha->fw_status = FAIL_FILE_SIZE; | ||
| 535 | return -EFAULT; | ||
| 536 | } | ||
| 532 | 537 | ||
| 533 | length = 1024 * 5 + sizeof(*payload) - 1; | ||
| 534 | ioctlbuffer = kzalloc(length, GFP_KERNEL); | 538 | ioctlbuffer = kzalloc(length, GFP_KERNEL); |
| 535 | if (!ioctlbuffer) | 539 | if (!ioctlbuffer) { |
| 540 | pm8001_ha->fw_status = FAIL_OUT_MEMORY; | ||
| 536 | return -ENOMEM; | 541 | return -ENOMEM; |
| 537 | if ((pm8001_ha->fw_image->size <= 0) || | ||
| 538 | (pm8001_ha->fw_image->size > 4096)) { | ||
| 539 | ret = FAIL_FILE_SIZE; | ||
| 540 | goto out; | ||
| 541 | } | 542 | } |
| 542 | payload = (struct pm8001_ioctl_payload *)ioctlbuffer; | 543 | payload = (struct pm8001_ioctl_payload *)ioctlbuffer; |
| 543 | memcpy((u8 *)&payload->func_specific, (u8 *)pm8001_ha->fw_image->data, | 544 | memcpy((u8 *)&payload->func_specific, (u8 *)pm8001_ha->fw_image->data, |
| @@ -547,6 +548,10 @@ static int pm8001_set_nvmd(struct pm8001_hba_info *pm8001_ha) | |||
| 547 | payload->minor_function = 0x1; | 548 | payload->minor_function = 0x1; |
| 548 | pm8001_ha->nvmd_completion = &completion; | 549 | pm8001_ha->nvmd_completion = &completion; |
| 549 | ret = PM8001_CHIP_DISP->set_nvmd_req(pm8001_ha, payload); | 550 | ret = PM8001_CHIP_DISP->set_nvmd_req(pm8001_ha, payload); |
| 551 | if (ret) { | ||
| 552 | pm8001_ha->fw_status = FAIL_OUT_MEMORY; | ||
| 553 | goto out; | ||
| 554 | } | ||
| 550 | wait_for_completion(&completion); | 555 | wait_for_completion(&completion); |
| 551 | out: | 556 | out: |
| 552 | kfree(ioctlbuffer); | 557 | kfree(ioctlbuffer); |
| @@ -557,35 +562,31 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha) | |||
| 557 | { | 562 | { |
| 558 | struct pm8001_ioctl_payload *payload; | 563 | struct pm8001_ioctl_payload *payload; |
| 559 | DECLARE_COMPLETION_ONSTACK(completion); | 564 | DECLARE_COMPLETION_ONSTACK(completion); |
| 560 | u8 *ioctlbuffer = NULL; | 565 | u8 *ioctlbuffer; |
| 561 | u32 length = 0; | ||
| 562 | struct fw_control_info *fwControl; | 566 | struct fw_control_info *fwControl; |
| 563 | u32 loopNumber, loopcount = 0; | ||
| 564 | u32 sizeRead = 0; | ||
| 565 | u32 partitionSize, partitionSizeTmp; | 567 | u32 partitionSize, partitionSizeTmp; |
| 566 | u32 ret = 0; | 568 | u32 loopNumber, loopcount; |
| 567 | u32 partitionNumber = 0; | ||
| 568 | struct pm8001_fw_image_header *image_hdr; | 569 | struct pm8001_fw_image_header *image_hdr; |
| 570 | u32 sizeRead = 0; | ||
| 571 | u32 ret = 0; | ||
| 572 | u32 length = 1024 * 16 + sizeof(*payload) - 1; | ||
| 569 | 573 | ||
| 570 | length = 1024 * 16 + sizeof(*payload) - 1; | 574 | if (pm8001_ha->fw_image->size < 28) { |
| 575 | pm8001_ha->fw_status = FAIL_FILE_SIZE; | ||
| 576 | return -EFAULT; | ||
| 577 | } | ||
| 571 | ioctlbuffer = kzalloc(length, GFP_KERNEL); | 578 | ioctlbuffer = kzalloc(length, GFP_KERNEL); |
| 572 | image_hdr = (struct pm8001_fw_image_header *)pm8001_ha->fw_image->data; | 579 | if (!ioctlbuffer) { |
| 573 | if (!ioctlbuffer) | 580 | pm8001_ha->fw_status = FAIL_OUT_MEMORY; |
| 574 | return -ENOMEM; | 581 | return -ENOMEM; |
| 575 | if (pm8001_ha->fw_image->size < 28) { | ||
| 576 | ret = FAIL_FILE_SIZE; | ||
| 577 | goto out; | ||
| 578 | } | 582 | } |
| 579 | 583 | image_hdr = (struct pm8001_fw_image_header *)pm8001_ha->fw_image->data; | |
| 580 | while (sizeRead < pm8001_ha->fw_image->size) { | 584 | while (sizeRead < pm8001_ha->fw_image->size) { |
| 581 | partitionSizeTmp = | 585 | partitionSizeTmp = |
| 582 | *(u32 *)((u8 *)&image_hdr->image_length + sizeRead); | 586 | *(u32 *)((u8 *)&image_hdr->image_length + sizeRead); |
| 583 | partitionSize = be32_to_cpu(partitionSizeTmp); | 587 | partitionSize = be32_to_cpu(partitionSizeTmp); |
| 584 | loopcount = (partitionSize + HEADER_LEN)/IOCTL_BUF_SIZE; | 588 | loopcount = DIV_ROUND_UP(partitionSize + HEADER_LEN, |
| 585 | if (loopcount % IOCTL_BUF_SIZE) | 589 | IOCTL_BUF_SIZE); |
| 586 | loopcount++; | ||
| 587 | if (loopcount == 0) | ||
| 588 | loopcount++; | ||
| 589 | for (loopNumber = 0; loopNumber < loopcount; loopNumber++) { | 590 | for (loopNumber = 0; loopNumber < loopcount; loopNumber++) { |
| 590 | payload = (struct pm8001_ioctl_payload *)ioctlbuffer; | 591 | payload = (struct pm8001_ioctl_payload *)ioctlbuffer; |
| 591 | payload->length = 1024*16; | 592 | payload->length = 1024*16; |
| @@ -617,18 +618,18 @@ static int pm8001_update_flash(struct pm8001_hba_info *pm8001_ha) | |||
| 617 | 618 | ||
| 618 | pm8001_ha->nvmd_completion = &completion; | 619 | pm8001_ha->nvmd_completion = &completion; |
| 619 | ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload); | 620 | ret = PM8001_CHIP_DISP->fw_flash_update_req(pm8001_ha, payload); |
| 620 | if (ret) | 621 | if (ret) { |
| 621 | break; | 622 | pm8001_ha->fw_status = FAIL_OUT_MEMORY; |
| 623 | goto out; | ||
| 624 | } | ||
| 622 | wait_for_completion(&completion); | 625 | wait_for_completion(&completion); |
| 623 | if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) { | 626 | if (fwControl->retcode > FLASH_UPDATE_IN_PROGRESS) { |
| 624 | ret = fwControl->retcode; | 627 | pm8001_ha->fw_status = fwControl->retcode; |
| 625 | break; | 628 | ret = -EFAULT; |
| 629 | goto out; | ||
| 630 | } | ||
| 626 | } | 631 | } |
| 627 | } | 632 | } |
| 628 | if (ret) | ||
| 629 | break; | ||
| 630 | partitionNumber++; | ||
| 631 | } | ||
| 632 | out: | 633 | out: |
| 633 | kfree(ioctlbuffer); | 634 | kfree(ioctlbuffer); |
| 634 | return ret; | 635 | return ret; |
| @@ -643,22 +644,29 @@ static ssize_t pm8001_store_update_fw(struct device *cdev, | |||
| 643 | char *cmd_ptr, *filename_ptr; | 644 | char *cmd_ptr, *filename_ptr; |
| 644 | int res, i; | 645 | int res, i; |
| 645 | int flash_command = FLASH_CMD_NONE; | 646 | int flash_command = FLASH_CMD_NONE; |
| 646 | int err = 0; | 647 | int ret; |
| 648 | |||
| 647 | if (!capable(CAP_SYS_ADMIN)) | 649 | if (!capable(CAP_SYS_ADMIN)) |
| 648 | return -EACCES; | 650 | return -EACCES; |
| 649 | 651 | ||
| 650 | cmd_ptr = kzalloc(count*2, GFP_KERNEL); | 652 | /* this test protects us from running two flash processes at once, |
| 653 | * so we should start with this test */ | ||
| 654 | if (pm8001_ha->fw_status == FLASH_IN_PROGRESS) | ||
| 655 | return -EINPROGRESS; | ||
| 656 | pm8001_ha->fw_status = FLASH_IN_PROGRESS; | ||
| 651 | 657 | ||
| 658 | cmd_ptr = kzalloc(count*2, GFP_KERNEL); | ||
| 652 | if (!cmd_ptr) { | 659 | if (!cmd_ptr) { |
| 653 | err = FAIL_OUT_MEMORY; | 660 | pm8001_ha->fw_status = FAIL_OUT_MEMORY; |
| 654 | goto out; | 661 | return -ENOMEM; |
| 655 | } | 662 | } |
| 656 | 663 | ||
| 657 | filename_ptr = cmd_ptr + count; | 664 | filename_ptr = cmd_ptr + count; |
| 658 | res = sscanf(buf, "%s %s", cmd_ptr, filename_ptr); | 665 | res = sscanf(buf, "%s %s", cmd_ptr, filename_ptr); |
| 659 | if (res != 2) { | 666 | if (res != 2) { |
| 660 | err = FAIL_PARAMETERS; | 667 | pm8001_ha->fw_status = FAIL_PARAMETERS; |
| 661 | goto out1; | 668 | ret = -EINVAL; |
| 669 | goto out; | ||
| 662 | } | 670 | } |
| 663 | 671 | ||
| 664 | for (i = 0; flash_command_table[i].code != FLASH_CMD_NONE; i++) { | 672 | for (i = 0; flash_command_table[i].code != FLASH_CMD_NONE; i++) { |
| @@ -669,50 +677,38 @@ static ssize_t pm8001_store_update_fw(struct device *cdev, | |||
| 669 | } | 677 | } |
| 670 | } | 678 | } |
| 671 | if (flash_command == FLASH_CMD_NONE) { | 679 | if (flash_command == FLASH_CMD_NONE) { |
| 672 | err = FAIL_PARAMETERS; | 680 | pm8001_ha->fw_status = FAIL_PARAMETERS; |
| 673 | goto out1; | 681 | ret = -EINVAL; |
| 682 | goto out; | ||
| 674 | } | 683 | } |
| 675 | 684 | ||
| 676 | if (pm8001_ha->fw_status == FLASH_IN_PROGRESS) { | 685 | ret = request_firmware(&pm8001_ha->fw_image, |
| 677 | err = FLASH_IN_PROGRESS; | ||
| 678 | goto out1; | ||
| 679 | } | ||
| 680 | err = request_firmware(&pm8001_ha->fw_image, | ||
| 681 | filename_ptr, | 686 | filename_ptr, |
| 682 | pm8001_ha->dev); | 687 | pm8001_ha->dev); |
| 683 | 688 | ||
| 684 | if (err) { | 689 | if (ret) { |
| 685 | PM8001_FAIL_DBG(pm8001_ha, | 690 | PM8001_FAIL_DBG(pm8001_ha, |
| 686 | pm8001_printk("Failed to load firmware image file %s," | 691 | pm8001_printk( |
| 687 | " error %d\n", filename_ptr, err)); | 692 | "Failed to load firmware image file %s, error %d\n", |
| 688 | err = FAIL_OPEN_BIOS_FILE; | 693 | filename_ptr, ret)); |
| 689 | goto out1; | 694 | pm8001_ha->fw_status = FAIL_OPEN_BIOS_FILE; |
| 695 | goto out; | ||
| 690 | } | 696 | } |
| 691 | 697 | ||
| 692 | switch (flash_command) { | 698 | if (FLASH_CMD_UPDATE == flash_command) |
| 693 | case FLASH_CMD_UPDATE: | 699 | ret = pm8001_update_flash(pm8001_ha); |
| 694 | pm8001_ha->fw_status = FLASH_IN_PROGRESS; | 700 | else |
| 695 | err = pm8001_update_flash(pm8001_ha); | 701 | ret = pm8001_set_nvmd(pm8001_ha); |
| 696 | break; | 702 | |
| 697 | case FLASH_CMD_SET_NVMD: | ||
| 698 | pm8001_ha->fw_status = FLASH_IN_PROGRESS; | ||
| 699 | err = pm8001_set_nvmd(pm8001_ha); | ||
| 700 | break; | ||
| 701 | default: | ||
| 702 | pm8001_ha->fw_status = FAIL_PARAMETERS; | ||
| 703 | err = FAIL_PARAMETERS; | ||
| 704 | break; | ||
| 705 | } | ||
| 706 | release_firmware(pm8001_ha->fw_image); | 703 | release_firmware(pm8001_ha->fw_image); |
| 707 | out1: | ||
| 708 | kfree(cmd_ptr); | ||
| 709 | out: | 704 | out: |
| 710 | pm8001_ha->fw_status = err; | 705 | kfree(cmd_ptr); |
| 711 | 706 | ||
| 712 | if (!err) | 707 | if (ret) |
| 713 | return count; | 708 | return ret; |
| 714 | else | 709 | |
| 715 | return -err; | 710 | pm8001_ha->fw_status = FLASH_OK; |
| 711 | return count; | ||
| 716 | } | 712 | } |
| 717 | 713 | ||
| 718 | static ssize_t pm8001_show_update_fw(struct device *cdev, | 714 | static ssize_t pm8001_show_update_fw(struct device *cdev, |
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index 173831016f5f..dd12c6fe57a6 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c | |||
| @@ -4824,7 +4824,7 @@ int pm8001_chip_set_nvmd_req(struct pm8001_hba_info *pm8001_ha, | |||
| 4824 | rc = pm8001_tag_alloc(pm8001_ha, &tag); | 4824 | rc = pm8001_tag_alloc(pm8001_ha, &tag); |
| 4825 | if (rc) { | 4825 | if (rc) { |
| 4826 | kfree(fw_control_context); | 4826 | kfree(fw_control_context); |
| 4827 | return rc; | 4827 | return -EBUSY; |
| 4828 | } | 4828 | } |
| 4829 | ccb = &pm8001_ha->ccb_info[tag]; | 4829 | ccb = &pm8001_ha->ccb_info[tag]; |
| 4830 | ccb->fw_control_context = fw_control_context; | 4830 | ccb->fw_control_context = fw_control_context; |
| @@ -4946,7 +4946,7 @@ pm8001_chip_fw_flash_update_req(struct pm8001_hba_info *pm8001_ha, | |||
| 4946 | rc = pm8001_tag_alloc(pm8001_ha, &tag); | 4946 | rc = pm8001_tag_alloc(pm8001_ha, &tag); |
| 4947 | if (rc) { | 4947 | if (rc) { |
| 4948 | kfree(fw_control_context); | 4948 | kfree(fw_control_context); |
| 4949 | return rc; | 4949 | return -EBUSY; |
| 4950 | } | 4950 | } |
| 4951 | ccb = &pm8001_ha->ccb_info[tag]; | 4951 | ccb = &pm8001_ha->ccb_info[tag]; |
| 4952 | ccb->fw_control_context = fw_control_context; | 4952 | ccb->fw_control_context = fw_control_context; |
diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index e49623a897a7..666bf5af06e2 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c | |||
| @@ -748,34 +748,35 @@ static u32 pm8001_setup_msix(struct pm8001_hba_info *pm8001_ha) | |||
| 748 | sizeof(pm8001_ha->msix_entries[0]); | 748 | sizeof(pm8001_ha->msix_entries[0]); |
| 749 | for (i = 0; i < max_entry ; i++) | 749 | for (i = 0; i < max_entry ; i++) |
| 750 | pm8001_ha->msix_entries[i].entry = i; | 750 | pm8001_ha->msix_entries[i].entry = i; |
| 751 | rc = pci_enable_msix(pm8001_ha->pdev, pm8001_ha->msix_entries, | 751 | rc = pci_enable_msix_exact(pm8001_ha->pdev, pm8001_ha->msix_entries, |
| 752 | number_of_intr); | 752 | number_of_intr); |
| 753 | pm8001_ha->number_of_intr = number_of_intr; | 753 | pm8001_ha->number_of_intr = number_of_intr; |
| 754 | if (!rc) { | 754 | if (rc) |
| 755 | PM8001_INIT_DBG(pm8001_ha, pm8001_printk( | 755 | return rc; |
| 756 | "pci_enable_msix request ret:%d no of intr %d\n", | ||
| 757 | rc, pm8001_ha->number_of_intr)); | ||
| 758 | 756 | ||
| 757 | PM8001_INIT_DBG(pm8001_ha, pm8001_printk( | ||
| 758 | "pci_enable_msix_exact request ret:%d no of intr %d\n", | ||
| 759 | rc, pm8001_ha->number_of_intr)); | ||
| 759 | 760 | ||
| 760 | for (i = 0; i < number_of_intr; i++) { | 761 | for (i = 0; i < number_of_intr; i++) { |
| 761 | snprintf(intr_drvname[i], sizeof(intr_drvname[0]), | 762 | snprintf(intr_drvname[i], sizeof(intr_drvname[0]), |
| 762 | DRV_NAME"%d", i); | 763 | DRV_NAME"%d", i); |
| 763 | pm8001_ha->irq_vector[i].irq_id = i; | 764 | pm8001_ha->irq_vector[i].irq_id = i; |
| 764 | pm8001_ha->irq_vector[i].drv_inst = pm8001_ha; | 765 | pm8001_ha->irq_vector[i].drv_inst = pm8001_ha; |
| 765 | 766 | ||
| 766 | rc = request_irq(pm8001_ha->msix_entries[i].vector, | 767 | rc = request_irq(pm8001_ha->msix_entries[i].vector, |
| 767 | pm8001_interrupt_handler_msix, flag, | 768 | pm8001_interrupt_handler_msix, flag, |
| 768 | intr_drvname[i], &(pm8001_ha->irq_vector[i])); | 769 | intr_drvname[i], &(pm8001_ha->irq_vector[i])); |
| 769 | if (rc) { | 770 | if (rc) { |
| 770 | for (j = 0; j < i; j++) | 771 | for (j = 0; j < i; j++) { |
| 771 | free_irq( | 772 | free_irq(pm8001_ha->msix_entries[j].vector, |
| 772 | pm8001_ha->msix_entries[j].vector, | ||
| 773 | &(pm8001_ha->irq_vector[i])); | 773 | &(pm8001_ha->irq_vector[i])); |
| 774 | pci_disable_msix(pm8001_ha->pdev); | ||
| 775 | break; | ||
| 776 | } | 774 | } |
| 775 | pci_disable_msix(pm8001_ha->pdev); | ||
| 776 | break; | ||
| 777 | } | 777 | } |
| 778 | } | 778 | } |
| 779 | |||
| 779 | return rc; | 780 | return rc; |
| 780 | } | 781 | } |
| 781 | #endif | 782 | #endif |
diff --git a/drivers/scsi/qla4xxx/ql4_init.c b/drivers/scsi/qla4xxx/ql4_init.c index 6f12f859b11d..4180d6d9fe78 100644 --- a/drivers/scsi/qla4xxx/ql4_init.c +++ b/drivers/scsi/qla4xxx/ql4_init.c | |||
| @@ -334,6 +334,12 @@ void qla4xxx_alloc_fw_dump(struct scsi_qla_host *ha) | |||
| 334 | /* Allocate memory for saving the template */ | 334 | /* Allocate memory for saving the template */ |
| 335 | md_tmp = dma_alloc_coherent(&ha->pdev->dev, ha->fw_dump_tmplt_size, | 335 | md_tmp = dma_alloc_coherent(&ha->pdev->dev, ha->fw_dump_tmplt_size, |
| 336 | &md_tmp_dma, GFP_KERNEL); | 336 | &md_tmp_dma, GFP_KERNEL); |
| 337 | if (!md_tmp) { | ||
| 338 | ql4_printk(KERN_INFO, ha, | ||
| 339 | "scsi%ld: Failed to allocate DMA memory\n", | ||
| 340 | ha->host_no); | ||
| 341 | return; | ||
| 342 | } | ||
| 337 | 343 | ||
| 338 | /* Request template */ | 344 | /* Request template */ |
| 339 | status = qla4xxx_get_minidump_template(ha, md_tmp_dma); | 345 | status = qla4xxx_get_minidump_template(ha, md_tmp_dma); |
diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c index fdfae79924ac..c291fdff1b33 100644 --- a/drivers/scsi/qla4xxx/ql4_mbx.c +++ b/drivers/scsi/qla4xxx/ql4_mbx.c | |||
| @@ -1620,8 +1620,8 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password, | |||
| 1620 | goto exit_get_chap; | 1620 | goto exit_get_chap; |
| 1621 | } | 1621 | } |
| 1622 | 1622 | ||
| 1623 | strncpy(password, chap_table->secret, QL4_CHAP_MAX_SECRET_LEN); | 1623 | strlcpy(password, chap_table->secret, QL4_CHAP_MAX_SECRET_LEN); |
| 1624 | strncpy(username, chap_table->name, QL4_CHAP_MAX_NAME_LEN); | 1624 | strlcpy(username, chap_table->name, QL4_CHAP_MAX_NAME_LEN); |
| 1625 | chap_table->cookie = __constant_cpu_to_le16(CHAP_VALID_COOKIE); | 1625 | chap_table->cookie = __constant_cpu_to_le16(CHAP_VALID_COOKIE); |
| 1626 | 1626 | ||
| 1627 | exit_get_chap: | 1627 | exit_get_chap: |
| @@ -1663,8 +1663,8 @@ int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password, | |||
| 1663 | else | 1663 | else |
| 1664 | chap_table->flags |= BIT_7; /* local */ | 1664 | chap_table->flags |= BIT_7; /* local */ |
| 1665 | chap_table->secret_len = strlen(password); | 1665 | chap_table->secret_len = strlen(password); |
| 1666 | strncpy(chap_table->secret, password, MAX_CHAP_SECRET_LEN); | 1666 | strncpy(chap_table->secret, password, MAX_CHAP_SECRET_LEN - 1); |
| 1667 | strncpy(chap_table->name, username, MAX_CHAP_NAME_LEN); | 1667 | strncpy(chap_table->name, username, MAX_CHAP_NAME_LEN - 1); |
| 1668 | chap_table->cookie = __constant_cpu_to_le16(CHAP_VALID_COOKIE); | 1668 | chap_table->cookie = __constant_cpu_to_le16(CHAP_VALID_COOKIE); |
| 1669 | 1669 | ||
| 1670 | if (is_qla40XX(ha)) { | 1670 | if (is_qla40XX(ha)) { |
| @@ -1742,8 +1742,8 @@ int qla4xxx_get_uni_chap_at_index(struct scsi_qla_host *ha, char *username, | |||
| 1742 | goto exit_unlock_uni_chap; | 1742 | goto exit_unlock_uni_chap; |
| 1743 | } | 1743 | } |
| 1744 | 1744 | ||
| 1745 | strncpy(password, chap_table->secret, MAX_CHAP_SECRET_LEN); | 1745 | strlcpy(password, chap_table->secret, MAX_CHAP_SECRET_LEN); |
| 1746 | strncpy(username, chap_table->name, MAX_CHAP_NAME_LEN); | 1746 | strlcpy(username, chap_table->name, MAX_CHAP_NAME_LEN); |
| 1747 | 1747 | ||
| 1748 | rval = QLA_SUCCESS; | 1748 | rval = QLA_SUCCESS; |
| 1749 | 1749 | ||
| @@ -2295,7 +2295,7 @@ int qla4_8xxx_set_param(struct scsi_qla_host *ha, int param) | |||
| 2295 | if (param == SET_DRVR_VERSION) { | 2295 | if (param == SET_DRVR_VERSION) { |
| 2296 | mbox_cmd[1] = SET_DRVR_VERSION; | 2296 | mbox_cmd[1] = SET_DRVR_VERSION; |
| 2297 | strncpy((char *)&mbox_cmd[2], QLA4XXX_DRIVER_VERSION, | 2297 | strncpy((char *)&mbox_cmd[2], QLA4XXX_DRIVER_VERSION, |
| 2298 | MAX_DRVR_VER_LEN); | 2298 | MAX_DRVR_VER_LEN - 1); |
| 2299 | } else { | 2299 | } else { |
| 2300 | ql4_printk(KERN_ERR, ha, "%s: invalid parameter 0x%x\n", | 2300 | ql4_printk(KERN_ERR, ha, "%s: invalid parameter 0x%x\n", |
| 2301 | __func__, param); | 2301 | __func__, param); |
diff --git a/drivers/scsi/qla4xxx/ql4_nx.c b/drivers/scsi/qla4xxx/ql4_nx.c index 9dbdb4be2d8f..7c3365864242 100644 --- a/drivers/scsi/qla4xxx/ql4_nx.c +++ b/drivers/scsi/qla4xxx/ql4_nx.c | |||
| @@ -4221,7 +4221,7 @@ qla4_8xxx_enable_msix(struct scsi_qla_host *ha) | |||
| 4221 | for (i = 0; i < QLA_MSIX_ENTRIES; i++) | 4221 | for (i = 0; i < QLA_MSIX_ENTRIES; i++) |
| 4222 | entries[i].entry = qla4_8xxx_msix_entries[i].entry; | 4222 | entries[i].entry = qla4_8xxx_msix_entries[i].entry; |
| 4223 | 4223 | ||
| 4224 | ret = pci_enable_msix(ha->pdev, entries, ARRAY_SIZE(entries)); | 4224 | ret = pci_enable_msix_exact(ha->pdev, entries, ARRAY_SIZE(entries)); |
| 4225 | if (ret) { | 4225 | if (ret) { |
| 4226 | ql4_printk(KERN_WARNING, ha, | 4226 | ql4_printk(KERN_WARNING, ha, |
| 4227 | "MSI-X: Failed to enable support -- %d/%d\n", | 4227 | "MSI-X: Failed to enable support -- %d/%d\n", |
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index c5d9564d455c..199fcf79a051 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
| @@ -756,9 +756,9 @@ static int qla4xxx_get_chap_list(struct Scsi_Host *shost, uint16_t chap_tbl_idx, | |||
| 756 | continue; | 756 | continue; |
| 757 | 757 | ||
| 758 | chap_rec->chap_tbl_idx = i; | 758 | chap_rec->chap_tbl_idx = i; |
| 759 | strncpy(chap_rec->username, chap_table->name, | 759 | strlcpy(chap_rec->username, chap_table->name, |
| 760 | ISCSI_CHAP_AUTH_NAME_MAX_LEN); | 760 | ISCSI_CHAP_AUTH_NAME_MAX_LEN); |
| 761 | strncpy(chap_rec->password, chap_table->secret, | 761 | strlcpy(chap_rec->password, chap_table->secret, |
| 762 | QL4_CHAP_MAX_SECRET_LEN); | 762 | QL4_CHAP_MAX_SECRET_LEN); |
| 763 | chap_rec->password_length = chap_table->secret_len; | 763 | chap_rec->password_length = chap_table->secret_len; |
| 764 | 764 | ||
| @@ -1050,6 +1050,7 @@ static int qla4xxx_get_host_stats(struct Scsi_Host *shost, char *buf, int len) | |||
| 1050 | if (!ql_iscsi_stats) { | 1050 | if (!ql_iscsi_stats) { |
| 1051 | ql4_printk(KERN_ERR, ha, | 1051 | ql4_printk(KERN_ERR, ha, |
| 1052 | "Unable to allocate memory for iscsi stats\n"); | 1052 | "Unable to allocate memory for iscsi stats\n"); |
| 1053 | ret = -ENOMEM; | ||
| 1053 | goto exit_host_stats; | 1054 | goto exit_host_stats; |
| 1054 | } | 1055 | } |
| 1055 | 1056 | ||
| @@ -1058,6 +1059,7 @@ static int qla4xxx_get_host_stats(struct Scsi_Host *shost, char *buf, int len) | |||
| 1058 | if (ret != QLA_SUCCESS) { | 1059 | if (ret != QLA_SUCCESS) { |
| 1059 | ql4_printk(KERN_ERR, ha, | 1060 | ql4_printk(KERN_ERR, ha, |
| 1060 | "Unable to retrieve iscsi stats\n"); | 1061 | "Unable to retrieve iscsi stats\n"); |
| 1062 | ret = -EIO; | ||
| 1061 | goto exit_host_stats; | 1063 | goto exit_host_stats; |
| 1062 | } | 1064 | } |
| 1063 | host_stats->mactx_frames = le64_to_cpu(ql_iscsi_stats->mac_tx_frames); | 1065 | host_stats->mactx_frames = le64_to_cpu(ql_iscsi_stats->mac_tx_frames); |
| @@ -6027,8 +6029,8 @@ static int qla4xxx_get_bidi_chap(struct scsi_qla_host *ha, char *username, | |||
| 6027 | if (!(chap_table->flags & BIT_6)) /* Not BIDI */ | 6029 | if (!(chap_table->flags & BIT_6)) /* Not BIDI */ |
| 6028 | continue; | 6030 | continue; |
| 6029 | 6031 | ||
| 6030 | strncpy(password, chap_table->secret, QL4_CHAP_MAX_SECRET_LEN); | 6032 | strlcpy(password, chap_table->secret, QL4_CHAP_MAX_SECRET_LEN); |
| 6031 | strncpy(username, chap_table->name, QL4_CHAP_MAX_NAME_LEN); | 6033 | strlcpy(username, chap_table->name, QL4_CHAP_MAX_NAME_LEN); |
| 6032 | ret = 0; | 6034 | ret = 0; |
| 6033 | break; | 6035 | break; |
| 6034 | } | 6036 | } |
| @@ -6258,8 +6260,8 @@ static void qla4xxx_get_param_ddb(struct ddb_entry *ddb_entry, | |||
| 6258 | 6260 | ||
| 6259 | tddb->tpgt = sess->tpgt; | 6261 | tddb->tpgt = sess->tpgt; |
| 6260 | tddb->port = conn->persistent_port; | 6262 | tddb->port = conn->persistent_port; |
| 6261 | strncpy(tddb->iscsi_name, sess->targetname, ISCSI_NAME_SIZE); | 6263 | strlcpy(tddb->iscsi_name, sess->targetname, ISCSI_NAME_SIZE); |
| 6262 | strncpy(tddb->ip_addr, conn->persistent_address, DDB_IPADDR_LEN); | 6264 | strlcpy(tddb->ip_addr, conn->persistent_address, DDB_IPADDR_LEN); |
| 6263 | } | 6265 | } |
| 6264 | 6266 | ||
| 6265 | static void qla4xxx_convert_param_ddb(struct dev_db_entry *fw_ddb_entry, | 6267 | static void qla4xxx_convert_param_ddb(struct dev_db_entry *fw_ddb_entry, |
| @@ -7764,7 +7766,7 @@ static int qla4xxx_sysfs_ddb_logout(struct iscsi_bus_flash_session *fnode_sess, | |||
| 7764 | goto exit_ddb_logout; | 7766 | goto exit_ddb_logout; |
| 7765 | } | 7767 | } |
| 7766 | 7768 | ||
| 7767 | strncpy(flash_tddb->iscsi_name, fnode_sess->targetname, | 7769 | strlcpy(flash_tddb->iscsi_name, fnode_sess->targetname, |
| 7768 | ISCSI_NAME_SIZE); | 7770 | ISCSI_NAME_SIZE); |
| 7769 | 7771 | ||
| 7770 | if (!strncmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4)) | 7772 | if (!strncmp(fnode_sess->portal_type, PORTAL_TYPE_IPV6, 4)) |
diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c index b481e62a12cc..67d43e35693d 100644 --- a/drivers/scsi/scsi_transport_iscsi.c +++ b/drivers/scsi/scsi_transport_iscsi.c | |||
| @@ -3429,7 +3429,7 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh) | |||
| 3429 | char *buf; | 3429 | char *buf; |
| 3430 | 3430 | ||
| 3431 | if (!transport->get_host_stats) | 3431 | if (!transport->get_host_stats) |
| 3432 | return -EINVAL; | 3432 | return -ENOSYS; |
| 3433 | 3433 | ||
| 3434 | priv = iscsi_if_transport_lookup(transport); | 3434 | priv = iscsi_if_transport_lookup(transport); |
| 3435 | if (!priv) | 3435 | if (!priv) |
| @@ -3467,6 +3467,10 @@ iscsi_get_host_stats(struct iscsi_transport *transport, struct nlmsghdr *nlh) | |||
| 3467 | memset(buf, 0, host_stats_size); | 3467 | memset(buf, 0, host_stats_size); |
| 3468 | 3468 | ||
| 3469 | err = transport->get_host_stats(shost, buf, host_stats_size); | 3469 | err = transport->get_host_stats(shost, buf, host_stats_size); |
| 3470 | if (err) { | ||
| 3471 | kfree_skb(skbhost_stats); | ||
| 3472 | goto exit_host_stats; | ||
| 3473 | } | ||
| 3470 | 3474 | ||
| 3471 | actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size); | 3475 | actual_size = nlmsg_total_size(sizeof(*ev) + host_stats_size); |
| 3472 | skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size)); | 3476 | skb_trim(skbhost_stats, NLMSG_ALIGN(actual_size)); |
diff --git a/drivers/scsi/u14-34f.c b/drivers/scsi/u14-34f.c index 4e76fe863fc4..d8dcf36aed11 100644 --- a/drivers/scsi/u14-34f.c +++ b/drivers/scsi/u14-34f.c | |||
| @@ -1006,7 +1006,7 @@ static int port_detect \ | |||
| 1006 | sh[j]->irq, dma_name, sh[j]->sg_tablesize, sh[j]->can_queue); | 1006 | sh[j]->irq, dma_name, sh[j]->sg_tablesize, sh[j]->can_queue); |
| 1007 | 1007 | ||
| 1008 | if (sh[j]->max_id > 8 || sh[j]->max_lun > 8) | 1008 | if (sh[j]->max_id > 8 || sh[j]->max_lun > 8) |
| 1009 | printk("%s: wide SCSI support enabled, max_id %u, max_lun %u.\n", | 1009 | printk("%s: wide SCSI support enabled, max_id %u, max_lun %llu.\n", |
| 1010 | BN(j), sh[j]->max_id, sh[j]->max_lun); | 1010 | BN(j), sh[j]->max_id, sh[j]->max_lun); |
| 1011 | 1011 | ||
| 1012 | for (i = 0; i <= sh[j]->max_channel; i++) | 1012 | for (i = 0; i <= sh[j]->max_channel; i++) |
| @@ -1285,7 +1285,7 @@ static int u14_34f_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct | |||
| 1285 | cpp->cpp_index = i; | 1285 | cpp->cpp_index = i; |
| 1286 | SCpnt->host_scribble = (unsigned char *) &cpp->cpp_index; | 1286 | SCpnt->host_scribble = (unsigned char *) &cpp->cpp_index; |
| 1287 | 1287 | ||
| 1288 | if (do_trace) printk("%s: qcomm, mbox %d, target %d.%d:%llu.\n", | 1288 | if (do_trace) printk("%s: qcomm, mbox %d, target %d.%d:%u.\n", |
| 1289 | BN(j), i, SCpnt->device->channel, SCpnt->device->id, | 1289 | BN(j), i, SCpnt->device->channel, SCpnt->device->id, |
| 1290 | (u8)SCpnt->device->lun); | 1290 | (u8)SCpnt->device->lun); |
| 1291 | 1291 | ||
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index fd0421c6d40a..95ed9424a11a 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
| @@ -527,6 +527,7 @@ enum iscsi_err { | |||
| 527 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, | 527 | ISCSI_ERR_XMIT_FAILED = ISCSI_ERR_BASE + 19, |
| 528 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, | 528 | ISCSI_ERR_TCP_CONN_CLOSE = ISCSI_ERR_BASE + 20, |
| 529 | ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21, | 529 | ISCSI_ERR_SCSI_EH_SESSION_RST = ISCSI_ERR_BASE + 21, |
| 530 | ISCSI_ERR_NOP_TIMEDOUT = ISCSI_ERR_BASE + 22, | ||
| 530 | }; | 531 | }; |
| 531 | 532 | ||
| 532 | /* | 533 | /* |
