Commit c8d2819
net: macb: Fix RX ring refill issue after link up
When the link goes down, the receive pipeline is cleared but the RX
queue pointer register remains unchanged. This causes a critical issue
where some RX ring entries may contain invalid addresses after link up.
The problem manifests when:
1. An entry with an invalid address prevents rx_tail from advancing
(gem_rx() checks rxused as 0)
2. No gap exists between rx_prepared_head and rx_tail from previous
refill operations
3. gem_rx_refill() cannot refill entries because CIRC_SPACE() always
returns 0
4. RSR register reports exception with value 0x7
5. The hardware detected that the buffer was unavailable. The DMA will
reread the pointer each time it receives an end-of-frame signal until
a valid pointer is found, but the software cannot fill it.
This regression was introduced by commit 99537d5 which moved
mog_init_rings() from macb_mac_link_up() to macb_open(), leaving
the RX ring in an inconsistent state after link transitions.
Fix this by:
- Reinitializing RX rings on link up via mog_init_rings()
- Adding full_refill atomic counter to force complete ring refill
- Ensuring all entries are traversed and refilled after link up
- Resetting rx_tail and rx_prepared_head to 0
Fixes: 99537d5 ("net: macb: Relocate mog_init_rings() callback from macb_mac_link_up() to macb_open()")
Closes: #7200 (comment)
Signed-off-by: Xiaolei Wang <xiaolei.wang@windriver.com>1 parent 6e53895 commit c8d2819
2 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1285 | 1285 | | |
1286 | 1286 | | |
1287 | 1287 | | |
| 1288 | + | |
1288 | 1289 | | |
1289 | 1290 | | |
1290 | 1291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
725 | 725 | | |
726 | 726 | | |
727 | 727 | | |
728 | | - | |
729 | 728 | | |
730 | 729 | | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
731 | 737 | | |
732 | 738 | | |
| 739 | + | |
733 | 740 | | |
734 | 741 | | |
735 | 742 | | |
| |||
1275 | 1282 | | |
1276 | 1283 | | |
1277 | 1284 | | |
1278 | | - | |
1279 | | - | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
1280 | 1288 | | |
1281 | 1289 | | |
1282 | 1290 | | |
| |||
1412 | 1420 | | |
1413 | 1421 | | |
1414 | 1422 | | |
| 1423 | + | |
1415 | 1424 | | |
1416 | 1425 | | |
1417 | 1426 | | |
| |||
0 commit comments