]> git.dujemihanovic.xyz Git - u-boot.git/commit
net: eth-uclass: guard against reentrant eth_init()/eth_halt() calls
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Fri, 26 Apr 2024 08:02:24 +0000 (10:02 +0200)
committerTom Rini <trini@konsulko.com>
Wed, 15 May 2024 16:46:47 +0000 (10:46 -0600)
commitef9d4da6c92b07f0668f059d0cdc51eb34ed947e
treef1c9b5e3dcb2d5fc3c5905a9cd260f5040af8165
parent85e2c6900ea3282b766ffc37c71f035b0f47395f
net: eth-uclass: guard against reentrant eth_init()/eth_halt() calls

With netconsole, any log message can result in an eth_init(), possibly
causing an reentrant call into eth_init() if a driver's ops print
anything:

    eth_init() -> driver.start() -> printf() -> netconsole -> eth_init()
    eth_halt() -> driver.stop() -> printf() -> netconsole -> eth_init()

Rather than expecting every single Ethernet driver to handle this case,
prevent the reentrant calls in eth_init() and eth_halt().

The issue was noticed on an AM62x board, where a bootm after
simultaneous netconsole and TFTP would result in a crash.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1350550/sk-am62a-lp-am65_cpsw_nuss_port-error-in-u-boot-while-using-netconsole-functionality/
net/eth-uclass.c