kernel freeze with Digiboard PC/X driver

From: Sergey Kononenko (sergk@kiyavia.crimea.ua)
Date: Sat Jul 06 2002 - 11:04:57 EST


        Hi, All.

Then I try to upgrade server (Dual PII-233), working on 2.2.20 kerel to 2.4.18.
And after loading driver for Digiboard PC/X serial multiport card (pcxx.o)
kernel imediatly freeze. I try 2.4.19-rc1 try compile this driver in
the kernel, but it is not solve the problem. Also I noticed that dirver
freeze kernel even in UP machine _wihtout_ digiboard card, but in 2.2.x it
correctly report that device not found.
I spent some time to explore this problem, and discover, that freeze happen
in pcxe_init() while calling function pcxxdelay() in this code (pcxx.c):

        for(crd=0; crd < numcards; crd++) {
                bd = &boards[crd];
                outb(FEPRST, bd->port);
                pcxxdelay(1);

                for(i=0; (inb(bd->port) & FEPMASK) != FEPRST; i++) {

But pcxxdelay is only wrapper for mdelay:

static void pcxxdelay(int msec)
{
        mdelay(msec);
}

I simply replace all calls of pcxxdelay by mdelay in pcxx.c and this solve
the problem! After that dirver work perfectly without any freezes. I can't
explain why calling mdelay in wrapper cause the problem an why this trivial
change fix freezing. May be this is bug in compiler optimizations, but I
compile kernel with standart gcc 2.95.3 and default optimization flags.

So I attach my patch in a hope, that somebody test it and this or more
correct patch will be included in official kernel.

P.S. Sorry for my bad English.

SergK.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Jul 07 2002 - 22:00:17 EST