public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli <luca.ceresoli@bootlin.com>
To: Ayush Singh <ayush@beagleboard.org>
Cc: xypron.glpk@gmx.de, Jason Kridner <jkridner@beagleboard.org>,
	Deepak Khatri <lorforlinux@beagleboard.org>,
	d-gole@ti.com, Robert Nelson <robertcnelson@beagleboard.org>,
	Andrew Davis <afd@ti.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	David Gibson <david@gibson.dropbear.id.au>,
	Pantelis Antoniou <pantelis.antoniou@gmail.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>
Subject: Re: [Question] Status of user-space dynamic overlays API
Date: Wed, 30 Apr 2025 15:07:25 +0200	[thread overview]
Message-ID: <20250430150725.2d564abc@booty> (raw)
In-Reply-To: <d42100cb-eaa0-487f-aaaa-6d8f87bc0705@beagleboard.org>

Hello Ayush,

On Wed, 30 Apr 2025 15:48:27 +0530
Ayush Singh <ayush@beagleboard.org> wrote:

> On 2/23/25 01:43, Ayush Singh wrote:
> 
> > Hello everyone.
> >
> > I have been looking at ways to do runtime devicetree overlay 
> > application, and was just wondering what the current status of the 
> > different proposals [0], [1] were. They seem to be quite old and I 
> > think they were already rejected, but due to all the broken links, I 
> > am not really sure about the exact reasons. Also, maybe we now have 
> > the solutions to some the blockers at the time.
> >
> >
> > Let me fist go over some of the use cases where I think dynamic 
> > devicetree overlays can be useful. I am mostly interested in their use 
> > in single board computers like PocketBeagle 2 [2], Raspberry Pi [3], etc.
> >
> >
> > # Uses
> >
> > ## Dynamic Pin muxing
> >
> > A lot of SBC's aimed for creating hardware projects expose headers, 
> > where each pin can be used for multiple things like GPIO, I2C, PWM, 
> > etc, depending on the pinmux. I think Raspberry Pi has it's own 
> > solution to do userspace pinmux, but if userspace devicetree 
> > application was a thing, it could probably be used for this. 
> > Additionally, being able to use dynamic devicetree overlays for pin 
> > muxing would allow much easier transition to use proper device trees 
> > during production.
> >
> >
> > ## Dynamic Sensors/Devices
> >
> > Using devices such as sensors, external ADCs, EEPROMs, etc are also a 
> > common usecase in SBC's. A lot of current solutions seem to be 
> > designed around using user-space drivers in such cases. This is a bit 
> > of a shame since Linux kernel already has drivers for a lot of these 
> > drivers, and they are probably going to be of higher quality than most 
> > user space drivers.
> >
> >
> > # Challenges
> >
> > ## Security
> >
> > The concerns regarding security seemed to show up in the other 
> > proposals. There was a proposal to have a devicetree property to 
> > allow/deny the application of overlays in some nodes, with default 
> > being deny. Was it insufficient?
> >
> >
> > ## Memory Leaks
> >
> > Currently, updating/removing properties leaks memory. Was it one of 
> > the reasons for the rejection of previous proposals?
> >
> >
> > Maybe kernel already has some solutions more suited to my usecase that 
> > I am unware of?
> >
> >
> > [0]: 
> > https://lore.kernel.org/all/1417605808-23327-1-git-send-email-pantelis.antoniou@konsulko.com/#t
> >
> > [1]: 
> > https://lore.kernel.org/all/20161220190455.25115-1-xypron.glpk@gmx.de/
> >
> > [2]: https://www.beagleboard.org/boards/pocketbeagle-2
> >
> > [3]: https://www.raspberrypi.com/
> >
> >
> > Best Regards,
> >
> > Ayush Singh
> >  
> 
> Just trying to consolidate the discussion. Feel free to correct anything 
> wrong.
> 
> 
> - Rather a generic global overlay solution, a driver per connector 
> should be used.
> 
> - The board headers (e.g. PocketBeagle 2) should be treated as a single 
> connector and any peripherals on it can be treated as an addon-board.

I agree with both points.

To the best of my knowledge this is also the position that everybody
agrees on, except Andrew Davis.

That said, I think this topic desperately needs some official feedback
from device tree and dt-schema maintainers: about export-symbols in the
very first place, and about i2c-bus-extension immediately after.
Otherwise we're keeping on circling around the same ideas after having
discussed and refined them so many times.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

      reply	other threads:[~2025-04-30 13:07 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-22 20:13 [Question] Status of user-space dynamic overlays API Ayush Singh
2025-02-22 20:31 ` Heinrich Schuchardt
2025-02-24  5:58   ` Ayush Singh
2025-02-24  8:37 ` Geert Uytterhoeven
2025-02-24 10:09   ` Ayush Singh
2025-02-24 13:29     ` Herve Codina
2025-03-05  4:31     ` David Gibson
2025-03-10  5:22       ` Ayush Singh
2025-03-05  4:27   ` David Gibson
2025-02-24 11:24 ` Luca Ceresoli
2025-04-30 10:18 ` Ayush Singh
2025-04-30 13:07   ` Luca Ceresoli [this message]

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=20250430150725.2d564abc@booty \
    --to=luca.ceresoli@bootlin.com \
    --cc=afd@ti.com \
    --cc=ayush@beagleboard.org \
    --cc=d-gole@ti.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jkridner@beagleboard.org \
    --cc=lorforlinux@beagleboard.org \
    --cc=pantelis.antoniou@gmail.com \
    --cc=robertcnelson@beagleboard.org \
    --cc=xypron.glpk@gmx.de \
    /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