Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: airoha: Wait for NPU PPE configuration to complete in airoha_ppe_offload_setup()

In order to properly enable flowtable hw offloading, poll
REG_PPE_FLOW_CFG register in airoha_ppe_offload_setup routine and
wait for NPU PPE configuration triggered by ppe_init callback to complete
before running airoha_ppe_hw_init().

Fixes: 00a7678310fe3 ("net: airoha: Introduce flowtable offload support")
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Link: https://patch.msgid.link/20260414-airoha-wait-for-npu-config-offload-setup-v2-1-5a9bf6d43aee@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Lorenzo Bianconi and committed by
Jakub Kicinski
f3206328 52bcb57a

+28
+28
drivers/net/ethernet/airoha/airoha_ppe.c
··· 1356 1356 return npu; 1357 1357 } 1358 1358 1359 + static int airoha_ppe_wait_for_npu_init(struct airoha_eth *eth) 1360 + { 1361 + int err; 1362 + u32 val; 1363 + 1364 + /* PPE_FLOW_CFG default register value is 0. Since we reset FE 1365 + * during the device probe we can just check the configured value 1366 + * is not 0 here. 1367 + */ 1368 + err = read_poll_timeout(airoha_fe_rr, val, val, USEC_PER_MSEC, 1369 + 100 * USEC_PER_MSEC, false, eth, 1370 + REG_PPE_PPE_FLOW_CFG(0)); 1371 + if (err) 1372 + return err; 1373 + 1374 + if (airoha_ppe_is_enabled(eth, 1)) 1375 + err = read_poll_timeout(airoha_fe_rr, val, val, USEC_PER_MSEC, 1376 + 100 * USEC_PER_MSEC, false, eth, 1377 + REG_PPE_PPE_FLOW_CFG(1)); 1378 + 1379 + return err; 1380 + } 1381 + 1359 1382 static int airoha_ppe_offload_setup(struct airoha_eth *eth) 1360 1383 { 1361 1384 struct airoha_npu *npu = airoha_ppe_npu_get(eth); ··· 1389 1366 return PTR_ERR(npu); 1390 1367 1391 1368 err = npu->ops.ppe_init(npu); 1369 + if (err) 1370 + goto error_npu_put; 1371 + 1372 + /* Wait for NPU PPE configuration to complete */ 1373 + err = airoha_ppe_wait_for_npu_init(eth); 1392 1374 if (err) 1393 1375 goto error_npu_put; 1394 1376