mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-04 04:02:26 +00:00
SCSI fixes on 20230330
Four small fixes, three in drivers. The core fix is yet another attempt to insulate us from UFS devices' weird behaviour for VPD pages. Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com> -----BEGIN PGP SIGNATURE----- iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCZCX0NCYcamFtZXMuYm90 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishSz5AQDiKfGd tTA/Ff24pGzvqFfsU9R8vbV/ROKxiC9yAf9OGwEA9racOhJOi0FWNwkM0M3hwBG6 I4T0jp+ItbdSwbONV+Q= =ltqk -----END PGP SIGNATURE----- Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Four small fixes, three in drivers. The core fix is yet another attempt to insulate us from UFS devices' weird behaviour for VPD pages" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: mpt3sas: Don't print sense pool info twice scsi: core: Improve scsi_vpd_inquiry() checks scsi: megaraid_sas: Fix crash after a double completion scsi: megaraid_sas: Fix fw_crash_buffer_show()
This commit is contained in:
commit
10f76dc3ab
@ -3298,7 +3298,7 @@ fw_crash_buffer_show(struct device *cdev,
|
||||
|
||||
spin_lock_irqsave(&instance->crashdump_lock, flags);
|
||||
buff_offset = instance->fw_crash_buffer_offset;
|
||||
if (!instance->crash_dump_buf &&
|
||||
if (!instance->crash_dump_buf ||
|
||||
!((instance->fw_crash_state == AVAILABLE) ||
|
||||
(instance->fw_crash_state == COPYING))) {
|
||||
dev_err(&instance->pdev->dev,
|
||||
|
@ -4771,7 +4771,7 @@ int megasas_task_abort_fusion(struct scsi_cmnd *scmd)
|
||||
devhandle = megasas_get_tm_devhandle(scmd->device);
|
||||
|
||||
if (devhandle == (u16)ULONG_MAX) {
|
||||
ret = SUCCESS;
|
||||
ret = FAILED;
|
||||
sdev_printk(KERN_INFO, scmd->device,
|
||||
"task abort issued for invalid devhandle\n");
|
||||
mutex_unlock(&instance->reset_mutex);
|
||||
@ -4841,7 +4841,7 @@ int megasas_reset_target_fusion(struct scsi_cmnd *scmd)
|
||||
devhandle = megasas_get_tm_devhandle(scmd->device);
|
||||
|
||||
if (devhandle == (u16)ULONG_MAX) {
|
||||
ret = SUCCESS;
|
||||
ret = FAILED;
|
||||
sdev_printk(KERN_INFO, scmd->device,
|
||||
"target reset issued for invalid devhandle\n");
|
||||
mutex_unlock(&instance->reset_mutex);
|
||||
|
@ -6616,11 +6616,6 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc)
|
||||
else if (rc == -EAGAIN)
|
||||
goto try_32bit_dma;
|
||||
total_sz += sense_sz;
|
||||
ioc_info(ioc,
|
||||
"sense pool(0x%p)- dma(0x%llx): depth(%d),"
|
||||
"element_size(%d), pool_size(%d kB)\n",
|
||||
ioc->sense, (unsigned long long)ioc->sense_dma, ioc->scsiio_depth,
|
||||
SCSI_SENSE_BUFFERSIZE, sz / 1024);
|
||||
/* reply pool, 4 byte align */
|
||||
sz = ioc->reply_free_queue_depth * ioc->reply_sz;
|
||||
rc = _base_allocate_reply_pool(ioc, sz);
|
||||
|
@ -314,11 +314,18 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer,
|
||||
if (result)
|
||||
return -EIO;
|
||||
|
||||
/* Sanity check that we got the page back that we asked for */
|
||||
/*
|
||||
* Sanity check that we got the page back that we asked for and that
|
||||
* the page size is not 0.
|
||||
*/
|
||||
if (buffer[1] != page)
|
||||
return -EIO;
|
||||
|
||||
return get_unaligned_be16(&buffer[2]) + 4;
|
||||
result = get_unaligned_be16(&buffer[2]);
|
||||
if (!result)
|
||||
return -EIO;
|
||||
|
||||
return result + 4;
|
||||
}
|
||||
|
||||
static int scsi_get_vpd_size(struct scsi_device *sdev, u8 page)
|
||||
|
Loading…
Reference in New Issue
Block a user