Commit 025c1970 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "Driver fixes plus core sd.c fix are all small and obvious.

  The larger change to hosts.c is less obvious, but required to avoid
  data corruption caused by bio splitting"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: ufs: core: Fix spelling of a sysfs attribute name
  scsi: core: Enforce unlimited max_segment_size when virt_boundary_mask is set
  scsi: RDMA/srp: Don't set a max_segment_size when virt_boundary_mask is set
  scsi: sd: Fix VPD page 0xb7 length check
  scsi: qla4xxx: Fix missing DMA mapping error in qla4xxx_alloc_pdu()
  scsi: qla2xxx: Fix DMA mapping test in qla24xx_get_port_database()
parents 17bbde2e 021f2436
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -711,7 +711,7 @@ Description: This file shows the thin provisioning type. This is one of

		The file is read only.

What:		/sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resourse_count
What:		/sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resource_count
Date:		February 2018
Contact:	Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
Description:	This file shows the total physical memory resources. This is
+3 −2
Original line number Diff line number Diff line
@@ -3705,9 +3705,10 @@ static ssize_t add_target_store(struct device *dev,
	target_host->max_id      = 1;
	target_host->max_lun     = -1LL;
	target_host->max_cmd_len = sizeof ((struct srp_cmd *) (void *) 0L)->cdb;
	target_host->max_segment_size = ib_dma_max_seg_size(ibdev);

	if (!(ibdev->attrs.kernel_cap_flags & IBK_SG_GAPS_REG))
	if (ibdev->attrs.kernel_cap_flags & IBK_SG_GAPS_REG)
		target_host->max_segment_size = ib_dma_max_seg_size(ibdev);
	else
		target_host->virt_boundary_mask = ~srp_dev->mr_page_mask;

	target = host_to_target(target_host);
+11 −7
Original line number Diff line number Diff line
@@ -473,10 +473,17 @@ struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *sht, int priv
	else
		shost->max_sectors = SCSI_DEFAULT_MAX_SECTORS;

	shost->virt_boundary_mask = sht->virt_boundary_mask;
	if (shost->virt_boundary_mask) {
		WARN_ON_ONCE(sht->max_segment_size &&
			     sht->max_segment_size != UINT_MAX);
		shost->max_segment_size = UINT_MAX;
	} else {
		if (sht->max_segment_size)
			shost->max_segment_size = sht->max_segment_size;
		else
			shost->max_segment_size = BLK_MAX_SEGMENT_SIZE;
	}

	/* 32-byte (dword) is a common minimum for HBAs. */
	if (sht->dma_alignment)
@@ -492,9 +499,6 @@ struct Scsi_Host *scsi_host_alloc(const struct scsi_host_template *sht, int priv
	else
		shost->dma_boundary = 0xffffffff;

	if (sht->virt_boundary_mask)
		shost->virt_boundary_mask = sht->virt_boundary_mask;

	device_initialize(&shost->shost_gendev);
	dev_set_name(&shost->shost_gendev, "host%d", shost->host_no);
	shost->shost_gendev.bus = &scsi_bus_type;
+1 −1
Original line number Diff line number Diff line
@@ -2147,7 +2147,7 @@ qla24xx_get_port_database(scsi_qla_host_t *vha, u16 nport_handle,

	pdb_dma = dma_map_single(&vha->hw->pdev->dev, pdb,
	    sizeof(*pdb), DMA_FROM_DEVICE);
	if (!pdb_dma) {
	if (dma_mapping_error(&vha->hw->pdev->dev, pdb_dma)) {
		ql_log(ql_log_warn, vha, 0x1116, "Failed to map dma buffer.\n");
		return QLA_MEMORY_ALLOC_FAILED;
	}
+2 −0
Original line number Diff line number Diff line
@@ -3420,6 +3420,8 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
		task_data->data_dma = dma_map_single(&ha->pdev->dev, task->data,
						     task->data_count,
						     DMA_TO_DEVICE);
		if (dma_mapping_error(&ha->pdev->dev, task_data->data_dma))
			return -ENOMEM;
	}

	DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",
Loading