Commit 6fc937d
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 5aa2f4e commit 6fc937d
2 files changed
+13
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1259 | 1259 | | |
1260 | 1260 | | |
1261 | 1261 | | |
| 1262 | + | |
1262 | 1263 | | |
1263 | 1264 | | |
1264 | 1265 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
775 | 775 | | |
776 | 776 | | |
777 | 777 | | |
778 | | - | |
779 | 778 | | |
780 | 779 | | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
781 | 787 | | |
782 | 788 | | |
| 789 | + | |
783 | 790 | | |
784 | 791 | | |
785 | 792 | | |
| |||
1327 | 1334 | | |
1328 | 1335 | | |
1329 | 1336 | | |
1330 | | - | |
1331 | | - | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
1332 | 1340 | | |
1333 | 1341 | | |
1334 | 1342 | | |
| |||
1453 | 1461 | | |
1454 | 1462 | | |
1455 | 1463 | | |
| 1464 | + | |
1456 | 1465 | | |
1457 | 1466 | | |
1458 | 1467 | | |
| |||
0 commit comments