Here comes an updated sw reset code. The previous one
accessed registers between spin_{lock,unlock}_irq() pair,
which was a bug if called from isp116x_stop() with irqs
disabled.

I also moved the mdelay(1) before the test in the loop. On
one of my boards, the reset caused trouble while it was
claimed to be ready right after the reset; this change made
it working.

Olav



static void isp116x_sw_reset(struct isp116x *isp116x)
{
        int tmp = 20;
        unsigned long flags;

        spin_lock_irqsave(&isp116x->lock, flags);

        isp116x_write_reg16(isp116x, HCSWRES, HCSWRES_MAGIC);
        isp116x_write_reg32(isp116x, HCCMDSTAT, OHCI_HCR);
        while (--tmp) {
                mdelay(1);
                if (!(isp116x_read_reg32(isp116x, HCCMDSTAT) & OHCI_HCR))
                        break;
        }
        if (!tmp)
                ERR("Software reset timeout\n");

        spin_unlock_irqrestore(&isp116x->lock, flags);
}




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to