Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 156314
b: refs/heads/master
c: ffd4bc2
h: refs/heads/master
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Jul 30, 2009
1 parent 42ef21f commit 0de5a62
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 19252de6818ced0def0551d64a0a2975f52a523d
refs/heads/master: ffd4bc2a984fab40ed969163efdff321490e8032
20 changes: 18 additions & 2 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,18 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp)
kfree(buffer);
}

static int sd_try_extended_inquiry(struct scsi_device *sdp)
{
/*
* Although VPD inquiries can go to SCSI-2 type devices,
* some USB ones crash on receiving them, and the pages
* we currently ask for are for SPC-3 and beyond
*/
if (sdp->scsi_level > SCSI_SPC_2)
return 1;
return 0;
}

/**
* sd_revalidate_disk - called the first time a new disk is seen,
* performs disk spin up, read_capacity, etc.
Expand Down Expand Up @@ -1877,8 +1889,12 @@ static int sd_revalidate_disk(struct gendisk *disk)
*/
if (sdkp->media_present) {
sd_read_capacity(sdkp, buffer);
sd_read_block_limits(sdkp);
sd_read_block_characteristics(sdkp);

if (sd_try_extended_inquiry(sdp)) {
sd_read_block_limits(sdkp);
sd_read_block_characteristics(sdkp);
}

sd_read_write_protect_flag(sdkp, buffer);
sd_read_cache_type(sdkp, buffer);
sd_read_app_tag_own(sdkp, buffer);
Expand Down

0 comments on commit 0de5a62

Please sign in to comment.