Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154013
b: refs/heads/master
c: 3821d76
h: refs/heads/master
i:
  154011: 0870605
v: v3
  • Loading branch information
Martin K. Petersen authored and James Bottomley committed Jun 21, 2009
1 parent 38163ff commit ba41d1a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea09bcc9c298d3057270abd78a973fc678d55c4c
refs/heads/master: 3821d768912a47ddbd6cab52943a8284df88003c
26 changes: 26 additions & 0 deletions trunk/drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1794,6 +1794,29 @@ void sd_read_app_tag_own(struct scsi_disk *sdkp, unsigned char *buffer)
return;
}

/**
* sd_read_block_characteristics - Query block dev. characteristics
* @disk: disk to query
*/
static void sd_read_block_characteristics(struct scsi_disk *sdkp)
{
char *buffer;
u16 rot;

/* Block Device Characteristics VPD */
buffer = scsi_get_vpd_page(sdkp->device, 0xb1);

if (buffer == NULL)
return;

rot = get_unaligned_be16(&buffer[4]);

if (rot == 1)
queue_flag_set_unlocked(QUEUE_FLAG_NONROT, sdkp->disk->queue);

kfree(buffer);
}

/**
* sd_revalidate_disk - called the first time a new disk is seen,
* performs disk spin up, read_capacity, etc.
Expand Down Expand Up @@ -1831,6 +1854,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
*/
if (sdkp->media_present) {
sd_read_capacity(sdkp, buffer);
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 Expand Up @@ -1953,6 +1977,8 @@ static void sd_probe_async(void *data, async_cookie_t cookie)
add_disk(gd);
sd_dif_config_host(sdkp);

sd_revalidate_disk(gd);

sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
sdp->removable ? "removable " : "");
}
Expand Down

0 comments on commit ba41d1a

Please sign in to comment.