diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/Kconfig | 16 | ||||
-rw-r--r-- | drivers/block/cciss.c | 49 |
2 files changed, 30 insertions, 35 deletions
diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig index cacb1c816e35..17ee97f3a99b 100644 --- a/drivers/block/Kconfig +++ b/drivers/block/Kconfig | |||
@@ -406,22 +406,6 @@ config BLK_DEV_RAM_BLOCKSIZE | |||
406 | setups function - apparently needed by the rd_load_image routine | 406 | setups function - apparently needed by the rd_load_image routine |
407 | that supposes the filesystem in the image uses a 1024 blocksize. | 407 | that supposes the filesystem in the image uses a 1024 blocksize. |
408 | 408 | ||
409 | config BLK_DEV_INITRD | ||
410 | bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" | ||
411 | depends on BROKEN || !FRV | ||
412 | help | ||
413 | The initial RAM filesystem is a ramfs which is loaded by the | ||
414 | boot loader (loadlin or lilo) and that is mounted as root | ||
415 | before the normal boot procedure. It is typically used to | ||
416 | load modules needed to mount the "real" root file system, | ||
417 | etc. See <file:Documentation/initrd.txt> for details. | ||
418 | |||
419 | If RAM disk support (BLK_DEV_RAM) is also included, this | ||
420 | also enables initial RAM disk (initrd) support and adds | ||
421 | 15 Kbytes (more on some other architectures) to the kernel size. | ||
422 | |||
423 | If unsure say Y. | ||
424 | |||
425 | config CDROM_PKTCDVD | 409 | config CDROM_PKTCDVD |
426 | tristate "Packet writing on CD/DVD media" | 410 | tristate "Packet writing on CD/DVD media" |
427 | depends on !UML | 411 | depends on !UML |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 05dfe357527c..0c716ee905d7 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1291,13 +1291,19 @@ static void cciss_update_drive_info(int ctlr, int drv_index) | |||
1291 | if (inq_buff == NULL) | 1291 | if (inq_buff == NULL) |
1292 | goto mem_msg; | 1292 | goto mem_msg; |
1293 | 1293 | ||
1294 | /* testing to see if 16-byte CDBs are already being used */ | ||
1295 | if (h->cciss_read == CCISS_READ_16) { | ||
1296 | cciss_read_capacity_16(h->ctlr, drv_index, 1, | ||
1297 | &total_size, &block_size); | ||
1298 | goto geo_inq; | ||
1299 | } | ||
1300 | |||
1294 | cciss_read_capacity(ctlr, drv_index, 1, | 1301 | cciss_read_capacity(ctlr, drv_index, 1, |
1295 | &total_size, &block_size); | 1302 | &total_size, &block_size); |
1296 | 1303 | ||
1297 | /* total size = last LBA + 1 */ | 1304 | /* if read_capacity returns all F's this volume is >2TB in size */ |
1298 | /* FFFFFFFF + 1 = 0, cannot have a logical volume of size 0 */ | 1305 | /* so we switch to 16-byte CDB's for all read/write ops */ |
1299 | /* so we assume this volume this must be >2TB in size */ | 1306 | if (total_size == 0xFFFFFFFFULL) { |
1300 | if (total_size == (__u32) 0) { | ||
1301 | cciss_read_capacity_16(ctlr, drv_index, 1, | 1307 | cciss_read_capacity_16(ctlr, drv_index, 1, |
1302 | &total_size, &block_size); | 1308 | &total_size, &block_size); |
1303 | h->cciss_read = CCISS_READ_16; | 1309 | h->cciss_read = CCISS_READ_16; |
@@ -1306,6 +1312,7 @@ static void cciss_update_drive_info(int ctlr, int drv_index) | |||
1306 | h->cciss_read = CCISS_READ_10; | 1312 | h->cciss_read = CCISS_READ_10; |
1307 | h->cciss_write = CCISS_WRITE_10; | 1313 | h->cciss_write = CCISS_WRITE_10; |
1308 | } | 1314 | } |
1315 | geo_inq: | ||
1309 | cciss_geometry_inquiry(ctlr, drv_index, 1, total_size, block_size, | 1316 | cciss_geometry_inquiry(ctlr, drv_index, 1, total_size, block_size, |
1310 | inq_buff, &h->drv[drv_index]); | 1317 | inq_buff, &h->drv[drv_index]); |
1311 | 1318 | ||
@@ -1917,13 +1924,14 @@ static void cciss_geometry_inquiry(int ctlr, int logvol, | |||
1917 | drv->raid_level = inq_buff->data_byte[8]; | 1924 | drv->raid_level = inq_buff->data_byte[8]; |
1918 | } | 1925 | } |
1919 | drv->block_size = block_size; | 1926 | drv->block_size = block_size; |
1920 | drv->nr_blocks = total_size; | 1927 | drv->nr_blocks = total_size + 1; |
1921 | t = drv->heads * drv->sectors; | 1928 | t = drv->heads * drv->sectors; |
1922 | if (t > 1) { | 1929 | if (t > 1) { |
1923 | unsigned rem = sector_div(total_size, t); | 1930 | sector_t real_size = total_size + 1; |
1931 | unsigned long rem = sector_div(real_size, t); | ||
1924 | if (rem) | 1932 | if (rem) |
1925 | total_size++; | 1933 | real_size++; |
1926 | drv->cylinders = total_size; | 1934 | drv->cylinders = real_size; |
1927 | } | 1935 | } |
1928 | } else { /* Get geometry failed */ | 1936 | } else { /* Get geometry failed */ |
1929 | printk(KERN_WARNING "cciss: reading geometry failed\n"); | 1937 | printk(KERN_WARNING "cciss: reading geometry failed\n"); |
@@ -1953,16 +1961,16 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1953 | ctlr, buf, sizeof(ReadCapdata_struct), | 1961 | ctlr, buf, sizeof(ReadCapdata_struct), |
1954 | 1, logvol, 0, NULL, TYPE_CMD); | 1962 | 1, logvol, 0, NULL, TYPE_CMD); |
1955 | if (return_code == IO_OK) { | 1963 | if (return_code == IO_OK) { |
1956 | *total_size = be32_to_cpu(*(__u32 *) buf->total_size)+1; | 1964 | *total_size = be32_to_cpu(*(__u32 *) buf->total_size); |
1957 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 1965 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); |
1958 | } else { /* read capacity command failed */ | 1966 | } else { /* read capacity command failed */ |
1959 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 1967 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
1960 | *total_size = 0; | 1968 | *total_size = 0; |
1961 | *block_size = BLOCK_SIZE; | 1969 | *block_size = BLOCK_SIZE; |
1962 | } | 1970 | } |
1963 | if (*total_size != (__u32) 0) | 1971 | if (*total_size != 0) |
1964 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 1972 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
1965 | (unsigned long long)*total_size, *block_size); | 1973 | (unsigned long long)*total_size+1, *block_size); |
1966 | kfree(buf); | 1974 | kfree(buf); |
1967 | return; | 1975 | return; |
1968 | } | 1976 | } |
@@ -1989,7 +1997,7 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1989 | 1, logvol, 0, NULL, TYPE_CMD); | 1997 | 1, logvol, 0, NULL, TYPE_CMD); |
1990 | } | 1998 | } |
1991 | if (return_code == IO_OK) { | 1999 | if (return_code == IO_OK) { |
1992 | *total_size = be64_to_cpu(*(__u64 *) buf->total_size)+1; | 2000 | *total_size = be64_to_cpu(*(__u64 *) buf->total_size); |
1993 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 2001 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); |
1994 | } else { /* read capacity command failed */ | 2002 | } else { /* read capacity command failed */ |
1995 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 2003 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
@@ -1997,7 +2005,7 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1997 | *block_size = BLOCK_SIZE; | 2005 | *block_size = BLOCK_SIZE; |
1998 | } | 2006 | } |
1999 | printk(KERN_INFO " blocks= %llu block_size= %d\n", | 2007 | printk(KERN_INFO " blocks= %llu block_size= %d\n", |
2000 | (unsigned long long)*total_size, *block_size); | 2008 | (unsigned long long)*total_size+1, *block_size); |
2001 | kfree(buf); | 2009 | kfree(buf); |
2002 | return; | 2010 | return; |
2003 | } | 2011 | } |
@@ -3119,8 +3127,9 @@ static void cciss_getgeometry(int cntl_num) | |||
3119 | } | 3127 | } |
3120 | cciss_read_capacity(cntl_num, i, 0, &total_size, &block_size); | 3128 | cciss_read_capacity(cntl_num, i, 0, &total_size, &block_size); |
3121 | 3129 | ||
3122 | /* total_size = last LBA + 1 */ | 3130 | /* If read_capacity returns all F's the logical is >2TB */ |
3123 | if(total_size == (__u32) 0) { | 3131 | /* so we switch to 16-byte CDBs for all read/write ops */ |
3132 | if(total_size == 0xFFFFFFFFULL) { | ||
3124 | cciss_read_capacity_16(cntl_num, i, 0, | 3133 | cciss_read_capacity_16(cntl_num, i, 0, |
3125 | &total_size, &block_size); | 3134 | &total_size, &block_size); |
3126 | hba[cntl_num]->cciss_read = CCISS_READ_16; | 3135 | hba[cntl_num]->cciss_read = CCISS_READ_16; |
@@ -3395,7 +3404,7 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, | |||
3395 | return -1; | 3404 | return -1; |
3396 | } | 3405 | } |
3397 | 3406 | ||
3398 | static void __devexit cciss_remove_one(struct pci_dev *pdev) | 3407 | static void cciss_remove_one(struct pci_dev *pdev) |
3399 | { | 3408 | { |
3400 | ctlr_info_t *tmp_ptr; | 3409 | ctlr_info_t *tmp_ptr; |
3401 | int i, j; | 3410 | int i, j; |
@@ -3419,9 +3428,10 @@ static void __devexit cciss_remove_one(struct pci_dev *pdev) | |||
3419 | memset(flush_buf, 0, 4); | 3428 | memset(flush_buf, 0, 4); |
3420 | return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL, | 3429 | return_code = sendcmd(CCISS_CACHE_FLUSH, i, flush_buf, 4, 0, 0, 0, NULL, |
3421 | TYPE_CMD); | 3430 | TYPE_CMD); |
3422 | if (return_code != IO_OK) { | 3431 | if (return_code == IO_OK) { |
3423 | printk(KERN_WARNING "Error Flushing cache on controller %d\n", | 3432 | printk(KERN_INFO "Completed flushing cache on controller %d\n", i); |
3424 | i); | 3433 | } else { |
3434 | printk(KERN_WARNING "Error flushing cache on controller %d\n", i); | ||
3425 | } | 3435 | } |
3426 | free_irq(hba[i]->intr[2], hba[i]); | 3436 | free_irq(hba[i]->intr[2], hba[i]); |
3427 | 3437 | ||
@@ -3472,6 +3482,7 @@ static struct pci_driver cciss_pci_driver = { | |||
3472 | .probe = cciss_init_one, | 3482 | .probe = cciss_init_one, |
3473 | .remove = __devexit_p(cciss_remove_one), | 3483 | .remove = __devexit_p(cciss_remove_one), |
3474 | .id_table = cciss_pci_device_id, /* id_table */ | 3484 | .id_table = cciss_pci_device_id, /* id_table */ |
3485 | .shutdown = cciss_remove_one, | ||
3475 | }; | 3486 | }; |
3476 | 3487 | ||
3477 | /* | 3488 | /* |