[PATCH] HPT37x: read f_CNT saved by BIOS from port

The undocumented register BIOS uses for saving f_CNT seems to only be
mapped to I/O space while all the other HPT3xx regs are dual-mapped. Looks
like another HighPoint's dirty trick. With this patch, the deadly kernel
oops on the cards having the modern HighPoint BIOSes is now at last gone!

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Sergei Shtylyov and committed by
Linus Torvalds
f13c1526 26c068da

+3 -3
+3 -3
drivers/ide/pci/hpt366.c
··· 1035 1035 * First try reading the register in which the HighPoint BIOS 1036 1036 * saves f_CNT value before reprogramming the DPLL from its 1037 1037 * default setting (which differs for the various chips). 1038 + * NOTE: This register is only accessible via I/O space. 1039 + * 1038 1040 * In case the signature check fails, we'll have to resort to 1039 1041 * reading the f_CNT register itself in hopes that nobody has 1040 1042 * touched the DPLL yet... 1041 1043 */ 1042 - pci_read_config_dword(dev, 0x70, &temp); 1044 + temp = inl(pci_resource_start(dev, 4) + 0x90); 1043 1045 if ((temp & 0xFFFFF000) != 0xABCDE000) { 1044 - int i; 1045 - 1046 1046 printk(KERN_WARNING "HPT37X: no clock data saved by BIOS\n"); 1047 1047 1048 1048 /* Calculate the average value of f_CNT */