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)
commit7aaa0f311e2df2704fa8ddb8ed681a3b5841d0bf
tree0c0aaba346c19bc8a15793512cc0e1efa1830abc
parent9d85a6f44bd5585761947f40f7821c9cd78a1bbe
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: 0b1b71370458 ("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