Skip to contentSkip to conversation

IDE fixes

GIT PULL Bartlomiej Zolnierkiewicz 5 participants 30 messages Jun 7, 2009 – Jun 8, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi,

Fixes for pdc202xx_old host driver and for Host Protected Area (HPA) support.

The latter ones come a bit late but since they were tested and reviewed (fs/partitions/ part was acked by Al, drivers/ide/ parts by Alan and Sergei) I see no real reason to delay them till 2.6.31, especially since they should make everyone's life easier (as we have now the same default HPA behavior in both ide/libata).

Linus, please pull from 'for-linus' branch of:

master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git for-linus

to receive the following updates:

 Documentation/ide/ide.txt           |    2 +
 Documentation/kernel-parameters.txt |    7 +--
 drivers/ide/ide-disk.c              |   71 ++++++++++++++++++++++++++++++-----
 drivers/ide/ide-gd.c                |   14 +++++++
 drivers/ide/ide.c                   |   10 +++++
 drivers/ide/pdc202xx_old.c          |   22 +++--------
 fs/partitions/check.c               |   42 ++++++++++++++++-----
 include/linux/blkdev.h              |    2 +
 include/linux/genhd.h               |    1 +
 include/linux/ide.h                 |    6 ++-
 10 files changed, 134 insertions(+), 43 deletions(-)

Bartlomiej Zolnierkiewicz (4):
partitions: warn about the partition exceeding device capacity
partitions: add ->set_capacity block device method
ide-gd: implement block device ->set_capacity method (v2)
ide: preserve Host Protected Area by default (v2)

Sergei Shtylyov (2):
pdc202xx_old: fix 'pdc20246_dma_ops'
pdc202xx_old: fix resetproc() method

Documentation/ide/ide.txt +2 -0
index 0c78f4b..e77bebf 100644
@@ -216,6 +216,8 @@ Other kernel parameters for ide_core are:
 
 * "noflush=[interface_number.device_number]" to disable flush requests
 
+* "nohpa=[interface_number.device_number]" to disable Host Protected Area
+
 * "noprobe=[interface_number.device_number]" to skip probing
 
 * "nowerr=[interface_number.device_number]" to ignore the WRERR_STAT bit
Documentation/kernel-parameters.txt +2 -5
index a19f021..e58c91c 100644
@@ -835,11 +835,8 @@ and is between 256 and 4096 characters. It is defined in the file
 
 	ide-core.nodma=	[HW] (E)IDE subsystem
 			Format: =0.0 to prevent dma on hda, =0.1 hdb =1.0 hdc
-			.vlb_clock .pci_clock .noflush .noprobe .nowerr .cdrom
-			.chs .ignore_cable are additional options
-			See Documentation/ide/ide.txt.
-
-	idebus=		[HW] (E)IDE subsystem - VLB/PCI bus speed
+			.vlb_clock .pci_clock .noflush .nohpa .noprobe .nowerr
+			.cdrom .chs .ignore_cable are additional options
 			See Documentation/ide/ide.txt.
 
 	ide-pci-generic.all-generic-ide [HW] (E)IDE subsystem
drivers/ide/ide-disk.c +61 -10

122 lines not on this page · raw message

drivers/ide/ide-gd.c +14 -0
index 4b6b71e..2141190 100644
@@ -287,6 +287,19 @@ static int ide_gd_media_changed(struct gendisk *disk)
 	return ret;
 }
 
+static unsigned long long ide_gd_set_capacity(struct gendisk *disk,
+					      unsigned long long capacity)
+{
+	struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
+	ide_drive_t *drive = idkp->drive;
+	const struct ide_disk_ops *disk_ops = drive->disk_ops;
+
+	if (disk_ops->set_capacity)
+		return disk_ops->set_capacity(drive, capacity);
+
+	return drive->capacity64;
+}
+
 static int ide_gd_revalidate_disk(struct gendisk *disk)
 {
 	struct ide_disk_obj *idkp = ide_drv_g(disk, ide_disk_obj);
@@ -315,6 +328,7 @@ static struct block_device_operations ide_gd_ops = {
 	.locked_ioctl		= ide_gd_ioctl,
 	.getgeo			= ide_gd_getgeo,
 	.media_changed		= ide_gd_media_changed,
+	.set_capacity		= ide_gd_set_capacity,
 	.revalidate_disk	= ide_gd_revalidate_disk
 };
 
drivers/ide/ide.c +10 -0
index 92c9b90..16d0569 100644
@@ -211,6 +211,11 @@ static unsigned int ide_noflush;
 module_param_call(noflush, ide_set_dev_param_mask, NULL, &ide_noflush, 0);
 MODULE_PARM_DESC(noflush, "disable flush requests for a device");
 
+static unsigned int ide_nohpa;
+
+module_param_call(nohpa, ide_set_dev_param_mask, NULL, &ide_nohpa, 0);
+MODULE_PARM_DESC(nohpa, "disable Host Protected Area for a device");
+
 static unsigned int ide_noprobe;
 
 module_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)
 				 drive->name);
 		drive->dev_flags |= IDE_DFLAG_NOFLUSH;
 	}
+	if (ide_nohpa & (1 << i)) {
+		printk(KERN_INFO "ide: disabling Host Protected Area for %s\n",
+				 drive->name);
+		drive->dev_flags |= IDE_DFLAG_NOHPA;
+	}
 	if (ide_noprobe & (1 << i)) {
 		printk(KERN_INFO "ide: skipping probe for %s\n", drive->name);
 		drive->dev_flags |= IDE_DFLAG_NOPROBE;
drivers/ide/pdc202xx_old.c +6 -16
index 248a54b..b3bc96f 100644
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 1998-2002		Andre Hedrick <[email protected]>
- *  Copyright (C) 2006-2007		MontaVista Software, Inc.
+ *  Copyright (C) 2006-2007, 2009	MontaVista Software, Inc.
  *  Copyright (C) 2007			Bartlomiej Zolnierkiewicz
  *
  *  Portions Copyright (C) 1999 Promise Technology, Inc.
@@ -227,28 +227,19 @@ somebody_else:
 	return (dma_stat & 4) == 4;	/* return 1 if INTR asserted */
 }
 
