]> git.baikalelectronics.ru Git - kernel.git/commit
dpaa2-switch: seed the buffer pool after allocating the swp
authorIoana Ciornei <ioana.ciornei@nxp.com>
Thu, 22 Jul 2021 12:15:51 +0000 (15:15 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Jul 2021 12:46:57 +0000 (05:46 -0700)
commit78a75e51bb92ae9f2aa9d54e32a8b58e990eee8f
tree0c0aaba346c19bc8a15793512cc0e1efa1830abc
parentc05f39c6b1d142d65fb04415691b88ba57ec35a7
dpaa2-switch: seed the buffer pool after allocating the swp

Any interraction with the buffer pool (seeding a buffer, acquire one) is
made through a software portal (SWP, a DPIO object).
There are circumstances where the dpaa2-switch driver probes on a DPSW
before any DPIO devices have been probed. In this case, seeding of the
buffer pool will lead to a panic since no SWPs are initialized.

To fix this, seed the buffer pool after making sure that the software
portals have been probed and are ready to be used.

Fixes: 385b693074b1 ("staging: dpaa2-switch: handle Rx path on control interface")
Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c