Note: The following patches were made to the driver in the 3.8.13 kernel. There have been some changes
to the driver code since my previous set of patches (3.0.21 kernel) and things may be slightly different
again with a later kernel.
Freeze during initialisation
I now know the reason for this behaviour. Back in June 2013
Karol pointed me at a
posting in the kernel list
about a problem with some MIPS hardware. I've only just got round to checking it out (March 2014!) and
it turns out this does solve the start-up problem. In the words of
"Some Loongson boards (e.g. Lemote FuLoong mini-PC) use ISA/southbridge device (CS5536 general purpose
timer) for the timer interrupt. It starts running early and is already enabled during the PCI configuration,
during which there is a small window in pci_read_base() when the register access is temporarily disabled.
If the timer interrupts at this point, the system will hang. Fix this by adding a fixup that keeps the
register access always enabled."
The accompanying patch was applied to the driver that's in the MIPS architecture source tree.
What we need to do is add the following code to the driver pata_cs5536.c that we're using
which is in the directory drivers/ata/:
* The mfgpt timer interrupt is running early, so we must keep the south bridge
* mmio always enabled. Otherwise we may race with the PCI configuration which
* may temporarily disable it. When that happens and the timer interrupt fires,
* we are not able to clear it and the system will hang.
static void cs5536_isa_mmio_always_on(struct pci_dev *dev)
dev->mmio_always_on = 1;
PCI_CLASS_BRIDGE_ISA, 8, cs5536_isa_mmio_always_on);
I added it at the start of the functions following all the #includes."
The patch they provide is against the linux kernel 3.8. I have checked and the 3.2 driver is somewhat different.
Would be nice if someone with kernel access, or involved with the Linux kernel, would submit the patch. If this isn't possible, would be nice to build the Thinstation Linux kernel with this patch, because it makes these thin clients usable again.