-static void pdc202xx_reset_host (ide_hwif_t *hwif)
+static void pdc202xx_reset(ide_drive_t *drive)
 {
+	ide_hwif_t *hwif	= drive->hwif;
 	unsigned long high_16	= hwif->extra_base - 16;
 	u8 udma_speed_flag	= inb(high_16 | 0x001f);
 
+	printk(KERN_WARNING "PDC202xx: software reset...\n");
+
 	outb(udma_speed_flag | 0x10, high_16 | 0x001f);
 	mdelay(100);
 	outb(udma_speed_flag & ~0x10, high_16 | 0x001f);
 	mdelay(2000);	/* 2 seconds ?! */
 
-	printk(KERN_WARNING "PDC202XX: %s channel reset.\n",
-		hwif->channel ? "Secondary" : "Primary");
-}
-
-static void pdc202xx_reset (ide_drive_t *drive)
-{
-	ide_hwif_t *hwif	= drive->hwif;
-	ide_hwif_t *mate	= hwif->mate;
-
-	pdc202xx_reset_host(hwif);
-	pdc202xx_reset_host(mate);
-
 	ide_set_max_pio(drive);
 }
 
@@ -328,9 +319,8 @@ static const struct ide_dma_ops pdc20246_dma_ops = {
 	.dma_start		= ide_dma_start,
 	.dma_end		= ide_dma_end,
 	.dma_test_irq		= pdc202xx_dma_test_irq,
-	.dma_lost_irq		= pdc202xx_dma_lost_irq,
+	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_clear		= pdc202xx_reset,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };
 
fs/partitions/check.c +32 -10

59 lines not on this page · raw message

