[PATCH v4 1/3] media: dt-bindings: rockchip,vdec: Add alternative reg-names order for RK35{76,88}

Nicolas Dufresne nicolas.dufresne at collabora.com
Thu Feb 26 13:56:30 PST 2026


Le jeudi 26 février 2026 à 20:59 +0000, Conor Dooley a écrit :
> On Thu, Feb 26, 2026 at 02:45:11PM -0500, Nicolas Dufresne wrote:
> > Le jeudi 26 février 2026 à 18:43 +0000, Conor Dooley a écrit :
> > > On Thu, Feb 26, 2026 at 12:46:53PM +0200, Cristian Ciocaltea wrote:
> > > > With the introduction of the RK3588 SoC, and RK3576 afterwards, two more
> > > > register blocks have been provided for the video decoder unit.
> > > > 
> > > > However, the binding does not properly describe the new hardware layout,
> > > > as it breaks the convention expecting the unit address to indicate the
> > > > start of the first register range, i.e. 'function' block is listed
> > > > before 'link' instead of the opposite.
> > > 
> > > I don't understand this commit message or rationale for an ABI break.
> > > Changing the unit address seems like a "free" fix to your problem,
> > > especially when reg-names is not a required property that you can rely
> > > on. Actually, there may be a bug in the driver - it expects reg-names
> > > for rk3576-vdec and rk3588-vdec but the binding doesn't mandate their
> > > presence for those devices.
> > 
> > If the bindings had been held instead of released early, the order would be what
> > is done in this patch for sure, and no one would have complained. These binding
> > have never been used by anyone so far, and what you are asking is to create a
> 
> 20:35:32 conor /stuff/linux$ rg "rk3576-vdec"
> 
> arch/arm64/boot/dts/rockchip/rk3576.dtsi
> 1283:			compatible = "rockchip,rk3576-vdec";
> 
> 20:35:34 conor /stuff/linux$ rg rk3588-vdec
> 
> arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
> 1357:		compatible = "rockchip,rk3588-vdec";
> 1389:		compatible = "rockchip,rk3588-vdec";
> 
> These look like users, at least at first look. Some elaboration on that
> would be good - impact on users definitely should be covered in the
> commit message of an ABI break.

Right, let me add some context. rk3576.dtsi/rk3588-base.dtsi became a user of
the binding in 7.0-rc1, which is a pre-release. In fact, I initially thought the
bindings was merged at the same time, which Krzysztof highlighted as my mistake.
And the driver modification that utilize multiple reg ranges was also introduced
in 7.0-rc1. More clarification on that below.

> 
> > DTS that deviate from the vendor provided documentation for the IP base address.
> > I know you have all technical fancy reasoning, but I like when things are
> > functional and effective to work with.
> 
> FWIW, I don't think you were trying to be dismissive, just trying to
> make a valid point about usability being important, but providing clear
> justifications for why the order of properties should be changed (or
> other similar ABI breaks) is really important. This is v4, and the
> rationale you've given here about the documentation, which is the actual
> motivation for changing things around, doesn't appear in the commit
> message, even after a back and forth with Krzysztof in an earlier
> version.

Ack, I'm not the one doing the work (just a reviewer), but was involved in
picking the work, and trying to learn enough so I can perhaps catch this next
time.

> 
> > > Deprecating the order also makes little sense to me, given that some of
> > > these devices only have one reg entry, which as far as I can tell from
> > > looking at the driver *is* the "function" region, so it can never be
> > > entirely deprecated.
> > 
> > What I'd like to see, is a binding expression that behave like a set, not a
> > list, and leave the ordering open. As people keep repeating, there is nothing in
> > a binding that assist to define the right ordering (its not address or base
> > addres aware). That basically means, we can't as reviewer see that ordering is
> > going to imposing using a base address in the unit name (which is a convenience,
> > not a rule I suppose) that differ from the vendor documented base address.
> > 
> > By explicitly removing the ordering in the binding, we create a strict rule that
> > driver should retrieve this by name, and never assume the ordering, which I
> > personally like.
> > 
> > thoughts ?
> 
> Yeah, you can do this, but to avoid potential breaks you have to do it
> from the start, not after the fact. Probably there's bindings that get
> acked every day that do do this. Even the retcon is okay to do when
> reg-names is mandated by the binding and the users use reg-names in my
> opinion.

