mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jonas Richardsen <jonasrichardsen@emlix.com>
To: barebox@lists.infradead.org
Subject: raspi: should vc fixups update properties of existing nodes?
Date: Wed, 10 Apr 2024 11:59:21 +0200	[thread overview]
Message-ID: <3e01cb35-858c-4aef-b0c6-564cc890086d@emlix.com> (raw)

Hi,

the function `rpi_vc_fdt_parse` in 
arch/arm/boards/raspberry-pi/rpi-common.c registers multiple fixups that 
take over nodes from the video core device tree. These fixups make use 
of the `of_copy_property` function to copy the properties of the 
respective node. In the case of already existing nodes (and properties), 
this function duplicates the properties instead of updating them.

If the intention is to not override existing properties, one should 
probably check for the existence of each property before copying to 
avoid kernel warnings and misconfiguration due to duplicate properties.

If existing properties are supposed to be updated, this could be 
achieved by switching to `of_set_property` (or something similar). Note 
that this notion of overriding properties also exists in video core, see 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/broadcom/bcm2711.dtsi?h=v6.8#n412 
for an example.

I would be glad to submit a patch for either case.

Regards,

Jonas




             reply	other threads:[~2024-04-10 10:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10  9:59 Jonas Richardsen [this message]
2024-04-10 11:51 ` Ahmad Fatoum
2024-04-15  8:14   ` [PATCH] of: do not copy properties if they already exist in the destination Jonas Richardsen
2024-04-15  8:30     ` Ahmad Fatoum
2024-04-15 12:26       ` [PATCH v2] " Jonas Richardsen
2024-04-16 13:38         ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e01cb35-858c-4aef-b0c6-564cc890086d@emlix.com \
    --to=jonasrichardsen@emlix.com \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox