Bug 16607
Summary: | divide error in ata_timing_compute() | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | Milan Kocian (milan.kocian) |
Component: | Serial ATA | Assignee: | Jeff Garzik (jgarzik) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | alan, tj |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.35.2 | Subsystem: | |
Regression: | Yes | Bisected commit-id: | |
Attachments: |
call trace begin
call trace end |
Description
Milan Kocian
2010-08-16 16:33:27 UTC
Created attachment 27471 [details]
call trace begin
Created attachment 27472 [details]
call trace end
hi, I have more info about it. Divide error happens on line: #define ENOUGH(v, unit) (((v)-1)/(unit)+1) #define EZ(v, unit) ((v)?ENOUGH(v, unit):0) /*((t->udma * 1000)?(((t->udma * 1000)-1)/(0)+1):0)*/ static void ata_timing_quantize(const struct ata_timing *t, struct ata_timing *q, int T, int UT) { q->setup = EZ(t->setup * 1000, T); q->act8b = EZ(t->act8b * 1000, T); q->rec8b = EZ(t->rec8b * 1000, T); q->cyc8b = EZ(t->cyc8b * 1000, T); q->active = EZ(t->active * 1000, T); q->recover = EZ(t->recover * 1000, T); q->dmack_hold = EZ(t->dmack_hold * 1000, T); q->cycle = EZ(t->cycle * 1000, T); printk("MM: Still ok\n"); !!--> q->udma = EZ(t->udma * 1000, UT); printk("MM: NOT DONE\n"); } in function 'static void ata_timing_quantize' where UT is zero. I see problem in commit d62f5576efc4886c0f3633c2652c3a924e043be9: --- a/drivers/ata/pata_cmd64x.c +++ b/drivers/ata/pata_cmd64x.c @@ -131,8 +131,14 @@ static void cmd64x_set_timing(struct ata_port *ap, struct ata_device *adev, u8 m if (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); + } } } Where ata_timing_compute() is called with UT = 0 which is not correct for XFER_UDMA_5 mode. (pair->dma_mode = XFER_UDMA_5 in my case). I'm not sure how to change UT value so I'm waiting for reply :-). cc'ing Alan Cox. Alan, can you please take a look? Thanks. Nothing to do with me Ask Bartlomiej commit d62f5576efc4886c0f3633c2652c3a924e043be9 Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Date: Mon Jan 18 18:15:04 2010 +0100 pata_cmd64x: fix handling of address setup timings Account for the requirements of the DMA mode currently used by the pair device. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Bartlomiej? The patch in question has never been submitted to upstream kernel and was only posted as a part of atang tree update: http://lkml.org/lkml/2010/1/18/256 http://patchwork.ozlabs.org/patch/43145/ http://lkml.org/lkml/2010/1/20/443 I have a very little control over what people are doing with my patches posted to public mailing lists (as a part of Q&A process of atang tree).. Unfortunately I don't have any time these days to work on this or any other kernel problems that are not covered by support or work contract so it would be the best to ping the upstream kernel maintainer (Jeff) w.r.t. resolution of the upstream kernel bug.. Patch to revert the offending commit is posted. http://article.gmane.org/gmane.linux.ide/47055 Thanks. Hi, exists any reason not to be in stable yet ? thanks. Patch has been already applied. |