Skip to content

Commit 4236f91

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: "Two small fixes, both in drivers (ufs and scsi_debug)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: core: Fix another deadlock during RTC update scsi: scsi_debug: Fix do_device_access() handling of unexpected SG copy length
2 parents c1e939a + cb7e509 commit 4236f91

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

drivers/scsi/scsi_debug.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,7 +3651,7 @@ static int do_device_access(struct sdeb_store_info *sip, struct scsi_cmnd *scp,
36513651
enum dma_data_direction dir;
36523652
struct scsi_data_buffer *sdb = &scp->sdb;
36533653
u8 *fsp;
3654-
int i;
3654+
int i, total = 0;
36553655

36563656
/*
36573657
* Even though reads are inherently atomic (in this driver), we expect
@@ -3688,18 +3688,16 @@ static int do_device_access(struct sdeb_store_info *sip, struct scsi_cmnd *scp,
36883688
fsp + (block * sdebug_sector_size),
36893689
sdebug_sector_size, sg_skip, do_write);
36903690
sdeb_data_sector_unlock(sip, do_write);
3691-
if (ret != sdebug_sector_size) {
3692-
ret += (i * sdebug_sector_size);
3691+
total += ret;
3692+
if (ret != sdebug_sector_size)
36933693
break;
3694-
}
36953694
sg_skip += sdebug_sector_size;
36963695
if (++block >= sdebug_store_sectors)
36973696
block = 0;
36983697
}
3699-
ret = num * sdebug_sector_size;
37003698
sdeb_data_unlock(sip, atomic);
37013699

3702-
return ret;
3700+
return total;
37033701
}
37043702

37053703
/* Returns number of bytes copied or -1 if error. */

drivers/ufs/core/ufshcd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8219,7 +8219,7 @@ static void ufshcd_update_rtc(struct ufs_hba *hba)
82198219

82208220
err = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR, QUERY_ATTR_IDN_SECONDS_PASSED,
82218221
0, 0, &val);
8222-
ufshcd_rpm_put_sync(hba);
8222+
ufshcd_rpm_put(hba);
82238223

82248224
if (err)
82258225
dev_err(hba->dev, "%s: Failed to update rtc %d\n", __func__, err);

0 commit comments

Comments
 (0)