All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next v3 0/3] dinghai: firmware handshake, MSI-X pools and async event queues
@ 2026-09-21  6:51 han.junyang
  2026-09-21  6:56 ` [PATCH net-next v3 1/3] dinghai: add firmware version check and RISC-V readiness polling han.junyang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: han.junyang @ 2026-09-21  6:51 UTC (permalink / raw)
  To: andrew+netdev, davem, edumazet, kuba, pabeni, horms
  Cc: linux-kernel, netdev, han.junyang, ran.ming, han.chengfei,
	zhang.yanze

From: Junyang Han <han.junyang@zte.com.cn>

This series continues the DingHai (ZXDH) PF driver bring-up: after PCI
probing, it verifies the firmware version contract, waits for the
RISC-V management core to become ready, sets up the MSI-X interrupt
pools, and creates the async event queues through which the firmware
will report events.

Some notes on the IRQ design:

The vector space is partitioned into per-purpose pools (async, RDMA,
vq). Event queues share a vector through an atomic notifier chain
attached to the IRQ, and the sharing degree is governed by pool
thresholds. The IRQ table hangs off a void *priv in the shared core
device: the PF, MPF and SF core devices each carry a different pool
layout behind that pointer, so a type-specific struct in en_pf.c keeps
the shared header free of PF-only details.

Changes in v3:
- Unmap the modern config MMIO regions on the probe error paths added
  in this series; they used to leak when the fw compat check or the
  RISC-V readiness wait failed.
- Skip the RISC-V readiness wait for firmware without the compat
  region: the erased patch field read as 0xffff and defeated the skip.
- Make fw_minor unsigned so firmware minor versions >= 128 are not
  rejected through sign wrap.
- Balance the per-CPU IRQ accounting on release, so pool teardown does
  not trip its leftover WARN; set the IRQ affinity for real with
  irq_set_affinity_and_hint() instead of only updating the hint; name
  IRQs after their pool instead of a hardcoded prefix; assert that the
  pool is empty at free instead of force-releasing leftovers.
- Clear eq->irq when the async IRQ request fails, so teardown does not
  treat the ERR_PTR as a live IRQ.

Review findings not taken:

- xa_alloc() with a NULL entry does not fail: __xa_alloc() turns a
  NULL entry into the internal zero entry as a reservation
  (lib/xarray.c), which is the reservation semantics the pool relies
  on.
- BAR 0 length checks against a truncated bar: the bar layout is part
  of the board firmware contract and the driver does not defend
  against a broken device, as settled during the review of the
  earlier device bring-up series (Andrew Lunn).
- The 200 s compat region wait is the cold boot budget and is
  bounded; firmware that never populates the region is handled by
  the module id check, which defers to the readiness wait.
- Torn reads of the compat block: the firmware populates the region
  with a single write, so there is no partial-write window.

Changes in v2:
- Convert both firmware readiness polls to readx_poll_timeout()
  (Andrew Lunn).
- Read the fw compat block field by field through ioread*() accessors
  instead of an ioread32_rep() bulk copy, which misplaces the u8/u16
  fields on big-endian; no __le annotations are needed since each
  accessor converts from little-endian (Andrew Lunn).
- Use kref for the IRQ reference count (Andrew Lunn).

Junyang Han (3):
  dinghai: add firmware version check and RISC-V readiness polling
  dinghai: add MSI-X interrupt pools
  dinghai: add async event queue for firmware notifications

 drivers/net/ethernet/zte/dinghai/Makefile   |   2 +-
 drivers/net/ethernet/zte/dinghai/en_pf.c    | 231 +++++++++++
 drivers/net/ethernet/zte/dinghai/en_pf.h    |  57 +++
 drivers/net/ethernet/zte/dinghai/zxdh_eq.c  | 146 +++++++
 drivers/net/ethernet/zte/dinghai/zxdh_eq.h  |  61 +++
 drivers/net/ethernet/zte/dinghai/zxdh_irq.c | 405 ++++++++++++++++++++
 drivers/net/ethernet/zte/dinghai/zxdh_irq.h |  72 ++++
 7 files changed, 973 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/ethernet/zte/dinghai/zxdh_eq.c
 create mode 100644 drivers/net/ethernet/zte/dinghai/zxdh_eq.h
 create mode 100644 drivers/net/ethernet/zte/dinghai/zxdh_irq.c
 create mode 100644 drivers/net/ethernet/zte/dinghai/zxdh_irq.h

-- 
2.27.0

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-09-28 12:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21  6:51 [PATCH net-next v3 0/3] dinghai: firmware handshake, MSI-X pools and async event queues han.junyang
2026-09-21  6:56 ` [PATCH net-next v3 1/3] dinghai: add firmware version check and RISC-V readiness polling han.junyang
2026-09-22 10:11   ` [PATCH net-next v3 1/3] dinghai: add firmware version check and? " Simon Horman
2026-09-28 12:00     ` han.junyang
2026-09-21  6:59 ` [PATCH net-next v3 2/3] dinghai: add MSI-X interrupt pools han.junyang
2026-09-22 10:09   ` Simon Horman
2026-09-24 16:00     ` Jakub Kicinski
2026-09-25 13:16       ` Simon Horman
2026-09-28 12:10     ` han.junyang
2026-09-21  7:03 ` [PATCH net-next v3 3/3] dinghai: add async event queue for firmware notifications han.junyang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.