[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rl_diag strangeness??



In trying to upgrade to 3.8, the rl driver complains
from rl_diag that loopback failed.  There is a bit of code
that doesn't make sense to me:

* Wait for it to propagate through the chip */

	DELAY(100000);
	for (i = 0; i < RL_TIMEOUT; i++) {
		status = CSR_READ_2(sc, RL_ISR);
		if ((status & (RL_ISR_TIMEOUT_EXPIRED|RL_ISR_RX_OK)) ==
								     ^^
		    (RL_ISR_TIMEOUT_EXPIRED|RL_ISR_RX_OK))
		    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
			break;
		DELAY(10);
	}
	if (i == RL_TIMEOUT) {
		printf("%s: diagnostic failed, failed to receive packet "
		    "in loopback mode\n", sc->sc_dev.dv_xname);
		error = EIO;
		goto done;
	}

It appears that the loop will always run RL_TIMEOUT cycles
because the test is for >both< RL_ISR_TIMEOUT_EXPIRED and RL_ISR_RX_OK.

On my systems, 3.7 runs the rl8169 fine, but fails the attach
with the above message.

I believe the marked code should be removed, leaving only the
test for either of the two status bits being true.

Anyone have an opinion?
    thanks
    Geoff Steckel gwes_(_at_)_oat_(_dot_)_com