Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 May 2009 15:52:06 -0700
From:      Xin LI <delphij@delphij.net>
To:        Alexander Sack <pisymbol@gmail.com>
Cc:        freebsd-current@freebsd.org, d@delphij.net
Subject:   Re: Broadcom bge(4) panics while shutting down
Message-ID:  <4A0CA096.4020706@delphij.net>
In-Reply-To: <3c0b01820905141505r5b8ea64bq42cdea70ee288015@mail.gmail.com>
References:  <3c0b01820905141202w113966dp4bfbab73d84d585@mail.gmail.com>	<4A0C7544.6010304@delphij.net>	<3c0b01820905141301h1b08fc0ay1e6a1676b5a149d4@mail.gmail.com>	<4A0C8F30.8080404@delphij.net> <3c0b01820905141505r5b8ea64bq42cdea70ee288015@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, Alexander,

Alexander Sack wrote:
[...]
>> @@ -3193,6 +3193,9 @@ bge_rxeof(struct bge_softc *sc)
>>                BGE_UNLOCK(sc);
>>                (*ifp->if_input)(ifp, m);
>>                BGE_LOCK(sc);
>> +
>> +               if (!(ifp->if_drv_flags & IFF_DRV_RUNNING))
>> +                       return;
>>        }
> 
> Xin this looks fine by me, I actually put this up in the while loop as
> I mentioned before which I think is functionality equivalent (can you
> gain some optimizations by putting in the while loop though compiler
> wise than a separate compilation unit?).

I think the two is not semantically the same...  For this case an
explicit 'return' would mean that no further actions, say the things
right after the while loop, would be taken.  In my opinion that this is
better since there is no protection over these DMA maps (which could
have been released elsewhere).

Note that I'm still not quite confident about the logic, we might just
narrowed but not closed the race completely - these
BGE_LOCK()/UNLOCK()'s could hit some problem if one thread has done
bge_stop() very quickly.  That would require more work, though, I don't
have a very good plan at this moment...

Cheers,
- --
Xin LI <delphij@delphij.net>	http://www.delphij.net/
FreeBSD - The Power to Serve!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (FreeBSD)

iEYEARECAAYFAkoMoJYACgkQi+vbBBjt66DULwCcCN8AjNLgQU7oiOyKeackBKar
V+YAoKHA6dDJymCi8rQEsr7h8m84KoW6
=HWBp
-----END PGP SIGNATURE-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A0CA096.4020706>