Skip to content

Commit fd2b2c5

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Three small fixes. The transfer size fixes are actually correcting some performance drops on the hpsa and smartpqi cards. The cards actually have an internal cache for request speed up but bypass it for transfers > 1MB. Since 4.3 the efficiency of our merges has rendered the cache mostly unused, so limit transfers to under 1MB to recover the cache boost" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sg: fix static checker warning in sg_is_valid_dxfer scsi: smartpqi: limit transfer length to 1MB scsi: hpsa: limit transfer length to 1MB
2 parents 5d4eeb8 + 14074ab commit fd2b2c5

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

drivers/scsi/hpsa.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ static struct scsi_host_template hpsa_driver_template = {
938938
#endif
939939
.sdev_attrs = hpsa_sdev_attrs,
940940
.shost_attrs = hpsa_shost_attrs,
941-
.max_sectors = 8192,
941+
.max_sectors = 1024,
942942
.no_write_same = 1,
943943
};
944944

drivers/scsi/sg.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,8 +759,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_t *hp)
759759
return false;
760760
return true;
761761
case SG_DXFER_FROM_DEV:
762-
if (hp->dxfer_len < 0)
763-
return false;
762+
/*
763+
* for SG_DXFER_FROM_DEV we always set dxfer_len to > 0. dxferp
764+
* can either be NULL or != NULL so there's no point in checking
765+
* it either. So just return true.
766+
*/
764767
return true;
765768
case SG_DXFER_TO_DEV:
766769
case SG_DXFER_TO_FROM_DEV:

drivers/scsi/smartpqi/smartpqi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ struct pqi_config_table_heartbeat {
690690

691691
#define PQI_MAX_OUTSTANDING_REQUESTS ((u32)~0)
692692
#define PQI_MAX_OUTSTANDING_REQUESTS_KDUMP 32
693-
#define PQI_MAX_TRANSFER_SIZE (4 * 1024U * 1024U)
693+
#define PQI_MAX_TRANSFER_SIZE (1024U * 1024U)
694694
#define PQI_MAX_TRANSFER_SIZE_KDUMP (512 * 1024U)
695695

696696
#define RAID_MAP_MAX_ENTRIES 1024

0 commit comments

Comments
 (0)