diff options
author | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
commit | aa11d958d1a6572eda08214d7c6a735804fe48a5 (patch) | |
tree | d025b05270ad1e010660d17eeadc6ac3c1abbd7d /drivers/scsi/sd.c | |
parent | 07f6642ee9418e962e54cbc07471cfe2e559c568 (diff) | |
parent | 9799218ae36910af50f002a5db1802d576fffb43 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
arch/microblaze/include/asm/socket.h
Diffstat (limited to 'drivers/scsi/sd.c')
-rw-r--r-- | drivers/scsi/sd.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 5616cd780ff3..b7b9fec67a98 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -1840,6 +1840,18 @@ static void sd_read_block_characteristics(struct scsi_disk *sdkp) | |||
1840 | kfree(buffer); | 1840 | kfree(buffer); |
1841 | } | 1841 | } |
1842 | 1842 | ||
1843 | static int sd_try_extended_inquiry(struct scsi_device *sdp) | ||
1844 | { | ||
1845 | /* | ||
1846 | * Although VPD inquiries can go to SCSI-2 type devices, | ||
1847 | * some USB ones crash on receiving them, and the pages | ||
1848 | * we currently ask for are for SPC-3 and beyond | ||
1849 | */ | ||
1850 | if (sdp->scsi_level > SCSI_SPC_2) | ||
1851 | return 1; | ||
1852 | return 0; | ||
1853 | } | ||
1854 | |||
1843 | /** | 1855 | /** |
1844 | * sd_revalidate_disk - called the first time a new disk is seen, | 1856 | * sd_revalidate_disk - called the first time a new disk is seen, |
1845 | * performs disk spin up, read_capacity, etc. | 1857 | * performs disk spin up, read_capacity, etc. |
@@ -1877,8 +1889,12 @@ static int sd_revalidate_disk(struct gendisk *disk) | |||
1877 | */ | 1889 | */ |
1878 | if (sdkp->media_present) { | 1890 | if (sdkp->media_present) { |
1879 | sd_read_capacity(sdkp, buffer); | 1891 | sd_read_capacity(sdkp, buffer); |
1880 | sd_read_block_limits(sdkp); | 1892 | |
1881 | sd_read_block_characteristics(sdkp); | 1893 | if (sd_try_extended_inquiry(sdp)) { |
1894 | sd_read_block_limits(sdkp); | ||
1895 | sd_read_block_characteristics(sdkp); | ||
1896 | } | ||
1897 | |||
1882 | sd_read_write_protect_flag(sdkp, buffer); | 1898 | sd_read_write_protect_flag(sdkp, buffer); |
1883 | sd_read_cache_type(sdkp, buffer); | 1899 | sd_read_cache_type(sdkp, buffer); |
1884 | sd_read_app_tag_own(sdkp, buffer); | 1900 | sd_read_app_tag_own(sdkp, buffer); |