aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-07 08:27:11 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-06-07 08:27:11 -0400
commit6250d3af2a1036fb356264442211a4246c7d64c7 (patch)
tree12474d59b96c0dc518159cb694f0e654cb18b5f6
parent4c9773ed7946fc375edba057770f5ef16d8b44fe (diff)
parent075affcbe01d4d7cefcd0e30a98df1253bcf8d92 (diff)
Merge branch 'for-linus' into for-next
-rw-r--r--Documentation/ide/ide.txt2
-rw-r--r--Documentation/kernel-parameters.txt7
-rw-r--r--drivers/ide/ide-disk.c71
-rw-r--r--drivers/ide/ide-gd.c14
-rw-r--r--drivers/ide/ide-pci-generic.c11
-rw-r--r--drivers/ide/ide.c10
-rw-r--r--drivers/ide/pdc202xx_old.c22
-rw-r--r--fs/partitions/check.c42
-rw-r--r--include/linux/blkdev.h2
-rw-r--r--include/linux/genhd.h1
-rw-r--r--include/linux/ide.h6
11 files changed, 145 insertions, 43 deletions
diff --git a/Documentation/ide/ide.txt b/Documentation/ide/ide.txt
index 0c78f4b1d9d9..e77bebfa7b0d 100644
--- a/Documentation/ide/ide.txt
+++ b/Documentation/ide/ide.txt
@@ -216,6 +216,8 @@ Other kernel parameters for ide_core are:
216 216
217* "noflush=[interface_number.device_number]" to disable flush requests 217* "noflush=[interface_number.device_number]" to disable flush requests
218 218
219* "nohpa=[interface_number.device_number]" to disable Host Protected Area
220
219* "noprobe=[interface_number.device_number]" to skip probing 221* "noprobe=[interface_number.device_number]" to skip probing
220 222
221* "nowerr=[interface_number.device_number]" to ignore the WRERR_STAT bit 223* "nowerr=[interface_number.device_number]" to ignore the WRERR_STAT bit
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index a19f021f081a..e58c91ca802c 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -835,11 +835,8 @@ and is between 256 and 4096 characters. It is defined in the file
835 835
836 ide-core.nodma= [HW] (E)IDE subsystem 836 ide-core.nodma= [HW] (E)IDE subsystem
837 Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc 837 Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
838 .vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom 838 .vlb_clock .pci_clock .noflush .nohpa .noprobe .nowerr
839 .chs .ignore_cable are additional options 839 .cdrom .chs .ignore_cable are additional options
840 See Documentation/ide/ide.txt.
841
842 idebus= [HW] (E)IDE subsystem - VLB/PCI bus speed
843 See Documentation/ide/ide.txt. 840 See Documentation/ide/ide.txt.
844 841
845 ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem 842 ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index d345f5f23f01..b5f25387cc01 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -302,14 +302,12 @@ static const struct drive_list_entry hpa_list[] = {
302 { NULL, NULL } 302 { NULL, NULL }
303}; 303};
304 304
305static void idedisk_check_hpa(ide_drive_t *drive) 305static u64 ide_disk_hpa_get_native_capacity(ide_drive_t *drive, int lba48)
306{ 306{
307 unsigned long long capacity, set_max; 307 u64 capacity, set_max;
308 int lba48 = ata_id_lba48_enabled(drive->id);
309 308
310 capacity = drive->capacity64; 309 capacity = drive->capacity64;
311 310 set_max = idedisk_read_native_max_address(drive, lba48);
312 set_max = idedisk_read_native_max_address(drive, lba48);
313 311
314 if (ide_in_drive_list(drive->id, hpa_list)) { 312 if (ide_in_drive_list(drive->id, hpa_list)) {
315 /* 313 /*
@@ -320,9 +318,31 @@ static void idedisk_check_hpa(ide_drive_t *drive)
320 set_max--; 318 set_max--;
321 } 319 }
322 320
321 return set_max;
322}
323
324static u64 ide_disk_hpa_set_capacity(ide_drive_t *drive, u64 set_max, int lba48)
325{
326 set_max = idedisk_set_max_address(drive, set_max, lba48);
327 if (set_max)
328 drive->capacity64 = set_max;
329
330 return set_max;
331}
332
333static void idedisk_check_hpa(ide_drive_t *drive)
334{
335 u64 capacity, set_max;
336 int lba48 = ata_id_lba48_enabled(drive->id);
337
338 capacity = drive->capacity64;
339 set_max = ide_disk_hpa_get_native_capacity(drive, lba48);
340
323 if (set_max <= capacity) 341 if (set_max <= capacity)
324 return; 342 return;
325 343
344 drive->probed_capacity = set_max;
345
326 printk(KERN_INFO "%s: Host Protected Area detected.\n" 346 printk(KERN_INFO "%s: Host Protected Area detected.\n"
327 "\tcurrent capacity is %llu sectors (%llu MB)\n" 347 "\tcurrent capacity is %llu sectors (%llu MB)\n"
328 "\tnative capacity is %llu sectors (%llu MB)\n", 348 "\tnative capacity is %llu sectors (%llu MB)\n",
@@ -330,13 +350,13 @@ static void idedisk_check_hpa(ide_drive_t *drive)
330 capacity, sectors_to_MB(capacity), 350 capacity, sectors_to_MB(capacity),
331 set_max, sectors_to_MB(set_max)); 351 set_max, sectors_to_MB(set_max));
332 352
333 set_max = idedisk_set_max_address(drive, set_max, lba48); 353 if ((drive->dev_flags & IDE_DFLAG_NOHPA) == 0)
354 return;
334 355
335 if (set_max) { 356 set_max = ide_disk_hpa_set_capacity(drive, set_max, lba48);
336 drive->capacity64 = set_max; 357 if (set_max)
337 printk(KERN_INFO "%s: Host Protected Area disabled.\n", 358 printk(KERN_INFO "%s: Host Protected Area disabled.\n",
338 drive->name); 359 drive->name);
339 }
340} 360}
341 361
342static int ide_disk_get_capacity(ide_drive_t *drive) 362static int ide_disk_get_capacity(ide_drive_t *drive)
@@ -358,6 +378,8 @@ static int ide_disk_get_capacity(ide_drive_t *drive)
358 drive->capacity64 = drive->cyl * drive->head * drive->sect; 378 drive->capacity64 = drive->cyl * drive->head * drive->sect;
359 } 379 }
360 380
381 drive->probed_capacity = drive->capacity64;
382
361 if (lba) { 383 if (lba) {
362 drive->dev_flags |= IDE_DFLAG_LBA; 384 drive->dev_flags |= IDE_DFLAG_LBA;
363 385
@@ -376,7 +398,7 @@ static int ide_disk_get_capacity(ide_drive_t *drive)
376 "%llu sectors (%llu MB)\n", 398 "%llu sectors (%llu MB)\n",
377 drive->name, (unsigned long long)drive->capacity64, 399 drive->name, (unsigned long long)drive->capacity64,
378 sectors_to_MB(drive->capacity64)); 400 sectors_to_MB(drive->capacity64));
379 drive->capacity64 = 1ULL << 28; 401 drive->probed_capacity = drive->capacity64 = 1ULL << 28;
380 } 402 }
381 403
382 if ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) && 404 if ((drive->hwif->host_flags & IDE_HFLAG_NO_LBA48_DMA) &&
@@ -392,6 +414,34 @@ static int ide_disk_get_capacity(ide_drive_t *drive)
392 return 0; 414 return 0;
393} 415}
394 416
417static u64 ide_disk_set_capacity(ide_drive_t *drive, u64 capacity)
418{
419 u64 set = min(capacity, drive->probed_capacity);
420 u16 *id = drive->id;
421 int lba48 = ata_id_lba48_enabled(id);
422
423 if ((drive->dev_flags & IDE_DFLAG_LBA) == 0 ||
424 ata_id_hpa_enabled(id) == 0)
425 goto out;
426
427 /*
428 * according to the spec the SET MAX ADDRESS command shall be
429 * immediately preceded by a READ NATIVE MAX ADDRESS command
430 */
431 capacity = ide_disk_hpa_get_native_capacity(drive, lba48);
432 if (capacity == 0)
433 goto out;
434
435 set = ide_disk_hpa_set_capacity(drive, set, lba48);
436 if (set) {
437 /* needed for ->resume to disable HPA */
438 drive->dev_flags |= IDE_DFLAG_NOHPA;
439 return set;
440 }
441out:
442 return drive->capacity64;
443}
444
395static void idedisk_prepare_flush(struct request_queue *q, struct request *rq) 445static void idedisk_prepare_flush(struct request_queue *q, struct request *rq)
396{ 446{
397 ide_drive_t *drive = q->queuedata; 447 ide_drive_t *drive = q->queuedata;
@@ -740,6 +790,7 @@ static int ide_disk_set_doorlock(ide_drive_t *drive, struct gendisk *disk,
740 790
741const struct ide_disk_ops ide_ata_disk_ops = { 791const struct ide_disk_ops ide_ata_disk_ops = {
742 .check = ide_disk_check, 792 .check = ide_disk_check,
793 .set_capacity = ide_disk_set_capacity,
743 .get_capacity = ide_disk_get_capacity, 794 .get_capacity = ide_disk_get_capacity,
744 .setup = ide_disk_setup, 795 .setup = ide_disk_setup,
745 .flush = ide_disk_flush, 796 .flush = ide_disk_flush,
diff --git a/drivers/ide/ide-gd.c b/drivers/ide/ide-gd.c
index 4b6b71e2cdf5..214119026b3f 100644
--- a/drivers/ide/ide-gd.c
+++ b/drivers/ide/ide-gd.c
@@ -287,6 +287,19 @@ static int ide_gd_media_changed(struct gendisk *disk)
287 return ret; 287 return ret;
288} 288}
289 289
290static unsigned long long ide_gd_set_capacity(struct gendisk *disk,
291 unsigned long long capacity)
292{
293 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
294 ide_drive_t *drive = idkp->drive;
295 const struct ide_disk_ops *disk_ops = drive->disk_ops;
296
297 if (disk_ops->set_capacity)
298 return disk_ops->set_capacity(drive, capacity);
299
300 return drive->capacity64;
301}
302
290static int ide_gd_revalidate_disk(struct gendisk *disk) 303static int ide_gd_revalidate_disk(struct gendisk *disk)
291{ 304{
292 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj); 305 struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
@@ -315,6 +328,7 @@ static struct block_device_operations ide_gd_ops = {
315 .locked_ioctl = ide_gd_ioctl, 328 .locked_ioctl = ide_gd_ioctl,
316 .getgeo = ide_gd_getgeo, 329 .getgeo = ide_gd_getgeo,
317 .media_changed = ide_gd_media_changed, 330 .media_changed = ide_gd_media_changed,
331 .set_capacity = ide_gd_set_capacity,
318 .revalidate_disk = ide_gd_revalidate_disk 332 .revalidate_disk = ide_gd_revalidate_disk
319}; 333};
320 334
diff --git a/drivers/ide/ide-pci-generic.c b/drivers/ide/ide-pci-generic.c
index 61111fd27130..39d4e01f5c9c 100644
--- a/drivers/ide/ide-pci-generic.c
+++ b/drivers/ide/ide-pci-generic.c
@@ -33,6 +33,16 @@ static int ide_generic_all; /* Set to claim all devices */
33module_param_named(all_generic_ide, ide_generic_all, bool, 0444); 33module_param_named(all_generic_ide, ide_generic_all, bool, 0444);
34MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers."); 34MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE storage controllers.");
35 35
36static void netcell_quirkproc(ide_drive_t *drive)
37{
38 /* mark words 85-87 as valid */
39 drive->id[ATA_ID_CSF_DEFAULT] |= 0x4000;
40}
41
42static const struct ide_port_ops netcell_port_ops = {
43 .quirkproc = netcell_quirkproc,
44};
45
36#define DECLARE_GENERIC_PCI_DEV(extra_flags) \ 46#define DECLARE_GENERIC_PCI_DEV(extra_flags) \
37 { \ 47 { \
38 .name = DRV_NAME, \ 48 .name = DRV_NAME, \
@@ -74,6 +84,7 @@ static const struct ide_port_info generic_chipsets[] __devinitdata = {
74 84
75 { /* 6: Revolution */ 85 { /* 6: Revolution */
76 .name = DRV_NAME, 86 .name = DRV_NAME,
87 .port_ops = &netcell_port_ops,
77 .host_flags = IDE_HFLAG_CLEAR_SIMPLEX | 88 .host_flags = IDE_HFLAG_CLEAR_SIMPLEX |
78 IDE_HFLAG_TRUST_BIOS_FOR_DMA | 89 IDE_HFLAG_TRUST_BIOS_FOR_DMA |
79 IDE_HFLAG_OFF_BOARD, 90 IDE_HFLAG_OFF_BOARD,
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 92c9b90931e7..16d056939f9f 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -211,6 +211,11 @@ static unsigned int ide_noflush;
211module_param_call(noflush, ide_set_dev_param_mask, NULL, &ide_noflush, 0); 211module_param_call(noflush, ide_set_dev_param_mask, NULL, &ide_noflush, 0);
212MODULE_PARM_DESC(noflush, "disable flush requests for a device"); 212MODULE_PARM_DESC(noflush, "disable flush requests for a device");
213 213
214static unsigned int ide_nohpa;
215
216module_param_call(nohpa, ide_set_dev_param_mask, NULL, &ide_nohpa, 0);
217MODULE_PARM_DESC(nohpa, "disable Host Protected Area for a device");
218
214static unsigned int ide_noprobe; 219static unsigned int ide_noprobe;
215 220
216module_param_call(noprobe, ide_set_dev_param_mask, NULL, &ide_noprobe, 0); 221module_param_call(noprobe, ide_set_dev_param_mask, NULL, &ide_noprobe, 0);
@@ -281,6 +286,11 @@ static void ide_dev_apply_params(ide_drive_t *drive, u8 unit)
281 drive->name); 286 drive->name);
282 drive->dev_flags |= IDE_DFLAG_NOFLUSH; 287 drive->dev_flags |= IDE_DFLAG_NOFLUSH;
283 } 288 }
289 if (ide_nohpa & (1 << i)) {
290 printk(KERN_INFO "ide: disabling Host Protected Area for %s\n",
291 drive->name);
292 drive->dev_flags |= IDE_DFLAG_NOHPA;
293 }
284 if (ide_noprobe & (1 << i)) { 294 if (ide_noprobe & (1 << i)) {
285 printk(KERN_INFO "ide: skipping probe for %s\n", drive->name); 295 printk(KERN_INFO "ide: skipping probe for %s\n", drive->name);
286 drive->dev_flags |= IDE_DFLAG_NOPROBE; 296 drive->dev_flags |= IDE_DFLAG_NOPROBE;
diff --git a/drivers/ide/pdc202xx_old.c b/drivers/ide/pdc202xx_old.c
index 248a54bd2386..b3bc96f930a6 100644
--- a/drivers/ide/pdc202xx_old.c
+++ b/drivers/ide/pdc202xx_old.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> 2 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
3 * Copyright (C) 2006-2007 MontaVista Software, Inc. 3 * Copyright (C) 2006-2007, 2009 MontaVista Software, Inc.
4 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 4 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz
5 * 5 *
6 * Portions Copyright (C) 1999 Promise Technology, Inc. 6 * Portions Copyright (C) 1999 Promise Technology, Inc.
@@ -227,28 +227,19 @@ somebody_else:
227 return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ 227 return (dma_stat & 4) == 4; /* return 1 if INTR asserted */
228} 228}
229 229
230static void pdc202xx_reset_host (ide_hwif_t *hwif) 230static void pdc202xx_reset(ide_drive_t *drive)
231{ 231{
232 ide_hwif_t *hwif = drive->hwif;
232 unsigned long high_16 = hwif->extra_base - 16; 233 unsigned long high_16 = hwif->extra_base - 16;
233 u8 udma_speed_flag = inb(high_16 | 0x001f); 234 u8 udma_speed_flag = inb(high_16 | 0x001f);
234 235
236 printk(KERN_WARNING "PDC202xx: software reset...\n");
237
235 outb(udma_speed_flag | 0x10, high_16 | 0x001f); 238 outb(udma_speed_flag | 0x10, high_16 | 0x001f);
236 mdelay(100); 239 mdelay(100);
237 outb(udma_speed_flag & ~0x10, high_16 | 0x001f); 240 outb(udma_speed_flag & ~0x10, high_16 | 0x001f);
238 mdelay(2000); /* 2 seconds ?! */ 241 mdelay(2000); /* 2 seconds ?! */
239 242
240 printk(KERN_WARNING "PDC202XX: %s channel reset.\n",
241 hwif->channel ? "Secondary" : "Primary");
242}
243
244static void pdc202xx_reset (ide_drive_t *drive)
245{
246 ide_hwif_t *hwif = drive->hwif;
247 ide_hwif_t *mate = hwif->mate;
248
249 pdc202xx_reset_host(hwif);
250 pdc202xx_reset_host(mate);
251
252 ide_set_max_pio(drive); 243 ide_set_max_pio(drive);
253} 244}
254 245
@@ -328,9 +319,8 @@ static const struct ide_dma_ops pdc20246_dma_ops = {
328 .dma_start = ide_dma_start, 319 .dma_start = ide_dma_start,
329 .dma_end = ide_dma_end, 320 .dma_end = ide_dma_end,
330 .dma_test_irq = pdc202xx_dma_test_irq, 321 .dma_test_irq = pdc202xx_dma_test_irq,
331 .dma_lost_irq = pdc202xx_dma_lost_irq, 322 .dma_lost_irq = ide_dma_lost_irq,
332 .dma_timer_expiry = ide_dma_sff_timer_expiry, 323 .dma_timer_expiry = ide_dma_sff_timer_expiry,
333 .dma_clear = pdc202xx_reset,
334 .dma_sff_read_status = ide_dma_sff_read_status, 324 .dma_sff_read_status = ide_dma_sff_read_status,
335}; 325};
336 326
diff --git a/fs/partitions/check.c b/fs/partitions/check.c
index 99e33ef40be4..4bc2c43fa083 100644
--- a/fs/partitions/check.c
+++ b/fs/partitions/check.c
@@ -546,27 +546,49 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev)
546 546
547 /* add partitions */ 547 /* add partitions */
548 for (p = 1; p < state->limit; p++) { 548 for (p = 1; p < state->limit; p++) {
549 sector_t size = state->parts[p].size; 549 sector_t size, from;
550 sector_t from = state->parts[p].from; 550try_scan:
551 size = state->parts[p].size;
551 if (!size) 552 if (!size)
552 continue; 553 continue;
554
555 from = state->parts[p].from;
553 if (from >= get_capacity(disk)) { 556 if (from >= get_capacity(disk)) {
554 printk(KERN_WARNING 557 printk(KERN_WARNING
555 "%s: p%d ignored, start %llu is behind the end of the disk\n", 558 "%s: p%d ignored, start %llu is behind the end of the disk\n",
556 disk->disk_name, p, (unsigned long long) from); 559 disk->disk_name, p, (unsigned long long) from);
557 continue; 560 continue;
558 } 561 }
562
559 if (from + size > get_capacity(disk)) { 563 if (from + size > get_capacity(disk)) {
560 /* 564 struct block_device_operations *bdops = disk->fops;
561 * we can not ignore partitions of broken tables 565 unsigned long long capacity;
562 * created by for example camera firmware, but we 566
563 * limit them to the end of the disk to avoid
564 * creating invalid block devices
565 */
566 printk(KERN_WARNING 567 printk(KERN_WARNING
567 "%s: p%d size %llu limited to end of disk\n", 568 "%s: p%d size %llu exceeds device capacity, ",
568 disk->disk_name, p, (unsigned long long) size); 569 disk->disk_name, p, (unsigned long long) size);
569 size = get_capacity(disk) - from; 570
571 if (bdops->set_capacity &&
572 (disk->flags & GENHD_FL_NATIVE_CAPACITY) == 0) {
573 printk(KERN_CONT "enabling native capacity\n");
574 capacity = bdops->set_capacity(disk, ~0ULL);
575 disk->flags |= GENHD_FL_NATIVE_CAPACITY;
576 if (capacity > get_capacity(disk)) {
577 set_capacity(disk, capacity);
578 check_disk_size_change(disk, bdev);
579 bdev->bd_invalidated = 0;
580 }
581 goto try_scan;
582 } else {
583 /*
584 * we can not ignore partitions of broken tables
585 * created by for example camera firmware, but
586 * we limit them to the end of the disk to avoid
587 * creating invalid block devices
588 */
589 printk(KERN_CONT "limited to end of disk\n");
590 size = get_capacity(disk) - from;
591 }
570 } 592 }
571 part = add_partition(disk, p, from, size, 593 part = add_partition(disk, p, from, size,
572 state->parts[p].flags); 594 state->parts[p].flags);
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6f841fb1be30..a2d7298be351 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -1106,6 +1106,8 @@ struct block_device_operations {
1106 int (*direct_access) (struct block_device *, sector_t, 1106 int (*direct_access) (struct block_device *, sector_t,
1107 void **, unsigned long *); 1107 void **, unsigned long *);
1108 int (*media_changed) (struct gendisk *); 1108 int (*media_changed) (struct gendisk *);
1109 unsigned long long (*set_capacity) (struct gendisk *,
1110 unsigned long long);
1109 int (*revalidate_disk) (struct gendisk *); 1111 int (*revalidate_disk) (struct gendisk *);
1110 int (*getgeo)(struct block_device *, struct hd_geometry *); 1112 int (*getgeo)(struct block_device *, struct hd_geometry *);
1111 struct module *owner; 1113 struct module *owner;
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 634c53028fb8..239e24b081a9 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -113,6 +113,7 @@ struct hd_struct {
113#define GENHD_FL_UP 16 113#define GENHD_FL_UP 16
114#define GENHD_FL_SUPPRESS_PARTITION_INFO 32 114#define GENHD_FL_SUPPRESS_PARTITION_INFO 32
115#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ 115#define GENHD_FL_EXT_DEVT 64 /* allow extended devt */
116#define GENHD_FL_NATIVE_CAPACITY 128
116 117
117#define BLK_SCSI_MAX_CMDS (256) 118#define BLK_SCSI_MAX_CMDS (256)
118#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) 119#define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 015955632091..c8f7b9673710 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -381,6 +381,7 @@ struct ide_drive_s;
381struct ide_disk_ops { 381struct ide_disk_ops {
382 int (*check)(struct ide_drive_s *, const char *); 382 int (*check)(struct ide_drive_s *, const char *);
383 int (*get_capacity)(struct ide_drive_s *); 383 int (*get_capacity)(struct ide_drive_s *);
384 u64 (*set_capacity)(struct ide_drive_s *, u64);
384 void (*setup)(struct ide_drive_s *); 385 void (*setup)(struct ide_drive_s *);
385 void (*flush)(struct ide_drive_s *); 386 void (*flush)(struct ide_drive_s *);
386 int (*init_media)(struct ide_drive_s *, struct gendisk *); 387 int (*init_media)(struct ide_drive_s *, struct gendisk *);
@@ -458,6 +459,8 @@ enum {
458 IDE_DFLAG_NICE1 = (1 << 5), 459 IDE_DFLAG_NICE1 = (1 << 5),
459 /* device is physically present */ 460 /* device is physically present */
460 IDE_DFLAG_PRESENT = (1 << 6), 461 IDE_DFLAG_PRESENT = (1 << 6),
462 /* disable Host Protected Area */
463 IDE_DFLAG_NOHPA = (1 << 7),
461 /* id read from device (synthetic if not set) */ 464 /* id read from device (synthetic if not set) */
462 IDE_DFLAG_ID_READ = (1 << 8), 465 IDE_DFLAG_ID_READ = (1 << 8),
463 IDE_DFLAG_NOPROBE = (1 << 9), 466 IDE_DFLAG_NOPROBE = (1 << 9),
@@ -552,8 +555,7 @@ struct ide_drive_s {
552 unsigned int drive_data; /* used by set_pio_mode/dev_select() */ 555 unsigned int drive_data; /* used by set_pio_mode/dev_select() */
553 unsigned int failures; /* current failure count */ 556 unsigned int failures; /* current failure count */
554 unsigned int max_failures; /* maximum allowed failure count */ 557 unsigned int max_failures; /* maximum allowed failure count */
555 u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ 558 u64 probed_capacity;/* initial/native media capacity */
556
557 u64 capacity64; /* total number of sectors */ 559 u64 capacity64; /* total number of sectors */
558 560
559 int lun; /* logical unit */ 561 int lun; /* logical unit */