[PATCH 0/4] clk: mediatek: Fix no-gate mux declarations

Sjoerd Simons sjoerd at collabora.com
Tue Dec 23 23:30:09 PST 2025


When booting a MT7981 board (OpenWRT One) with UBSAN, the following
error showed up:

```
UBSAN: shift-out-of-bounds in drivers/clk/mediatek/clk-mux.c:76:8
shift exponent 255 is too large for 64-bit type 'long unsigned int'
```

This is due to various infra muxes being declared as MUX_GATE_ even
though they don't actually have a gate.

First patch in this series adds a helper to make it easier to declare
muxes that neither have a gate nor update registers. This seems common
for MT798* infra muxes. The following ones corrects the incorrect mux
definitions by transitioning to this new declaration.

Signed-off-by: Sjoerd Simons <sjoerd at collabora.com>
---
Sjoerd Simons (4):
      clk: mediatek: clk-mux: Add helper for muxes without UPD
      clk: mediatek: Declare MT7981 infra muxes as no-gate muxes
      clk: mediatek: Declare MT7986 infra muxes as no-gate muxes
      clk: mediatek: Declare MT7988 infra muxes as no-gate muxes

 drivers/clk/mediatek/clk-mt7981-infracfg.c | 55 ++++++++-----------
 drivers/clk/mediatek/clk-mt7986-infracfg.c | 45 ++++++---------
 drivers/clk/mediatek/clk-mt7988-infracfg.c | 88 ++++++++++++++++--------------
 drivers/clk/mediatek/clk-mux.h             |  7 +++
 4 files changed, 93 insertions(+), 102 deletions(-)
---
base-commit: b927546677c876e26eba308550207c2ddf812a43
change-id: 20251224-mtk-not-a-gate-ec0b6b6851a8

Best regards,
-- 
Sjoerd Simons <sjoerd at collabora.com>




More information about the Linux-mediatek mailing list