News: 0001478787

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

New Power Sequencing Driver Subsystem Merged For Linux 6.11

([Hardware] 5 Hours Ago Power Sequencing Subsystem)


There's a new driver subsystem being introduced in the Linux 6.11 kernel for power sequencing.

Linaro engineer Bartosz Golaszewski has been working on this power sequencing framewortk stemming from a need of dealing with Bluetooth and WiFi support on Qualcomm hardware. Due to some components sharing a power-up sequence and not wanting multiple drivers to clash over the powering up of the hardware, the power sequencing framework will basically mediate the process on relevant hardware. This power sequencing framework can also be useful for bringing up PCI devices before they are detected on the PCIe bus.

Golaszewski explained in [1]the merge request :

"I'm sending this early as this is the initial pull-request for a new driver subsystem living under drivers/power/sequencing/. I'll try to be brief here and allow myself to link the cover letter from the last time the series was sent in its entirety[1] (as opposed to smaller chunks targetting specific maintainers) for a very detailed description of the problem and the solution. I'll just stick to the key points below.

This has been in development since last year's Linux Plumbers Conference and was inspired by the need to enable support upstream for Bluetooth/WLAN chips on Qualcomm platforms.

The main problem we're fixing is powering up devices which are represented as separate objects in the kernel (binding to different drivers) but which share parts of the power-up sequence and thus need some kind of a mediator who knows the possible interactions and can assure they don't interfere with neither device's bring up. An example of such an inter-driver interaction is the WCN family of BT/WLAN chips from Qualcomm of which some models require the user to observe a certain delay between driving the bt-enable and wlan-enable GPIOs.

This is not a new problem but up to this point all attempts at addressing it ended up hitting one wall or another and being dropped. The main obstacle was the fact that most these attempts tried to introduce the concept of a "power sequence" into the device-tree bindings which breaks the main DT rule: describe the hardware, not its behavior. The solution I proposed focuses on making the power sequencer drivers interpret the actual HW description flexibly. More details on that are in the linked cover letter.

The second problem fixed here is powering up PCI devices before they are detected on the bus. This is achieved by creating special platform devices for device-tree nodes describing hard-wired PCI devices which bind to the so-called PCI power control drivers which enable required resources and trigger a bus rescan once the controlled device is up then setup the correct devlink hierarchy for power-management.

By combining the two new frameworks we implemented the power sequencing PCI power control driver which is capable of powering up the WLAN modules of the QCom WCN family of chipsets.

All this has spent a significant amount of time in linux-next and enabled WLAN/BT support on several Qualcomm platforms. To further prove that this is useful and needed: right after this was picked up into next, I was sent a series using the subsystem for a similar use-case on Amlogic platforms.

This PR contains the core power sequencing framework, the first driver, PCI changes using the pwrseq library (blessed by Bjorn Helgaas) and some fixes that came later."

Linus Torvalds has already merged this new power sequencing subsystem that now lives under drivers/power/sequencing/ within Linux Git.



[1] https://lore.kernel.org/linux-pm/20240712091008.14815-1-brgl@bgdev.pl/



phoronix

A new koan:
If you have some ice cream, I will give it to you.
If you have no ice cream, I will take it away from you.
It is an ice cream koan.