Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"This is the final round of mostly small fixes in our initial submit.

It's mostly minor fixes and driver updates. The only change of note is
adding a virt_boundary_mask to the SCSI host and host template to
parametrise this for NVMe devices instead of having them do a call in
slave_alloc. It's a fairly straightforward conversion except in the
two NVMe handling drivers that didn't set it who now have a virtual
infinity parameter added"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (24 commits)
scsi: megaraid_sas: set an unlimited max_segment_size
scsi: mpt3sas: set an unlimited max_segment_size for SAS 3.0 HBAs
scsi: IB/srp: set virt_boundary_mask in the scsi host
scsi: IB/iser: set virt_boundary_mask in the scsi host
scsi: storvsc: set virt_boundary_mask in the scsi host template
scsi: ufshcd: set max_segment_size in the scsi host template
scsi: core: take the DMA max mapping size into account
scsi: core: add a host / host template field for the virt boundary
scsi: core: Fix race on creating sense cache
scsi: sd_zbc: Fix compilation warning
scsi: libfc: fix null pointer dereference on a null lport
scsi: zfcp: fix GCC compiler warning emitted with -Wmaybe-uninitialized
scsi: zfcp: fix request object use-after-free in send path causing wrong traces
scsi: zfcp: fix request object use-after-free in send path causing seqno errors
scsi: megaraid_sas: Update driver version to 07.710.50.00
scsi: megaraid_sas: Add module parameter for FW Async event logging
scsi: megaraid_sas: Enable msix_load_balance for Invader and later controllers
scsi: megaraid_sas: Fix calculation of target ID
scsi: lpfc: reduce stack size with CONFIG_GCC_PLUGIN_STRUCTLEAK_VERBOSE
scsi: devinfo: BLIST_TRY_VPD_PAGES for SanDisk Cruzer Blade
...

