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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull SCSI fixes from James Bottomley:
"The most important is the libsas fix, which is a problem for DMA to a
kmalloc'd structure too small causing cache line interference. The
other fixes (all in drivers) are mostly for allocation length fixes,
error leg unwinding, suspend races and a missing retry"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
scsi: ufs: core: Fix MCQ mode dev command timeout
scsi: libsas: Align SMP request allocation to ARCH_DMA_MINALIGN
scsi: sd: Unregister device if device_add_disk() failed in sd_probe()
scsi: ufs: core: WLUN suspend dev/link state error recovery
scsi: mylex: Fix sysfs buffer lengths

+31 -26
+1 -1
drivers/scsi/libsas/sas_expander.c
··· 135 135 136 136 static inline void *alloc_smp_req(int size) 137 137 { 138 - u8 *p = kzalloc(size, GFP_KERNEL); 138 + u8 *p = kzalloc(ALIGN(size, ARCH_DMA_MINALIGN), GFP_KERNEL); 139 139 if (p) 140 140 p[0] = SMP_REQUEST; 141 141 return p;
+10 -10
drivers/scsi/myrb.c
··· 1775 1775 1776 1776 name = myrb_devstate_name(ldev_info->state); 1777 1777 if (name) 1778 - ret = snprintf(buf, 32, "%s\n", name); 1778 + ret = snprintf(buf, 64, "%s\n", name); 1779 1779 else 1780 - ret = snprintf(buf, 32, "Invalid (%02X)\n", 1780 + ret = snprintf(buf, 64, "Invalid (%02X)\n", 1781 1781 ldev_info->state); 1782 1782 } else { 1783 1783 struct myrb_pdev_state *pdev_info = sdev->hostdata; ··· 1796 1796 else 1797 1797 name = myrb_devstate_name(pdev_info->state); 1798 1798 if (name) 1799 - ret = snprintf(buf, 32, "%s\n", name); 1799 + ret = snprintf(buf, 64, "%s\n", name); 1800 1800 else 1801 - ret = snprintf(buf, 32, "Invalid (%02X)\n", 1801 + ret = snprintf(buf, 64, "Invalid (%02X)\n", 1802 1802 pdev_info->state); 1803 1803 } 1804 1804 return ret; ··· 1886 1886 1887 1887 name = myrb_raidlevel_name(ldev_info->raid_level); 1888 1888 if (!name) 1889 - return snprintf(buf, 32, "Invalid (%02X)\n", 1889 + return snprintf(buf, 64, "Invalid (%02X)\n", 1890 1890 ldev_info->state); 1891 - return snprintf(buf, 32, "%s\n", name); 1891 + return snprintf(buf, 64, "%s\n", name); 1892 1892 } 1893 - return snprintf(buf, 32, "Physical Drive\n"); 1893 + return snprintf(buf, 64, "Physical Drive\n"); 1894 1894 } 1895 1895 static DEVICE_ATTR_RO(raid_level); 1896 1896 ··· 1903 1903 unsigned char status; 1904 1904 1905 1905 if (sdev->channel < myrb_logical_channel(sdev->host)) 1906 - return snprintf(buf, 32, "physical device - not rebuilding\n"); 1906 + return snprintf(buf, 64, "physical device - not rebuilding\n"); 1907 1907 1908 1908 status = myrb_get_rbld_progress(cb, &rbld_buf); 1909 1909 1910 1910 if (rbld_buf.ldev_num != sdev->id || 1911 1911 status != MYRB_STATUS_SUCCESS) 1912 - return snprintf(buf, 32, "not rebuilding\n"); 1912 + return snprintf(buf, 64, "not rebuilding\n"); 1913 1913 1914 - return snprintf(buf, 32, "rebuilding block %u of %u\n", 1914 + return snprintf(buf, 64, "rebuilding block %u of %u\n", 1915 1915 rbld_buf.ldev_size - rbld_buf.blocks_left, 1916 1916 rbld_buf.ldev_size); 1917 1917 }
+12 -12
drivers/scsi/myrs.c
··· 947 947 948 948 name = myrs_devstate_name(ldev_info->dev_state); 949 949 if (name) 950 - ret = snprintf(buf, 32, "%s\n", name); 950 + ret = snprintf(buf, 64, "%s\n", name); 951 951 else 952 - ret = snprintf(buf, 32, "Invalid (%02X)\n", 952 + ret = snprintf(buf, 64, "Invalid (%02X)\n", 953 953 ldev_info->dev_state); 954 954 } else { 955 955 struct myrs_pdev_info *pdev_info; ··· 958 958 pdev_info = sdev->hostdata; 959 959 name = myrs_devstate_name(pdev_info->dev_state); 960 960 if (name) 961 - ret = snprintf(buf, 32, "%s\n", name); 961 + ret = snprintf(buf, 64, "%s\n", name); 962 962 else 963 - ret = snprintf(buf, 32, "Invalid (%02X)\n", 963 + ret = snprintf(buf, 64, "Invalid (%02X)\n", 964 964 pdev_info->dev_state); 965 965 } 966 966 return ret; ··· 1066 1066 ldev_info = sdev->hostdata; 1067 1067 name = myrs_raid_level_name(ldev_info->raid_level); 1068 1068 if (!name) 1069 - return snprintf(buf, 32, "Invalid (%02X)\n", 1069 + return snprintf(buf, 64, "Invalid (%02X)\n", 1070 1070 ldev_info->dev_state); 1071 1071 1072 1072 } else 1073 1073 name = myrs_raid_level_name(MYRS_RAID_PHYSICAL); 1074 1074 1075 - return snprintf(buf, 32, "%s\n", name); 1075 + return snprintf(buf, 64, "%s\n", name); 1076 1076 } 1077 1077 static DEVICE_ATTR_RO(raid_level); 1078 1078 ··· 1086 1086 unsigned char status; 1087 1087 1088 1088 if (sdev->channel < cs->ctlr_info->physchan_present) 1089 - return snprintf(buf, 32, "physical device - not rebuilding\n"); 1089 + return snprintf(buf, 64, "physical device - not rebuilding\n"); 1090 1090 1091 1091 ldev_info = sdev->hostdata; 1092 1092 ldev_num = ldev_info->ldev_num; ··· 1098 1098 return -EIO; 1099 1099 } 1100 1100 if (ldev_info->rbld_active) { 1101 - return snprintf(buf, 32, "rebuilding block %zu of %zu\n", 1101 + return snprintf(buf, 64, "rebuilding block %zu of %zu\n", 1102 1102 (size_t)ldev_info->rbld_lba, 1103 1103 (size_t)ldev_info->cfg_devsize); 1104 1104 } else 1105 - return snprintf(buf, 32, "not rebuilding\n"); 1105 + return snprintf(buf, 64, "not rebuilding\n"); 1106 1106 } 1107 1107 1108 1108 static ssize_t rebuild_store(struct device *dev, ··· 1190 1190 unsigned short ldev_num; 1191 1191 1192 1192 if (sdev->channel < cs->ctlr_info->physchan_present) 1193 - return snprintf(buf, 32, "physical device - not checking\n"); 1193 + return snprintf(buf, 64, "physical device - not checking\n"); 1194 1194 1195 1195 ldev_info = sdev->hostdata; 1196 1196 if (!ldev_info) ··· 1198 1198 ldev_num = ldev_info->ldev_num; 1199 1199 myrs_get_ldev_info(cs, ldev_num, ldev_info); 1200 1200 if (ldev_info->cc_active) 1201 - return snprintf(buf, 32, "checking block %zu of %zu\n", 1201 + return snprintf(buf, 64, "checking block %zu of %zu\n", 1202 1202 (size_t)ldev_info->cc_lba, 1203 1203 (size_t)ldev_info->cfg_devsize); 1204 1204 else 1205 - return snprintf(buf, 32, "not checking\n"); 1205 + return snprintf(buf, 64, "not checking\n"); 1206 1206 } 1207 1207 1208 1208 static ssize_t consistency_check_store(struct device *dev,
+1 -1
drivers/scsi/sd.c
··· 3920 3920 3921 3921 error = device_add_disk(dev, gd, NULL); 3922 3922 if (error) { 3923 - put_device(&sdkp->disk_dev); 3923 + device_unregister(&sdkp->disk_dev); 3924 3924 put_disk(gd); 3925 3925 goto out; 3926 3926 }
+7 -2
drivers/ufs/core/ufshcd.c
··· 3217 3217 3218 3218 /* MCQ mode */ 3219 3219 if (is_mcq_enabled(hba)) { 3220 - err = ufshcd_clear_cmd(hba, lrbp->task_tag); 3220 + /* successfully cleared the command, retry if needed */ 3221 + if (ufshcd_clear_cmd(hba, lrbp->task_tag) == 0) 3222 + err = -EAGAIN; 3221 3223 hba->dev_cmd.complete = NULL; 3222 3224 return err; 3223 3225 } ··· 9793 9791 9794 9792 /* UFS device & link must be active before we enter in this function */ 9795 9793 if (!ufshcd_is_ufs_dev_active(hba) || !ufshcd_is_link_active(hba)) { 9796 - ret = -EINVAL; 9794 + /* Wait err handler finish or trigger err recovery */ 9795 + if (!ufshcd_eh_in_progress(hba)) 9796 + ufshcd_force_error_recovery(hba); 9797 + ret = -EBUSY; 9797 9798 goto enable_scaling; 9798 9799 } 9799 9800