I think from the above analyses, since the usage only starts in rc1, we have
room for improving it knowing we aren't creating problem for anyone. Note that I
have no idea what the syntax is to "do this", and I doubt either Detlev or
Cristian have a clue.

> 
> In this case, the driver is currently buggy, because, as I mentioned, it
> uses reg-names without reg-names being required on the platforms with
> more than 1 reg property. Probably the binding should make reg-names
> mandatory for these platforms even without this patch, but it *has* to
> IMO for this proposed change to be applicable.

That forced me to check the driver. So for RK33xx and older, there is only one
range, and the driver will just pick the one entry expected:


	if (rkvdec->variant->has_single_reg_region) {
		rkvdec->regs = devm_platform_ioremap_resource(pdev, 0);
		if (IS_ERR(rkvdec->regs))
			return PTR_ERR(rkvdec->regs);
	} else {
		rkvdec->regs = devm_platform_ioremap_resource_byname(pdev, "function");
		if (IS_ERR(rkvdec->regs))
			return PTR_ERR(rkvdec->regs);

		rkvdec->link = devm_platform_ioremap_resource_byname(pdev, "link");
		if (IS_ERR(rkvdec->link))
			return PTR_ERR(rkvdec->link);
	}


Where for RK35xx variants, it only pick the resources by name. I don't see the
bug that you see, but I believe this was just a supposition, that you didn't
check the code.

So what happened with the binding, is that in preparation for the new SoC, they
added the named range, but probably without really realizing that there was an
ordering imposed, or realizing the order was far from ideal.

> 
> But anyway, the takeaway from my original mail should be "Conor is not
> happy with the rationale the commit message provides for this change,
> as it doesn't explain why you want to do it". I necessarily object to
> the change itself.

Understood, I think Cristian is a bit sandwich between my rational to make
things match the doc, and Krzysztof requesting to preserve the ABI. I think
that's fixable, but again, if there is a syntax to just remove the ordering from
there, knowing there is no user of that order in released kernel yet, that would
be my preference over deprecation syntax.

regards,
Nicolas

> 
> Conor.
> 
> > > > Since the binding changes have been already released and a fix would
> > > > bring up an ABI break, mark the current 'reg-names' ordering as
> > > > deprecated and introduce an alternative 'link,function,cache' listing
> > > > which follows the address-based ordering according to the TRM.
> > > > 
> > > > Additionally, drop the 'reg' description items as the order is not fixed
> > > > anymore, while the information they offer is not very relevant anyway.
> > > > 
> > > > Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea at collabora.com>
> > > > ---
> > > >  .../devicetree/bindings/media/rockchip,vdec.yaml     | 20 ++++++++++++-----
> > > > ---
> > > >  1 file changed, 12 insertions(+), 8 deletions(-)
> > > > 
> > > > diff --git a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
> > > > b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
> > > > index 809fda45b3bd..c513b68d2c72 100644
> > > > --- a/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
> > > > +++ b/Documentation/devicetree/bindings/media/rockchip,vdec.yaml
> > > > @@ -28,16 +28,20 @@ properties:
> > > >  
> > > >    reg:
> > > >      minItems: 1
> > > > -    items:
> > > > -      - description: The function configuration registers base
> > > > -      - description: The link table configuration registers base
> > > > -      - description: The cache configuration registers base
> > > > +    maxItems: 3
> > > >  
> > > >    reg-names:
> > > > -    items:
> > > > -      - const: function
> > > > -      - const: link
> > > > -      - const: cache
> > > > +    oneOf:
> > > > +      - items:
> > > > +          - const: link
> > > > +          - const: function
> > > > +          - const: cache
> > > > +      - items:
> > > > +          - const: function
> > > > +          - const: link
> > > > +          - const: cache
> > > > +        deprecated: true
> > > > +        description: Use link,function,cache block order instead.
> > > >  
> > > >    interrupts:
> > > >      maxItems: 1
> > > > 
> > > > -- 
> > > > 2.52.0
> > > > 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part
URL: <http://lists.infradead.org/pipermail/linux-rockchip/attachments/20260226/fae65c01/attachment.sig>


More information about the Linux-rockchip mailing list