Skip to contentSkip to conversation

RocketPoint 1520 [hpt366] fails clock stabilization

DISCUSSION Loren M. Lang 2 participants 5 messages Sep 29, 2005 – Oct 1, 2005

lore
Share & tools
lore
#0 lore raw

Please CC me as I'm not on the list.

I just purchased a HighPoint Rocket 1520 SATA controller. There seems to be no libata driver (yet), but there is an ide driver, hpt366. When the driver gets loaded, it causes a kernel NULL pointer dereference in pci_bus_clock_list. It seems to be because the driver is waiting for clock stabilization in init_hpt37x() which never comes. The driver just continues on with the pci drvdata set to NULL, instead of a valid clock entry. The following patch prevents the NULL dereference from happening, but instead exit with an error.

--- drivers/ide/pci/hpt366.c.orig 2005-09-29 01:00:12.000000000
+++ drivers/ide/pci/hpt366.c 2005-09-29 01:00:17.000000000 -0700
-0700
@@ -1310,10 +1310,6 @@

                                goto init_hpt37X_done;
                        }
                }

+ if (!pci_get_drvdata(dev)) {
+ printk("No Clock Stabilization!!!\n");
+ return -1;
+ }
pll_recal:

                if (adjust & 1)
                        pll -= (adjust >> 1);

I am using Gentoo linux with a gentoo patched kernel 2.6.12-r10. The dmesg of the driver attempting to attach is:

HPT372A: IDE controller at PCI slot 0000:02:0c.0
PCI: Enabling device 0000:02:0c.0 (0105 -> 0107)
ACPI: PCI Interrupt 0000:02:0c.0[A] -> GSI 20 (level, low) -> IRQ 20
HPT372A: chipset revision 2
hpt: HPT372N detected, using 372N timing.
FREQ: 125 PLL: 45
No Clock Stabilization!!!
HPT366_IDE: probe of 0000:02:0c.0 failed with error -1

I have seen a post from last year of someone with a similar problem.

http://readlist.com/lists/vger.kernel.org/linux-kernel/10/50990.html

Seems to be the same oops I was seeing.

Signature · 9 lines
I sense much NT in you.
NT leads to Bluescreen.
Bluescreen leads to downtime.
Downtime leads to suffering.
NT is the path to the darkside.
Powerful Unix is.

Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
Fingerprint: CEE1 AAE2 F66C 59B5 34CA  C415 6D35 E847 0118 A3D2
#1 lore raw
Quoted 4 lines · Loren M. Lang

Please CC me as I'm not on the list.

I just purchased a HighPoint Rocket 1520 SATA controller. There seems to be no libata driver (yet), but there is an ide driver, hpt366. When

Is this 302 or 302N based (what does lspci -vxx say about it ?)

#2 lore raw
Quoted 7 lines · Alan Cox
Quoted 4 lines · Loren M. Lang

Please CC me as I'm not on the list.

I just purchased a HighPoint Rocket 1520 SATA controller. There seems to be no libata driver (yet), but there is an ide driver, hpt366. When

Is this 302 or 302N based (what does lspci -vxx say about it ?)

$ lspci -vxx
0000:02:0c.0 RAID bus controller: Triones Technologies, Inc. HPT372A
(rev 02)
        Subsystem: Triones Technologies, Inc.: Unknown device 0001
        Flags: bus master, 66Mhz, medium devsel, latency 64, IRQ 10
        I/O ports at dfe0 [size=feaa0000]
        I/O ports at dfac [size=4]
        I/O ports at dfa0 [size=8]
        I/O ports at dfa8 [size=4]
        I/O ports at d400 [size=256]
        Expansion ROM at 00020000 [disabled]
        Capabilities: <available only to root>
00: 03 11 05 00 05 01 30 02 02 00 04 01 04 40 00 00
10: e1 df 00 00 ad df 00 00 a1 df 00 00 a9 df 00 00
20: 01 d4 00 00 00 00 00 00 00 00 00 00 03 11 01 00
30: 00 00 aa fe 60 00 00 00 00 00 00 00 0a 01 08 08

