Hi all,
Self-review (with Sashiko AI assist) caught five real issues in v1's
NoC driver before the maintainer review cycle reached them, so
re-rolling promptly. v1:
https://lore.kernel.org/linux-arm-msm/cover.1780148149.git.github.com@herrie.org/
v2 changes (driver patch only; the binding header is unchanged from v1):
- MMFAB master port collision: mmfab_to_appss claimed port 2, but
that port was already owned by mmfab_mas_adm1_port0. Per the
fabric's port table the APPS_FAB gateway lives at port 11; fix
the DEFINE_QNODE so ADM1 DMA's arbitration vote on MMFAB is no
longer overwritten by the gateway.
- msm8660_rpm_commit() double-converted bandwidth units: it called
icc_units_to_bps() (which already returns bytes/s) and then
immediately divided by 8 "bits -> bytes", asking RPM for 1/8 of
the bandwidth that consumers had requested. Drop the spurious
divide.
- Fabric rate cache hoisted to provider scope and divided by the
fabric's own bus width rather than the triggering node's local
buswidth. A fabric has one shared hardware clock; using each
master's local buswidth makes the requested clk rate oscillate
depending on which master called icc_set_bw() last, and caching
the result on the node lets a subsequent update skip clk_set_rate
even though a different node has already moved the hardware. The
new layout adds desc->bus_width per fabric (AFAB/SFAB/DFAB=8,
MMFAB=16) and qp->rate as the single source of truth.
- msm8660_get_rpm() rewritten:
* returns ERR_PTR(-EPROBE_DEFER) when the RPM phandle resolves
but the device hasn't probed yet, instead of returning NULL
and silently disabling ARB forever;
* adds a device_link to the RPM device so the devres-managed
qcom_rpm struct can't be freed out from under us if the RPM
driver is unbound at runtime (previously a use-after-free
risk because we kept a pointer past put_device()).
Probe propagates IS_ERR(qp->rpm) up so the framework retries.
- devm_clk_bulk_get_optional() now distinguishes -EPROBE_DEFER
(propagated) from real "no clocks" (continue without scaling).
Previously every error was swallowed, which permanently disabled
clock scaling if the icc driver happened to probe before the
clock provider - which it usually does, given the core_initcall
ordering.
No functional change intended on the working paths; this is purely
correctness work.
Thanks,
Herman
Herman van Hazendonk (2):
dt-bindings: interconnect: qcom: add msm8660 fabric IDs
interconnect: qcom: add MSM8x60 NoC driver
drivers/interconnect/qcom/Kconfig | 10 +
drivers/interconnect/qcom/Makefile | 2 +
drivers/interconnect/qcom/msm8660.c | 1069 +++++++++++++++++
.../dt-bindings/interconnect/qcom,msm8660.h | 156 +++
4 files changed, 1237 insertions(+)
create mode 100644 drivers/interconnect/qcom/msm8660.c
create mode 100644 include/dt-bindings/interconnect/qcom,msm8660.h
--
2.43.0