include/linux/blkdev.h +2 -0
index 6f841fb..a2d7298 100644
@@ -1106,6 +1106,8 @@ struct block_device_operations {
 	int (*direct_access) (struct block_device *, sector_t,
 						void **, unsigned long *);
 	int (*media_changed) (struct gendisk *);
+	unsigned long long (*set_capacity) (struct gendisk *,
+						unsigned long long);
 	int (*revalidate_disk) (struct gendisk *);
 	int (*getgeo)(struct block_device *, struct hd_geometry *);
 	struct module *owner;
include/linux/genhd.h +1 -0
index 634c530..239e24b 100644
@@ -113,6 +113,7 @@ struct hd_struct {
 #define GENHD_FL_UP				16
 #define GENHD_FL_SUPPRESS_PARTITION_INFO	32
 #define GENHD_FL_EXT_DEVT			64 /* allow extended devt */
+#define GENHD_FL_NATIVE_CAPACITY		128
 
 #define BLK_SCSI_MAX_CMDS	(256)
 #define BLK_SCSI_CMD_PER_LONG	(BLK_SCSI_MAX_CMDS / (sizeof(long) * 8))
include/linux/ide.h +4 -2
index 9fed365..45dce3b 100644
@@ -397,6 +397,7 @@ struct ide_drive_s;
 struct ide_disk_ops {
 	int		(*check)(struct ide_drive_s *, const char *);
 	int		(*get_capacity)(struct ide_drive_s *);
+	u64		(*set_capacity)(struct ide_drive_s *, u64);
 	void		(*setup)(struct ide_drive_s *);
 	void		(*flush)(struct ide_drive_s *);
 	int		(*init_media)(struct ide_drive_s *, struct gendisk *);
@@ -474,6 +475,8 @@ enum {
 	IDE_DFLAG_NICE1			= (1 << 5),
 	/* device is physically present */
 	IDE_DFLAG_PRESENT		= (1 << 6),
+	/* disable Host Protected Area */
+	IDE_DFLAG_NOHPA			= (1 << 7),
 	/* id read from device (synthetic if not set) */
 	IDE_DFLAG_ID_READ		= (1 << 8),
 	IDE_DFLAG_NOPROBE		= (1 << 9),
@@ -568,8 +571,7 @@ struct ide_drive_s {
 	unsigned int	drive_data;	/* used by set_pio_mode/dev_select() */
 	unsigned int	failures;	/* current failure count */
 	unsigned int	max_failures;	/* maximum allowed failure count */
-	u64		probed_capacity;/* initial reported media capacity (ide-cd only currently) */
-
+	u64		probed_capacity;/* initial/native media capacity */
 	u64		capacity64;	/* total number of sectors */
 
 	int		lun;		/* logical unit */
#1 lore raw

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

#2 lore raw
Quoted 10 lines · On Sunday 07 June 2009 16:21:51 Alan Cox wrote:

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

Quoted 3 lines

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

If you want to discuss any code that I push upstream then *please* quote it in your mails so we all can see what parts you question and discuss it based on technical merits.

#6 lore raw
In reply to Alan Cox
Quoted 10 lines · Alan Cox

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

Quoted 3 lines

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

Absolutely seconded.

Plus this is only one of the proposals for dealing with IDE native sizes moving through the process. The other one is in libata with the gendisk
proposal for alt size instead of your set_capacity callback. The last
thing we want is two separate mechanisms for this, so trying to push anything upstream before we have agreement on direction is premature ... trying to send a feature as a bug fix is doubly so.

James

#3 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 3 lines

If you want to discuss any code that I push upstream then *please* quote it in your mails so we all can see what parts you question and discuss it based on technical merits.

This isn't about technical merits - it is about *risk*. You don't submit patches to core code to add new features just before the final release.

And my email included enough meta-information (such as the patch header) to make the neccessary point.

Alan

#7 lore raw
In reply to James Bottomley
Quoted 15 lines · On Sunday 07 June 2009 16:38:56 James Bottomley wrote:
Quoted 10 lines · Alan Cox

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

Quoted 3 lines

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

Quoted 5 lines

Absolutely seconded.

Plus this is only one of the proposals for dealing with IDE native sizes moving through the process. The other one is in libata with the gendisk
proposal for alt size instead of your set_capacity callback. The last

->set_capacity callback is needed for drivers/ide regardless of alt_size sysfs interface and it don't conflict with it in any way.

Those patches are a complimentary work to Tejun's alt_size patches.

They don't export anything to user-space.

Quoted 3 lines

thing we want is two separate mechanisms for this, so trying to push anything upstream before we have agreement on direction is premature ... trying to send a feature as a bug fix is doubly so.

James, please (re-)read commits, then bug #13365 at kernel.org and if you still find some code parts controversial I'll be happy to discuss them.

Thanks.
Bart

#4 lore raw
In reply to Alan Cox
Quoted 5 lines · On Sunday 07 June 2009 16:40:48 Alan Cox wrote:
Quoted 3 lines

If you want to discuss any code that I push upstream then *please* quote it in your mails so we all can see what parts you question and discuss it based on technical merits.

This isn't about technical merits - it is about *risk*. You don't submit

fs/partitions/check.c change doesn't influence anything other that behavior of ide-gd driver and has been ACK-ed by Al Viro.

Quoted 1 line

patches to core code to add new features just before the final release.

This is not a feature but really a bug fix (requested by you along other people in the past).

#5 lore raw
Quoted 4 lines
Quoted 1 line

This isn't about technical merits - it is about *risk*. You don't submit

fs/partitions/check.c change doesn't influence anything other that behavior of ide-gd driver and has been ACK-ed by Al Viro.

What part of "risk" don't you understand ? Any change to core code paths is a risk, submitting it just before 2.6.30 is plain stupid.

Quoted 4 lines
Quoted 1 line

patches to core code to add new features just before the final release.

This is not a feature but really a bug fix (requested by you along other people in the past).

Its not an urgent this release doom-disaster fix - its a run of the mill feature improvement that fixes up a long term issue and wants testing in quantity before merging and nicely integrating so other storage people are happy with it.

#8 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 16 lines · Bartlomiej Zolnierkiewicz
Quoted 15 lines · On Sunday 07 June 2009 16:38:56 James Bottomley wrote:
Quoted 13 lines · Alan Cox

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

Quoted 8 lines
Quoted 5 lines

Absolutely seconded.

Plus this is only one of the proposals for dealing with IDE native sizes moving through the process. The other one is in libata with the gendisk
proposal for alt size instead of your set_capacity callback. The last

->set_capacity callback is needed for drivers/ide regardless of alt_size sysfs interface and it don't conflict with it in any way.

It's used as a heuristic for selecting native vs protected disk size depending on what the partition table says ... I grant that's one way to handle the problem.

Quoted 3 lines

Those patches are a complimentary work to Tejun's alt_size patches.

They don't export anything to user-space.

So you're trying to solve the problem heuristically, and Tejun is trying
to provide the user with full information. At the end of the day it
would be nice to get agreement on how we do this *before* exposing it to users. It's certainly possible we could do both, but for that to happen libata would have to implement .get_capacity() is that going to be the case?

Quoted 6 lines
Quoted 3 lines

thing we want is two separate mechanisms for this, so trying to push anything upstream before we have agreement on direction is premature ... trying to send a feature as a bug fix is doubly so.

James, please (re-)read commits, then bug #13365 at kernel.org and if you still find some code parts controversial I'll be happy to discuss them.

Um, that's a red herring, isn't it? That bug complains that a migration from IDE to libata failed because IDE was ignoring HPA and libata was respecting it resulting in a disk under libata whose partition table was too big for its HPA reduced capacity; the fix was to turn off libata HPA in that configuration. As far as I can tell nothing in the code you've added actually fixes that bug. To fix it, we'd have to add a get_capacity() method to libata as well so that it could use your partition heuristics to turn off the HPA.

What your code does instead is to add HPA handling to IDE so that you no longer always ignore it ... that's fine, but it's still a feature enhancement not a bug fix.

James

#9 lore raw
Quoted 30 lines · On Sunday 07 June 2009 17:18:51 you wrote:
Quoted 16 lines · Bartlomiej Zolnierkiewicz
Quoted 15 lines · On Sunday 07 June 2009 16:38:56 James Bottomley wrote:
Quoted 13 lines · Alan Cox

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

Quoted 8 lines
Quoted 5 lines

Absolutely seconded.

Plus this is only one of the proposals for dealing with IDE native sizes moving through the process. The other one is in libata with the gendisk
proposal for alt size instead of your set_capacity callback. The last

->set_capacity callback is needed for drivers/ide regardless of alt_size sysfs interface and it don't conflict with it in any way.

It's used as a heuristic for selecting native vs protected disk size depending on what the partition table says ... I grant that's one way to handle the problem.

Quoted 8 lines
Quoted 3 lines

Those patches are a complimentary work to Tejun's alt_size patches.

They don't export anything to user-space.

So you're trying to solve the problem heuristically, and Tejun is trying
to provide the user with full information. At the end of the day it
would be nice to get agreement on how we do this *before* exposing it to users. It's certainly possible we could do both, but for that to happen

Sure. My patches don't export anything to user-space.

If you find any code parts controversial please post them and I'll be more than happy to discuss them in details.

Quoted 2 lines

libata would have to implement .get_capacity() is that going to be the case?

Now we get the real source of Alan's and your complains...

Those patches (among other things) make IDE superior overt libata w.r.t. HPA handling so libata now has to catch up.

Honestly, this should be solved on technical basis by somebody posting needed libata patches instead of attempts to slow down IDE fixes.

Quoted 7 lines
Quoted 6 lines
Quoted 3 lines

thing we want is two separate mechanisms for this, so trying to push anything upstream before we have agreement on direction is premature ... trying to send a feature as a bug fix is doubly so.

James, please (re-)read commits, then bug #13365 at kernel.org and if you still find some code parts controversial I'll be happy to discuss them.

Quoted 8 lines

Um, that's a red herring, isn't it? That bug complains that a migration from IDE to libata failed because IDE was ignoring HPA and libata was respecting it resulting in a disk under libata whose partition table was too big for its HPA reduced capacity; the fix was to turn off libata HPA in that configuration. As far as I can tell nothing in the code you've added actually fixes that bug. To fix it, we'd have to add a get_capacity() method to libata as well so that it could use your partition heuristics to turn off the HPA.

Indeed.

Though first you have to get somebody from libata agree that this is a bug and that it should get fixed. Then somebody would need to do the work.

However my patches make it *easier* for libata developers to fix the aforementioned compatibility issue.

Quoted 3 lines

What your code does instead is to add HPA handling to IDE so that you no longer always ignore it ... that's fine, but it's still a feature enhancement not a bug fix.

If you look at the whole HPA handling from the Big Picture perspective (taking new system installs into account when the old behavior could result in all sorts of problems including firmware corruption) than it *really* is a bug fix.

#10 lore raw
Quoted 48 lines · Bartlomiej Zolnierkiewicz
Quoted 30 lines · On Sunday 07 June 2009 17:18:51 you wrote:
Quoted 16 lines · Bartlomiej Zolnierkiewicz
Quoted 15 lines · On Sunday 07 June 2009 16:38:56 James Bottomley wrote:
Quoted 13 lines · Alan Cox

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

Quoted 8 lines
Quoted 5 lines

Absolutely seconded.

Plus this is only one of the proposals for dealing with IDE native sizes moving through the process. The other one is in libata with the gendisk
proposal for alt size instead of your set_capacity callback. The last

->set_capacity callback is needed for drivers/ide regardless of alt_size sysfs interface and it don't conflict with it in any way.

It's used as a heuristic for selecting native vs protected disk size depending on what the partition table says ... I grant that's one way to handle the problem.

Quoted 8 lines
Quoted 3 lines

Those patches are a complimentary work to Tejun's alt_size patches.

They don't export anything to user-space.

So you're trying to solve the problem heuristically, and Tejun is trying
to provide the user with full information. At the end of the day it
would be nice to get agreement on how we do this *before* exposing it to users. It's certainly possible we could do both, but for that to happen

Sure. My patches don't export anything to user-space.

If you find any code parts controversial please post them and I'll be more than happy to discuss them in details.

Quoted 2 lines

libata would have to implement .get_capacity() is that going to be the case?

Quoted 7 lines

Now we get the real source of Alan's and your complains...

Those patches (among other things) make IDE superior overt libata w.r.t. HPA handling so libata now has to catch up.

Honestly, this should be solved on technical basis by somebody posting needed libata patches instead of attempts to slow down IDE fixes.

You've got the wrong motive. I have notice that you and Alan seem to have a somewhat antagonistic relationship resulting in a proxy battle over IDE/libata, so you would necessarily see this as at play in his first post. I hoped, by emphasizing the point, that you'd see this adding features as bug fixes is a problem even from a more neutral perspective.

So I have two specific problems with the way you're trying to one up libata:

1. You're trying to get a jump on them by adding features as bug fixes ... this is incredibly bad release practice.
2. this antagonism in feature evolution is likely to lead to interface incompatibility between libata and IDE ... and users will be the ultimate losers because of this.

James

#18 lore raw
In reply to Bartlomiej Zolnierkiewicz

Hi Bartlomiej,

Quoted 2 lines · Bartlomiej Zolnierkiewicz

Honestly, this should be solved on technical basis by somebody posting needed libata patches instead of attempts to slow down IDE fixes.

Nobody is "slowing down" IDE fixes here. Linus explicitly said that -rc8 is the last release candidate and the next one is going to be -final. There's absolutely _no way_ this series is appropriate at the very end of a release cycle.

Pekka

#11 lore raw
In reply to James Bottomley
Quoted 54 lines · On Sunday 07 June 2009 18:08:09 James Bottomley wrote:
Quoted 53 lines · Bartlomiej Zolnierkiewicz
Quoted 30 lines · On Sunday 07 June 2009 17:18:51 you wrote:
Quoted 16 lines · Bartlomiej Zolnierkiewicz
Quoted 15 lines · On Sunday 07 June 2009 16:38:56 James Bottomley wrote:
Quoted 13 lines · Alan Cox

fs/partitions/check.c

Quoted 4 lines
fs/partitions/check.c +0 -0
index 99e33ef..4bc2c43 100644

You seriously want to add code to the core partition handling logic moments before release when we know we have all sorts of devices with weird behaviours ?

This should be .31 stuff where we can take the time to see how it works on all sorts of weird real world devices (eg those with 2K sector size) and the like.

Quoted 8 lines
Quoted 5 lines

Absolutely seconded.

Plus this is only one of the proposals for dealing with IDE native sizes moving through the process. The other one is in libata with the gendisk
proposal for alt size instead of your set_capacity callback. The last

->set_capacity callback is needed for drivers/ide regardless of alt_size sysfs interface and it don't conflict with it in any way.

It's used as a heuristic for selecting native vs protected disk size depending on what the partition table says ... I grant that's one way to handle the problem.

Quoted 8 lines
Quoted 3 lines

Those patches are a complimentary work to Tejun's alt_size patches.

They don't export anything to user-space.

So you're trying to solve the problem heuristically, and Tejun is trying
to provide the user with full information. At the end of the day it
would be nice to get agreement on how we do this *before* exposing it to users. It's certainly possible we could do both, but for that to happen

Sure. My patches don't export anything to user-space.

If you find any code parts controversial please post them and I'll be more than happy to discuss them in details.

Quoted 2 lines

libata would have to implement .get_capacity() is that going to be the case?

Now we get the real source of Alan's and your complains...

Those patches (among other things) make IDE superior overt libata w.r.t. HPA handling so libata now has to catch up.

Quoted 7 lines
Quoted 2 lines

Honestly, this should be solved on technical basis by somebody posting needed libata patches instead of attempts to slow down IDE fixes.

You've got the wrong motive. I have notice that you and Alan seem to have a somewhat antagonistic relationship resulting in a proxy battle over IDE/libata, so you would necessarily see this as at play in his first post. I hoped, by emphasizing the point, that you'd see this

Please don't project your own way of thinking on me or (maybe?) try to play on imaginary conflict between me and Alan for your own gains.

By emphasizing untrue point -- I have a much respect for Alan for all his kernel work and also for being a long-term promoter of Linux -- you are trying to move the discussion from technical means to political ones.

It is true that we get into heated arguments with Alan from time to time but this is unavoidable given large differences in our views on kernel development process (I was late to the game so I have very different experiences that people who were doing it since the beginning) and also on future directions of progress (i.e. I don't support segregation of hardware support on "relevant" and "irrelevant" or dropping ISA support).

However as long as we stick to the *code* and discuss things based on the *code* we have no problems with working together (which happens more often then not).

[ Who I really have antagonistic relationship with are some smart-asses
trying to play politics by using other people to do your dirty work (and no, I didn't went on hiatus in 2005 because of Alan if some people still wonder). ]

When it comes to libata: are you serious?

I gave libata a full green light back when it was introduced in 2003.

What I have been always complaining about w.r.t. libata is too slow progress and a bit too little long-term planning.

[ Cause I know that we can do better! ]

When it comes libata PATA: "the battle" has been lost back in 2005 (nobody with semi-sane thinking would believe that it could be won), or more like that there was never any battle since I was always fine with PATA support in libata (though I was *extremely* unhappy with the way it was introduced and resulting long-term consequences).

Quoted 8 lines

adding features as bug fixes is a problem even from a more neutral perspective.

So I have two specific problems with the way you're trying to one up libata:

1. You're trying to get a jump on them by adding features as bug fixes ... this is incredibly bad release practice.

It is a bugfix. Long overdue one.

However you have to look beyond kernel to see it. From the commit log:

"

Quoted 1 line

From the perspective of most users of recent systems, disabling Host

Protected Area (HPA) can break vendor RAID formats, GPT partitions and risks corrupting firmware or overwriting vendor system recovery tools.

Unfortunately the original (kernels < 2.6.30) behavior (unconditionally disabling HPA and using full disk capacity) was introduced at the time when the main use of HPA was to make the drive look small enough for the BIOS to allow the system to boot with large capacity drives.

Thus to allow the maximum compatibility with the existing setups (using HPA and partitioned with HPA disabled) we automically disable HPA if any partitions overlapping HPA are detected. Additionally HPA can also be disabled using the "nohpa" module parameter (i.e. "ide_core.nohpa=0.0" to disable HPA on /dev/hda).
"

Yes, it is true that there is no rush.

OTOH there are absolutely no valid technical reasons to slow it down!

Quoted 3 lines

2. this antagonism in feature evolution is likely to lead to interface incompatibility between libata and IDE ... and users will be the ultimate losers because of this.

Hmmm, did you *really* read the patches?

They make libata and IDE more similar by making IDE also default to preserving HPA (which is what libata does). So users get more coherent overall kernel behavior.

The only difference is that IDE for compatibility reasons must handle old installs (with HPA wrongly disabled and protected area used for filesystem data).

However it does it in a clean way (not a subsystem specific hack) which can be later used for implementing the same functionality in libata!

[ I also tried to encourage libata developers to look into making the needed
libata changes (see my initial posting of HPA patches) and I will still be glad to help with libata patches if somebody would like to work on them (Robert? Tejun?). ]

#19 lore raw
In reply to Pekka Enberg
Quoted 11 lines · On Sunday 07 June 2009 18:54:08 Pekka Enberg wrote:

Hi Bartlomiej,

Quoted 2 lines · Bartlomiej Zolnierkiewicz

Honestly, this should be solved on technical basis by somebody posting needed libata patches instead of attempts to slow down IDE fixes.

Nobody is "slowing down" IDE fixes here. Linus explicitly said that

(quoted diff) +0 -2
-rc8 is the last release candidate and the next one is going to be
-final. There's absolutely _no way_ this series is appropriate at the

very end of a release cycle.

My honest opinion is that it is as appropriate now as it will be 2.6.31.

[ I'm still amazed by the amount of *completely* bogus reasons given for
not merging it. ]

However it sure can wait, no big deal (though I still think that it was worth to try to get it in and not make users wait another few months).

I'll let Linus decide and revise pull request if necessary.

#20 lore raw

Hi Bartlomiej,

Quoted 15 lines · Bartlomiej Zolnierkiewicz
Quoted 11 lines · On Sunday 07 June 2009 18:54:08 Pekka Enberg wrote:

Hi Bartlomiej,

Quoted 2 lines · Bartlomiej Zolnierkiewicz

Honestly, this should be solved on technical basis by somebody posting needed libata patches instead of attempts to slow down IDE fixes.

Nobody is "slowing down" IDE fixes here. Linus explicitly said that

(quoted diff) +0 -2
-rc8 is the last release candidate and the next one is going to be
-final. There's absolutely _no way_ this series is appropriate at the

very end of a release cycle.

My honest opinion is that it is as appropriate now as it will be 2.6.31.

Quoted 2 lines

[ I'm still amazed by the amount of *completely* bogus reasons given for not merging it. ]

I don't consider this a bogus reason at all:

 10 files changed, 134 insertions(+), 43 deletions(-)

Just search the LKML archives for the amount of crap other subsystem maintainers have gotten from Linus when they've tried to sneak something like that after -rc4 or so.

Pekka

#21 lore raw
Quoted 19 lines · On Sunday 07 June 2009 20:21:11 Pekka Enberg wrote:

Hi Bartlomiej,

Quoted 15 lines · Bartlomiej Zolnierkiewicz
Quoted 11 lines · On Sunday 07 June 2009 18:54:08 Pekka Enberg wrote:

Hi Bartlomiej,

Quoted 2 lines · Bartlomiej Zolnierkiewicz

Honestly, this should be solved on technical basis by somebody posting needed libata patches instead of attempts to slow down IDE fixes.

Nobody is "slowing down" IDE fixes here. Linus explicitly said that

(quoted diff) +0 -2
-rc8 is the last release candidate and the next one is going to be
-final. There's absolutely _no way_ this series is appropriate at the

very end of a release cycle.

My honest opinion is that it is as appropriate now as it will be 2.6.31.

Quoted 6 lines
Quoted 2 lines

[ I'm still amazed by the amount of *completely* bogus reasons given for
not merging it. ]

I don't consider this a bogus reason at all:

 10 files changed, 134 insertions(+), 43 deletions(-)

Since when do we validate code quality based solely on LOC changed? :)

I'm yet to see anybody posting a single code chunk in this whole discussion.

Quoted 3 lines

Just search the LKML archives for the amount of crap other subsystem maintainers have gotten from Linus when they've tried to sneak something like that after -rc4 or so.

How many of those other patches:

* got tested by the maintainer
* re-audited twice by the maintainer
* reviewed by two other subsystem gurus

Moreover there was no sneaking here at all:

I admitted in the pull request that I'm unsure if this is appropriate that late in the cycle.

I'm fine with delaying those changes but I'm not fine with attempts to do it using completely "made up" technical arguments (no risky core changes, no 2K sector devices affected, no relation to alt_size sysfs interface, no misrepresenting of feature as a bug fix -- to mention just a few).

#12 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 21 lines · Bartlomiej Zolnierkiewicz
Quoted 5 lines · On Sunday 07 June 2009 18:08:09 James Bottomley wrote:

So I have two specific problems with the way you're trying to one up libata:

1. You're trying to get a jump on them by adding features as bug fixes ... this is incredibly bad release practice.

It is a bugfix. Long overdue one.

However you have to look beyond kernel to see it. From the commit log:

"
From the perspective of most users of recent systems, disabling Host Protected Area (HPA) can break vendor RAID formats, GPT partitions and risks corrupting firmware or overwriting vendor system recovery tools.

Unfortunately the original (kernels < 2.6.30) behavior (unconditionally disabling HPA and using full disk capacity) was introduced at the time when the main use of HPA was to make the drive look small enough for the BIOS to allow the system to boot with large capacity drives.

Quoted 8 lines

Thus to allow the maximum compatibility with the existing setups (using HPA and partitioned with HPA disabled) we automically disable HPA if any partitions overlapping HPA are detected. Additionally HPA can also be disabled using the "nohpa" module parameter (i.e. "ide_core.nohpa=0.0" to disable HPA on /dev/hda).
"

Yes, it is true that there is no rush.

So why 2.6.30-rc7 then?

Quoted 1 line

OTOH there are absolutely no valid technical reasons to slow it down!

There is incredibly valid reason not to put this in 2.6.30-rc7: You've added a feature (HPA) which ide previously ignored, so now you need to identify all those cases and turn it off. The way you've done this is a fallback heuristic in the partitions code which recognises that the device has a partition into the host protected area and turns off the HPA feature. There are three areas of risk here

1. Adding HPA at all. We have zero outstanding bugs saying that ignoring HPA broke anyone's system. Alan's concern you quote above is valid, but unproven at this point. Conversely, by turning on HPA in IDE we may discover some legacy devices that don't behave well with it that haven't been picked up by libata. This is almost unquantifiable, but I'd guess high based on previous run ins with new IDE features and standards conformance.
2. The modification of generic partition code for the fallback heuristic ... get something wrong in here and all of storage will suffer. This is a medium risk which could be mitigated by a longer test cycle.
3. Your actual heuristic: it sounds fine in principle, but what about people who use the kpartx method of partitioning or even just used native dm ... their disks suddenly and unexpectedly get shorter. This heuristic has had insufficient testing to turn up any of these possible failure cases (or any others I haven't through of). Again, this is high risk for an immediate release which could be mitigated by a longer test cycle.

All of this adds up to unacceptable risk in the last week of a release.

In the real world people get fired for this sort of thing (admittedly only usually if the risk factor militates against them).

Quoted 5 lines
Quoted 3 lines

2. this antagonism in feature evolution is likely to lead to interface incompatibility between libata and IDE ... and users will be the ultimate losers because of this.

Hmmm, did you *really* read the patches?

yes, so perhaps you'd have the courtesy to avoid newbie intimidation tactics.

Quoted 7 lines

They make libata and IDE more similar by making IDE also default to preserving HPA (which is what libata does). So users get more coherent overall kernel behavior.

The only difference is that IDE for compatibility reasons must handle old installs (with HPA wrongly disabled and protected area used for filesystem data).

I know this, but as I said, the risk of IDE damaging a system by ignoring HPA is theoretical at the moment ... you have to set that against the introduced risks listed above.

Quoted 2 lines

However it does it in a clean way (not a subsystem specific hack) which can be later used for implementing the same functionality in libata!

I agree with this too ... the problem is that doing things the right way(tm) does increase the footprint of the changes and with it the release risk.

Quoted 4 lines

[ I also tried to encourage libata developers to look into making the needed
libata changes (see my initial posting of HPA patches) and I will still be glad to help with libata patches if somebody would like to work on them (Robert? Tejun?). ]

OK, so back off on the 2.6.30-rc7 release of this and I'll undertake to get libata engaged for integrating this into both subsystems for 2.6.31 ... does that sound fair?

James

#22 lore raw
In reply to Bartlomiej Zolnierkiewicz

Hi Bartlomiej,

Quoted 10 lines · Bartlomiej Zolnierkiewicz
Quoted 8 lines
Quoted 4 lines

My honest opinion is that it is as appropriate now as it will be 2.6.31.

[ I'm still amazed by the amount of *completely* bogus reasons given for not merging it. ]

I don't consider this a bogus reason at all:

 10 files changed, 134 insertions(+), 43 deletions(-)

Since when do we validate code quality based solely on LOC changed? :)

Since when we entered -rc8 (or even earlier).

Quoted 1 line · Bartlomiej Zolnierkiewicz

I'm yet to see anybody posting a single code chunk in this whole discussion.

That's because I am not objecting to the code. I am objecting to the fact that you're submitting something as big as this so late in the release cycle and the fact that it's not a clear-cut bug fix.

But anyway, I don't really want to argue about this. I simply wanted to point out that I agree with Alan's and James' comments and that I don't think they have anything to do with "slowing down IDE fixes" but rather with how the whole release cycle with fixed merge window works.

Pekka

#13 lore raw
In reply to James Bottomley
Quoted 29 lines · On Sunday 07 June 2009 21:08:49 James Bottomley wrote:
Quoted 28 lines · Bartlomiej Zolnierkiewicz
Quoted 5 lines · On Sunday 07 June 2009 18:08:09 James Bottomley wrote:

So I have two specific problems with the way you're trying to one up libata:

1. You're trying to get a jump on them by adding features as bug fixes ... this is incredibly bad release practice.

It is a bugfix. Long overdue one.

However you have to look beyond kernel to see it. From the commit log:

"
From the perspective of most users of recent systems, disabling Host Protected Area (HPA) can break vendor RAID formats, GPT partitions and risks corrupting firmware or overwriting vendor system recovery tools.

Unfortunately the original (kernels < 2.6.30) behavior (unconditionally disabling HPA and using full disk capacity) was introduced at the time when the main use of HPA was to make the drive look small enough for the BIOS to allow the system to boot with large capacity drives.

Thus to allow the maximum compatibility with the existing setups (using HPA and partitioned with HPA disabled) we automically disable HPA if any partitions overlapping HPA are detected. Additionally HPA can also be disabled using the "nohpa" module parameter (i.e. "ide_core.nohpa=0.0" to disable HPA on /dev/hda).
"

Quoted 8 lines
Quoted 1 line

Yes, it is true that there is no rush.

So why 2.6.30-rc7 then?

Quoted 1 line

OTOH there are absolutely no valid technical reasons to slow it down!

There is incredibly valid reason not to put this in 2.6.30-rc7: You've added a feature (HPA) which ide previously ignored, so now you need to

No. HPA as feature was always supported back to 2.4.x days.

End of discussion. I'm not even reading the rest of your mail.

Please go read the code and don't come back till you do.

#23 lore raw
In reply to Pekka Enberg
Quoted 9 lines · On Sunday 07 June 2009 21:09:47 Pekka Enberg wrote:

Hi Bartlomiej,

Quoted 5 lines · Bartlomiej Zolnierkiewicz
Quoted 5 lines
Quoted 4 lines

My honest opinion is that it is as appropriate now as it will be 2.6.31.

[ I'm still amazed by the amount of *completely* bogus reasons given for
not merging it. ]

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

I don't consider this a bogus reason at all:

 10 files changed, 134 insertions(+), 43 deletions(-)

Since when do we validate code quality based solely on LOC changed? :)

Since when we entered -rc8 (or even earlier).

To be perfectly clear on this:

* all patches were posted a week ago to the list (they replaced patches from two weeks ago -- which were intended for -rc8 but thanks to feedback I found a better way to do it).

Quoted 7 lines
Quoted 1 line · Bartlomiej Zolnierkiewicz

I'm yet to see anybody posting a single code chunk in this whole discussion.

That's because I am not objecting to the code. I am objecting to the fact that you're submitting something as big as this so late in the release cycle and the fact that it's not a clear-cut bug fix.

That is a valid objection in contrast to some other ones.

Still, changes are really *safe*:

* fs/partitions/check.c change is straight-forward (doesn't affect anything besides ide-gd)

* ide-gd changes are making it similar in HPA behavior to libata (which is what most distributions are shipping)

#14 lore raw
In reply to James Bottomley
Quoted 8 lines
Quoted 4 lines

[ I also tried to encourage libata developers to look into making the needed
libata changes (see my initial posting of HPA patches) and I will still be glad to help with libata patches if somebody would like to work on them (Robert? Tejun?). ]

OK, so back off on the 2.6.30-rc7 release of this and I'll undertake to get libata engaged for integrating this into both subsystems for 2.6.31 ... does that sound fair?

libata already is, and I've been following and reviewing the patches. The problem remaining is basically that this is not the time to merge it.

It will probably also be worth looking at the way the CD driver plays fast and loose with capacity when handling CD-R devices as a follow on from this stuff.

#15 lore raw
Quoted 5 lines · On Sunday 07 June 2009 22:07:01 Alan Cox wrote:
Quoted 5 lines
Quoted 4 lines

[ I also tried to encourage libata developers to look into making the needed
libata changes (see my initial posting of HPA patches) and I will still be glad to help with libata patches if somebody would like to work on them (Robert? Tejun?). ]

Quoted 7 lines
Quoted 3 lines

OK, so back off on the 2.6.30-rc7 release of this and I'll undertake to get libata engaged for integrating this into both subsystems for 2.6.31 ... does that sound fair?

libata already is, and I've been following and reviewing the patches. The problem remaining is basically that this is not the time to merge it.

In ide's case the situation is a bit different:

This is a bug fix. Not an obvious one but it will help anyone installing a new distribution/kernel using ide on machine with HPA, as it will allow this user for streamline transition to a distribution/kernel using libata later if needed (even though I don't recommend it :).

I just want a fair treatment. I'm not posting crap -rc pull request so I see no reason why I have to pay for other maintainers mistakes.

This was better tested and reviewed that some other changes that got in after 2.6.30-rc8 (and is smaller than at least one other pull request that got in).

I even admitted in the pull request that this may be too late but based on my technical judgment (strongly backed by on reviews from you and Sergei) I considered those changes to be on the edge...

It is not a *must*have* for 2.6.30 but still 2.6.30 *shall*have* it.

Quoted 3 lines

It will probably also be worth looking at the way the CD driver plays fast and loose with capacity when handling CD-R devices as a follow on from this stuff.

Sure and it would be easier to look into this (and libata changes) with partitions/ide changes in.

#16 lore raw
In reply to Alan Cox
Quoted 5 lines · Alan Cox
Quoted 5 lines
Quoted 4 lines

[ I also tried to encourage libata developers to look into making the needed
libata changes (see my initial posting of HPA patches) and I will still be glad to help with libata patches if somebody would like to work on them (Robert? Tejun?). ]

Quoted 7 lines
Quoted 3 lines

OK, so back off on the 2.6.30-rc7 release of this and I'll undertake to get libata engaged for integrating this into both subsystems for 2.6.31 ... does that sound fair?

libata already is, and I've been following and reviewing the patches. The problem remaining is basically that this is not the time to merge it.

Actually, I was talking about the fallback to disabling heuristic which this patch set introduces, and which would fix bug 13365 if it were applied to libata, but which is the bit I think needs some testing.

Quoted 3 lines

It will probably also be worth looking at the way the CD driver plays fast and loose with capacity when handling CD-R devices as a follow on from this stuff.

James

#17 lore raw
Quoted 10 lines · On Sunday 07 June 2009 22:39:45 James Bottomley wrote:
Quoted 9 lines · Alan Cox
Quoted 8 lines
Quoted 4 lines

[ I also tried to encourage libata developers to look into making the needed
libata changes (see my initial posting of HPA patches) and I will still be glad to help with libata patches if somebody would like to work on them (Robert? Tejun?). ]

OK, so back off on the 2.6.30-rc7 release of this and I'll undertake to get libata engaged for integrating this into both subsystems for 2.6.31 ... does that sound fair?

Quoted 7 lines
Quoted 3 lines

libata already is, and I've been following and reviewing the patches. The problem remaining is basically that this is not the time to merge it.

Actually, I was talking about the fallback to disabling heuristic which this patch set introduces, and which would fix bug 13365 if it were applied to libata, but which is the bit I think needs some testing.

My patches fix the root cause of the problem and alleviate the issue for all new installations. In libata's case more testing is needed because the libata's default is to keep HPA enabled (which is proper for modern systems).

Once you get all HPA details (it is a complicated mess -- that is why kernel/distributions couldn't get it right for years) you will see the overall picture of the problem -- the work on multiple fronts at once (including user-space) is needed to fix it properly.

#29 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 1 line · Bartlomiej Zolnierkiewicz

They don't export anything to user-space.

Bartlomiej, that's irrelevant. I want to release 2.6.30. We're not adding some totally new interfaces after -rc8.

This has nothing to do with user space or anything else. It's a new feature.

Linus

#28 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 2 lines · Bartlomiej Zolnierkiewicz

My honest opinion is that it is as appropriate now as it will be 2.6.31.

No.

I['m not pulling new features after -rc8. It had better be a major bugfix to a major oops or security issue.

This is not a "2.6.30" vs "2.6.31" issue. It's a "before -rc1" vs "after -rc8" issue.

Linus

#24 lore raw
In reply to Bartlomiej Zolnierkiewicz
Quoted 6 lines · Bartlomiej Zolnierkiewicz

To be perfectly clear on this:

* all patches were posted a week ago to the list (they replaced patches from two weeks ago -- which were intended for -rc8 but thanks to feedback I found a better way to do it).

Bartlomiej - if you want to add new features, they should have been posted on the list BEFORE THE MERGE WINDOW EVEN OPENED.

Not just after -rc7 or something like that.

Linus

#25 lore raw
Quoted 11 lines · On Monday 08 June 2009 01:15:42 Linus Torvalds wrote:
Quoted 6 lines · Bartlomiej Zolnierkiewicz

To be perfectly clear on this:

* all patches were posted a week ago to the list (they replaced patches from two weeks ago -- which were intended for -rc8 but thanks to feedback I found a better way to do it).

Bartlomiej - if you want to add new features, they should have been posted on the list BEFORE THE MERGE WINDOW EVEN OPENED.

This is not a new feature and basing your opinions on opinions of people who don't read the code before commenting is bad, really bad, m'kay?

Anyway I'll revisit the pull request tomorrow.

#26 lore raw
Quoted 3 lines · Bartlomiej Zolnierkiewicz

This is not a new feature and basing your opinions on opinions of people who don't read the code before commenting is bad, really bad, m'kay?

The thing is, I had planned on doing a final release yesterday, even before your pull came in. I decided to hold off, let it be, just to test the _current_ state a bit more. No way am I then adding some effectively totally untested new code-path.

And if you start messing in partitions.c and adding whole new callback functions to generic block_device_operations, then that's a new code-path. The IDE subsystem has _no_ business adding random new callbacks in the very last days of a release.

It sure as hell is not just a bugfix, it's a new feature. The feature may be _needed_ for some specific bug report, but that is totally irrelevant. We don't do things like that.

It's also almost certainly not a regression, is it? So by no measure does it work as a "late in the -rc sequence" patch.

Linus

#27 lore raw
Quoted 7 lines · On Monday 08 June 2009 01:57:19 Linus Torvalds wrote:
Quoted 3 lines · Bartlomiej Zolnierkiewicz

This is not a new feature and basing your opinions on opinions of people who don't read the code before commenting is bad, really bad, m'kay?

The thing is, I had planned on doing a final release yesterday, even

I don't want IDE to possibly hold off the final release so...

Linus, please pull from 'for-linus' branch of:

master.kernel.org:/pub/scm/linux/kernel/git/bart/ide-2.6.git for-linus

to receive the following updates:

 drivers/ide/pdc202xx_old.c |   22 ++++++----------------
 1 files changed, 6 insertions(+), 16 deletions(-)

Sergei Shtylyov (2):
pdc202xx_old: fix 'pdc20246_dma_ops'
pdc202xx_old: fix resetproc() method

drivers/ide/pdc202xx_old.c +6 -16
index 248a54b..b3bc96f 100644
@@ -1,6 +1,6 @@
 /*
  *  Copyright (C) 1998-2002		Andre Hedrick <[email protected]>
- *  Copyright (C) 2006-2007		MontaVista Software, Inc.
+ *  Copyright (C) 2006-2007, 2009	MontaVista Software, Inc.
  *  Copyright (C) 2007			Bartlomiej Zolnierkiewicz
  *
  *  Portions Copyright (C) 1999 Promise Technology, Inc.
@@ -227,28 +227,19 @@ somebody_else:
 	return (dma_stat & 4) == 4;	/* return 1 if INTR asserted */
 }
 
-static void pdc202xx_reset_host (ide_hwif_t *hwif)
+static void pdc202xx_reset(ide_drive_t *drive)
 {
+	ide_hwif_t *hwif	= drive->hwif;
 	unsigned long high_16	= hwif->extra_base - 16;
 	u8 udma_speed_flag	= inb(high_16 | 0x001f);
 
+	printk(KERN_WARNING "PDC202xx: software reset...\n");
+
 	outb(udma_speed_flag | 0x10, high_16 | 0x001f);
 	mdelay(100);
 	outb(udma_speed_flag & ~0x10, high_16 | 0x001f);
 	mdelay(2000);	/* 2 seconds ?! */
 
-	printk(KERN_WARNING "PDC202XX: %s channel reset.\n",
-		hwif->channel ? "Secondary" : "Primary");
-}
-
-static void pdc202xx_reset (ide_drive_t *drive)
-{
-	ide_hwif_t *hwif	= drive->hwif;
-	ide_hwif_t *mate	= hwif->mate;
-
-	pdc202xx_reset_host(hwif);
-	pdc202xx_reset_host(mate);
-
 	ide_set_max_pio(drive);
 }
 
@@ -328,9 +319,8 @@ static const struct ide_dma_ops pdc20246_dma_ops = {
 	.dma_start		= ide_dma_start,
 	.dma_end		= ide_dma_end,
 	.dma_test_irq		= pdc202xx_dma_test_irq,
-	.dma_lost_irq		= pdc202xx_dma_lost_irq,
+	.dma_lost_irq		= ide_dma_lost_irq,
 	.dma_timer_expiry	= ide_dma_sff_timer_expiry,
-	.dma_clear		= pdc202xx_reset,
 	.dma_sff_read_status	= ide_dma_sff_read_status,
 };