I booted FreeBSD 6.0 and it seemed to reconize the card and attached hard drive ok. In the dmesg for freebsd, it mentioned 372N, if that means anything. There is a patch, I discovered, which disables the driver from marking a 372A chipset from being detected as a 372N chip. When I applied the patch, it finally detected the sata driver ok and my new sata drive as well. So my current hpt366 driver is as patched below. I added a check for a NULL drvdata to prevent the driver from seg faulting when it failed to detect my chip, and I disabled a check for the 372N chipset.

--- drivers/ide/pci/hpt366.c.orig 2005-09-29 01:00:12.000000000
-0700
+++ drivers/ide/pci/hpt366.c 2005-09-30 02:28:47.000000000 -0700
@@ -1168,8 +1168,10 @@ static int __devinit init_hpt37x(struct

                did = inb(dmabase + 0x22);
                rid = inb(dmabase + 0x28);

+#if 0

                if((did == 4 && rid == 6) || (did == 5 && rid > 1))
                        is_372n = 1;
+#endif
        }
 
        /*
@@ -1310,6 +1312,10 @@ static int __devinit init_hpt37x(struct 
                                goto init_hpt37X_done;
                        }
                }

+ if (!pci_get_drvdata(dev)) {
+ printk("No Clock Stabilization!!!");
+ return -1;
+ }
pll_recal:

                if (adjust & 1)
                        pll -= (adjust >> 1);
Signature · 9 lines
I sense much NT in you.
NT leads to Bluescreen.
Bluescreen leads to downtime.
Downtime leads to suffering.
NT is the path to the darkside.
Powerful Unix is.

Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
Fingerprint: CEE1 AAE2 F66C 59B5 34CA  C415 6D35 E847 0118 A3D2
#3 lore raw
Quoted 3 lines · Loren M. Lang

I booted FreeBSD 6.0 and it seemed to reconize the card and attached hard drive ok. In the dmesg for freebsd, it mentioned 372N, if that means anything. There is a patch, I discovered, which disables the

Yes - it means its the older card with a 372N on it.

Quoted 2 lines

seg faulting when it failed to detect my chip, and I disabled a check for the 372N chipset.

Which means you are misclocking the IDE drive. I need to work out why the PLL failed.

What does it report for FREQ and PLL if you boot 2.6.13.something on it ?

#4 lore raw
Quoted 6 lines · Alan Cox
Quoted 3 lines · Loren M. Lang

I booted FreeBSD 6.0 and it seemed to reconize the card and attached hard drive ok. In the dmesg for freebsd, it mentioned 372N, if that means anything. There is a patch, I discovered, which disables the

Yes - it means its the older card with a 372N on it.

Actually, while FreeBSD claims it's a 372N, both NetBSD and OpenBSD agree it's a 372A. Also, FreeBSD reports UDMA133, instead of SATA150 like my onboard sata ports. Is this chip a modified PATA driver? There seem to be lots of references to IDE drives used with this chip.

Quoted 9 lines
Quoted 3 lines

seg faulting when it failed to detect my chip, and I disabled a check for the 372N chipset.

Which means you are misclocking the IDE drive. I need to work out why the PLL failed.

What does it report for FREQ and PLL if you boot 2.6.13.something on it ?

On a vanilla 2.6.13.2 kernel, the FREQ is 144 and the PLL is 66. The driver still seg faults when it fails to find a stable clock. I can probably post an updated patch that will at least prevent it from crashing and fail properly instead. The full dmesg of the driver insertion is below.

HPT372A: IDE controller at PCI slot 0000:02:0c.0
PCI: Enabling device 0000:02:0c.0 (0105 -> 0107)
ACPI: PCI Interrupt 0000:02:0c.0[A] -> GSI 20 (level, low) -> IRQ 23
HPT372A: chipset revision 2
HPT372A: 100% native mode on irq 23
hpt: HPT372N detected, using 372N timing.
FREQ: 124 PLL: 45
No Clock Stabilization!!!
hpt: no known IDE timings, disabling DMA.
hpt: HPT372N detected, using 372N timing.
FREQ: 144 PLL: 66
No Clock Stabilization!!!
hpt: no known IDE timings, disabling DMA.
Probing IDE interface ide2...
hde: WDC WD2500KS-00MJB0, ATA DISK drive

Unable to handle kernel NULL pointer dereference at virtual address

00000000
printing eip:
fe0a7349
*pde = 00000000

Oops: 0000 [#1]
PREEMPT SMP 
Modules linked in: hpt366 nfsd exportfs lockd sunrpc nls_cp437

nls_iso8859_1 smbfs nls_base twofish serpent aes_i586 blowfish des sha256 sha1 crypto_null af_key w8362
7hf i2c_sensor i2c_isa ipv6 rfcomm hidp l2cap snd_pcm_oss snd_mixer_oss snd_seq_midi_event snd_seq snd_seq_device ohci_hcd parport_pc parport floppy 8250_pnp 8250 ser
ial_core pcspkr ohci1394 ieee1394 snd_bt87x tuner tvaudio msp3400 bttv video_buf firmware_class v4l2_common btcx_risc tveeprom videodev sk98lin nvidiafb i2c_algo_bit
snd_intel8x0 snd_ac97_codec snd_pcm snd_timer snd snd_page_alloc i2c_i801 usb_storage ehci_hcd evdev hci_usb bluetooth usbhid uhci_hcd intel_agp agpgart usbcore ufs s
d_mod ata_piix libata sg scsi_mod ide_cd cdrom dm_mod emu10k1 sound soundcore ac97_codec

CPU:    0
EIP:    0060:[<fe0a7349>]    Not tainted VLI
EFLAGS: 00010282   (2.6.13.2) 

EIP is at pci_bus_clock_list+0x9/0x30 [hpt366]
eax: 0000000c ebx: 00000051 ecx: 0000000c edx: 00000000
esi: 30070000 edi: c1a7a660 ebp: c19ee000 esp: f6d0fe1c
ds: 007b es: 007b ss: 0068
Process insmod (pid: 15167, threadinfo=f6d0e000 task=f7d30a80)

Stack: fe0a7728 0000000c 00000000 00000051 00000000 0000000c 0c409900
00000000 
       00479990 c0479990 c0344cc1 000000ff c0479900 c029a929 c0479990
0000000c 
       fe0abaf8 00000017 00000017 00000017 00000246 00000000 c19ee000
00000000 
Call Trace:
 [<fe0a7728>] hpt372_tune_chipset+0xd8/0x160 [hpt366]
 [<c029a929>] probe_hwif+0x259/0x4a0
 [<c029ab85>] probe_hwif_init_with_fixup+0x15/0xa0
 [<c029e1a1>] ide_setup_pci_device+0x61/0xa0
 [<fe0a93d8>] hpt366_init_one+0x28/0x30 [hpt366]
 [<c022648f>] __pci_device_probe+0x5f/0x70
 [<c02264cf>] pci_device_probe+0x2f/0x50
 [<c027dd8b>] driver_probe_device+0x3b/0xb0
 [<c027de80>] __driver_attach+0x0/0x60
 [<c027ded0>] __driver_attach+0x50/0x60
 [<c027d359>] bus_for_each_dev+0x69/0x80
 [<c027df05>] driver_attach+0x25/0x30
 [<c027de80>] __driver_attach+0x0/0x60
 [<c027d8ad>] bus_add_driver+0x8d/0xe0
 [<c02267a3>] pci_register_driver+0x83/0xa0
 [<fe0a93ef>] hpt366_ide_init+0xf/0x14 [hpt366]
 [<c013dfea>] sys_init_module+0x16a/0x220
 [<c01030bb>] sysenter_past_esp+0x54/0x75
Code: c2 85 c0 ba 01 00 00 00 75 cf 8b 75 00 85 f6 75 e1 eb c4 eb 0d 90

90 90 90 90 90 90 90 90 90 90 90 90 0f b6 4c 24 04 8b 54 24 08 <0f> b6 02 84 c0 74 0e 38 c8 74
0e 83 c2 08 0f b6 02 84 c0 75 f2

Signature · 9 lines
I sense much NT in you.
NT leads to Bluescreen.
Bluescreen leads to downtime.
Downtime leads to suffering.
NT is the path to the darkside.
Powerful Unix is.

Public Key: ftp://ftp.tallye.com/pub/lorenl_pubkey.asc
Fingerprint: CEE1 AAE2 F66C 59B5 34CA  C415 6D35 E847 0118 A3D2