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

Merge branch '6.18/scsi-queue' into 6.18/scsi-fixes

Pull in outstanding SCSI fixes for 6.18.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

+57 -57
+4
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-ufs-phy.yaml
··· 24 24 - enum: 25 25 - qcom,qcs8300-qmp-ufs-phy 26 26 - const: qcom,sa8775p-qmp-ufs-phy 27 + - items: 28 + - enum: 29 + - qcom,kaanapali-qmp-ufs-phy 30 + - const: qcom,sm8750-qmp-ufs-phy 27 31 - enum: 28 32 - qcom,msm8996-qmp-ufs-phy 29 33 - qcom,msm8998-qmp-ufs-phy
+2
Documentation/devicetree/bindings/ufs/qcom,sm8650-ufshc.yaml
··· 15 15 compatible: 16 16 contains: 17 17 enum: 18 + - qcom,kaanapali-ufshc 18 19 - qcom,sm8650-ufshc 19 20 - qcom,sm8750-ufshc 20 21 required: ··· 25 24 compatible: 26 25 items: 27 26 - enum: 27 + - qcom,kaanapali-ufshc 28 28 - qcom,sm8650-ufshc 29 29 - qcom,sm8750-ufshc 30 30 - const: qcom,ufshc
+1 -1
drivers/scsi/libfc/fc_fcp.c
··· 503 503 host_bcode = FC_ERROR; 504 504 goto err; 505 505 } 506 - if (offset + len > fsp->data_len) { 506 + if (size_add(offset, len) > fsp->data_len) { 507 507 /* this should never happen */ 508 508 if ((fr_flags(fp) & FCPHF_CRC_UNCHECKED) && 509 509 fc_frame_crc_check(fp))
+4 -4
drivers/scsi/qla4xxx/ql4_os.c
··· 4104 4104 * The mid-level driver tries to ensure that queuecommand never gets 4105 4105 * invoked concurrently with itself or the interrupt handler (although 4106 4106 * the interrupt handler may call this routine as part of request- 4107 - * completion handling). Unfortunely, it sometimes calls the scheduler 4107 + * completion handling). Unfortunately, it sometimes calls the scheduler 4108 4108 * in interrupt context which is a big NO! NO!. 4109 4109 **/ 4110 4110 static int qla4xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) ··· 4647 4647 cmd = scsi_host_find_tag(ha->host, index); 4648 4648 /* 4649 4649 * We cannot just check if the index is valid, 4650 - * becase if we are run from the scsi eh, then 4650 + * because if we are run from the scsi eh, then 4651 4651 * the scsi/block layer is going to prevent 4652 4652 * the tag from being released. 4653 4653 */ ··· 4952 4952 /* Upon successful firmware/chip reset, re-initialize the adapter */ 4953 4953 if (status == QLA_SUCCESS) { 4954 4954 /* For ISP-4xxx, force function 1 to always initialize 4955 - * before function 3 to prevent both funcions from 4955 + * before function 3 to prevent both functions from 4956 4956 * stepping on top of the other */ 4957 4957 if (is_qla40XX(ha) && (ha->mac_index == 3)) 4958 4958 ssleep(6); ··· 6914 6914 struct ddb_entry *ddb_entry = NULL; 6915 6915 6916 6916 /* Create session object, with INVALID_ENTRY, 6917 - * the targer_id would get set when we issue the login 6917 + * the target_id would get set when we issue the login 6918 6918 */ 6919 6919 cls_sess = iscsi_session_setup(&qla4xxx_iscsi_transport, ha->host, 6920 6920 cmds_max, sizeof(struct ddb_entry),
+46 -52
drivers/scsi/storvsc_drv.c
··· 1406 1406 } 1407 1407 1408 1408 /* 1409 - * Our channel array is sparsley populated and we 1409 + * Our channel array could be sparsley populated and we 1410 1410 * initiated I/O on a processor/hw-q that does not 1411 1411 * currently have a designated channel. Fix this. 1412 1412 * The strategy is simple: 1413 - * I. Ensure NUMA locality 1414 - * II. Distribute evenly (best effort) 1413 + * I. Prefer the channel associated with the current CPU 1414 + * II. Ensure NUMA locality 1415 + * III. Distribute evenly (best effort) 1415 1416 */ 1417 + 1418 + /* Prefer the channel on the I/O issuing processor/hw-q */ 1419 + if (cpumask_test_cpu(q_num, &stor_device->alloced_cpus)) 1420 + return stor_device->stor_chns[q_num]; 1416 1421 1417 1422 node_mask = cpumask_of_node(cpu_to_node(q_num)); 1418 1423 ··· 1474 1469 /* See storvsc_change_target_cpu(). */ 1475 1470 outgoing_channel = READ_ONCE(stor_device->stor_chns[q_num]); 1476 1471 if (outgoing_channel != NULL) { 1477 - if (outgoing_channel->target_cpu == q_num) { 1478 - /* 1479 - * Ideally, we want to pick a different channel if 1480 - * available on the same NUMA node. 1481 - */ 1482 - node_mask = cpumask_of_node(cpu_to_node(q_num)); 1483 - for_each_cpu_wrap(tgt_cpu, 1484 - &stor_device->alloced_cpus, q_num + 1) { 1485 - if (!cpumask_test_cpu(tgt_cpu, node_mask)) 1486 - continue; 1487 - if (tgt_cpu == q_num) 1488 - continue; 1489 - channel = READ_ONCE( 1490 - stor_device->stor_chns[tgt_cpu]); 1491 - if (channel == NULL) 1492 - continue; 1493 - if (hv_get_avail_to_write_percent( 1494 - &channel->outbound) 1495 - > ring_avail_percent_lowater) { 1496 - outgoing_channel = channel; 1497 - goto found_channel; 1498 - } 1499 - } 1472 + if (hv_get_avail_to_write_percent(&outgoing_channel->outbound) 1473 + > ring_avail_percent_lowater) 1474 + goto found_channel; 1500 1475 1501 - /* 1502 - * All the other channels on the same NUMA node are 1503 - * busy. Try to use the channel on the current CPU 1504 - */ 1505 - if (hv_get_avail_to_write_percent( 1506 - &outgoing_channel->outbound) 1507 - > ring_avail_percent_lowater) 1476 + /* 1477 + * Channel is busy, try to find a channel on the same NUMA node 1478 + */ 1479 + node_mask = cpumask_of_node(cpu_to_node(q_num)); 1480 + for_each_cpu_wrap(tgt_cpu, &stor_device->alloced_cpus, 1481 + q_num + 1) { 1482 + if (!cpumask_test_cpu(tgt_cpu, node_mask)) 1483 + continue; 1484 + channel = READ_ONCE(stor_device->stor_chns[tgt_cpu]); 1485 + if (!channel) 1486 + continue; 1487 + if (hv_get_avail_to_write_percent(&channel->outbound) 1488 + > ring_avail_percent_lowater) { 1489 + outgoing_channel = channel; 1508 1490 goto found_channel; 1509 - 1510 - /* 1511 - * If we reach here, all the channels on the current 1512 - * NUMA node are busy. Try to find a channel in 1513 - * other NUMA nodes 1514 - */ 1515 - for_each_cpu(tgt_cpu, &stor_device->alloced_cpus) { 1516 - if (cpumask_test_cpu(tgt_cpu, node_mask)) 1517 - continue; 1518 - channel = READ_ONCE( 1519 - stor_device->stor_chns[tgt_cpu]); 1520 - if (channel == NULL) 1521 - continue; 1522 - if (hv_get_avail_to_write_percent( 1523 - &channel->outbound) 1524 - > ring_avail_percent_lowater) { 1525 - outgoing_channel = channel; 1526 - goto found_channel; 1527 - } 1528 1491 } 1529 1492 } 1493 + 1494 + /* 1495 + * If we reach here, all the channels on the current 1496 + * NUMA node are busy. Try to find a channel in 1497 + * all NUMA nodes 1498 + */ 1499 + for_each_cpu_wrap(tgt_cpu, &stor_device->alloced_cpus, 1500 + q_num + 1) { 1501 + channel = READ_ONCE(stor_device->stor_chns[tgt_cpu]); 1502 + if (!channel) 1503 + continue; 1504 + if (hv_get_avail_to_write_percent(&channel->outbound) 1505 + > ring_avail_percent_lowater) { 1506 + outgoing_channel = channel; 1507 + goto found_channel; 1508 + } 1509 + } 1510 + /* 1511 + * If we reach here, all the channels are busy. Use the 1512 + * original channel found. 1513 + */ 1530 1514 } else { 1531 1515 spin_lock_irqsave(&stor_device->lock, flags); 1532 1516 outgoing_channel = stor_device->stor_chns[q_num];