Merge remote-tracking branch 'scsi-queue/drivers-for-3.16' into for-linus

+5 -4
MAINTAINERS
··· 5517 5517 F: arch/arm/mach-lpc32xx/ 5518 5518 5519 5519 LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI) 5520 - M: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com> 5521 - M: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> 5522 - M: support@lsi.com 5523 - L: DL-MPTFusionLinux@lsi.com 5520 + M: Nagalakshmi Nandigama <nagalakshmi.nandigama@avagotech.com> 5521 + M: Praveen Krishnamoorthy <praveen.krishnamoorthy@avagotech.com> 5522 + M: Sreekanth Reddy <sreekanth.reddy@avagotech.com> 5523 + M: Abhijit Mahajan <abhijit.mahajan@avagotech.com> 5524 + L: MPT-FusionLinux.pdl@avagotech.com 5524 5525 L: linux-scsi@vger.kernel.org 5525 5526 W: http://www.lsilogic.com/support 5526 5527 S: Supported
+2
drivers/scsi/be2iscsi/be_main.c
··· 4198 4198 kfree(phba->ep_array); 4199 4199 phba->ep_array = NULL; 4200 4200 ret = -ENOMEM; 4201 + 4202 + goto free_memory; 4201 4203 } 4202 4204 4203 4205 for (i = 0; i < phba->params.cxns_per_ctrl; i++) {
+1 -3
drivers/scsi/be2iscsi/be_mgmt.c
··· 1008 1008 BE2_IPV6 : BE2_IPV4 ; 1009 1009 1010 1010 rc = mgmt_get_if_info(phba, ip_type, &if_info); 1011 - if (rc) { 1012 - kfree(if_info); 1011 + if (rc) 1013 1012 return rc; 1014 - } 1015 1013 1016 1014 if (boot_proto == ISCSI_BOOTPROTO_DHCP) { 1017 1015 if (if_info->dhcp_state) {
+4 -12
drivers/scsi/bnx2fc/bnx2fc_fcoe.c
··· 516 516 skb_pull(skb, sizeof(struct fcoe_hdr)); 517 517 fr_len = skb->len - sizeof(struct fcoe_crc_eof); 518 518 519 - stats = per_cpu_ptr(lport->stats, get_cpu()); 520 - stats->RxFrames++; 521 - stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; 522 - 523 519 fp = (struct fc_frame *)skb; 524 520 fc_frame_init(fp); 525 521 fr_dev(fp) = lport; 526 522 fr_sof(fp) = hp->fcoe_sof; 527 523 if (skb_copy_bits(skb, fr_len, &crc_eof, sizeof(crc_eof))) { 528 - put_cpu(); 529 524 kfree_skb(skb); 530 525 return; 531 526 } 532 527 fr_eof(fp) = crc_eof.fcoe_eof; 533 528 fr_crc(fp) = crc_eof.fcoe_crc32; 534 529 if (pskb_trim(skb, fr_len)) { 535 - put_cpu(); 536 530 kfree_skb(skb); 537 531 return; 538 532 } ··· 538 544 port = lport_priv(vn_port); 539 545 if (!ether_addr_equal(port->data_src_addr, dest_mac)) { 540 546 BNX2FC_HBA_DBG(lport, "fpma mismatch\n"); 541 - put_cpu(); 542 547 kfree_skb(skb); 543 548 return; 544 549 } ··· 545 552 if (fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA && 546 553 fh->fh_type == FC_TYPE_FCP) { 547 554 /* Drop FCP data. We dont this in L2 path */ 548 - put_cpu(); 549 555 kfree_skb(skb); 550 556 return; 551 557 } ··· 554 562 case ELS_LOGO: 555 563 if (ntoh24(fh->fh_s_id) == FC_FID_FLOGI) { 556 564 /* drop non-FIP LOGO */ 557 - put_cpu(); 558 565 kfree_skb(skb); 559 566 return; 560 567 } ··· 563 572 564 573 if (fh->fh_r_ctl == FC_RCTL_BA_ABTS) { 565 574 /* Drop incoming ABTS */ 566 - put_cpu(); 567 575 kfree_skb(skb); 568 576 return; 569 577 } 578 + 579 + stats = per_cpu_ptr(lport->stats, smp_processor_id()); 580 + stats->RxFrames++; 581 + stats->RxWords += fr_len / FCOE_WORD_TO_BYTE; 570 582 571 583 if (le32_to_cpu(fr_crc(fp)) != 572 584 ~crc32(~0, skb->data, fr_len)) { ··· 577 583 printk(KERN_WARNING PFX "dropping frame with " 578 584 "CRC error\n"); 579 585 stats->InvalidCRCCount++; 580 - put_cpu(); 581 586 kfree_skb(skb); 582 587 return; 583 588 } 584 - put_cpu(); 585 589 fc_exch_recv(lport, fp); 586 590 } 587 591
+2
drivers/scsi/bnx2fc/bnx2fc_io.c
··· 282 282 arr_sz, GFP_KERNEL); 283 283 if (!cmgr->free_list_lock) { 284 284 printk(KERN_ERR PFX "failed to alloc free_list_lock\n"); 285 + kfree(cmgr->free_list); 286 + cmgr->free_list = NULL; 285 287 goto mem_err; 286 288 } 287 289
+12 -1
drivers/scsi/ibmvscsi/ibmvscsi.c
··· 185 185 if (crq->valid & 0x80) { 186 186 if (++queue->cur == queue->size) 187 187 queue->cur = 0; 188 + 189 + /* Ensure the read of the valid bit occurs before reading any 190 + * other bits of the CRQ entry 191 + */ 192 + rmb(); 188 193 } else 189 194 crq = NULL; 190 195 spin_unlock_irqrestore(&queue->lock, flags); ··· 208 203 { 209 204 struct vio_dev *vdev = to_vio_dev(hostdata->dev); 210 205 206 + /* 207 + * Ensure the command buffer is flushed to memory before handing it 208 + * over to the VIOS to prevent it from fetching any stale data. 209 + */ 210 + mb(); 211 211 return plpar_hcall_norets(H_SEND_CRQ, vdev->unit_address, word1, word2); 212 212 } 213 213 ··· 807 797 evt->hostdata->dev); 808 798 if (evt->cmnd_done) 809 799 evt->cmnd_done(evt->cmnd); 810 - } else if (evt->done) 800 + } else if (evt->done && evt->crq.format != VIOSRP_MAD_FORMAT && 801 + evt->iu.srp.login_req.opcode != SRP_LOGIN_REQ) 811 802 evt->done(evt); 812 803 free_event_struct(&evt->hostdata->pool, evt); 813 804 spin_lock_irqsave(hostdata->host->host_lock, flags);
+10 -3
drivers/scsi/pm8001/pm8001_init.c
··· 677 677 * pm8001_get_phy_settings_info : Read phy setting values. 678 678 * @pm8001_ha : our hba. 679 679 */ 680 - void pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha) 680 + static int pm8001_get_phy_settings_info(struct pm8001_hba_info *pm8001_ha) 681 681 { 682 682 683 683 #ifdef PM8001_READ_VPD ··· 691 691 payload.offset = 0; 692 692 payload.length = 4096; 693 693 payload.func_specific = kzalloc(4096, GFP_KERNEL); 694 + if (!payload.func_specific) 695 + return -ENOMEM; 694 696 /* Read phy setting values from flash */ 695 697 PM8001_CHIP_DISP->get_nvmd_req(pm8001_ha, &payload); 696 698 wait_for_completion(&completion); 697 699 pm8001_set_phy_profile(pm8001_ha, sizeof(u8), payload.func_specific); 700 + kfree(payload.func_specific); 698 701 #endif 702 + return 0; 699 703 } 700 704 701 705 #ifdef PM8001_USE_MSIX ··· 883 879 pm8001_init_sas_add(pm8001_ha); 884 880 /* phy setting support for motherboard controller */ 885 881 if (pdev->subsystem_vendor != PCI_VENDOR_ID_ADAPTEC2 && 886 - pdev->subsystem_vendor != 0) 887 - pm8001_get_phy_settings_info(pm8001_ha); 882 + pdev->subsystem_vendor != 0) { 883 + rc = pm8001_get_phy_settings_info(pm8001_ha); 884 + if (rc) 885 + goto err_out_shost; 886 + } 888 887 pm8001_post_sas_ha_init(shost, chip); 889 888 rc = sas_register_ha(SHOST_TO_SAS_HA(shost)); 890 889 if (rc)
+11 -6
drivers/scsi/qla2xxx/qla_target.c
··· 1128 1128 ctio->u.status1.flags = 1129 1129 __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | 1130 1130 CTIO7_FLAGS_TERMINATE); 1131 - ctio->u.status1.ox_id = entry->fcp_hdr_le.ox_id; 1131 + ctio->u.status1.ox_id = cpu_to_le16(entry->fcp_hdr_le.ox_id); 1132 1132 1133 1133 qla2x00_start_iocbs(vha, vha->req); 1134 1134 ··· 1262 1262 { 1263 1263 struct atio_from_isp *atio = &mcmd->orig_iocb.atio; 1264 1264 struct ctio7_to_24xx *ctio; 1265 + uint16_t temp; 1265 1266 1266 1267 ql_dbg(ql_dbg_tgt, ha, 0xe008, 1267 1268 "Sending task mgmt CTIO7 (ha=%p, atio=%p, resp_code=%x\n", ··· 1293 1292 ctio->u.status1.flags = (atio->u.isp24.attr << 9) | 1294 1293 __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | 1295 1294 CTIO7_FLAGS_SEND_STATUS); 1296 - ctio->u.status1.ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id); 1295 + temp = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id); 1296 + ctio->u.status1.ox_id = cpu_to_le16(temp); 1297 1297 ctio->u.status1.scsi_status = 1298 1298 __constant_cpu_to_le16(SS_RESPONSE_INFO_LEN_VALID); 1299 1299 ctio->u.status1.response_len = __constant_cpu_to_le16(8); ··· 1515 1513 struct ctio7_to_24xx *pkt; 1516 1514 struct qla_hw_data *ha = vha->hw; 1517 1515 struct atio_from_isp *atio = &prm->cmd->atio; 1516 + uint16_t temp; 1518 1517 1519 1518 pkt = (struct ctio7_to_24xx *)vha->req->ring_ptr; 1520 1519 prm->pkt = pkt; ··· 1544 1541 pkt->initiator_id[2] = atio->u.isp24.fcp_hdr.s_id[0]; 1545 1542 pkt->exchange_addr = atio->u.isp24.exchange_addr; 1546 1543 pkt->u.status0.flags |= (atio->u.isp24.attr << 9); 1547 - pkt->u.status0.ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id); 1544 + temp = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id); 1545 + pkt->u.status0.ox_id = cpu_to_le16(temp); 1548 1546 pkt->u.status0.relative_offset = cpu_to_le32(prm->cmd->offset); 1549 1547 1550 1548 ql_dbg(ql_dbg_tgt, vha, 0xe00c, 1551 1549 "qla_target(%d): handle(cmd) -> %08x, timeout %d, ox_id %#x\n", 1552 - vha->vp_idx, pkt->handle, QLA_TGT_TIMEOUT, 1553 - le16_to_cpu(pkt->u.status0.ox_id)); 1550 + vha->vp_idx, pkt->handle, QLA_TGT_TIMEOUT, temp); 1554 1551 return 0; 1555 1552 } 1556 1553 ··· 2622 2619 struct qla_hw_data *ha = vha->hw; 2623 2620 request_t *pkt; 2624 2621 int ret = 0; 2622 + uint16_t temp; 2625 2623 2626 2624 ql_dbg(ql_dbg_tgt, vha, 0xe01c, "Sending TERM EXCH CTIO (ha=%p)\n", ha); 2627 2625 ··· 2659 2655 ctio24->u.status1.flags = (atio->u.isp24.attr << 9) | 2660 2656 __constant_cpu_to_le16(CTIO7_FLAGS_STATUS_MODE_1 | 2661 2657 CTIO7_FLAGS_TERMINATE); 2662 - ctio24->u.status1.ox_id = swab16(atio->u.isp24.fcp_hdr.ox_id); 2658 + temp = be16_to_cpu(atio->u.isp24.fcp_hdr.ox_id); 2659 + ctio24->u.status1.ox_id = cpu_to_le16(temp); 2663 2660 2664 2661 /* Most likely, it isn't needed */ 2665 2662 ctio24->u.status1.residual = get_unaligned((uint32_t *)
+2 -2
drivers/scsi/qla2xxx/qla_target.h
··· 443 443 uint16_t reserved1; 444 444 __le16 flags; 445 445 uint32_t residual; 446 - uint16_t ox_id; 446 + __le16 ox_id; 447 447 uint16_t scsi_status; 448 448 uint32_t relative_offset; 449 449 uint32_t reserved2; ··· 458 458 uint16_t sense_length; 459 459 uint16_t flags; 460 460 uint32_t residual; 461 - uint16_t ox_id; 461 + __le16 ox_id; 462 462 uint16_t scsi_status; 463 463 uint16_t response_len; 464 464 uint16_t reserved;
+1
drivers/scsi/scsi_transport_fc.c
··· 2549 2549 fc_flush_devloss(shost); 2550 2550 if (!cancel_delayed_work(&rport->dev_loss_work)) 2551 2551 fc_flush_devloss(shost); 2552 + cancel_work_sync(&rport->scan_work); 2552 2553 spin_lock_irqsave(shost->host_lock, flags); 2553 2554 rport->flags &= ~FC_RPORT_DEVLOSS_PENDING; 2554 2555 }
+25 -1
drivers/scsi/virtio_scsi.c
··· 237 237 virtscsi_vq_done(vscsi, req_vq, virtscsi_complete_cmd); 238 238 }; 239 239 240 + static void virtscsi_poll_requests(struct virtio_scsi *vscsi) 241 + { 242 + int i, num_vqs; 243 + 244 + num_vqs = vscsi->num_queues; 245 + for (i = 0; i < num_vqs; i++) 246 + virtscsi_vq_done(vscsi, &vscsi->req_vqs[i], 247 + virtscsi_complete_cmd); 248 + } 249 + 240 250 static void virtscsi_complete_free(struct virtio_scsi *vscsi, void *buf) 241 251 { 242 252 struct virtio_scsi_cmd *cmd = buf; ··· 263 253 virtscsi_vq_done(vscsi, &vscsi->ctrl_vq, virtscsi_complete_free); 264 254 }; 265 255 256 + static void virtscsi_handle_event(struct work_struct *work); 257 + 266 258 static int virtscsi_kick_event(struct virtio_scsi *vscsi, 267 259 struct virtio_scsi_event_node *event_node) 268 260 { ··· 272 260 struct scatterlist sg; 273 261 unsigned long flags; 274 262 263 + INIT_WORK(&event_node->work, virtscsi_handle_event); 275 264 sg_init_one(&sg, &event_node->event, sizeof(struct virtio_scsi_event)); 276 265 277 266 spin_lock_irqsave(&vscsi->event_vq.vq_lock, flags); ··· 390 377 { 391 378 struct virtio_scsi_event_node *event_node = buf; 392 379 393 - INIT_WORK(&event_node->work, virtscsi_handle_event); 394 380 schedule_work(&event_node->work); 395 381 } 396 382 ··· 600 588 if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK || 601 589 cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) 602 590 ret = SUCCESS; 591 + 592 + /* 593 + * The spec guarantees that all requests related to the TMF have 594 + * been completed, but the callback might not have run yet if 595 + * we're using independent interrupts (e.g. MSI). Poll the 596 + * virtqueues once. 597 + * 598 + * In the abort case, sc->scsi_done will do nothing, because 599 + * the block layer must have detected a timeout and as a result 600 + * REQ_ATOM_COMPLETE has been set. 601 + */ 602 + virtscsi_poll_requests(vscsi); 603 603 604 604 out: 605 605 mempool_free(cmd, virtscsi_cmd_pool);