Re: [PATCH v5] arm64: dts: ti: k3-j784s4-main: Fix mux-reg-masks in serdes_ln_ctrl

From: Andrew Davis
Date: Fri Feb 16 2024 - 10:09:21 EST


On 2/15/24 10:56 PM, Siddharth Vadapalli wrote:
On 24/02/13 11:08AM, Andrew Davis wrote:
On 2/13/24 3:19 AM, Peter Rosin wrote:
Hi!

2024-02-13 at 09:03, Siddharth Vadapalli wrote:
From: Chintan Vankar <c-vankar@xxxxxx>

Change offset in mux-reg-masks property for serdes_ln_ctrl node
since reg-mux property is used in compatible.

Fixes: 2765149273f4 ("mux: mmio: use reg property when parent device is not a syscon")
Signed-off-by: Chintan Vankar <c-vankar@xxxxxx>
Acked-by: Andrew Davis <afd@xxxxxx>
Signed-off-by: Siddharth Vadapalli <s-vadapalli@xxxxxx>
---
...

+ mux-reg-masks = <0x0 0x3>, <0x4 0x3>, /* SERDES0 lane0/1 select */
+ <0x8 0x3>, <0xc 0x3>, /* SERDES0 lane2/3 select */
+ <0x10 0x3>, <0x14 0x3>, /* SERDES1 lane0/1 select */
+ <0x18 0x3>, <0x1c 0x3>, /* SERDES1 lane2/3 select */
+ <0x20 0x3>, <0x24 0x3>, /* SERDES2 lane0/1 select */
+ <0x28 0x3>, <0x2c 0x3>; /* SERDES2 lane2/3 select */
idle-states = <J784S4_SERDES0_LANE0_PCIE1_LANE0>,
<J784S4_SERDES0_LANE1_PCIE1_LANE1>,
<J784S4_SERDES0_LANE2_IP3_UNUSED>,

Ouch. I suspect there is a similar problem in
arch/arm64/boot/dts/ti/k3-j721e-mcu-wakeup.dtsi:


fss: bus@47000000 {
compatible = "simple-bus";
reg = <0x0 0x47000000 0x0 0x100>;
#address-cells = <2>;
#size-cells = <2>;
ranges;

hbmc_mux: mux-controller@47000004 {
compatible = "reg-mux";
reg = <0x00 0x47000004 0x00 0x2>;
#mux-control-cells = <1>;
- mux-reg-masks = <0x4 0x2>; /* HBMC select */
+ mux-reg-masks = <0x0 0x2>; /* HBMC select */
};

Who knows what non-upstreamed devices and devicetrees are affected?
I guess we need to revert 2765149273f4 ("mux: mmio: use reg property
when parent device is not a syscon") unless someone sees a sane way
to fix this.

There are only two in-tree nodes with "reg-mux" with a reg property: the
one this patch fixes, and the hbmc_mux you point out, both in TI devices.
I'd say it is safe to assume we are the only users, and our non-upstreamed
DTs depend on that patch, reverting it would cause more issues for
out-of-tree users than just fixing the two broken nodes above.

Peter,

Is it alright for this patch to be merged, given Andrew's response above?
The problem with "hbmc_mux" node that you pointed out above could be fixed
by another patch. Please let me know.

The hbmc_mux fix is now also posted:

https://lore.kernel.org/linux-arm-kernel/20240215141957.13775-1-afd@xxxxxx/

Andrew


Regards,
Siddharth.