On 27/01/2016 18:15, Kevin O'Connor wrote:
Oh, I understand and agree that recovery isn't worth while. My concern is that a hardware error here will appear as a silent hang. Breaking out of the loop eventually, calling warn_timeout(), and returning an error code has the benefit of some debugging from seabios and likely some strong error messages from the calling app.
As I'm more interested in the debugging then the recovery, a simple addition like this would be an improvement IMO:
u32 end = calc_timeout(30000); // 30 second max timeout for (;;) { ... if (timer_check(end)) { warn_timeout(); return DISK_RET_ECONTROLLER; } usleep(50); }
I understood this to be your proposal. The problem is that I wouldn't be able to send any further requests later, because of the way the HBA is programmed.
The only alternative would be a bare bones recovery, which however (being bare bones) would not include a timeout and thus would have the same problem we're trying to fix.
Paolo