pata_cmd64x: revert commit d62f5576
PATCH 1/1 pata_cmd64x: revert commit d62f5576
Commit d62f5576 (pata_cmd64x: fix handling of address setup timings) incorrectly called ata_timing_compute() on UDMA mode on 0 @UT leading to devide by zero fault. Revert it until better fix is available. This is reported in bko#16607 by Milan Kocian who also root caused it.
https://bugzilla.kernel.org/show_bug.cgi?id=16607
--- drivers/ata/pata_cmd64x.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/ata/pata_cmd64x.c +0 -6
@@ -121,14 +121,8 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 mif (pair) {struct ata_timing tp; -ata_timing_compute (pair, pair->pio_mode, &tp,T ,0 );ata_timing_merge (&t, &tp, &t,ATA_TIMING_SETUP ); -if (pair->dma_mode) { -ata_timing_compute (pair, pair->dma_mode, - &tp,T ,0 ); -ata_timing_merge (&tp, &t, &t,ATA_TIMING_SETUP ); - } } }
Quoted 6 lines · Tejun Heo
Commit
d62f5576(pata_cmd64x: fix handling of address setup timings) incorrectly calledata_timing_compute()on UDMA mode on 0 @UT leading to devide by zero fault. Revert it until better fix is available. This is reported in bko#16607 by Milan Kocian who also root caused it.
How's about giving the ATA maintainer some time to resolve the issue properly?
The revert should be a last resort action (+ the issue was reported only yesterday) as it introduces another regression (it just replaces new bug with the old bug while adding noise in the process)..
Quoted 26 lines
Signed-off-by Tejun Heo <[email protected]>Reported-and-root-caused-by Milan Kocian <[email protected]>Cc Bartlomiej Zolnierkiewicz <[email protected]>--- drivers/ata/pata_cmd64x.c | 6 ------ 1 file changed, 6 deletions(-)drivers/ata/pata_cmd64x.c +0
-6@@ -121,14 +121,8 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 mif (pair) {struct ata_timing tp; -ata_timing_compute (pair, pair->pio_mode, &tp,T ,0 );ata_timing_merge (&t, &tp, &t,ATA_TIMING_SETUP ); -if (pair->dma_mode) { -ata_timing_compute (pair, pair->dma_mode, - &tp,T ,0 ); -ata_timing_merge (&tp, &t, &t,ATA_TIMING_SETUP ); - } } }
Hello,
Quoted 10 lines · Bartlomiej Zolnierkiewicz
Quoted 6 lines · Tejun Heo
Commit
d62f5576(pata_cmd64x: fix handling of address setup timings) incorrectly calledata_timing_compute()on UDMA mode on 0 @UT leading to devide by zero fault. Revert it until better fix is available. This is reported in bko#16607 by Milan Kocian who also root caused it.How's about giving the ATA maintainer some time to resolve the issue properly?
Yeap, sure.
Quoted 3 lines
The revert should be a last resort action (+ the issue was reported only yesterday) as it introduces another regression (it just replaces new bug with the old bug while adding noise in the process)..
The old problem is much less severe tho. The introduced regression causes oops while the old bug probably doesn't show itself too often. Does it really need to merge the DMA timings too? If the device can't do certain timing, it's PIO configuration should reflect that so merging PIO part only should be enough for PIO configuration, no?
Thanks.
Signature · 1 line
tejun
Quoted 2 lines
The old problem is much less severe tho. The introduced regression causes oops while the old bug probably doesn't show itself too often.
If ever
Quoted 3 lines
Does it really need to merge the DMA timings too? If the device can't do certain timing, it's PIO configuration should reflect that so merging PIO part only should be enough for PIO configuration, no?
The timing code knows about DMA/PIO constraints itself. The whole mucking around passing both timings is just bogus.
Pass pair->dma_mode only and it'll work out the PIO for you. Not that it matters - no real hardware has a DMA mode with a slower address setup than its PIO mode.
and for UT just stick in some value (eg 33000) so it works in PCI clocks
Quoted 9 lines · Alan Cox
Quoted 2 lines
The old problem is much less severe tho. The introduced regression causes oops while the old bug probably doesn't show itself too often.
If ever
Quoted 3 lines
Does it really need to merge the DMA timings too? If the device can't do certain timing, it's PIO configuration should reflect that so merging PIO part only should be enough for PIO configuration, no?
Quoted 6 lines
The timing code knows about DMA/PIO constraints itself. The whole mucking around passing both timings is just bogus.
Pass
pair->dma_modeonly and it'll work out the PIO for you. Not that it matters - no real hardware has a DMA mode with a slower address setup than its PIO mode.
There were some PIO3/MWDMA1 devices out in the wild (Iomega ZIP IIRC)..
Anyway the patch has never been submitted upstream:
*) I have absolutely no time to support it or related changes
*) it was not critical enough and/or important for other related work
(it is more important in atang/ide2libata context)
Quoted 1 line
and for UT just stick in some value (eg 33000) so it works in PCI clocks
Exactly, ->udma is never used by the driver itself..
Thanks.
--
Bartlomiej Zolnierkiewicz
Quoted 10 lines · Alan Cox
Quoted 3 lines
Does it really need to merge the DMA timings too? If the device can't do certain timing, it's PIO configuration should reflect that so merging PIO part only should be enough for PIO configuration, no?
The timing code knows about DMA/PIO constraints itself. The whole mucking around passing both timings is just bogus.
Pass
pair->dma_modeonly and it'll work out the PIO for you. Not that it matters - no real hardware has a DMA mode with a slower address setup than its PIO mode.
The address setup timing means *exactly nothing* for DMA modes. I keep
wondering why it has been added to the libata timing table...
MBR, Sergei
Jeff Garzik
AppliedQuoted 20 lines · Tejun Heo
Commit
d62f5576(pata_cmd64x: fix handling of address setup timings) incorrectly calledata_timing_compute()on UDMA mode on 0 @UT leading to devide by zero fault. Revert it until better fix is available. This is reported in bko#16607 by Milan Kocian who also root caused it.https://bugzilla.kernel.org/show_bug.cgi?id=16607Signed-off-by Tejun Heo<[email protected]>Reported-and-root-caused-by Milan Kocian<[email protected]>Cc Bartlomiej Zolnierkiewicz<[email protected]>--- drivers/ata/pata_cmd64x.c | 6 ------ 1 file changed, 6 deletions(-)drivers/ata/pata_cmd64x.c +0
-0
drivers/ata/pata_cmd64x.c static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m · line 130
Quoted 10 lines
drivers/ata/pata_cmd64x.c +0
-5@@ -121,14 +121,8 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 mif (pair) {struct ata_timing tp; -ata_timing_compute (pair, pair->pio_mode,&tp,T ,0 );ata_timing_merge (&t,&tp,&t,ATA_TIMING_SETUP ); -if (pair->dma_mode) { -ata_timing_compute (pair, pair->dma_mode, - &tp,T ,0 ); -ata_timing_merge (&tp,&t,&t,ATA_TIMING_SETUP );
applied; even if not perfect, this gets us into a better state.
Quoted 22 lines · Jeff Garzik
Quoted 21 lines · Tejun Heo
Commit
d62f5576(pata_cmd64x: fix handling of address setup timings) incorrectly calledata_timing_compute()on UDMA mode on 0 @UT leading to devide by zero fault. Revert it until better fix is available. This is reported in bko#16607 by Milan Kocian who also root caused it.https://bugzilla.kernel.org/show_bug.cgi?id=16607
Signed-off-by Tejun Heo<[email protected]>Reported-and-root-caused-by Milan Kocian<[email protected]>Cc Bartlomiej Zolnierkiewicz<[email protected]>--- drivers/ata/pata_cmd64x.c | 6 ------ 1 file changed, 6 deletions(-)drivers/ata/pata_cmd64x.c +0
-0@@ -121,14 +121,8 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m
Quoted 13 lines
drivers/ata/pata_cmd64x.c static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m
Quoted 9 lines
drivers/ata/pata_cmd64x.c +0
-5if (pair) {struct ata_timing tp; -ata_timing_compute (pair, pair->pio_mode,&tp,T ,0 );ata_timing_merge (&t,&tp,&t,ATA_TIMING_SETUP ); -if (pair->dma_mode) { -ata_timing_compute (pair, pair->dma_mode, - &tp,T ,0 ); -ata_timing_merge (&tp,&t,&t,ATA_TIMING_SETUP );applied; even if not perfect, this gets us into a better state.
Thank all for solving this. Should I close the bug now ?
regards
Signature · 1 line
Milan Kocian