+123 -74
+7 -28
drivers/infiniband/ulp/iser/iscsi_iser.c
··· 611 611 struct Scsi_Host *shost; 612 612 struct iser_conn *iser_conn = NULL; 613 613 struct ib_conn *ib_conn; 614 + struct ib_device *ib_dev; 614 615 u32 max_fr_sectors; 615 616 616 617 shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 0); ··· 642 641 } 643 642 644 643 ib_conn = &iser_conn->ib_conn; 644 + ib_dev = ib_conn->device->ib_device; 645 645 if (ib_conn->pi_support) { 646 - u32 sig_caps = ib_conn->device->ib_device->attrs.sig_prot_cap; 646 + u32 sig_caps = ib_dev->attrs.sig_prot_cap; 647 647 648 648 scsi_host_set_prot(shost, iser_dif_prot_caps(sig_caps)); 649 649 scsi_host_set_guard(shost, SHOST_DIX_GUARD_IP | 650 650 SHOST_DIX_GUARD_CRC); 651 651 } 652 652 653 - if (iscsi_host_add(shost, 654 - ib_conn->device->ib_device->dev.parent)) { 653 + if (!(ib_dev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG)) 654 + shost->virt_boundary_mask = ~MASK_4K; 655 + 656 + if (iscsi_host_add(shost, ib_dev->dev.parent)) { 655 657 mutex_unlock(&iser_conn->state_mutex); 656 658 goto free_host; 657 659 } ··· 960 956 return 0; 961 957 } 962 958 963 - static int iscsi_iser_slave_alloc(struct scsi_device *sdev) 964 - { 965 - struct iscsi_session *session; 966 - struct iser_conn *iser_conn; 967 - struct ib_device *ib_dev; 968 - 969 - mutex_lock(&unbind_iser_conn_mutex); 970 - 971 - session = starget_to_session(scsi_target(sdev))->dd_data; 972 - iser_conn = session->leadconn->dd_data; 973 - if (!iser_conn) { 974 - mutex_unlock(&unbind_iser_conn_mutex); 975 - return -ENOTCONN; 976 - } 977 - ib_dev = iser_conn->ib_conn.device->ib_device; 978 - 979 - if (!(ib_dev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG)) 980 - blk_queue_virt_boundary(sdev->request_queue, ~MASK_4K); 981 - 982 - mutex_unlock(&unbind_iser_conn_mutex); 983 - 984 - return 0; 985 - } 986 - 987 959 static struct scsi_host_template iscsi_iser_sht = { 988 960 .module = THIS_MODULE, 989 961 .name = "iSCSI Initiator over iSER", ··· 972 992 .eh_device_reset_handler= iscsi_eh_device_reset, 973 993 .eh_target_reset_handler = iscsi_eh_recover_target, 974 994 .target_alloc = iscsi_target_alloc, 975 - .slave_alloc = iscsi_iser_slave_alloc, 976 995 .proc_name = "iscsi_iser", 977 996 .this_id = -1, 978 997 .track_queue_depth = 1,
+3 -15
drivers/infiniband/ulp/srp/ib_srp.c
··· 3046 3046 return 0; 3047 3047 } 3048 3048 3049 - static int srp_slave_alloc(struct scsi_device *sdev) 3050 - { 3051 - struct Scsi_Host *shost = sdev->host; 3052 - struct srp_target_port *target = host_to_target(shost); 3053 - struct srp_device *srp_dev = target->srp_host->srp_dev; 3054 - struct ib_device *ibdev = srp_dev->dev; 3055 - 3056 - if (!(ibdev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG)) 3057 - blk_queue_virt_boundary(sdev->request_queue, 3058 - ~srp_dev->mr_page_mask); 3059 - 3060 - return 0; 3061 - } 3062 - 3063 3049 static int srp_slave_configure(struct scsi_device *sdev) 3064 3050 { 3065 3051 struct Scsi_Host *shost = sdev->host; ··· 3248 3262 .name = "InfiniBand SRP initiator", 3249 3263 .proc_name = DRV_NAME, 3250 3264 .target_alloc = srp_target_alloc, 3251 - .slave_alloc = srp_slave_alloc, 3252 3265 .slave_configure = srp_slave_configure, 3253 3266 .info = srp_target_info, 3254 3267 .queuecommand = srp_queuecommand, ··· 3790 3805 target_host->max_lun = -1LL; 3791 3806 target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb; 3792 3807 target_host->max_segment_size = ib_dma_max_seg_size(ibdev); 3808 + 3809 + if (!(ibdev->attrs.device_cap_flags & IB_DEVICE_SG_GAPS_REG)) 3810 + target_host->virt_boundary_mask = ~srp_dev->mr_page_mask; 3793 3811 3794 3812 target = host_to_target(target_host); 3795 3813
+7
drivers/s390/scsi/zfcp_erp.c
··· 11 11 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 12 12 13 13 #include <linux/kthread.h> 14 + #include <linux/bug.h> 14 15 #include "zfcp_ext.h" 15 16 #include "zfcp_reqlist.h" 16 17 ··· 217 216 { 218 217 struct zfcp_erp_action *erp_action; 219 218 struct zfcp_scsi_dev *zfcp_sdev; 219 + 220 + if (WARN_ON_ONCE(need != ZFCP_ERP_ACTION_REOPEN_LUN && 221 + need != ZFCP_ERP_ACTION_REOPEN_PORT && 222 + need != ZFCP_ERP_ACTION_REOPEN_PORT_FORCED && 223 + need != ZFCP_ERP_ACTION_REOPEN_ADAPTER)) 224 + return NULL; 220 225 221 226 switch (need) { 222 227 case ZFCP_ERP_ACTION_REOPEN_LUN:
+48 -7
drivers/s390/scsi/zfcp_fsf.c
··· 11 11 #define pr_fmt(fmt) KMSG_COMPONENT ": " fmt 12 12 13 13 #include <linux/blktrace_api.h> 14 + #include <linux/types.h> 14 15 #include <linux/slab.h> 15 16 #include <scsi/fc/fc_els.h> 16 17 #include "zfcp_ext.h" ··· 742 741 743 742 static int zfcp_fsf_req_send(struct zfcp_fsf_req *req) 744 743 { 744 + const bool is_srb = zfcp_fsf_req_is_status_read_buffer(req); 745 745 struct zfcp_adapter *adapter = req->adapter; 746 746 struct zfcp_qdio *qdio = adapter->qdio; 747 747 int req_id = req->req_id; ··· 759 757 return -EIO; 760 758 } 761 759 760 + /* 761 + * NOTE: DO NOT TOUCH ASYNC req PAST THIS POINT. 762 + * ONLY TOUCH SYNC req AGAIN ON req->completion. 763 + * 764 + * The request might complete and be freed concurrently at any point 765 + * now. This is not protected by the QDIO-lock (req_q_lock). So any 766 + * uncontrolled access after this might result in an use-after-free bug. 767 + * Only if the request doesn't have ZFCP_STATUS_FSFREQ_CLEANUP set, and 768 + * when it is completed via req->completion, is it safe to use req 769 + * again. 770 + */ 771 + 762 772 /* Don't increase for unsolicited status */ 763 - if (!zfcp_fsf_req_is_status_read_buffer(req)) 773 + if (!is_srb) 764 774 adapter->fsf_req_seq_no++; 765 775 adapter->req_no++; 766 776 ··· 819 805 retval = zfcp_fsf_req_send(req); 820 806 if (retval) 821 807 goto failed_req_send; 808 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 822 809 823 810 goto out; 824 811 ··· 929 914 req->qtcb->bottom.support.req_handle = (u64) old_req_id; 930 915 931 916 zfcp_fsf_start_timer(req, ZFCP_FSF_SCSI_ER_TIMEOUT); 932 - if (!zfcp_fsf_req_send(req)) 917 + if (!zfcp_fsf_req_send(req)) { 918 + /* NOTE: DO NOT TOUCH req, UNTIL IT COMPLETES! */ 933 919 goto out; 920 + } 934 921 935 922 out_error_free: 936 923 zfcp_fsf_req_free(req); ··· 1115 1098 ret = zfcp_fsf_req_send(req); 1116 1099 if (ret) 1117 1100 goto failed_send; 1101 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1118 1102 1119 1103 goto out; 1120 1104 ··· 1216 1198 ret = zfcp_fsf_req_send(req); 1217 1199 if (ret) 1218 1200 goto failed_send; 1201 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1219 1202 1220 1203 goto out; 1221 1204 ··· 1262 1243 zfcp_fsf_req_free(req); 1263 1244 erp_action->fsf_req_id = 0; 1264 1245 } 1246 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1265 1247 out: 1266 1248 spin_unlock_irq(&qdio->req_q_lock); 1267 1249 return retval; ··· 1299 1279 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); 1300 1280 retval = zfcp_fsf_req_send(req); 1301 1281 spin_unlock_irq(&qdio->req_q_lock); 1302 - if (!retval) 1282 + if (!retval) { 1283 + /* NOTE: ONLY TOUCH SYNC req AGAIN ON req->completion. */ 1303 1284 wait_for_completion(&req->completion); 1285 + } 1304 1286 1305 1287 zfcp_fsf_req_free(req); 1306 1288 return retval; ··· 1352 1330 zfcp_fsf_req_free(req); 1353 1331 erp_action->fsf_req_id = 0; 1354 1332 } 1333 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1355 1334 out: 1356 1335 spin_unlock_irq(&qdio->req_q_lock); 1357 1336 return retval; ··· 1395 1372 retval = zfcp_fsf_req_send(req); 1396 1373 spin_unlock_irq(&qdio->req_q_lock); 1397 1374 1398 - if (!retval) 1375 + if (!retval) { 1376 + /* NOTE: ONLY TOUCH SYNC req AGAIN ON req->completion. */ 1399 1377 wait_for_completion(&req->completion); 1378 + } 1400 1379 1401 1380 zfcp_fsf_req_free(req); 1402 1381 ··· 1518 1493 erp_action->fsf_req_id = 0; 1519 1494 put_device(&port->dev); 1520 1495 } 1496 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1521 1497 out: 1522 1498 spin_unlock_irq(&qdio->req_q_lock); 1523 1499 return retval; ··· 1583 1557 zfcp_fsf_req_free(req); 1584 1558 erp_action->fsf_req_id = 0; 1585 1559 } 1560 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1586 1561 out: 1587 1562 spin_unlock_irq(&qdio->req_q_lock); 1588 1563 return retval; ··· 1627 1600 { 1628 1601 struct zfcp_qdio *qdio = wka_port->adapter->qdio; 1629 1602 struct zfcp_fsf_req *req; 1603 + unsigned long req_id = 0; 1630 1604 int retval = -EIO; 1631 1605 1632 1606 spin_lock_irq(&qdio->req_q_lock); ··· 1650 1622 hton24(req->qtcb->bottom.support.d_id, wka_port->d_id); 1651 1623 req->data = wka_port; 1652 1624 1625 + req_id = req->req_id; 1626 + 1653 1627 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); 1654 1628 retval = zfcp_fsf_req_send(req); 1655 1629 if (retval) 1656 1630 zfcp_fsf_req_free(req); 1631 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1657 1632 out: 1658 1633 spin_unlock_irq(&qdio->req_q_lock); 1659 1634 if (!retval) 1660 - zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req->req_id); 1635 + zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req_id); 1661 1636 return retval; 1662 1637 } 1663 1638 ··· 1686 1655 { 1687 1656 struct zfcp_qdio *qdio = wka_port->adapter->qdio; 1688 1657 struct zfcp_fsf_req *req; 1658 + unsigned long req_id = 0; 1689 1659 int retval = -EIO; 1690 1660 1691 1661 spin_lock_irq(&qdio->req_q_lock); ··· 1709 1677 req->data = wka_port; 1710 1678 req->qtcb->header.port_handle = wka_port->handle; 1711 1679 1680 + req_id = req->req_id; 1681 + 1712 1682 zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); 1713 1683 retval = zfcp_fsf_req_send(req); 1714 1684 if (retval) 1715 1685 zfcp_fsf_req_free(req); 1686 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1716 1687 out: 1717 1688 spin_unlock_irq(&qdio->req_q_lock); 1718 1689 if (!retval) 1719 - zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req->req_id); 1690 + zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req_id); 1720 1691 return retval; 1721 1692 } 1722 1693 ··· 1811 1776 zfcp_fsf_req_free(req); 1812 1777 erp_action->fsf_req_id = 0; 1813 1778 } 1779 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1814 1780 out: 1815 1781 spin_unlock_irq(&qdio->req_q_lock); 1816 1782 return retval; ··· 1935 1899 zfcp_fsf_req_free(req); 1936 1900 erp_action->fsf_req_id = 0; 1937 1901 } 1902 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 1938 1903 out: 1939 1904 spin_unlock_irq(&qdio->req_q_lock); 1940 1905 return retval; ··· 2024 1987 zfcp_fsf_req_free(req); 2025 1988 erp_action->fsf_req_id = 0; 2026 1989 } 1990 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 2027 1991 out: 2028 1992 spin_unlock_irq(&qdio->req_q_lock); 2029 1993 return retval; ··· 2337 2299 retval = zfcp_fsf_req_send(req); 2338 2300 if (unlikely(retval)) 2339 2301 goto failed_scsi_cmnd; 2302 + /* NOTE: DO NOT TOUCH req PAST THIS POINT! */ 2340 2303 2341 2304 goto out; 2342 2305 ··· 2412 2373 zfcp_fc_fcp_tm(fcp_cmnd, sdev, tm_flags); 2413 2374 2414 2375 zfcp_fsf_start_timer(req, ZFCP_FSF_SCSI_ER_TIMEOUT); 2415 - if (!zfcp_fsf_req_send(req)) 2376 + if (!zfcp_fsf_req_send(req)) { 2377 + /* NOTE: DO NOT TOUCH req, UNTIL IT COMPLETES! */ 2416 2378 goto out; 2379 + } 2417 2380 2418 2381 zfcp_fsf_req_free(req); 2419 2382 req = NULL;
+3
drivers/scsi/hosts.c
··· 462 462 else 463 463 shost->dma_boundary = 0xffffffff; 464 464 465 + if (sht->virt_boundary_mask) 466 + shost->virt_boundary_mask = sht->virt_boundary_mask; 467 + 465 468 device_initialize(&shost->shost_gendev); 466 469 dev_set_name(&shost->shost_gendev, "host%d", shost->host_no); 467 470 shost->shost_gendev.bus = &scsi_bus_type;
+1 -1
drivers/scsi/libfc/fc_exch.c
··· 2591 2591 2592 2592 /* lport lock ? */ 2593 2593 if (!lport || lport->state == LPORT_ST_DISABLED) { 2594 - FC_LPORT_DBG(lport, "Receiving frames for an lport that " 2594 + FC_LIBFC_DBG("Receiving frames for an lport that " 2595 2595 "has not been initialized correctly\n"); 2596 2596 fc_frame_free(fp); 2597 2597 return;
-1
drivers/scsi/libsas/sas_scsi_host.c
··· 414 414 goto retry; 415 415 } 416 416 } 417 - EXPORT_SYMBOL(sas_wait_eh); 418 417 419 418 static int sas_queue_reset(struct domain_device *dev, int reset_type, 420 419 u64 lun, int wait)
+1 -1
drivers/scsi/lpfc/lpfc_debugfs.h
··· 330 330 * This function dumps an entry indexed by @idx from a queue specified by the 331 331 * queue descriptor @q. 332 332 **/ 333 - static inline void 333 + static void 334 334 lpfc_debug_dump_qe(struct lpfc_queue *q, uint32_t idx) 335 335 { 336 336 char line_buf[LPFC_LBUF_SZ];
+2 -2
drivers/scsi/megaraid/megaraid_sas.h
··· 21 21 /* 22 22 * MegaRAID SAS Driver meta data 23 23 */ 24 - #define MEGASAS_VERSION "07.710.06.00-rc1" 25 - #define MEGASAS_RELDATE "June 18, 2019" 24 + #define MEGASAS_VERSION "07.710.50.00-rc1" 25 + #define MEGASAS_RELDATE "June 28, 2019" 26 26 27 27 /* 28 28 * Device IDs
+25 -6
drivers/scsi/megaraid/megaraid_sas_base.c
··· 105 105 "default mode is 'balanced'" 106 106 ); 107 107 108 + int event_log_level = MFI_EVT_CLASS_CRITICAL; 109 + module_param(event_log_level, int, 0644); 110 + MODULE_PARM_DESC(event_log_level, "Asynchronous event logging level- range is: -2(CLASS_DEBUG) to 4(CLASS_DEAD), Default: 2(CLASS_CRITICAL)"); 111 + 108 112 MODULE_LICENSE("GPL"); 109 113 MODULE_VERSION(MEGASAS_VERSION); 110 114 MODULE_AUTHOR("megaraidlinux.pdl@broadcom.com"); ··· 284 280 } 285 281 } 286 282 287 - void 283 + static void 288 284 megasas_issue_dcmd(struct megasas_instance *instance, struct megasas_cmd *cmd) 289 285 { 290 286 instance->instancet->fire_cmd(instance, ··· 408 404 union megasas_evt_class_locale class_locale; 409 405 class_locale.word = le32_to_cpu(evt_detail->cl.word); 410 406 411 - if (class_locale.members.class >= MFI_EVT_CLASS_CRITICAL) 407 + if ((event_log_level < MFI_EVT_CLASS_DEBUG) || 408 + (event_log_level > MFI_EVT_CLASS_DEAD)) { 409 + printk(KERN_WARNING "megaraid_sas: provided event log level is out of range, setting it to default 2(CLASS_CRITICAL), permissible range is: -2 to 4\n"); 410 + event_log_level = MFI_EVT_CLASS_CRITICAL; 411 + } 412 + 413 + if (class_locale.members.class >= event_log_level) 412 414 dev_info(&instance->pdev->dev, "%d (%s/0x%04x/%s) - %s\n", 413 415 le32_to_cpu(evt_detail->seq_num), 414 416 format_timestamp(le32_to_cpu(evt_detail->time_stamp)), ··· 2247 2237 static void 2248 2238 process_fw_state_change_wq(struct work_struct *work); 2249 2239 2250 - void megasas_do_ocr(struct megasas_instance *instance) 2240 + static void megasas_do_ocr(struct megasas_instance *instance) 2251 2241 { 2252 2242 if ((instance->pdev->device == PCI_DEVICE_ID_LSI_SAS1064R) || 2253 2243 (instance->pdev->device == PCI_DEVICE_ID_DELL_PERC5) || ··· 3313 3303 static DEVICE_ATTR_RO(dump_system_regs); 3314 3304 static DEVICE_ATTR_RO(raid_map_id); 3315 3305 3316 - struct device_attribute *megaraid_host_attrs[] = { 3306 + static struct device_attribute *megaraid_host_attrs[] = { 3317 3307 &dev_attr_fw_crash_buffer_size, 3318 3308 &dev_attr_fw_crash_buffer, 3319 3309 &dev_attr_fw_crash_state, ··· 3344 3334 .shost_attrs = megaraid_host_attrs, 3345 3335 .bios_param = megasas_bios_param, 3346 3336 .change_queue_depth = scsi_change_queue_depth, 3337 + .max_segment_size = 0xffffffff, 3347 3338 .no_write_same = 1, 3348 3339 }; 3349 3340 ··· 5944 5933 instance->is_rdpq = (scratch_pad_1 & MR_RDPQ_MODE_OFFSET) ? 5945 5934 1 : 0; 5946 5935 5947 - if (!instance->msix_combined) { 5936 + if (instance->adapter_type >= INVADER_SERIES && 5937 + !instance->msix_combined) { 5948 5938 instance->msix_load_balance = true; 5949 5939 instance->smp_affinity_enable = false; 5950 5940 } ··· 6558 6546 int ret; 6559 6547 struct megasas_cmd *cmd; 6560 6548 struct megasas_dcmd_frame *dcmd; 6561 - u16 targetId = (sdev->channel % 2) + sdev->id; 6549 + u16 targetId = ((sdev->channel % 2) * MEGASAS_MAX_DEV_PER_CHANNEL) + 6550 + sdev->id; 6562 6551 6563 6552 cmd = megasas_get_cmd(instance); 6564 6553 ··· 8759 8746 if (rval) { 8760 8747 printk(KERN_DEBUG "megasas: PCI hotplug registration failed \n"); 8761 8748 goto err_pcidrv; 8749 + } 8750 + 8751 + if ((event_log_level < MFI_EVT_CLASS_DEBUG) || 8752 + (event_log_level > MFI_EVT_CLASS_DEAD)) { 8753 + printk(KERN_WARNING "megarid_sas: provided event log level is out of range, setting it to default 2(CLASS_CRITICAL), permissible range is: -2 to 4\n"); 8754 + event_log_level = MFI_EVT_CLASS_CRITICAL; 8762 8755 } 8763 8756 8764 8757 rval = driver_create_file(&megasas_pci_driver.driver,
+1
drivers/scsi/mpt3sas/mpt3sas_scsih.c
··· 10238 10238 .this_id = -1, 10239 10239 .sg_tablesize = MPT3SAS_SG_DEPTH, 10240 10240 .max_sectors = 32767, 10241 + .max_segment_size = 0xffffffff, 10241 10242 .cmd_per_lun = 7, 10242 10243 .shost_attrs = mpt3sas_host_attrs, 10243 10244 .sdev_attrs = mpt3sas_dev_attrs,
+5 -1
drivers/scsi/pm8001/pm8001_sas.c
··· 888 888 spin_unlock_irqrestore(&pm8001_ha->lock, flags); 889 889 pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev , 890 890 dev, 1, 0); 891 + while (pm8001_dev->running_req) 892 + msleep(20); 891 893 spin_lock_irqsave(&pm8001_ha->lock, flags); 892 894 } 893 895 PM8001_CHIP_DISP->dereg_dev_req(pm8001_ha, device_id); ··· 1258 1256 PM8001_MSG_DBG(pm8001_ha, 1259 1257 pm8001_printk("Waiting for Port reset\n")); 1260 1258 wait_for_completion(&completion_reset); 1261 - if (phy->port_reset_status) 1259 + if (phy->port_reset_status) { 1260 + pm8001_dev_gone_notify(dev); 1262 1261 goto out; 1262 + } 1263 1263 1264 1264 /* 1265 1265 * 4. SATA Abort ALL
+1 -1
drivers/scsi/pm8001/pm80xx_hwi.c
··· 604 604 pm8001_ha->main_cfg_tbl.pm80xx_tbl.port_recovery_timer &= 605 605 0x0000ffff; 606 606 pm8001_ha->main_cfg_tbl.pm80xx_tbl.port_recovery_timer |= 607 - 0x140000; 607 + CHIP_8006_PORT_RECOVERY_TIMEOUT; 608 608 } 609 609 pm8001_mw32(address, MAIN_PORT_RECOVERY_TIMER, 610 610 pm8001_ha->main_cfg_tbl.pm80xx_tbl.port_recovery_timer);
+2
drivers/scsi/pm8001/pm80xx_hwi.h
··· 230 230 #define SAS_MAX_AIP 0x200000 231 231 #define IT_NEXUS_TIMEOUT 0x7D0 232 232 #define PORT_RECOVERY_TIMEOUT ((IT_NEXUS_TIMEOUT/100) + 30) 233 + /* Port recovery timeout, 10000 ms for PM8006 controller */ 234 + #define CHIP_8006_PORT_RECOVERY_TIMEOUT 0x640000 233 235 234 236 #ifdef __LITTLE_ENDIAN_BITFIELD 235 237 struct sas_identify_frame_local {
+2
drivers/scsi/scsi_devinfo.c
··· 239 239 {"LSI", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, 240 240 {"ENGENIO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, 241 241 {"LENOVO", "Universal Xport", "*", BLIST_NO_ULD_ATTACH}, 242 + {"SanDisk", "Cruzer Blade", NULL, BLIST_TRY_VPD_PAGES | 243 + BLIST_INQUIRY_36}, 242 244 {"SMSC", "USB 2 HS-CF", NULL, BLIST_SPARSELUN | BLIST_INQUIRY_36}, 243 245 {"SONY", "CD-ROM CDU-8001", NULL, BLIST_BORKEN}, 244 246 {"SONY", "TSL", NULL, BLIST_FORCELUN}, /* DDS3 & DDS4 autoloaders */
+8 -5
drivers/scsi/scsi_lib.c
··· 84 84 struct kmem_cache *cache; 85 85 int ret = 0; 86 86 87 + mutex_lock(&scsi_sense_cache_mutex); 87 88 cache = scsi_select_sense_cache(shost->unchecked_isa_dma); 88 89 if (cache) 89 - return 0; 90 + goto exit; 90 91 91 - mutex_lock(&scsi_sense_cache_mutex); 92 92 if (shost->unchecked_isa_dma) { 93 93 scsi_sense_isadma_cache = 94 94 kmem_cache_create("scsi_sense_cache(DMA)", ··· 104 104 if (!scsi_sense_cache) 105 105 ret = -ENOMEM; 106 106 } 107 - 107 + exit: 108 108 mutex_unlock(&scsi_sense_cache_mutex); 109 109 return ret; 110 110 } ··· 1452 1452 disposition = scsi_decide_disposition(cmd); 1453 1453 if (disposition != SUCCESS && 1454 1454 time_before(cmd->jiffies_at_alloc + wait_for, jiffies)) { 1455 - sdev_printk(KERN_ERR, cmd->device, 1455 + scmd_printk(KERN_ERR, cmd, 1456 1456 "timing out command, waited %lus\n", 1457 1457 wait_for/HZ); 1458 1458 disposition = SUCCESS; ··· 1784 1784 blk_queue_max_integrity_segments(q, shost->sg_prot_tablesize); 1785 1785 } 1786 1786 1787 + shost->max_sectors = min_t(unsigned int, shost->max_sectors, 1788 + dma_max_mapping_size(dev) << SECTOR_SHIFT); 1787 1789 blk_queue_max_hw_sectors(q, shost->max_sectors); 1788 1790 if (shost->unchecked_isa_dma) 1789 1791 blk_queue_bounce_limit(q, BLK_BOUNCE_ISA); ··· 1793 1791 dma_set_seg_boundary(dev, shost->dma_boundary); 1794 1792 1795 1793 blk_queue_max_segment_size(q, shost->max_segment_size); 1796 - dma_set_max_seg_size(dev, shost->max_segment_size); 1794 + blk_queue_virt_boundary(q, shost->virt_boundary_mask); 1795 + dma_set_max_seg_size(dev, queue_max_segment_size(q)); 1797 1796 1798 1797 /* 1799 1798 * Set a reasonable default alignment: The larger of 32-byte (dword),
+1 -1
drivers/scsi/sd_zbc.c
··· 461 461 { 462 462 struct gendisk *disk = sdkp->disk; 463 463 unsigned int nr_zones; 464 - u32 zone_blocks; 464 + u32 zone_blocks = 0; 465 465 int ret; 466 466 467 467 if (!sd_is_zoned(sdkp))
+2 -3
drivers/scsi/storvsc_drv.c
··· 1423 1423 { 1424 1424 blk_queue_rq_timeout(sdevice->request_queue, (storvsc_timeout * HZ)); 1425 1425 1426 - /* Ensure there are no gaps in presented sgls */ 1427 - blk_queue_virt_boundary(sdevice->request_queue, PAGE_SIZE - 1); 1428 - 1429 1426 sdevice->no_write_same = 1; 1430 1427 1431 1428 /* ··· 1695 1698 .this_id = -1, 1696 1699 /* Make sure we dont get a sg segment crosses a page boundary */ 1697 1700 .dma_boundary = PAGE_SIZE-1, 1701 + /* Ensure there are no gaps in presented sgls */ 1702 + .virt_boundary_mask = PAGE_SIZE-1, 1698 1703 .no_write_same = 1, 1699 1704 .track_queue_depth = 1, 1700 1705 .change_queue_depth = storvsc_change_queue_depth,
+1 -2
drivers/scsi/ufs/ufshcd.c
··· 4587 4587 struct request_queue *q = sdev->request_queue; 4588 4588 4589 4589 blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1); 4590 - blk_queue_max_segment_size(q, PRDT_DATA_BYTE_COUNT_MAX); 4591 - 4592 4590 return 0; 4593 4591 } 4594 4592 ··· 7020 7022 .sg_tablesize = SG_ALL, 7021 7023 .cmd_per_lun = UFSHCD_CMD_PER_LUN, 7022 7024 .can_queue = UFSHCD_CAN_QUEUE, 7025 + .max_segment_size = PRDT_DATA_BYTE_COUNT_MAX, 7023 7026 .max_host_blocked = 1, 7024 7027 .track_queue_depth = 1, 7025 7028 .sdev_groups = ufshcd_driver_groups,
+3
include/scsi/scsi_host.h
··· 369 369 */ 370 370 unsigned long dma_boundary; 371 371 372 + unsigned long virt_boundary_mask; 373 + 372 374 /* 373 375 * This specifies "machine infinity" for host templates which don't 374 376 * limit the transfer size. Note this limit represents an absolute ··· 589 587 unsigned int max_sectors; 590 588 unsigned int max_segment_size; 591 589 unsigned long dma_boundary; 590 + unsigned long virt_boundary_mask; 592 591 /* 593 592 * In scsi-mq mode, the number of hardware queues supported by the LLD. 594 593 *