History

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()

Linus Torvalds committed 3 years ago

Commit 10f76dc2 parents b2bc47e d684a7a4 files · +12 −10Browse files

Unified · Split

4 files
  1. drivers/scsi/megaraid/megaraid_sas_base.c +1 −1
  2. drivers/scsi/megaraid/megaraid_sas_fusion.c +2 −2
  3. drivers/scsi/mpt3sas/mpt3sas_base.c +0 −5
  4. drivers/scsi/scsi.c +9 −2
drivers/scsi/megaraid/megaraid_sas_base.c+1−1
@@ -3298,7 +3298,7 @@ fw_crash_buffer_show(struct device *cdev, · 3297 unmodified lines
3298 3298
3299 spin_lock_irqsave(&instance->crashdump_lock, flags);3299 spin_lock_irqsave(&instance->crashdump_lock, flags);
3300 buff_offset = instance->fw_crash_buffer_offset;3300 buff_offset = instance->fw_crash_buffer_offset;
3301 if (!instance->crash_dump_buf &&3301 if (!instance->crash_dump_buf ||
3302 !((instance->fw_crash_state == AVAILABLE) ||3302 !((instance->fw_crash_state == AVAILABLE) ||
3303 (instance->fw_crash_state == COPYING))) {3303 (instance->fw_crash_state == COPYING))) {
3304 dev_err(&instance->pdev->dev,3304 dev_err(&instance->pdev->dev,
drivers/scsi/megaraid/megaraid_sas_fusion.c+2−2
@@ -4771,7 +4771,7 @@ int megasas_task_abort_fusion(struct scsi_cmnd *scmd) · 4770 unmodified lines
4771 devhandle = megasas_get_tm_devhandle(scmd->device);4771 devhandle = megasas_get_tm_devhandle(scmd->device);
4772 4772
4773 if (devhandle == (u16)ULONG_MAX) {4773 if (devhandle == (u16)ULONG_MAX) {
4774 ret = SUCCESS;4774 ret = FAILED;
4775 sdev_printk(KERN_INFO, scmd->device,4775 sdev_printk(KERN_INFO, scmd->device,
4776 "task abort issued for invalid devhandle\n");4776 "task abort issued for invalid devhandle\n");
4777 mutex_unlock(&instance->reset_mutex);4777 mutex_unlock(&instance->reset_mutex);
@@ -4841,7 +4841,7 @@ int megasas_reset_target_fusion(struct scsi_cmnd *scmd) · 63 unmodified lines
4841 devhandle = megasas_get_tm_devhandle(scmd->device);4841 devhandle = megasas_get_tm_devhandle(scmd->device);
4842 4842
4843 if (devhandle == (u16)ULONG_MAX) {4843 if (devhandle == (u16)ULONG_MAX) {
4844 ret = SUCCESS;4844 ret = FAILED;
4845 sdev_printk(KERN_INFO, scmd->device,4845 sdev_printk(KERN_INFO, scmd->device,
4846 "target reset issued for invalid devhandle\n");4846 "target reset issued for invalid devhandle\n");
4847 mutex_unlock(&instance->reset_mutex);4847 mutex_unlock(&instance->reset_mutex);
drivers/scsi/mpt3sas/mpt3sas_base.c+0−5
@@ -6616,11 +6616,6 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc) · 6615 unmodified lines
6616 else if (rc == -EAGAIN)6616 else if (rc == -EAGAIN)
6617 goto try_32bit_dma;6617 goto try_32bit_dma;
6618 total_sz += sense_sz;6618 total_sz += sense_sz;
6619 ioc_info(ioc,
6620 "sense pool(0x%p)- dma(0x%llx): depth(%d),"
6621 "element_size(%d), pool_size(%d kB)\n",
6622 ioc->sense, (unsigned long long)ioc->sense_dma, ioc->scsiio_depth,
6623 SCSI_SENSE_BUFFERSIZE, sz / 1024);
6624 /* reply pool, 4 byte align */6619 /* reply pool, 4 byte align */
6625 sz = ioc->reply_free_queue_depth * ioc->reply_sz;6620 sz = ioc->reply_free_queue_depth * ioc->reply_sz;
6626 rc = _base_allocate_reply_pool(ioc, sz);6621 rc = _base_allocate_reply_pool(ioc, sz);
drivers/scsi/scsi.c+9−2
@@ -314,11 +314,18 @@ static int scsi_vpd_inquiry(struct scsi_device *sdev, unsigned char *buffer, · 313 unmodified lines
314 if (result)314 if (result)
315 return -EIO;315 return -EIO;
316 316
317 /* Sanity check that we got the page back that we asked for */317 /*
318 * Sanity check that we got the page back that we asked for and that
319 * the page size is not 0.
320 */
318 if (buffer[1] != page)321 if (buffer[1] != page)
319 return -EIO;322 return -EIO;
320 323
321 return get_unaligned_be16(&buffer[2]) + 4;324 result = get_unaligned_be16(&buffer[2]);
325 if (!result)
326 return -EIO;
327
328 return result + 4;
322}329}
323 330
324static int scsi_get_vpd_size(struct scsi_device *sdev, u8 page)331static int scsi_get_vpd_size(struct scsi_device *sdev, u8 page)