Bug 8791
Summary: | pata_hpt37x: BIOS has not set timing clocks. | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | Bjoern Olausson (lkmlist) |
Component: | Serial ATA | Assignee: | Alan (alan) |
Status: | CLOSED CODE_FIX | ||
Severity: | normal | CC: | alan, headless |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.22.1 | Subsystem: | |
Regression: | --- | Bisected commit-id: | |
Attachments: | Diff for PLL tuning |
Description
Bjoern Olausson
2007-07-22 15:33:03 UTC
Alan? Groan, the HPT clocks are such a total pain. Interesting that the current 2.6.22 old HPT driver works as they in theory use identical code for the tuning. Added to the todo list. Thanks for fixing it. regards Bjoern Olausson Ok please try the attached change Created attachment 12104 [details]
Diff for PLL tuning
Fine, works. hpt37x: Bus clock 66MHz, using DPLL. ACPI: PCI Interrupt 0000:00:0a.0[A] -> GSI 18 (level, low) -> IRQ 19 scsi2 : pata_hpt37x scsi3 : pata_hpt37x ata3: PATA max UDMA/100 cmd 0x00019c00 ctl 0x00019402 bmdma 0x00018800 irq 19 ata4: PATA max UDMA/100 cmd 0x00019000 ctl 0x00018c02 bmdma 0x00018808 irq 19 With this patch we can close the bug, I suggest. Will it be included into 2.6.22 line? Otherwise I'll submit this patch to gentoo bugtracker so they can include this patch into gentoo sources. regards Bjoern Olausson (In reply to comment #6) > Fine, works. > hpt37x: Bus clock 66MHz, using DPLL. Hm... HPT374 clocked by 66 MHz DPLL works? Interesting, I've recently fixed the "old" driver to clock it with only 50 MHz as it didn't seem to tolerate 66 MHz (and neither it supports UDMA133 for which this clock is necessary). Bus Clock not DPLL. We set a 50MHz DPLL on the 374 (and any device not capable of UDMA133) Alan (In reply to comment #8) > Bus Clock not DPLL. > We set a 50MHz DPLL on the 374 (and any device not capable of UDMA133) But it still has .udma_mask of 0x7f in pata_hpt37x.c. (In reply to comment #9) > (In reply to comment #8) > > Bus Clock not DPLL. > > We set a 50MHz DPLL on the 374 (and any device not capable of UDMA133) > But it still has .udma_mask of 0x7f in pata_hpt37x.c. Moreover, from looking at the code, it seems that will tune the DPLL to the bus clock. (In reply to comment #10) > (In reply to comment #9) > > (In reply to comment #8) > > > Bus Clock not DPLL. > > > We set a 50MHz DPLL on the 374 (and any device not capable of UDMA133) > > But it still has .udma_mask of 0x7f in pata_hpt37x.c. > Moreover, from looking at the code, it seems that will tune the DPLL to the > bus > clock. Sorry, was looking at 2.6.21 as it turned out. :-< (In reply to comment #11) > > > > Bus Clock not DPLL. > > > > We set a 50MHz DPLL on the 374 (and any device not capable of UDMA133) > > > But it still has .udma_mask of 0x7f in pata_hpt37x.c. > > Moreover, from looking at the code, it seems that will tune the DPLL to the > bus > > clock. > Sorry, was looking at 2.6.21 as it turned out. :-< I mean sorry about the mask comment, not about the latter one which still seems to be true... :-/ The system ist running for a few hours now and still everything is up and running. Thats all I can say from the "users" point of view ;-) regards Bjoern Committed Thanks for the bug report and testing Mhh, today I got a strange log entry... I hope this is not related to the driver. Maybe it's a hardware fault? Jul 27 04:15:08 enterprise ata4.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen Jul 27 04:15:08 enterprise ata4.01: cmd 35/00:90:af:39:5d/00:02:00:00:00/f0 tag 0 cdb 0x0 data 335872 out Jul 27 04:15:08 enterprise res 40/00:ff:00:00:00/00:00:00:00:00/50 Emask 0x4 (timeout) Jul 27 04:15:08 enterprise ata4: soft resetting port Jul 27 04:15:08 enterprise Find mode for 12 reports C829C62 Jul 27 04:15:08 enterprise Find mode for 12 reports C829C62 Jul 27 04:15:08 enterprise Find mode for DMA 69 reports 1CAE9C62 Jul 27 04:15:08 enterprise Find mode for DMA 69 reports 1CAE9C62 Jul 27 04:15:08 enterprise ata4.00: configured for UDMA/100 Jul 27 04:15:08 enterprise ata4.01: configured for UDMA/100 Jul 27 04:15:08 enterprise ata4: EH complete Jul 27 04:15:08 enterprise sd 3:0:0:0: [sdc] 490234752 512-byte hardware sectors (251000 MB) Jul 27 04:15:08 enterprise sd 3:0:0:0: [sdc] Write Protect is off Jul 27 04:15:08 enterprise sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00 Jul 27 04:15:08 enterprise sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Jul 27 04:15:08 enterprise sd 3:0:1:0: [sdd] 490234752 512-byte hardware sectors (251000 MB) Jul 27 04:15:08 enterprise sd 3:0:1:0: [sdd] Write Protect is off Jul 27 04:15:08 enterprise sd 3:0:1:0: [sdd] Mode Sense: 00 3a 00 00 Jul 27 04:15:08 enterprise sd 3:0:1:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Jul 27 04:15:08 enterprise sd 3:0:0:0: [sdc] 490234752 512-byte hardware sectors (251000 MB) Jul 27 04:15:09 enterprise sd 3:0:0:0: [sdc] Write Protect is off Jul 27 04:15:09 enterprise sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00 Jul 27 04:15:09 enterprise sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Jul 27 04:15:09 enterprise sd 3:0:1:0: [sdd] Write Protect is off Jul 27 04:15:09 enterprise sd 3:0:1:0: [sdd] Mode Sense: 00 3a 00 00 Jul 27 04:15:09 enterprise sd 3:0:1:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA regards Bjoern Jul 27 04:21:17 enterprise ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen Jul 27 04:21:17 enterprise ata4.00: cmd 25/00:00:3f:7b:4f/00:02:01:00:00/e0 tag 0 cdb 0x0 data 262144 in Jul 27 04:21:17 enterprise res 40/00:00:00:4f:c2/00:00:00:00:00/10 Emask 0x4 (timeout) Jul 27 04:21:17 enterprise ata4: soft resetting port Jul 27 04:21:17 enterprise ata4.01: revalidation failed (errno=-2) Jul 27 04:21:17 enterprise ata4: failed to recover some devices, retrying in 5 secs Jul 27 04:21:22 enterprise ata4: soft resetting port Jul 27 04:21:22 enterprise ata4.01: revalidation failed (errno=-2) Jul 27 04:21:22 enterprise ata4: failed to recover some devices, retrying in 5 secs Jul 27 04:21:27 enterprise ata4: soft resetting port Jul 27 04:21:27 enterprise ata4.01: revalidation failed (errno=-2) Jul 27 04:21:27 enterprise ata4.01: disabled Jul 27 04:21:27 enterprise ata4: failed to recover some devices, retrying in 5 secs Jul 27 04:21:32 enterprise ata4.00: failed to IDENTIFY (I/O error, err_mask=0x40) Jul 27 04:21:32 enterprise ata4.00: revalidation failed (errno=-5) Jul 27 04:21:32 enterprise ata4: failed to recover some devices, retrying in 5 secs Jul 27 04:21:37 enterprise ata4: soft resetting port Jul 27 04:21:37 enterprise ata4.00: limited to UDMA/33 due to 40-wire cable Jul 27 04:21:37 enterprise Find mode for 12 reports C829C62 Jul 27 04:21:37 enterprise Find mode for DMA 66 reports 1C929C62 Jul 27 04:21:37 enterprise ata4.00: configured for UDMA/33 Jul 27 04:21:37 enterprise ata4: EH complete Jul 27 04:21:37 enterprise sd 3:0:1:0: [sdd] Result: hostbyte=0x04 driverbyte=0x00 Jul 27 04:21:37 enterprise end_request: I/O error, dev sdd, sector 21985599 Jul 27 04:21:37 enterprise raid5: Disk failure on sdd1, disabling device. Operation continuing on 3 devices Jul 27 04:21:37 enterprise sd 3:0:1:0: [sdd] Result: hostbyte=0x04 driverbyte=0x00 Jul 27 04:21:37 enterprise end_request: I/O error, dev sdd, sector 21986031 Jul 27 04:21:37 enterprise sd 3:0:0:0: [sdc] 490234752 512-byte hardware sectors (251000 MB) Jul 27 04:21:37 enterprise sd 3:0:0:0: [sdc] Write Protect is off Jul 27 04:21:37 enterprise sd 3:0:0:0: [sdc] Mode Sense: 00 3a 00 00 Jul 27 04:21:38 enterprise sd 3:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Alan, your patch worked fine on 2.6.22.1 but does not on 2.6.22.1, wich means in detail: Linux boots fine, but asa. I start to copy stuff on the raid md3 (sda and sdb in raid level 1) it fails after a few MB. Actually I can't be sure if it is caused by the driver and your patch or if something other went wrong in 2.6.22.2. Only thing I can match in the changelog is this: commit 74ff092c258313747791da5d82054027167d1a79 Author: Milan Broz <mbroz@redhat.com> Date: Thu Jul 12 17:27:24 2007 +0100 dm raid1: fix status Fix mirror status line broken in dm-log-report-fault-status.patch: - space missing between two words - placeholder ("0") required for compatibility with a subsequent patch - incorrect offset parameter Signed-off-by: Milan Broz <mbroz@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> I personally don't care to get it fixed in 2.6.22.* cause I'll stick with 2.6.22.1 until 2.6.23 will be released. Than I'll give it a shot. But It is maybe of interesting for the you, and oterh devs. regards Bjoern Kernel 2.6.22.1 <--- WORKS with patch Kernel 2.6.22.2 <--- ERRORS with patch Patch from Alan: --- pata_hpt37x.c 2007-07-23 12:56:11.000000000 +0100 +++ pata_hpt37x.c 2007-07-23 14:44:39.003320584 +0100 @@ -26,7 +26,7 @@ #include <linux/libata.h> #define DRV_NAME "pata_hpt37x" -#define DRV_VERSION "0.6.6" +#define DRV_VERSION "0.6.7" struct hpt_clock { u8 xfer_speed; @@ -1103,17 +1103,17 @@ /* Select the DPLL clock. */ pci_write_config_byte(dev, 0x5b, 0x21); - pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); + pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100); for(adjust = 0; adjust < 8; adjust++) { if (hpt37x_calibrate_dpll(dev)) break; /* See if it'll settle at a fractionally different clock */ - if ((adjust & 3) == 3) { - f_low --; - f_high ++; - } - pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low); + if (adjust & 1) + f_low -= adjust >> 1; + else + f_high += adjust >> 1; + pci_write_config_dword(dev, 0x5C, (f_high << 16) | f_low | 0x100); } if (adjust == 8) { printk(KERN_WARNING "hpt37x: DPLL did not stabilize.\n"); Aug 9 12:01:01 enterprise ata3.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen Aug 9 12:01:01 enterprise ata3.01: cmd c8/00:20:47:00:ee/00:00:00:00:00/fd tag 0 cdb 0x0 data 16384 in Aug 9 12:01:01 enterprise res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) Aug 9 12:01:01 enterprise ata3: soft resetting port Aug 9 12:01:01 enterprise cron[10127]: (root) CMD (/usr/bin/mrtg) Aug 9 12:01:01 enterprise Find mode for 12 reports C829C62 Aug 9 12:01:01 enterprise Find mode for 12 reports C829C62 Aug 9 12:01:01 enterprise Find mode for DMA 69 reports 1CAE9C62 Aug 9 12:01:01 enterprise Find mode for DMA 69 reports 1CAE9C62 Aug 9 12:01:01 enterprise ata3.00: configured for UDMA/100 Aug 9 12:01:01 enterprise ata3.01: configured for UDMA/100 Aug 9 12:01:01 enterprise ata3: EH complete Aug 9 12:01:02 enterprise sd 2:0:0:0: [sda] 398297088 512-byte hardware sectors (203928 MB) Aug 9 12:01:02 enterprise sd 2:0:0:0: [sda] Write Protect is off Aug 9 12:01:02 enterprise sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00 Aug 9 12:01:02 enterprise sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Aug 9 12:01:02 enterprise sd 2:0:1:0: [sdb] 398297088 512-byte hardware sectors (203928 MB) Aug 9 12:01:02 enterprise sd 2:0:1:0: [sdb] Write Protect is off Aug 9 12:01:02 enterprise sd 2:0:1:0: [sdb] Mode Sense: 00 3a 00 00 Aug 9 12:01:02 enterprise sd 2:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Aug 9 12:02:02 enterprise ata3.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen Aug 9 12:02:02 enterprise ata3.01: cmd c8/00:08:8f:02:ec/00:00:00:00:00/fd tag 0 cdb 0x0 data 4096 in Aug 9 12:02:02 enterprise res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) Aug 9 12:02:02 enterprise ata3: soft resetting port Aug 9 12:02:02 enterprise Find mode for 12 reports C829C62 Aug 9 12:02:02 enterprise Find mode for 12 reports C829C62 Aug 9 12:02:02 enterprise Find mode for DMA 69 reports 1CAE9C62 Aug 9 12:02:02 enterprise Find mode for DMA 69 reports 1CAE9C62 Aug 9 12:02:02 enterprise ata3.00: configured for UDMA/100 Aug 9 12:02:02 enterprise ata3.01: configured for UDMA/100 Aug 9 12:02:02 enterprise ata3: EH complete Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] 398297088 512-byte hardware sectors (203928 MB) Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] Write Protect is off Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00 Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] 398297088 512-byte hardware sectors (203928 MB) Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] Write Protect is off Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] Mode Sense: 00 3a 00 00 Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] 398297088 512-byte hardware sectors (203928 MB) Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] Write Protect is off Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] Mode Sense: 00 3a 00 00 Aug 9 12:02:02 enterprise sd 2:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] 398297088 512-byte hardware sectors (203928 MB) Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] Write Protect is off Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] Mode Sense: 00 3a 00 00 Aug 9 12:02:02 enterprise sd 2:0:1:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA Sory, a typo: replace: "Alan, your patch worked fine on 2.6.22.1 but does not on 2.6.22.1, wich means in detail:" with "Alan, your patch worked fine on 2.6.22.1 but does not on 2.6.22.2, wich means in detail:" Regards BJoern I added a new bugreport on this cause I thing it is caused by MD and closing this bug again. http://bugzilla.kernel.org/show_bug.cgi?id=8889 Thanks Bjoern |