]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r273606:
authorloos <loos@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 9 Jan 2015 02:51:06 +0000 (02:51 +0000)
committerloos <loos@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 9 Jan 2015 02:51:06 +0000 (02:51 +0000)
commit59382711f937b7dec2129248e81d063d2ac8e58e
tree37df4ccd412379eda86b1a6f2b6e545344d0b4db
parenta11f5b76d76842a87ad95ece38e2a906fe711a48
MFC r273606:

Fix cpsw_detach() to not panic when called from cpsw_attach().

For an unkown reason (at moment), sometimes if_cpsw cannot read from PHY
and fails to attach calling cpsw_detach() which end up in a panic.

Fix it by doing the proper check before detach the miibus and also fix the
leak of few variables.

And to actually make it work, ether_ifattach() has to be moved to the end
of cpsw_attach() to avoid a race where calling ether_ifdetach() before
domain_init() (which will only run later on) would make it crash at
INP_INFO_RLOCK() on in_pcbpurgeif0().

Tested on:    BBB (am335x)

git-svn-id: svn://svn.freebsd.org/base/stable/10@276875 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/arm/ti/cpsw/if_cpsw.c