Skip to contentSkip to conversation

Mainline kernel on a cellphone

Ksummit-discuss Pavel Machek 27 participants 84 messages Jul 23, 2015 – Aug 29, 2015

lore
Share & tools
lore
#0 lore raw

Hi!

(Please cc me on replies).

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Interested people:

Sebastian Reichel <[email protected]>
Pali Rohár <[email protected]>

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#1 lore raw
Quoted 8 lines · Pavel Machek

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 4 lines

Interested people:

Sebastian Reichel <[email protected]>
Pali Rohár <[email protected]>

I'm adding Björn Andersson <[email protected]> to this list.

Björn has as of yesterday booted a mainline kernel on the SONY Xperia Z3 and his company has demonstrated strong interest in getting the mainline kernel to run on their handsets.
https://plus.google.com/102276447148493441479/posts/amRvpE8piSw

Yours,
Linus Walleij

#2 lore raw
Quoted 15 lines · Linus Walleij
Quoted 8 lines · Pavel Machek

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 4 lines

Interested people:

Sebastian Reichel <[email protected]>
Pali Rohár <[email protected]>

Quoted 6 lines

I'm adding Björn Andersson <[email protected]> to this list.

Björn has as of yesterday booted a mainline kernel on the SONY Xperia Z3 and his company has demonstrated strong interest in getting the mainline kernel to run on their handsets.
https://plus.google.com/102276447148493441479/posts/amRvpE8piSw

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

http://lists.infradead.org/pipermail/linux-arm-kernel/2011-December/078428.html

Signed-off-by HeungJun, Kim <riverful.kim at samsung.com>
Signed-off-by Kyungmin Park <kyungmin.park at samsung.com>

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#3 lore raw

2015-07-23 21:14 GMT+09:00 Pavel Machek <[email protected]>:

Quoted 23 lines · Linus Walleij
Quoted 15 lines · Pavel Machek
Quoted 9 lines

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 4 lines

Interested people:

Sebastian Reichel <[email protected]>
Pali Rohár <[email protected]>

Quoted 6 lines

I'm adding Björn Andersson <[email protected]> to this list.

Björn has as of yesterday booted a mainline kernel on the SONY Xperia Z3 and his company has demonstrated strong interest in getting the mainline kernel to run on their handsets.
https://plus.google.com/102276447148493441479/posts/amRvpE8piSw

Quoted 6 lines

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

http://lists.infradead.org/pipermail/linux-arm-kernel/2011-December/078428.html

Signed-off-by HeungJun, Kim <riverful.kim at samsung.com>
Signed-off-by Kyungmin Park <kyungmin.park at samsung.com>

Interesting topic also for me. We were (and still are) spending significant effort so Trats (~Galaxy S 2 for Tizen) and Trats2 devices (Galaxy S III released for Tizen) would be fully supported by mainline. The same we did more recently for Gear 2 smartwatch. Although it is not a cellphone but fits to a mobile device category.

Standard Debian works fine on them. With a mobile operating system - like Tizen - it gets more difficult.

Most of the drivers are there but few important SoC components are missing (for example camera for Gear 2). One of the obstacles here was lack of public firmware which prevented mainlining some of the drivers (e.g. FIMC - the camera).

Best regards,
Krzysztof

#4 lore raw
Quoted 14 lines · Krzysztof Kozlowski

2015-07-23 21:14 GMT+09:00 Pavel Machek <[email protected]>:

Quoted 13 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

I'm adding Björn Andersson <[email protected]> to this list.

Björn has as of yesterday booted a mainline kernel on the SONY Xperia Z3 and his company has demonstrated strong interest in getting the mainline kernel to run on their handsets.
https://plus.google.com/102276447148493441479/posts/amRvpE8piSw

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

http://lists.infradead.org/pipermail/linux-arm-kernel/2011-December/078428.html

Quoted 8 lines
Quoted 2 lines
Signed-off-by HeungJun, Kim <riverful.kim at samsung.com>
Signed-off-by Kyungmin Park <kyungmin.park at samsung.com>

Interesting topic also for me. We were (and still are) spending significant effort so Trats (~Galaxy S 2 for Tizen) and Trats2 devices (Galaxy S III released for Tizen) would be fully supported by mainline. The same we did more recently for Gear 2 smartwatch. Although it is not a cellphone but fits to a mobile device category.

Can I get Galaxy S III and use mainline or that? If not... can I get Trats or Trats2 device somehow?

Quoted 2 lines

Standard Debian works fine on them. With a mobile operating system - like Tizen - it gets more difficult.

What do you use for desktop in Debian? I'm using MATE on n900, and it is almost usable. I have cellular calls working (but audio quality is awful). But MATE is so usable thanks to n900's keyboard and stylus... (and I'm still searching for web browser that works within 256MB ram).

Quoted 4 lines

Most of the drivers are there but few important SoC components are missing (for example camera for Gear 2). One of the obstacles here was lack of public firmware which prevented mainlining some of the drivers (e.g. FIMC - the camera).

You mean.. there is not even redistributable firmware binary?
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#5 lore raw
Quoted 18 lines · Pavel Machek
Quoted 17 lines · Krzysztof Kozlowski

2015-07-23 21:14 GMT+09:00 Pavel Machek <[email protected]>:

Quoted 15 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

I'm adding Björn Andersson <[email protected]> to this list.

Björn has as of yesterday booted a mainline kernel on the SONY Xperia Z3 and his company has demonstrated strong interest in getting the mainline kernel to run on their handsets.
https://plus.google.com/102276447148493441479/posts/amRvpE8piSw

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

http://lists.infradead.org/pipermail/linux-arm-kernel/2011-December/078428.html

Signed-off-by HeungJun, Kim <riverful.kim at samsung.com>
Signed-off-by Kyungmin Park <kyungmin.park at samsung.com>
Quoted 8 lines
Quoted 5 lines

Interesting topic also for me. We were (and still are) spending significant effort so Trats (~Galaxy S 2 for Tizen) and Trats2 devices (Galaxy S III released for Tizen) would be fully supported by mainline. The same we did more recently for Gear 2 smartwatch. Although it is not a cellphone but fits to a mobile device category.

Can I get Galaxy S III and use mainline or that? If not... can I get Trats or Trats2 device somehow?

([email protected], email bounces)

You can try with Galaxy S III after uploading mainline uboot. Essentially this is exactly the same device as Trats2 so everything should work... but debugging would be hard if you don't have the Anyway JIG.

If anything goes wrong then maybe you could restore original image... or not. :)

The Trats devices were given to developers during Tizen Developer Conferences and some time after. I remember that some division in Samsung America was providing these to individual application developers few years ago. I don't think they do now.

Anyway Samsung was releasing (and was giving away) new devices on each Tizen Developer Conference. Last year it was Gear 2:
https://www.tizen.org/ko/events/tizen-developer-conference/2014/great-tizen-developer-conference-2014-giveaway-gear2-nuc

This year the conference is in China:
https://www.tizen.org/ko/events/tizen-developer-conference/2015

Quoted 9 lines
Quoted 3 lines

Standard Debian works fine on them. With a mobile operating system - like Tizen - it gets more difficult.

What do you use for desktop in Debian? I'm using MATE on n900, and it is almost usable. I have cellular calls working (but audio quality is awful). But MATE is so usable thanks to n900's keyboard and stylus... (and I'm still searching for web browser that works within 256MB ram).

The Debian was chosen for a testing platform. It is not a usable phone with Debian but a usable 4-core device :) .

Quoted 7 lines
Quoted 5 lines

Most of the drivers are there but few important SoC components are missing (for example camera for Gear 2). One of the obstacles here was lack of public firmware which prevented mainlining some of the drivers (e.g. FIMC - the camera).

You mean.. there is not even redistributable firmware binary?

There was a reluctance on LKML to accept camera drivers without releasing the firmware. Samsung never released the firmware on any website however you can download it from the device and find it on unofficial website:
www.sammobile.com/firmwares
(this website is not related to Samsung)

Some drivers were not even upstreamed (like touchscreen driver for Gear2) but you can find the sources on vendor's site or on tizen.org. Again you will have to get the firmware from unofficial site or from device image directly (maybe here:
https://download.tizen.org/snapshots/tizen/mobile/latest/images ?)

Best regards,
Krzysztof

#6 lore raw
In reply to Krzysztof Kozlowski
Quoted 30 lines · Krzysztof Kozlowski

2015-07-23 21:14 GMT+09:00 Pavel Machek <[email protected]>:

Quoted 29 lines · Linus Walleij
Quoted 15 lines · Pavel Machek
Quoted 9 lines

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 4 lines

Interested people:

Sebastian Reichel <[email protected]>
Pali Rohár <[email protected]>

Quoted 6 lines

I'm adding Björn Andersson <[email protected]> to this list.

Björn has as of yesterday booted a mainline kernel on the SONY Xperia Z3 and his company has demonstrated strong interest in getting the mainline kernel to run on their handsets.
https://plus.google.com/102276447148493441479/posts/amRvpE8piSw

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

http://lists.infradead.org/pipermail/linux-arm-kernel/2011-December/078428.html

Signed-off-by HeungJun, Kim <riverful.kim at samsung.com>
Signed-off-by Kyungmin Park <kyungmin.park at samsung.com>

Already Krzysztof mentioned. Our team tried to support mainline kernel for product and it's still on-going.
see gear 2 support with exysno3250.

I'm interested in this topic. Moreover KS is held at Korea. so It's good chance to attend and discuss this topic.

Thank you,
Kyungmin Park

Quoted 21 lines

Interesting topic also for me. We were (and still are) spending significant effort so Trats (~Galaxy S 2 for Tizen) and Trats2 devices (Galaxy S III released for Tizen) would be fully supported by mainline. The same we did more recently for Gear 2 smartwatch. Although it is not a cellphone but fits to a mobile device category.

Standard Debian works fine on them. With a mobile operating system - like Tizen - it gets more difficult.

Most of the drivers are there but few important SoC components are missing (for example camera for Gear 2). One of the obstacles here was lack of public firmware which prevented mainlining some of the drivers (e.g. FIMC - the camera).

Best regards,
Krzysztof
_______________________________________________
Ksummit-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss

#7 lore raw
In reply to Pavel Machek
Quoted 12 lines · On Thu, 23 Jul 2015 14:14:41 +0200 Pavel Machek <[email protected]> wrote:
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 1 line

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

Seems like a reasonable topic, especially since KS is being held in South Korea this year.

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

Also, what is expected to be solved at KS?

-- Steve

#8 lore raw
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

#9 lore raw
Quoted 11 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 5 lines
Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

As Mark says, I've been working on almost exactly this topic for several months now. Last year I conducted a survey investigating obstacles that developers (mostly corporate product developers) have in mainlining. There are lots of non-technical issues that are worth working on (version gap, corporate incentives, training, etc.), but which are outside the scope of the kernel summit.

There are also some technical areas where I think coordinated effort might be useful, to identify deficiencies and collaborate on progress. These might be worth discussing at the summit.

In March of this year, I analysed code from several shipping phones (representing a number of different SoCs, including both ARM and Intel-architecture CPUs), and found that most products have between 1.2 and 3 million lines of code out-of-tree. We are still in progress of finding patterns of out-of-treeness, to inform decisions about technical projects going forward.

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

IMHO it would be useful to discuss these areas, to see if there are technical reasons for these deficiencies, and work to resolve them.
-- Tim

#10 lore raw
Quoted 18 lines · Tim Bird
Quoted 16 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

[..]

Quoted 4 lines

In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

In the Xperia Z3 we have a bcm4339 and I managed to get that up and running with the brcmf driver on mainline last week - pending Qualcomm regulator support and 1 pending patch in mmc.

For some of our other devices we have various Qualcomm based chips and there's progress towards getting those up to speed on mainline as well (wcn36xx).

Regards,
Bjorn

#11 lore raw
Quoted 16 lines · Bjorn Andersson
Quoted 14 lines · Tim Bird
Quoted 13 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 1 line

Also, what is expected to be solved at KS?

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

[..]

Quoted 3 lines

In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Practically every vendor BSP I've looked at has Broadcom vendor driver copied in.

Quoted 3 lines

In the Xperia Z3 we have a bcm4339 and I managed to get that up and running with the brcmf driver on mainline last week - pending Qualcomm regulator support and 1 pending patch in mmc.

That's no small feat, but the real problem here are the feature gaps with mainline. Things I've heard about are switching between AP and client modes, P2P support, Android specific power optimized firmware, etc. We do have to start somewhere, but as long as vendors are putting new features in their vendor drivers first and not getting pushback from customers to have mainline (or mainline + feature X) drivers it is going to be a loosing battle.

The WiFi side is actually in better shape than BT. With BT, we have Bluedroid vs. BlueZ, no real DT bindings to describe BT chips (plenty of examples of how not to do it[1]), and chip specific userspace initialization (firmware loading, baudrate setup, power mgt).

NFC is even worse. What's in the kernel for NFC is generally not used by Android AFAIK.

Rob

[1] https://www.mail-archive.com/[email protected]/msg937944.html

#12 lore raw
Quoted 22 lines · Rob Herring
Quoted 20 lines · Bjorn Andersson
Quoted 18 lines · Tim Bird
Quoted 16 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

Quoted 8 lines
Quoted 4 lines

[..]

Quoted 3 lines

In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Practically every vendor BSP I've looked at has Broadcom vendor driver copied in.

Right, everyone inherits the bcmdhd driver from the android-common tree, and uses that with some level of patching.

Quoted 8 lines
Quoted 3 lines

In the Xperia Z3 we have a bcm4339 and I managed to get that up and running with the brcmf driver on mainline last week - pending Qualcomm regulator support and 1 pending patch in mmc.

That's no small feat, but the real problem here are the feature gaps with mainline. Things I've heard about are switching between AP and client modes, P2P support, Android specific power optimized firmware, etc.

Right, I expect both a functional and a stability gap. But the my goal is to get to the point where our WiFi team can work on these issues - even if that's on the side of normal product development for the foreseeable future.

Quoted 5 lines

We do have to start somewhere, but as long as vendors are putting new features in their vendor drivers first and not getting pushback from customers to have mainline (or mainline + feature X) drivers it is going to be a loosing battle.

Right, but we (Sony) are one of those customers' of Broadcomm and by just having this running we are in a better state of pushing back.

For now I've only tested this on SDIO based bcm devices though, the latest batch are PCIe; so we have to get back to that...

Quoted 5 lines

The WiFi side is actually in better shape than BT. With BT, we have Bluedroid vs. BlueZ, no real DT bindings to describe BT chips (plenty of examples of how not to do it[1]), and chip specific userspace initialization (firmware loading, baudrate setup, power mgt).

In other words, plenty of savings to be found :)

Quoted 3 lines

NFC is even worse. What's in the kernel for NFC is generally not used by Android AFAIK.

The NFC implementation used by Android is completely done in userspace.

The kernel parts looks promising, but last time I looked Android support was only at the horizon of their todo list; with plenty of not-so-android-compatible pieces put in before that (e.g DBUS)

Regards,
Bjorn

#13 lore raw
Quoted 4 lines · Bjorn Andersson

For now I've only tested this on SDIO based bcm devices though, the latest batch are PCIe; so we have to get back to that...

Are the PCIe ones also bcmdhd? Until recently, all I knew was that the PCIe ones were softmac, i.e. bcmsmac (in mainline) or not supported at all. Are there fullmac PCIe ones now?

johannes

#14 lore raw
In reply to Rob Herring
Quoted 34 lines · Rob Herring
Quoted 16 lines · Bjorn Andersson
Quoted 14 lines · Tim Bird
Quoted 13 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 1 line

Also, what is expected to be solved at KS?

Quoted 8 lines
Quoted 4 lines
Quoted 3 lines

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

[..]

Quoted 3 lines

In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Practically every vendor BSP I've looked at has Broadcom vendor driver copied in.

Quoted 3 lines

In the Xperia Z3 we have a bcm4339 and I managed to get that up and running with the brcmf driver on mainline last week - pending Qualcomm regulator support and 1 pending patch in mmc.

Quoted 7 lines

That's no small feat, but the real problem here are the feature gaps with mainline. Things I've heard about are switching between AP and client modes, P2P support, Android specific power optimized firmware, etc. We do have to start somewhere, but as long as vendors are putting new features in their vendor drivers first and not getting pushback from customers to have mainline (or mainline + feature X) drivers it is going to be a losing battle.

I agree completely.

I'm doing some research now on the usefulness of backporting the current brcm80211 code to 3.18, which many of the next round of Android phones will be using. This at least exposes the stack to mobile device vendors and device owners, who (with some luck) can test it in production settings and find deficiencies.

If we do nothing, then we'll have another full generation of phones which focus exclusively on out-of-tree wireless driver code. This will end up delaying the adoption of the mainline driver (in this product area) by another few years, IMHO.

Feedback on the and sanity of this approach are welcome. :-) If anyone knows things about the broadcom driver or the wireless stack that would make this backport particularly costly, please let me know.
-- Tim

#15 lore raw

On Fri, Jul 31, 2015 at 10:25:47AM -0700, Tim Bird wrote:

<snip>

Quoted 6 lines

I'm doing some research now on the usefulness of backporting the current brcm80211 code to 3.18, which many of the next round of Android phones will be using. This at least exposes the stack to mobile device vendors and device owners, who (with some luck) can test it in production settings and find deficiencies.

Quoted 8 lines

If we do nothing, then we'll have another full generation of phones which focus exclusively on out-of-tree wireless driver code. This will end up delaying the adoption of the mainline driver (in this product area) by another few years, IMHO.

Feedback on the and sanity of this approach are welcome. :-) If anyone knows things about the broadcom driver or the wireless stack that would make this backport particularly costly, please let me know.

It probably goes without saying, but you should make sure that brcm80211 actually supports the chips in use. Broadcom has not done a very good job at keeping brcm80211 up-to-date with the hardware that they actually release for laptops. Installing out-of-tree Broadcom wireless drivers on laptops still seems to be a common requirement. :-(

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#16 lore raw
In reply to Rob Herring
Quoted 4 lines · Rob Herring

The WiFi side is actually in better shape than BT. With BT, we have Bluedroid vs. BlueZ, no real DT bindings to describe BT chips (plenty of examples of how not to do it[1]), and chip specific userspace initialization (firmware loading, baudrate setup, power mgt).

I was looking at it at one point and couldn't wrap my head around how the BT support was devised from a kernel point of view.

It seems BT chips more often than not sit on a UART connection (often very high speed) and since there is no "uart bus" or "serial bus" akin to what we have for I2C or SPI, it is actually impossible to instantiate them properly in the driver model. Instead BT drivers are poked and peeked from userspace using the line discipline as if they were some kind of modem, just in-kernel.

The stuff going on up there may seem simple and intuitive for the BT people but for a random kernel engineer like me it seems like magic. This makes them hard to review and upstream for what I can see.

Yours,
Linus Walleij

#17 lore raw
Quoted 10 lines · Linus Walleij
Quoted 4 lines · Rob Herring

The WiFi side is actually in better shape than BT. With BT, we have Bluedroid vs. BlueZ, no real DT bindings to describe BT chips (plenty of examples of how not to do it[1]), and chip specific userspace initialization (firmware loading, baudrate setup, power mgt).

I was looking at it at one point and couldn't wrap my head around how the BT support was devised from a kernel point of view.

Quoted 6 lines

It seems BT chips more often than not sit on a UART connection (often very high speed) and since there is no "uart bus" or "serial bus" akin to what we have for I2C or SPI, it is actually impossible to instantiate them properly in the driver model. Instead BT drivers are poked and peeked from userspace using the line discipline as if they were some kind of modem, just in-kernel.

Yes, but then there's always some side band signals for regulator control, reset, clocks, wake-up, rf-kill, etc. that needs a glue driver. There's been some work by Neil Brown to create a UART slave bus[1] and I've gotten several other UART device bindings recently, but they all suffer from being one off device bindings done in different ways and I want to see something common here.

It also seems the BT folks are working on moving more of the setup into the kernel and creating a proper subsystem. I'm not sure about the details on that.

Rob

[1] https://lwn.net/Articles/643878/

#18 lore raw

Hi Rob,

Quoted 22 lines
Quoted 8 lines
Quoted 4 lines

The WiFi side is actually in better shape than BT. With BT, we have Bluedroid vs. BlueZ, no real DT bindings to describe BT chips (plenty of examples of how not to do it[1]), and chip specific userspace initialization (firmware loading, baudrate setup, power mgt).

I was looking at it at one point and couldn't wrap my head around how the BT support was devised from a kernel point of view.

Quoted 6 lines

It seems BT chips more often than not sit on a UART connection (often very high speed) and since there is no "uart bus" or "serial bus" akin to what we have for I2C or SPI, it is actually impossible to instantiate them properly in the driver model. Instead BT drivers are poked and peeked from userspace using the line discipline as if they were some kind of modem, just in-kernel.

Yes, but then there's always some side band signals for regulator control, reset, clocks, wake-up, rf-kill, etc. that needs a glue driver. There's been some work by Neil Brown to create a UART slave bus[1] and I've gotten several other UART device bindings recently, but they all suffer from being one off device bindings done in different ways and I want to see something common here.

Quoted 3 lines

It also seems the BT folks are working on moving more of the setup into the kernel and creating a proper subsystem. I'm not sure about the details on that.

we are indeed moving a lot of the initialization and handling of the Bluetooth controller into the kernel. So that this can also be shared between USB and UART based controllers.

The work on UART slaves (or whatever it will be called eventually) is important for Bluetooth and most likely GPS and NFC in the future. It then allows to define all the nasty behind the curtain details of that UART via DT or ACPI in vendor drivers.

The Bluetooth driver in theory should not care at all and generally speaking it doesn't since the Bluetooth SIG has defined a Host Controller Interface (HCI) that is standard. Meaning all operation are well defined. Just the transport over UART has many vendor specific tweaks. The two most obvious ones are deep sleep modes and running the UART at high speeds.

In a perfect world I would prefer we are not using the Bluetooth HCI line discipline at all. The problem right now is that everybody wants to enable the UART as /dev/ttyFOO and then move on. However in reality they are not general purpose TTY devices. The only thing you can ever do with them is tell the Bluetooth subsystem that there is a TTY device and attach its line discipline to it.

The majority of these high speed UARTs in phones, tablets and also laptops with Bluetooth chips attached to it should just expose a special bus that we can then enumerate. Pretending to a general purpose UART is actually cumbersome and you will just see more and more of these.

While Bluetooth supports USB and SDIO as well, the most common other low power interface is the UART (using H:4 or 3-Wire Bluetooth transports). The usage of PCI or SPI or I2C as interface to Bluetooth never really happened.

Current Bluetooth/WiFi chips usually come in these flavors. WiFi on PCIe + Bluetooth on USB, WiFi + Bluetooth on USB, WiFi + Bluetooth on SDIO and WiFi on SDIO + Bluetooth on UART. Now if you are building a mobile phone, you can choose the low power version you like. And this often turns into SDIO for WiFi and UART for Bluetooth.

Or and did I mention that some manufactures actually put FM radio and GPS controls behind the Bluetooth chip. So access to these slave devices goes via the Bluetooth HCI. This means that you have this fun dependency:

FM radio -> Bluetooth HCI -> UART -> UART slave

Some nasty solution here are to double stack the line disciplines and have some sort of shared transport driver in between. I am trying to actually fix that so that Bluetooth drivers can expose proper platform buses with correctly assigned resources that the FM radio driver would just enumerate on. So that part is in the works as well.

We can also talk about A4WP and the corner cases where your battery is so drained that the Bluetooth Low Energy portion of your hardware is the only one that gets powered first before you get your device back to life. In case this is not obvious, the A4WP wireless charging technology using Bluetooth Low Energy for its communication.

Regards

Marcel

#19 lore raw
Quoted 8 lines · Marcel Holtmann

Hi Rob,

Quoted 2 lines

There's been some work by Neil Brown to create a UART slave bus[1] (...)

The work on UART slaves (or whatever it will be called eventually) is important for Bluetooth and most likely GPS and NFC in the future. It then allows to define all the nasty behind the curtain details of that UART via DT or ACPI in vendor drivers.

I agree 100%, and I think I have a simple enough in-kernel usecase so I can get testing these series.

It seems GPS and NFC and other code is being kept out of the kernel because of the absense of a UART slave bus and all the hazzle of handling this.

Quoted 5 lines

In a perfect world I would prefer we are not using the Bluetooth HCI line discipline at all. The problem right now is that everybody wants to enable the UART as /dev/ttyFOO and then move on. However in reality they are not general purpose TTY devices. The only thing you can ever do with them is tell the Bluetooth subsystem that there is a TTY device and attach its line discipline to it.

This is done from userspace right? I never managed to wrap my head around this because it seemed so odd and plainly hackish.

In this ST-Ericsson driver for CG2900:
http://marc.info/?l=linux-kernel&m=134873373526049&w=2
the HCI link is used to tunnel things that are not Bluetooth, also GPS and FM radio is controlled over HCI. Yeah sorry, I didn't invent it... the HCI is then run over a UART.

Yours,
Linus Walleij

#20 lore raw
Quoted 1 line · Linus Walleij

On Tue, Aug 4, 2015 at 12:36 AM, Marcel Holtmann <[email protected]> wrote:

(...)

Quoted 6 lines
Quoted 5 lines

In a perfect world I would prefer we are not using the Bluetooth HCI line discipline at all. The problem right now is that everybody wants to enable the UART as /dev/ttyFOO and then move on. However in reality they are not general purpose TTY devices. The only thing you can ever do with them is tell the Bluetooth subsystem that there is a TTY device and attach its line discipline to it.

Quoted 8 lines

This is done from userspace right? I never managed to wrap my head around this because it seemed so odd and plainly hackish.

In this ST-Ericsson driver for CG2900:
http://marc.info/?l=linux-kernel&m=134873373526049&w=2
the HCI link is used to tunnel things that are not Bluetooth, also GPS and FM radio is controlled over HCI. Yeah sorry, I didn't invent it... the HCI is then run over a UART.

Damned I snapped off the latter part of your message. Typing and mailing to quickly. This was obviously in response to:

Quoted 5 lines
Quoted 5 lines

Or and did I mention that some manufactures actually put FM radio and GPS controls behind the Bluetooth chip. So access to these slave devices goes via the Bluetooth HCI. This means that you have this fun dependency:

FM radio -> Bluetooth HCI -> UART -> UART slave

So what I wanted to ask is who else is doing this apart from CG2900/STLC2690? Is it a common pattern?

Quoted 5 lines
Quoted 5 lines

Some nasty solution here are to double stack the line disciplines and have some sort of shared transport driver in between. I am trying to actually fix that so that Bluetooth drivers can expose proper platform buses with correctly assigned resources that the FM radio driver would just enumerate on. So that part is in the works as well.

IIRC that was also suggested to us by Vitaly Wool when my colleagues tried to mainline CG2900/STLC2690, so very very nice to see this happening! Put me on CC when you post something, not that it's my expert area but would be happy to help if I can.

Yours,
Linus Walleij

#21 lore raw
Quoted 21 lines · Linus Walleij
Quoted 1 line · Linus Walleij

On Tue, Aug 4, 2015 at 12:36 AM, Marcel Holtmann <[email protected]> wrote:

(...)

Quoted 6 lines
Quoted 5 lines

In a perfect world I would prefer we are not using the Bluetooth HCI line discipline at all. The problem right now is that everybody wants to enable the UART as /dev/ttyFOO and then move on. However in reality they are not general purpose TTY devices. The only thing you can ever do with them is tell the Bluetooth subsystem that there is a TTY device and attach its line discipline to it.

Quoted 8 lines

This is done from userspace right? I never managed to wrap my head around this because it seemed so odd and plainly hackish.

In this ST-Ericsson driver for CG2900:
http://marc.info/?l=linux-kernel&m=134873373526049&w=2
the HCI link is used to tunnel things that are not Bluetooth, also GPS and FM radio is controlled over HCI. Yeah sorry, I didn't invent it... the HCI is then run over a UART.

Damned I snapped off the latter part of your message. Typing and mailing to quickly. This was obviously in response to:

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

Or and did I mention that some manufactures actually put FM radio and GPS controls behind the Bluetooth chip. So access to these slave devices goes via the Bluetooth HCI. This means that you have this fun dependency:

FM radio -> Bluetooth HCI -> UART -> UART slave

So what I wanted to ask is who else is doing this apart from CG2900/STLC2690? Is it a common pattern?

Unfortunately it seems to be a common pattern. TI combos used to do that at well.

Cheers,
Samuel.

#22 lore raw
In reply to Linus Walleij

Hi!

Quoted 8 lines
Quoted 5 lines
Quoted 5 lines

Or and did I mention that some manufactures actually put FM radio and GPS controls behind the Bluetooth chip. So access to these slave devices goes via the Bluetooth HCI. This means that you have this fun dependency:

FM radio -> Bluetooth HCI -> UART -> UART slave

So what I wanted to ask is who else is doing this apart from CG2900/STLC2690? Is it a common pattern?

The most important phone in the world (*) does it like that.

- it has extra GPIOs to handle power management

- GPS is connected to the GSM parts, not to bluetooth

Best regards,
Pavel
(*) Nokia N900.

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#23 lore raw
In reply to Linus Walleij
Quoted 10 lines · Linus Walleij
Quoted 8 lines · Marcel Holtmann

Hi Rob,

Quoted 2 lines

There's been some work by Neil Brown to create a UART slave bus[1] (...)

The work on UART slaves (or whatever it will be called eventually) is important for Bluetooth and most likely GPS and NFC in the future. It then allows to define all the nasty behind the curtain details of that UART via DT or ACPI in vendor drivers.

Quoted 6 lines

I agree 100%, and I think I have a simple enough in-kernel usecase so I can get testing these series.

It seems GPS and NFC and other code is being kept out of the kernel because of the absense of a UART slave bus and all the hazzle of handling this.

Keeping it in userspace means vendors can provide their stacks under the apache license, not the kernel GPL one.

Cheers,
Samuel.

#24 lore raw
In reply to Linus Walleij

Hi Linus,

Quoted 7 lines
Quoted 6 lines
Quoted 2 lines

There's been some work by Neil Brown to create a UART slave bus[1] (...)

The work on UART slaves (or whatever it will be called eventually) is important for Bluetooth and most likely GPS and NFC in the future. It then allows to define all the nasty behind the curtain details of that UART via DT or ACPI in vendor drivers.

Quoted 6 lines

I agree 100%, and I think I have a simple enough in-kernel usecase so I can get testing these series.

It seems GPS and NFC and other code is being kept out of the kernel because of the absense of a UART slave bus and all the hazzle of handling this.

we have NFC subsystem in the kernel with wide vendor support. We can discuss why Android is insisting on doing NFC in userspace, but that is a complete different off-topic ;)

GPS is a bit of a funky one. Historically the NMEA protocol is pretty much bound to an UART running at 4800 baud. So I can see a bit of reasoning behind it. These days NMEA is not the only protocol and a some GPS chip companies have developed their own ones.

Also GPS is found as Serial Port over Bluetooth, as USB-Serial, as actually serial port and so on. Then you have the really funky ones where it is hooked over a Bluetooth HCI interface, or as part a magic AT command port of a GSM modem. And if you want to get really funky then you have NMEA over Qualcomm QMI protocol.

These days LTE modems normally include the GPS and GLONASS chip. So you have to go through the LTE modem to access it.

With the oFono telephony stack, we actually added a location provider API for getting access to GPS. So you can request GPS access via D-Bus and it will then return you an fd. That fd might map to a physical TTY, or a virtual port on the GSM 07.11 multiplexer or via QMI.

And there are more odd ones out there.

Quoted 6 lines
Quoted 5 lines

In a perfect world I would prefer we are not using the Bluetooth HCI line discipline at all. The problem right now is that everybody wants to enable the UART as /dev/ttyFOO and then move on. However in reality they are not general purpose TTY devices. The only thing you can ever do with them is tell the Bluetooth subsystem that there is a TTY device and attach its line discipline to it.

Quoted 8 lines

This is done from userspace right? I never managed to wrap my head around this because it seemed so odd and plainly hackish.

In this ST-Ericsson driver for CG2900:
http://marc.info/?l=linux-kernel&m=134873373526049&w=2
the HCI link is used to tunnel things that are not Bluetooth, also GPS and FM radio is controlled over HCI. Yeah sorry, I didn't invent it... the HCI is then run over a UART.

Yes, pretty much. TI calls this shared transport aka TI-ST which is also pretty messy. It hacks around setup problems that should be solved a clean way.

For example one cumbersome details back in the days was that the Bluetooth chip comes without a persistent address in these embedded devices. So the address is stored in the host filesystem or in a dedicated one-time flash section.

Of course to program and address, you need HCI commands. For starting the Bluetooth stack, you need a valid address. We added support for handling this chicken and egg problem cleanly by abstracting the bringup into a setup stage. So you can start the HCI transport without starting the Bluetooth stack.

This in the end also resulted in the support of what is called HCI User Channel. Meaning you can drive a Bluetooth stack from userspace if you wanted to, but you would use the Bluetooth subsystem still for the transport abstraction to the hardware and the initial setup like firmware loading and address programming. This lead to the nice feature that we can run Android's Bluedroid stack on top of the Linux Bluetooth subsystem and avoid having to enable hardware for different stacks over and over again.

Regards

Marcel

#25 lore raw
In reply to Marcel Holtmann
Quoted 53 lines · Marcel Holtmann

Hi Rob,

Quoted 24 lines
Quoted 9 lines
Quoted 5 lines

The WiFi side is actually in better shape than BT. With BT, we have Bluedroid vs. BlueZ, no real DT bindings to describe BT chips (plenty of examples of how not to do it[1]), and chip specific userspace initialization (firmware loading, baudrate setup, power mgt).

I was looking at it at one point and couldn't wrap my head around how the BT support was devised from a kernel point of view.

Quoted 7 lines

It seems BT chips more often than not sit on a UART connection (often very high speed) and since there is no "uart bus" or "serial bus" akin to what we have for I2C or SPI, it is actually impossible to instantiate them properly in the driver model. Instead BT drivers are poked and peeked from userspace using the line discipline as if they were some kind of modem, just in-kernel.

Yes, but then there's always some side band signals for regulator control, reset, clocks, wake-up, rf-kill, etc. that needs a glue driver. There's been some work by Neil Brown to create a UART slave bus[1] and I've gotten several other UART device bindings recently, but they all suffer from being one off device bindings done in different ways and I want to see something common here.

Quoted 3 lines

It also seems the BT folks are working on moving more of the setup into the kernel and creating a proper subsystem. I'm not sure about the details on that.

we are indeed moving a lot of the initialization and handling of the Bluetooth controller into the kernel. So that this can also be shared between USB and UART based controllers.

The work on UART slaves (or whatever it will be called eventually) is important for Bluetooth and most likely GPS and NFC in the future. It then allows to define all the nasty behind the curtain details of that UART via DT or ACPI in vendor drivers.

The Bluetooth driver in theory should not care at all and generally speaking it doesn't since the Bluetooth SIG has defined a Host Controller Interface (HCI) that is standard. Meaning all operation are well defined. Just the transport over UART has many vendor specific tweaks. The two most obvious ones are deep sleep modes and running the UART at high speeds.

In a perfect world I would prefer we are not using the Bluetooth HCI line discipline at all. The problem right now is that everybody wants to enable the UART as /dev/ttyFOO and then move on. However in reality they are not general purpose TTY devices. The only thing you can ever do with them is tell the Bluetooth subsystem that there is a TTY device and attach its line discipline to it.

Quoted 5 lines

The majority of these high speed UARTs in phones, tablets and also laptops with Bluetooth chips attached to it should just expose a special bus that we can then enumerate. Pretending to a general purpose UART is actually cumbersome and you will just see more and more of these.

Hardware-wise, the UARTs on SOCs I've seen are no different whether used for console or BT device. Of course, running UARTs at 3-4Mbps means things like hooking up external DMA controllers which are kind of pointless for normal tty use.

Perhaps BT and other UART devices could interface directly to the serial_core/uart_port layer rather than the tty layer? I've got no idea if that would buy us anything though. I'm guessing part of the problem here is the requirements for a character based interface are different from a more packet based interface (HCI) even if the h/w is the same.

Quoted 10 lines

While Bluetooth supports USB and SDIO as well, the most common other low power interface is the UART (using H:4 or 3-Wire Bluetooth transports). The usage of PCI or SPI or I2C as interface to Bluetooth never really happened.

Current Bluetooth/WiFi chips usually come in these flavors. WiFi on PCIe + Bluetooth on USB, WiFi + Bluetooth on USB, WiFi + Bluetooth on SDIO and WiFi on SDIO + Bluetooth on UART. Now if you are building a mobile phone, you can choose the low power version you like. And this often turns into SDIO for WiFi and UART for Bluetooth.

SDIO is such a pain. The hosts and devices have so many quirks as there is no interoperability testing.

Do you ever see interdependencies between the BT and WiFi portions of the combo chips which have different host interfaces? They seem to be fairly well separated AFAICT. Some things like shared irq, clocks or regulators can be dealt with easily, but if you had things like the WiFi firmware has to be loaded and running before BT can work or vice-versa that would be a pain to deal with. That would impact how we do DT bindings as well.

Quoted 14 lines

Or and did I mention that some manufactures actually put FM radio and GPS controls behind the Bluetooth chip. So access to these slave devices goes via the Bluetooth HCI. This means that you have this fun dependency:

FM radio -> Bluetooth HCI -> UART -> UART slave

Some nasty solution here are to double stack the line disciplines and have some sort of shared transport driver in between. I am trying to actually fix that so that Bluetooth drivers can expose proper platform buses with correctly assigned resources that the FM radio driver would just enumerate on. So that part is in the works as well.

Quoted 5 lines

We can also talk about A4WP and the corner cases where your battery is so drained that the Bluetooth Low Energy portion of your hardware is the only one that gets powered first before you get your device back to life. In case this is not obvious, the A4WP wireless charging technology using Bluetooth Low Energy for its communication.

Always something fun and new to deal with. :)

Rob

#26 lore raw

Hi Rob,

Quoted 62 lines
Quoted 51 lines
Quoted 24 lines
Quoted 9 lines
Quoted 5 lines

The WiFi side is actually in better shape than BT. With BT, we have Bluedroid vs. BlueZ, no real DT bindings to describe BT chips (plenty of examples of how not to do it[1]), and chip specific userspace initialization (firmware loading, baudrate setup, power mgt).

I was looking at it at one point and couldn't wrap my head around how the BT support was devised from a kernel point of view.

Quoted 7 lines

It seems BT chips more often than not sit on a UART connection (often very high speed) and since there is no "uart bus" or "serial bus" akin to what we have for I2C or SPI, it is actually impossible to instantiate them properly in the driver model. Instead BT drivers are poked and peeked from userspace using the line discipline as if they were some kind of modem, just in-kernel.

Yes, but then there's always some side band signals for regulator control, reset, clocks, wake-up, rf-kill, etc. that needs a glue driver. There's been some work by Neil Brown to create a UART slave bus[1] and I've gotten several other UART device bindings recently, but they all suffer from being one off device bindings done in different ways and I want to see something common here.

Quoted 3 lines

It also seems the BT folks are working on moving more of the setup into the kernel and creating a proper subsystem. I'm not sure about the details on that.

we are indeed moving a lot of the initialization and handling of the Bluetooth controller into the kernel. So that this can also be shared between USB and UART based controllers.

The work on UART slaves (or whatever it will be called eventually) is important for Bluetooth and most likely GPS and NFC in the future. It then allows to define all the nasty behind the curtain details of that UART via DT or ACPI in vendor drivers.

The Bluetooth driver in theory should not care at all and generally speaking it doesn't since the Bluetooth SIG has defined a Host Controller Interface (HCI) that is standard. Meaning all operation are well defined. Just the transport over UART has many vendor specific tweaks. The two most obvious ones are deep sleep modes and running the UART at high speeds.

In a perfect world I would prefer we are not using the Bluetooth HCI line discipline at all. The problem right now is that everybody wants to enable the UART as /dev/ttyFOO and then move on. However in reality they are not general purpose TTY devices. The only thing you can ever do with them is tell the Bluetooth subsystem that there is a TTY device and attach its line discipline to it.

Quoted 5 lines

The majority of these high speed UARTs in phones, tablets and also laptops with Bluetooth chips attached to it should just expose a special bus that we can then enumerate. Pretending to a general purpose UART is actually cumbersome and you will just see more and more of these.

Hardware-wise, the UARTs on SOCs I've seen are no different whether used for console or BT device. Of course, running UARTs at 3-4Mbps means things like hooking up external DMA controllers which are kind of pointless for normal tty use.

Quoted 5 lines

Perhaps BT and other UART devices could interface directly to the serial_core/uart_port layer rather than the tty layer? I've got no idea if that would buy us anything though. I'm guessing part of the problem here is the requirements for a character based interface are different from a more packet based interface (HCI) even if the h/w is the same.

interfacing directly with the serial / UART layer would be beneficial. For example ACPI already describes if the UART is used for Bluetooth operation and what settings it expects. That means that there is really no point in hooking it up as /dev/ttyFOO and then expect userspace to discover it again and attach a line discipline to it.

However for this to work, the UART layer would have to have some smarts to turn the extra ACPI provided information into a decision between /dev/ttyFOO and the creation of platform device. If such a platform device is present, we can then easily enumerate from a simple Bluetooth H:4 or 3-Wire driver. It just bind it it similar to what USB and SDIO is doing.

And of course exposing the same via DT instead of ACPI should be possible as well. I just know that ACPI has this since on Intel platforms it has been exposed like this for a while now. The main problem is that non of this is available easily to userspace to make the same smart decision on what TTY device node is for Bluetooth and what is the actual vendor of the Bluetooth chip. We need that as well to drive different firmware loading strategies.

Instead of a platform device, the TTY / UART layer could also turn into its own bus for these kind of things. I just don't know if bus vs platform device is the right solution here.

Quoted 5 lines
Quoted 5 lines

While Bluetooth supports USB and SDIO as well, the most common other low power interface is the UART (using H:4 or 3-Wire Bluetooth transports). The usage of PCI or SPI or I2C as interface to Bluetooth never really happened.

Quoted 8 lines
Quoted 5 lines

Current Bluetooth/WiFi chips usually come in these flavors. WiFi on PCIe + Bluetooth on USB, WiFi + Bluetooth on USB, WiFi + Bluetooth on SDIO and WiFi on SDIO + Bluetooth on UART. Now if you are building a mobile phone, you can choose the low power version you like. And this often turns into SDIO for WiFi and UART for Bluetooth.

SDIO is such a pain. The hosts and devices have so many quirks as there is no interoperability testing.

What I have found is that the quirks are in the host controller for SDIO. Once that is working, the drivers have less quirks to handle. Then again, the number of Bluetooth based SDIO devices is limited. The majority of them are UART based in embedded devices.

Quoted 7 lines

Do you ever see interdependencies between the BT and WiFi portions of the combo chips which have different host interfaces? They seem to be fairly well separated AFAICT. Some things like shared irq, clocks or regulators can be dealt with easily, but if you had things like the WiFi firmware has to be loaded and running before BT can work or vice-versa that would be a pain to deal with. That would impact how we do DT bindings as well.

In the combo chips the vendor normally has figured this out. So I have not heard about large. I can speak about some funky stuff from the past that never made it to the market, but lets not go there.

Regards

Marcel

#27 lore raw
Quoted 11 lines · Marcel Holtmann
Quoted 8 lines
Quoted 5 lines

Current Bluetooth/WiFi chips usually come in these flavors. WiFi on PCIe + Bluetooth on USB, WiFi + Bluetooth on USB, WiFi + Bluetooth on SDIO and WiFi on SDIO + Bluetooth on UART. Now if you are building a mobile phone, you can choose the low power version you like. And this often turns into SDIO for WiFi and UART for Bluetooth.

SDIO is such a pain. The hosts and devices have so many quirks as there is no interoperability testing.

What I have found is that the quirks are in the host controller for SDIO. Once that is working, the drivers have less quirks to handle

Yeah and SDIO is more common for WLAN than for BT indeed. What we've seen (paging Ulf Hannson) is that SDIO has had a number of quirks because of two things:

- Devices that are not cards require a non-power of two byte transfer, and often hardware quirks to even write say 1, 2 or 3 bytes in the 32bit out FIFO registers.

- Power sequencing WRT the device on the outer side, which has been addressed in drivers/mmc/core/pwrseq.c

First is just basic driver features not uniformly implemented, the second I think is addressed now, just tricksy to use.

Linus Walleij

#28 lore raw
In reply to Tim Bird
Quoted 42 lines · Tim Bird
Quoted 11 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 5 lines
Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

As Mark says, I've been working on almost exactly this topic for several months now. Last year I conducted a survey investigating obstacles that developers (mostly corporate product developers) have in mainlining. There are lots of non-technical issues that are worth working on (version gap, corporate incentives, training, etc.), but which are outside the scope of the kernel summit.

There are also some technical areas where I think coordinated effort might be useful, to identify deficiencies and collaborate on progress. These might be worth discussing at the summit.

In March of this year, I analysed code from several shipping phones (representing a number of different SoCs, including both ARM and Intel-architecture CPUs), and found that most products have between 1.2 and 3 million lines of code out-of-tree. We are still in progress of finding patterns of out-of-treeness, to inform decisions about technical projects going forward.

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Quoted 3 lines

IMHO it would be useful to discuss these areas, to see if there are technical reasons for these deficiencies, and work to resolve them.

Fully agreed!

Thanks,
Rafael

#29 lore raw
In reply to Tim Bird
Quoted 36 lines · Tim Bird
Quoted 11 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 5 lines
Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

As Mark says, I've been working on almost exactly this topic for several months now. Last year I conducted a survey investigating obstacles that developers (mostly corporate product developers) have in mainlining. There are lots of non-technical issues that are worth working on (version gap, corporate incentives, training, etc.), but which are outside the scope of the kernel summit.

There are also some technical areas where I think coordinated effort might be useful, to identify deficiencies and collaborate on progress. These might be worth discussing at the summit.

In March of this year, I analysed code from several shipping phones (representing a number of different SoCs, including both ARM and Intel-architecture CPUs), and found that most products have between 1.2 and 3 million lines of code out-of-tree. We are still in progress of finding patterns of out-of-treeness, to inform decisions about technical projects going forward.

Quoted 5 lines

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Did anyone see successful attempts of mainlining such vendor code? I mean mainlining by individuals, not by vendor company itself.

It is a difficult task, especially without datasheets but it's possible. At least for some drivers.

If there were such efforts, I would be curious what obstacles he/she encountered (except a common one - missing datasheet/specs) and how he can be helped?

Best regards,
Krzysztof

#30 lore raw
Quoted 45 lines · On Wednesday 29 July 2015 09:45:22 Krzysztof Kozlowski wrote:
Quoted 35 lines · Tim Bird
Quoted 10 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 5 lines
Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

As Mark says, I've been working on almost exactly this topic for several months now. Last year I conducted a survey investigating obstacles that developers (mostly corporate product developers) have in mainlining. There are lots of non-technical issues that are worth working on (version gap, corporate incentives, training, etc.), but which are outside the scope of the kernel summit.

There are also some technical areas where I think coordinated effort might be useful, to identify deficiencies and collaborate on progress. These might be worth discussing at the summit.

In March of this year, I analysed code from several shipping phones (representing a number of different SoCs, including both ARM and Intel-architecture CPUs), and found that most products have between 1.2 and 3 million lines of code out-of-tree. We are still in progress of finding patterns of out-of-treeness, to inform decisions about technical projects going forward.

Quoted 5 lines

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Did anyone see successful attempts of mainlining such vendor code? I mean mainlining by individuals, not by vendor company itself.

Quoted 6 lines

It is a difficult task, especially without datasheets but it's possible. At least for some drivers.

If there were such efforts, I would be curious what obstacles he/she encountered (except a common one - missing datasheet/specs) and how he can be helped?

Given the dubious (to remain polite) quality of most out-of-tree vendor code, mainlining such drivers requires kernel guru skills and that's a very scarce resource. One big issue in my opinion is that people who have the necessary skills just lack free time. We would need to find budget to make that happen.

Signature · 3 lines
Regards,

Laurent Pinchart
#31 lore raw
In reply to Krzysztof Kozlowski

Hi!

Quoted 8 lines
Quoted 5 lines

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Did anyone see successful attempts of mainlining such vendor code? I mean mainlining by individuals, not by vendor company itself.

That is what is happening on Nokia N900. It took some time, but we have almost usable phone at this point. We'll have usable one once power management is working and once we get some more reasonable code to control ofono.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#32 lore raw
Quoted 8 lines · Pavel Machek

Hi!

Quoted 6 lines
Quoted 5 lines

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Quoted 7 lines
Quoted 2 lines

Did anyone see successful attempts of mainlining such vendor code? I mean mainlining by individuals, not by vendor company itself.

That is what is happening on Nokia N900. It took some time, but we have almost usable phone at this point. We'll have usable one once power management is working and once we get some more reasonable code to control ofono.

Just an update on this thread. We held a BOF at LinuxCon last week on this topic. I gave a presentation with some background, and then we had a discussion. Notes from the meeting (and a link to the presentation) are at:
http://elinux.org/LCNA_2015_Device_Mainlining_BOF_meeting_notes

We'll be doing more BOFs on this topic at Linaro Connect and ELC Europe.

I believe this would make a good discussion area for the kernel summit. The summit will likely include developers who have a good idea of detailed technical problem areas that need attention in order to make progress on this problem.

Thanks.
-- Tim

#33 lore raw
Quoted 17 lines · Tim Bird
Quoted 8 lines · Pavel Machek

Hi!

Quoted 6 lines
Quoted 5 lines

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Quoted 7 lines
Quoted 2 lines

Did anyone see successful attempts of mainlining such vendor code? I mean mainlining by individuals, not by vendor company itself.

That is what is happening on Nokia N900. It took some time, but we have almost usable phone at this point. We'll have usable one once power management is working and once we get some more reasonable code to control ofono.

Quoted 5 lines

Just an update on this thread. We held a BOF at LinuxCon last week on this topic. I gave a presentation with some background, and then we had a discussion. Notes from the meeting (and a link to the presentation) are at:
http://elinux.org/LCNA_2015_Device_Mainlining_BOF_meeting_notes

Thanks for updated numbers. Interesting that for the same SoC vendor (MSM) the difference between phone vendors is significant, e.g. 3.1M of Samsung/MSM insertions, 2.6M of LG insertions and only 1.8M of Sony and Motorola.

In the same time number of mainline contributors from LG, Sony and Motorola is similar... so why LG and Samsung/MSM need more than 1M of additional code out of tree?

I made also a diff with Tizen (developer) kernel source code. These are kernel trees not used directly by end-market products, but for devices released to developers. Sometimes these are the same as market-products, but the kernel is developed in a more open-source way:

1. 4.0 kernel (for Odroid XU3):
https://review.tizen.org/git/?p=platform/kernel/linux-exynos.git

   1404 files changed,

4566 insertions(+),
162026 deletions(-),
1761 hunks

2. 3.10 kernel (for Gear2, Trats2/Galaxy S3, Odroid U3):
https://review.tizen.org/git/?p=platform/kernel/linux-3.10.git

   5804 files changed,

84175 insertions(+),
536798 deletions(-),
17917 hunks

I think the numbers are reversed (insertions <-> deletions) because adding only Mali 400 should give ~50 000 of insertions.

Mali GPU drivers are an interesting case:
1. They are open (I believe Linux version is entirely under GPLv2).

2. They are developed for many OS-es.

3. They are present on may end-user products (using SoCs from Allwinner, Mediatek, Rockchip, Samsung and more).

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Best regards,
Krzysztof

#34 lore raw
Quoted 2 lines · Krzysztof Kozlowski
Quoted 1 line · Tim Bird

On 07/29/2015 12:40 AM, Pavel Machek wrote:

<snip>

Quoted 5 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you. And I can also guess that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then I can take up the task of adding it to staging. But I will need to have a board for that as without hardware Greg will not allow the code to be added. And Krzysztof has suggested ODROID-U3 for this purpose.

Regards
Sudip

#35 lore raw
Quoted 5 lines · Sudip Mukherjee
Quoted 2 lines · Krzysztof Kozlowski
Quoted 1 line · Tim Bird

On 07/29/2015 12:40 AM, Pavel Machek wrote:

<snip>

Quoted 1 line
Quoted 8 lines
Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you.

Looking at the list of SoCs using Mali:
https://en.wikipedia.org/wiki/Mali_(GPU)
then clearly a lot of vendors could benefit from that. I would be happy to see Mali in staging/mainline.

Quoted 8 lines

And I can also guess
that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then I can take up the task of adding it to staging. But I will need to have a board for that as without hardware Greg will not allow the code to be added. And Krzysztof has suggested ODROID-U3 for this purpose.

Right, I suggested Odroid-U3 (with Mali 400 and Exynos4412) because the board works quite well with mainline. Most of stuff is upstreamed. However I am using Tizen TV profile (public) on it with 4.0 kernel (not entirely public).

There are a lot of more devices with Mali 400 or newer so the question would be rather - which board would work the best (with less problems) on mainline.

Anyway good luck :)

Best regards,
Krzysztof

#36 lore raw
Quoted 35 lines · On Wednesday 26 August 2015 13:52:23 Krzysztof Kozlowski wrote:
Quoted 10 lines · Sudip Mukherjee
Quoted 2 lines · Krzysztof Kozlowski
Quoted 1 line · Tim Bird

On 07/29/2015 12:40 AM, Pavel Machek wrote:

<snip>

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Quoted 4 lines

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you.

Looking at the list of SoCs using Mali:
https://en.wikipedia.org/wiki/Mali_(GPU)
then clearly a lot of vendors could benefit from that. I would be happy to see Mali in staging/mainline.

Quoted 8 lines

And I can also guess
that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then I can take up the task of adding it to staging. But I will need to have a board for that as without hardware Greg will not allow the code to be added. And Krzysztof has suggested ODROID-U3 for this purpose.

Right, I suggested Odroid-U3 (with Mali 400 and Exynos4412) because the board works quite well with mainline. Most of stuff is upstreamed. However I am using Tizen TV profile (public) on it with 4.0 kernel (not entirely public).

Quoted 5 lines

There are a lot of more devices with Mali 400 or newer so the question would be rather - which board would work the best (with less problems) on mainline.

Anyway good luck :)

Given that DRM drivers can't be merged to mainline without an open-source userspace we're stuck until ARM decides to play fair (unlikely) or the Lima driver project rises back from the deaths.

Signature · 3 lines
Regards,

Laurent Pinchart
#37 lore raw
Quoted 40 lines · Laurent Pinchart
Quoted 39 lines · On Wednesday 26 August 2015 13:52:23 Krzysztof Kozlowski wrote:
Quoted 10 lines · Sudip Mukherjee
Quoted 2 lines · Krzysztof Kozlowski
Quoted 1 line · Tim Bird

On 07/29/2015 12:40 AM, Pavel Machek wrote:

<snip>

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Quoted 4 lines

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you.

Looking at the list of SoCs using Mali:
https://en.wikipedia.org/wiki/Mali_(GPU)
then clearly a lot of vendors could benefit from that. I would be happy to see Mali in staging/mainline.

Quoted 8 lines

And I can also guess
that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then I can take up the task of adding it to staging. But I will need to have a board for that as without hardware Greg will not allow the code to be added. And Krzysztof has suggested ODROID-U3 for this purpose.

Right, I suggested Odroid-U3 (with Mali 400 and Exynos4412) because the board works quite well with mainline. Most of stuff is upstreamed. However I am using Tizen TV profile (public) on it with 4.0 kernel (not entirely public).

There are a lot of more devices with Mali 400 or newer so the question would be rather - which board would work the best (with less problems) on mainline.

Quoted 5 lines
Quoted 1 line

Anyway good luck :)

Given that DRM drivers can't be merged to mainline without an open-source userspace we're stuck until ARM decides to play fair (unlikely) or the Lima driver project rises back from the deaths.

You mean that closed Mali DDK (the user-space interface) is major obstacle for mainlining Mali kernel side? Why?

Best regards,
Krzysztof

#38 lore raw
Quoted 41 lines · Krzysztof Kozlowski
Quoted 40 lines · Laurent Pinchart
Quoted 39 lines · On Wednesday 26 August 2015 13:52:23 Krzysztof Kozlowski wrote:
Quoted 10 lines · Sudip Mukherjee
Quoted 2 lines · Krzysztof Kozlowski
Quoted 1 line · Tim Bird

On 07/29/2015 12:40 AM, Pavel Machek wrote:

<snip>

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Quoted 4 lines

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you.

Looking at the list of SoCs using Mali:
https://en.wikipedia.org/wiki/Mali_(GPU)
then clearly a lot of vendors could benefit from that. I would be happy to see Mali in staging/mainline.

Quoted 8 lines

And I can also guess
that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then I can take up the task of adding it to staging. But I will need to have a board for that as without hardware Greg will not allow the code to be added. And Krzysztof has suggested ODROID-U3 for this purpose.

Right, I suggested Odroid-U3 (with Mali 400 and Exynos4412) because the board works quite well with mainline. Most of stuff is upstreamed. However I am using Tizen TV profile (public) on it with 4.0 kernel (not entirely public).

There are a lot of more devices with Mali 400 or newer so the question would be rather - which board would work the best (with less problems) on mainline.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Anyway good luck :)

Given that DRM drivers can't be merged to mainline without an open-source userspace we're stuck until ARM decides to play fair (unlikely) or the Lima driver project rises back from the deaths.

You mean that closed Mali DDK (the user-space interface) is major obstacle for mainlining Mali kernel side? Why?

Exactly as stated: in general, and particularly for graphics, a kernel interface needs some Open Source userspace showing that it actually works. The graphics maintainers do not merge kernel drivers for which only a proprietary userspace exists, for a variety of reasons, not least of which an inability to test them, check for regressions, or otherwise maintain them.

I haven't heard anything about Lima being defunct, though; as far as I know, it's as functional as it ever was on the hardware it supports. It's unlikely to ever be officially supported, but that hardly seems like a requirement. If you're running on a Mali 400, Lima should work.

- Josh Triplett

#39 lore raw

Am Dienstag, 25. August 2015, 23:15:14 schrieb Josh Triplett:

Quoted 58 lines · Krzysztof Kozlowski
Quoted 48 lines · Laurent Pinchart
Quoted 47 lines · On Wednesday 26 August 2015 13:52:23 Krzysztof Kozlowski wrote:
Quoted 45 lines · Sudip Mukherjee
Quoted 12 lines · Krzysztof Kozlowski
Quoted 2 lines · Tim Bird
Quoted 1 line · Pavel Machek

<snip>

Quoted 6 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was
literally hurting my eyes to see that coding style. It's like opposite
of kernel.

Quoted 4 lines

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you.

Looking at the list of SoCs using Mali:
https://en.wikipedia.org/wiki/Mali_(GPU)
then clearly a lot of vendors could benefit from that. I would be happy to see Mali in staging/mainline.

Quoted 11 lines

And I can also guess
that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then
I can take up the task of adding it to staging. But I will need to have
a board for that as without hardware Greg will not allow the code to be
added. And Krzysztof has suggested ODROID-U3 for this purpose.

Right, I suggested Odroid-U3 (with Mali 400 and Exynos4412) because the board works quite well with mainline. Most of stuff is upstreamed. However I am using Tizen TV profile (public) on it with 4.0 kernel (not entirely public).

There are a lot of more devices with Mali 400 or newer so the question would be rather - which board would work the best (with less problems) on mainline.

Anyway good luck :)

Quoted 8 lines
Quoted 5 lines

Given that DRM drivers can't be merged to mainline without an open-source
userspace we're stuck until ARM decides to play fair (unlikely) or the Lima
driver project rises back from the deaths.

You mean that closed Mali DDK (the user-space interface) is major obstacle for mainlining Mali kernel side? Why?

Quoted 6 lines

Exactly as stated: in general, and particularly for graphics, a kernel interface needs some Open Source userspace showing that it actually works. The graphics maintainers do not merge kernel drivers for which only a proprietary userspace exists, for a variety of reasons, not least of which an inability to test them, check for regressions, or otherwise maintain them.

An additional point would be the possible (in-)stability of the userspace interface. While I could sucessfully use a r6 midgard kernel driver with a r5 userspace lib yesterday on my Rockchip Chromebook using Debian, I don't think that is guaranteed to work everytime or that special care is taken for the kernel driver to prevent needing upgrades in lockstep.

And that is not even taking into account, that the mali userspace libs seem to be implementator-specific somehow too. For example for Rockchip I currently get my libs from the ChromeOS tree [0] which can talk to X11 [although not plasma5 it seems] and ARM seems to provide a variant for the firefly board using the legacy fbdev interface of the 3.10-based Android kernel. And then there are different variants for Samsung, etc too.

Quoted 4 lines

I haven't heard anything about Lima being defunct, though; as far as I know, it's as functional as it ever was on the hardware it supports. It's unlikely to ever be officially supported, but that hardly seems like a requirement. If you're running on a Mali 400, Lima should work.

probably not entirely defunct, but still on life-support:

For one, if you click on the "Source"-link on limadriver.org you get the gitorious "we're migrating old projects to archive.org" page.

And secondly there is supposed to be an actual mesa driver for mali400 and even bits for the midgard gpus (Mali-T) around, but limited to Luc's harddrive for now [1].

[0] https://github.com/mmind/mali-driver
[1] http://libv.livejournal.com/27461.html

#40 lore raw
Quoted 66 lines · Heiko Stuebner

Am Dienstag, 25. August 2015, 23:15:14 schrieb Josh Triplett:

Quoted 58 lines · Krzysztof Kozlowski
Quoted 48 lines · Laurent Pinchart
Quoted 47 lines · On Wednesday 26 August 2015 13:52:23 Krzysztof Kozlowski wrote:
Quoted 45 lines · Sudip Mukherjee
Quoted 12 lines · Krzysztof Kozlowski
Quoted 2 lines · Tim Bird
Quoted 1 line · Pavel Machek

<snip>

Quoted 6 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was
literally hurting my eyes to see that coding style. It's like opposite
of kernel.

Quoted 4 lines

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you.

Looking at the list of SoCs using Mali:
https://en.wikipedia.org/wiki/Mali_(GPU)
then clearly a lot of vendors could benefit from that. I would be happy to see Mali in staging/mainline.

Quoted 11 lines

And I can also guess
that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then
I can take up the task of adding it to staging. But I will need to have
a board for that as without hardware Greg will not allow the code to be
added. And Krzysztof has suggested ODROID-U3 for this purpose.

Right, I suggested Odroid-U3 (with Mali 400 and Exynos4412) because the board works quite well with mainline. Most of stuff is upstreamed. However I am using Tizen TV profile (public) on it with 4.0 kernel (not entirely public).

There are a lot of more devices with Mali 400 or newer so the question would be rather - which board would work the best (with less problems) on mainline.

Anyway good luck :)

Quoted 8 lines
Quoted 5 lines

Given that DRM drivers can't be merged to mainline without an open-source
userspace we're stuck until ARM decides to play fair (unlikely) or the Lima
driver project rises back from the deaths.

You mean that closed Mali DDK (the user-space interface) is major obstacle for mainlining Mali kernel side? Why?

Quoted 6 lines

Exactly as stated: in general, and particularly for graphics, a kernel interface needs some Open Source userspace showing that it actually works. The graphics maintainers do not merge kernel drivers for which only a proprietary userspace exists, for a variety of reasons, not least of which an inability to test them, check for regressions, or otherwise maintain them.

Quoted 5 lines

An additional point would be the possible (in-)stability of the userspace interface. While I could sucessfully use a r6 midgard kernel driver with a r5 userspace lib yesterday on my Rockchip Chromebook using Debian, I don't think that is guaranteed to work everytime or that special care is taken for the kernel driver to prevent needing upgrades in lockstep.

One could imagine also a situation where the closed user-space library would not change API because it would care also about compatibility with mainline driver, not only about ARM open driver. But that actually looks like a job for ARM.

I see now also another reason for not accepting Mali mainline - putting pressure on the ARM to open the DDK.

Quoted 7 lines

And that is not even taking into account, that the mali userspace libs seem to be implementator-specific somehow too. For example for Rockchip I currently get my libs from the ChromeOS tree [0] which can talk to X11 [although not plasma5 it seems] and ARM seems to provide a variant for the firefly board using the legacy fbdev interface of the 3.10-based Android kernel. And then there are different variants for Samsung, etc too.

Yes, indeed. They are customer-oriented, where SoC vendor is the customer. This also means that the customer has an ability to influence on ARM decisions...

Anyway thanks Josh and Heiko for explaining.

Best regards,
Krzysztof

Quoted 19 lines
Quoted 4 lines

I haven't heard anything about Lima being defunct, though; as far as I know, it's as functional as it ever was on the hardware it supports. It's unlikely to ever be officially supported, but that hardly seems like a requirement. If you're running on a Mali 400, Lima should work.

probably not entirely defunct, but still on life-support:

For one, if you click on the "Source"-link on limadriver.org you get the gitorious "we're migrating old projects to archive.org" page.

And secondly there is supposed to be an actual mesa driver for mali400 and even bits for the midgard gpus (Mali-T) around, but limited to Luc's harddrive for now [1].

[0] https://github.com/mmind/mali-driver
[1] http://libv.livejournal.com/27461.html

#41 lore raw
Quoted 73 lines · Krzysztof Kozlowski
Quoted 66 lines · Heiko Stuebner

Am Dienstag, 25. August 2015, 23:15:14 schrieb Josh Triplett:

Quoted 58 lines · Krzysztof Kozlowski
Quoted 48 lines · Laurent Pinchart
Quoted 47 lines · On Wednesday 26 August 2015 13:52:23 Krzysztof Kozlowski wrote:
Quoted 45 lines · Sudip Mukherjee
Quoted 12 lines · Krzysztof Kozlowski
Quoted 2 lines · Tim Bird
Quoted 1 line · Pavel Machek

<snip>

Quoted 6 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was
literally hurting my eyes to see that coding style. It's like opposite
of kernel.

Quoted 4 lines

Hi,
I have seen Mali code once few months ago and true that the styling there is exactly opposite of what we use. But anyway, I hope including that in staging will be beneficial for all of you.

Looking at the list of SoCs using Mali:
https://en.wikipedia.org/wiki/Mali_(GPU)
then clearly a lot of vendors could benefit from that. I would be happy to see Mali in staging/mainline.

Quoted 11 lines

And I can also guess
that it will be a waste of your time if you add it to staging and refactor the code ultimately merging it to the main part of the kerel.

I am not an experienced Mali developer but if you all are ok with it then
I can take up the task of adding it to staging. But I will need to have
a board for that as without hardware Greg will not allow the code to be
added. And Krzysztof has suggested ODROID-U3 for this purpose.

Right, I suggested Odroid-U3 (with Mali 400 and Exynos4412) because the board works quite well with mainline. Most of stuff is upstreamed. However I am using Tizen TV profile (public) on it with 4.0 kernel (not entirely public).

There are a lot of more devices with Mali 400 or newer so the question would be rather - which board would work the best (with less problems) on mainline.

Anyway good luck :)

Quoted 8 lines
Quoted 5 lines

Given that DRM drivers can't be merged to mainline without an open-source
userspace we're stuck until ARM decides to play fair (unlikely) or the Lima
driver project rises back from the deaths.

You mean that closed Mali DDK (the user-space interface) is major obstacle for mainlining Mali kernel side? Why?

Quoted 6 lines

Exactly as stated: in general, and particularly for graphics, a kernel interface needs some Open Source userspace showing that it actually works. The graphics maintainers do not merge kernel drivers for which only a proprietary userspace exists, for a variety of reasons, not least of which an inability to test them, check for regressions, or otherwise maintain them.

Quoted 5 lines

An additional point would be the possible (in-)stability of the userspace interface. While I could sucessfully use a r6 midgard kernel driver with a r5 userspace lib yesterday on my Rockchip Chromebook using Debian, I don't think that is guaranteed to work everytime or that special care is taken for the kernel driver to prevent needing upgrades in lockstep.

Quoted 7 lines

One could imagine also a situation where the closed user-space library would not change API because it would care also about compatibility with mainline driver, not only about ARM open driver. But that actually looks like a job for ARM.

I see now also another reason for not accepting Mali mainline - putting pressure on the ARM to open the DDK.

I doubt that the moderated but constant pressure that ARM has gotten from the community these latest years would produce any modification of their model. It didn't happen in the past, if the same approach is taken, I have the feeling that nothing will change...

Don't forget that MALI 400 is very old and outdated, so if any effort to open its software suite had happened, it would have been done already.

Quoted 10 lines
Quoted 6 lines

And that is not even taking into account, that the mali userspace libs seem to be implementator-specific somehow too. For example for Rockchip I currently get my libs from the ChromeOS tree [0] which can talk to X11 [although not plasma5 it seems] and ARM seems to provide a variant for the firefly board using the legacy fbdev interface of the 3.10-based Android kernel. And then there are different variants for Samsung, etc too.

Yes, indeed. They are customer-oriented, where SoC vendor is the customer. This also means that the customer has an ability to influence on ARM decisions...

Well... tried hard and failed :-(

Don't overestimate the ability of (some) SoC vendors to influence this division of ARM.

Bye,

Quoted 22 lines

Anyway thanks Josh and Heiko for explaining.

Best regards,
Krzysztof

Quoted 17 lines
Quoted 4 lines

I haven't heard anything about Lima being defunct, though; as far as I know, it's as functional as it ever was on the hardware it supports. It's unlikely to ever be officially supported, but that hardly seems like a requirement. If you're running on a Mali 400, Lima should work.

probably not entirely defunct, but still on life-support:

For one, if you click on the "Source"-link on limadriver.org you get the gitorious "we're migrating old projects to archive.org" page.

And secondly there is supposed to be an actual mesa driver for mali400 and even bits for the midgard gpus (Mali-T) around, but limited to Luc's harddrive for now [1].

[0] https://github.com/mmind/mali-driver
[1] http://libv.livejournal.com/27461.html

Signature · 2 lines
Nicolas Ferre
(I only speak for myself)
#42 lore raw
In reply to Krzysztof Kozlowski
Quoted 8 lines · Krzysztof Kozlowski

Thanks for updated numbers. Interesting that for the same SoC vendor (MSM) the difference between phone vendors is significant, e.g. 3.1M of Samsung/MSM insertions, 2.6M of LG insertions and only 1.8M of Sony and Motorola.

In the same time number of mainline contributors from LG, Sony and Motorola is similar... so why LG and Samsung/MSM need more than 1M of additional code out of tree?

One thing that happens here is that there's a wide variation in how much the hardware gets customized from the reference designs provided by the SoC vendors which has knock on effect on the amount of additional work that is needed in order to support a given board. I know the Korean manufacturers do tend to make quite a few modifications to their designs so I'd not be surprised if that were contributing to the number of code changes required.

Quoted 2 lines

Mali GPU drivers are an interesting case:
1. They are open (I believe Linux version is entirely under GPLv2).

Well, there's the in kernel stubs and the actual driver...

Quoted 9 lines

2. They are developed for many OS-es.

3. They are present on may end-user products (using SoCs from Allwinner, Mediatek, Rockchip, Samsung and more).

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

The other thing here is that they don't (AIUI) offer a stable ABI, the ABI can change between IP revisions.

#43 lore raw
In reply to Krzysztof Kozlowski
Quoted 1 line · Krzysztof Kozlowski

Mali GPU drivers are an interesting case:

...

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

iirc, gregkh's requirement for staging/ is that it compile. Nothing more. If you're interested, I wrote a script a while back to automate confirming that massive code cleanup (such as changing coding style) doesn't change the resulting object code. It's scripts/objdiff, I used it for the initial import of skein and threefish crypto algorithms into staging.

hth,

Jason.

#44 lore raw

Hi Jason,

Quoted 6 lines · Jason Cooper

iirc, gregkh's requirement for staging/ is that it compile. Nothing more. If you're interested, I wrote a script a while back to automate confirming that massive code cleanup (such as changing coding style) doesn't change the resulting object code. It's scripts/objdiff, I used it for the initial import of skein and threefish crypto algorithms into staging.

Cool, I didn't know about this tool.
Now I can stop doing this manually...

Thanks!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#45 lore raw
In reply to Jason Cooper
Quoted 10 lines · Jason Cooper
Quoted 1 line · Krzysztof Kozlowski

Mali GPU drivers are an interesting case:

...

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

iirc, gregkh's requirement for staging/ is that it compile. Nothing more.

Yes. But Greg will also say that we should be modifying the code with the ultimate goal of moving it out of staging into the main part of the kernel. And if all of us know that it can not be merged into the main part because of closed userspace then will Greg accept it?

regards
sudip

#46 lore raw

Hi Sudip,

Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Jason Cooper
Quoted 1 line · Krzysztof Kozlowski

Mali GPU drivers are an interesting case:

...

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Quoted 7 lines
Quoted 2 lines

iirc, gregkh's requirement for staging/ is that it compile. Nothing more.

Yes. But Greg will also say that we should be modifying the code with the ultimate goal of moving it out of staging into the main part of the kernel. And if all of us know that it can not be merged into the main part because of closed userspace then will Greg accept it?

Well, this seems to me to be a case of chicken-and-the-egg, which came first? fwiw, I think there's benefit in putting the driver in staging/ to see if it ignites development efforts on the userspace side. If it doesn't, I know Greg isn't shy about removing drivers from staging. ;-)

thx,

Jason.

#47 lore raw
Quoted 20 lines · Jason Cooper

Hi Sudip,

Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Jason Cooper
Quoted 1 line · Krzysztof Kozlowski

Mali GPU drivers are an interesting case:

...

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Quoted 7 lines
Quoted 2 lines

iirc, gregkh's requirement for staging/ is that it compile. Nothing more.

Yes. But Greg will also say that we should be modifying the code with the ultimate goal of moving it out of staging into the main part of the kernel. And if all of us know that it can not be merged into the main part because of closed userspace then will Greg accept it?

Quoted 4 lines

Well, this seems to me to be a case of chicken-and-the-egg, which came first? fwiw, I think there's benefit in putting the driver in staging/ to see if it ignites development efforts on the userspace side. If it doesn't, I know Greg isn't shy about removing drivers from staging. ;-)

Adding Greg in the To: list for his comments.

Hi Greg,
Incase you have not seen the previous mails in the thread, we were discussing if mali driver code can be added to staging. Many benefits, but the problem is that the userspace is closed and unless we have an open userspace this cannot be merged with the main part of the kernel.

regards
sudip

#48 lore raw
Quoted 25 lines · Sudip Mukherjee
Quoted 20 lines · Jason Cooper

Hi Sudip,

Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Jason Cooper
Quoted 1 line · Krzysztof Kozlowski

Mali GPU drivers are an interesting case:

...

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Quoted 7 lines
Quoted 2 lines

iirc, gregkh's requirement for staging/ is that it compile. Nothing more.

Yes. But Greg will also say that we should be modifying the code with the ultimate goal of moving it out of staging into the main part of the kernel. And if all of us know that it can not be merged into the main part because of closed userspace then will Greg accept it?

Quoted 4 lines

Well, this seems to me to be a case of chicken-and-the-egg, which came first? fwiw, I think there's benefit in putting the driver in staging/ to see if it ignites development efforts on the userspace side. If it doesn't, I know Greg isn't shy about removing drivers from staging. ;-)

Quoted 7 lines

Adding Greg in the To: list for his comments.

Hi Greg,
Incase you have not seen the previous mails in the thread, we were discussing if mali driver code can be added to staging. Many benefits, but the problem is that the userspace is closed and unless we have an open userspace this cannot be merged with the main part of the kernel.

staging is not for dumping crap that the owners don't want to do the work to get it merged "properly". So I will not take DRM drivers in staging that violate the existing DRM rules of requiring an open userspace as that would mean I would be adding code that can never be merged out of the staging tree.

sorry, go kick the Mali authors to do this correctly. They know what they have to do, their management just doesn't want to let them do it.

good luck,

greg k-h

#49 lore raw

Hi!

Quoted 34 lines · Greg Kroah-Hartman
Quoted 25 lines · Sudip Mukherjee
Quoted 20 lines · Jason Cooper

Hi Sudip,

Quoted 9 lines · Sudip Mukherjee
Quoted 8 lines · Jason Cooper
Quoted 1 line · Krzysztof Kozlowski

Mali GPU drivers are an interesting case:

...

Quoted 4 lines

4. Their coding style is so different that I can't imagine mainlining them into staging area... Recently I was digging into Mali400 and it was literally hurting my eyes to see that coding style. It's like opposite of kernel.

Quoted 7 lines
Quoted 2 lines

iirc, gregkh's requirement for staging/ is that it compile. Nothing more.

Yes. But Greg will also say that we should be modifying the code with the ultimate goal of moving it out of staging into the main part of the kernel. And if all of us know that it can not be merged into the main part because of closed userspace then will Greg accept it?

Quoted 4 lines

Well, this seems to me to be a case of chicken-and-the-egg, which came first? fwiw, I think there's benefit in putting the driver in staging/ to see if it ignites development efforts on the userspace side. If it doesn't, I know Greg isn't shy about removing drivers from staging. ;-)

Quoted 7 lines

Adding Greg in the To: list for his comments.

Hi Greg,
Incase you have not seen the previous mails in the thread, we were discussing if mali driver code can be added to staging. Many benefits, but the problem is that the userspace is closed and unless we have an open userspace this cannot be merged with the main part of the kernel.

Quoted 8 lines

staging is not for dumping crap that the owners don't want to do the work to get it merged "properly". So I will not take DRM drivers in staging that violate the existing DRM rules of requiring an open userspace as that would mean I would be adding code that can never be merged out of the staging tree.

sorry, go kick the Mali authors to do this correctly. They know what they have to do, their management just doesn't want to let them do

it.

Well, you still can get it working with http://limadriver.org/ , then merge it to staging/ , then clean the horrible coding style in tree...

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#50 lore raw

Am Freitag, 28. August 2015, 09:44:39 schrieb Pavel Machek:

Quoted 10 lines

Hi!

Quoted 7 lines · Greg Kroah-Hartman
Quoted 6 lines · Sudip Mukherjee
Quoted 5 lines · Jason Cooper

Hi Sudip,

Quoted 2 lines · Sudip Mukherjee
Quoted 1 line · Jason Cooper

On Wed, Aug 26, 2015 at 10:22:11AM +0900, Krzysztof Kozlowski

Quoted 44 lines · wrote:
Quoted 44 lines
Quoted 30 lines
Quoted 23 lines
Quoted 15 lines
Quoted 11 lines
Quoted 1 line

Mali GPU drivers are an interesting case:

...

Quoted 7 lines

4. Their coding style is so different that I can't imagine mainlining
them into staging area... Recently I was digging into Mali400 and it was
literally hurting my eyes to see that coding style. It's like opposite
of kernel.

Quoted 3 lines

iirc, gregkh's requirement for staging/ is that it compile. Nothing
more.

Quoted 7 lines

Yes. But Greg will also say that we should be modifying the code with
the ultimate goal of moving it out of staging into the main part of the
kernel. And if all of us know that it can not be merged into the main part
because of closed userspace then will Greg accept it?

Quoted 6 lines

Well, this seems to me to be a case of chicken-and-the-egg, which came first? fwiw, I think there's benefit in putting the driver in staging/
to see if it ignites development efforts on the userspace side. If it doesn't, I know Greg isn't shy about removing drivers from staging. ;-)

Quoted 7 lines

Adding Greg in the To: list for his comments.

Hi Greg,
Incase you have not seen the previous mails in the thread, we were discussing if mali driver code can be added to staging. Many benefits, but the problem is that the userspace is closed and unless we have an open userspace this cannot be merged with the main part of the kernel.

staging is not for dumping crap that the owners don't want to do the work to get it merged "properly". So I will not take DRM drivers in staging that violate the existing DRM rules of requiring an open userspace as that would mean I would be adding code that can never be merged out of the staging tree.

Quoted 6 lines
Quoted 2 lines

sorry, go kick the Mali authors to do this correctly. They know what they have to do, their management just doesn't want to let them do

it.

Well, you still can get it working with http://limadriver.org/ ,

except the old public code has vanished with the gitorious shutdown (somebody having a copy should maybe upload it to github or somewhere, so it doesn't get lost completely?) and of course the rumored already existing mesa driver is still in hiding.

Quoted 5 lines

then
merge it to staging/ , then clean the horrible coding style in tree...

Best regards,
Pavel

#51 lore raw
Quoted 8 lines · Heiko Stuebner

Am Freitag, 28. August 2015, 09:44:39 schrieb Pavel Machek:

Quoted 2 lines

Well, you still can get it working with http://limadriver.org/ ,

except the old public code has vanished with the gitorious shutdown (somebody having a copy should maybe upload it to github or somewhere, so it doesn't get lost completely?) and of course the rumored already existing mesa driver is still in hiding.

I managed to find a clone and have put that up in github. Can anyone please check if the copy at https://github.com/sudipm-mukherjee/lima.git
is a valid and the latest one...

regards
sudip

#52 lore raw
In reply to Krzysztof Kozlowski

Am Mittwoch, 29. Juli 2015, 09:45:22 schrieb Krzysztof Kozlowski:

Quoted 36 lines · Tim Bird
Quoted 35 lines · Mark Brown
Quoted 10 lines · Steven Rostedt
Quoted 3 lines

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 5 lines
Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

As Mark says, I've been working on almost exactly this topic for several months now. Last year I conducted a survey investigating obstacles that developers (mostly corporate product developers) have in mainlining. There are lots of non-technical issues that are worth working on (version gap, corporate incentives, training, etc.), but which are outside the scope of the kernel summit.

There are also some technical areas where I think coordinated effort might be useful, to identify deficiencies and collaborate on progress. These might be worth discussing at the summit.

In March of this year, I analysed code from several shipping phones (representing a number of different SoCs, including both ARM and Intel-architecture CPUs), and found that most products have between 1.2 and 3 million lines of code out-of-tree. We are still in progress of finding patterns of out-of-treeness, to inform decisions about technical projects going forward.

Quoted 8 lines
Quoted 5 lines

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Did anyone see successful attempts of mainlining such vendor code? I mean mainlining by individuals, not by vendor company itself.

I started the Rockchip ARM support in this manner ;-) . My main job is hacking on the mentioned vendor kernels, Finding the quirks after everybody put their out-of-tree stuff into it, so doing mainline is for me always a means of balance in terms of clean code, having a nice process to follow and a lot of great people to learn from. So I'm doing mainline as a means to learn and grow.

Quoted 6 lines

It is a difficult task, especially without datasheets but it's possible. At least for some drivers.

If there were such efforts, I would be curious what obstacles he/she encountered (except a common one - missing datasheet/specs) and how he can be helped?

The dubious code quality Laurent already mentioned in another mail - aka you normally cannot upstream vendor-drivers directly.

For example in the vendor kernel, the clock tree was 150K of C code per soc and hard to read at all. So in a first step I did "reverse-engineer" the code from the GPL'ed source release and built a register map out of it [0].

So getting the clock tree right to what it is today was one of the biggest obstacles. Another was pinctrl, which in retrospect is sub-optimal.

So I guess the big issues are the big core systems which you essentially _need to get right_ from the start, as everything else builds on it. And with dt- bindings you get issues if stuff needs to be redone later.

On the other hand, Rockchip SoCs have the benefit of seeming to use a lot of external IPs (dw-uart, dw-mmc, dw-hdmi, etc), so a lot of the later drivers get comparatively easy.

[0]
https://docs.google.com/document/d/1voaR9Xk3lisCQIG3ThySOSnSHBUequljQYnceFlr53w/edit
[Public and linked to already way before any involvement from Rockchip itself, so does not fall under an NDA, but also unchanged since then]

#53 lore raw
In reply to Tim Bird
Quoted 5 lines · Tim Bird

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Quick question on your table: Is "Video" drivers/video i.e. all the legacy fbdev horror-show? If so you probably want to rename that to "GPU (legacy)" or similar since for upstream all that stuff really should end up as a drm gpu driver. Especially now that atomic modesetting is merged.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#54 lore raw
Quoted 7 lines · Daniel Vetter
Quoted 5 lines · Tim Bird

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Quoted 5 lines

Quick question on your table: Is "Video" drivers/video i.e. all the legacy fbdev horror-show? If so you probably want to rename that to "GPU (legacy)" or similar since for upstream all that stuff really should end up as a drm gpu driver. Especially now that atomic modesetting is merged.

It is. Thanks for the feedback.
-- Tim

#55 lore raw
In reply to Tim Bird

Hi All,

I am also very interested in this topic, and now I am focusing on Huawei cellphone kernel development.

One month ago, I submitted the basic system and clock driver of HiKey to linux kernel, and HiKey is the prototype of Huawei Honor 4X cellphone.

We really hope people can download the latest kernel code and run well on HiKey(or other mobile products) at some future date, and now we try to submit the rest drivers to kernel maillist.

Quoted 36 lines · Tim Bird
Quoted 11 lines · Mark Brown
Quoted 3 lines · Steven Rostedt

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

It's basically all subsystems that get impacted, at the minute I'd say it's more a plan of action and process discussion than a technical one though in the context of KS planning that's quite probably the same thing.

Quoted 5 lines
Quoted 1 line

Also, what is expected to be solved at KS?

Tim Bird (Cced) has been running some sessions at other conferences scoping the problem and discussing ways to move forward on this, another similar session might be useful.

As Mark says, I've been working on almost exactly this topic for several months now. Last year I conducted a survey investigating obstacles that developers (mostly corporate product developers) have in mainlining. There are lots of non-technical issues that are worth working on (version gap, corporate incentives, training, etc.), but which are outside the scope of the kernel summit.

There are also some technical areas where I think coordinated effort might be useful, to identify deficiencies and collaborate on progress. These might be worth discussing at the summit.

In March of this year, I analysed code from several shipping phones (representing a number of different SoCs, including both ARM and Intel-architecture CPUs), and found that most products have between 1.2 and 3 million lines of code out-of-tree. We are still in progress of finding patterns of out-of-treeness, to inform decisions about technical projects going forward.

Quoted 5 lines

There is now a wiki page at:
See http://elinux.org/Kernel_areas_of_focus_for_mainlining
In particular it has a table showing certain areas that tend to have a lot of out-of-tree code (e.g. most phones have between 80K to 100K of lines of wireless driver support out-of-mainline)

Very glad to see Huawei P6 is also in your investigation list :)

For HiKey, the original display driver is based on Framebuffer, but we need to reconstruct this driver based on DRM framework when do the upstream work, one lesson we learned here is trying to develop drivers based on the requirements of current linux sub-system.

Quoted 4 lines

IMHO it would be useful to discuss these areas, to see if there are technical reasons for these deficiencies, and work to resolve them.

Agree.

Thanks,

Bintian

Quoted 9 lines

-- Tim

_______________________________________________
Ksummit-discuss mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/ksummit-discuss

.

#56 lore raw
Quoted 5 lines · Bintian

Hi All,

I am also very interested in this topic, and now I am focusing on Huawei cellphone kernel development.

Quoted 7 lines

One month ago, I submitted the basic system and clock driver of HiKey to linux kernel, and HiKey is the prototype of Huawei Honor 4X cellphone.

We really hope people can download the latest kernel code and run well on HiKey(or other mobile products) at some future date, and now we try to submit the rest drivers to kernel maillist.

That's great! Thanks for your efforts on this!

...

Quoted 4 lines

For HiKey, the original display driver is based on Framebuffer, but we need to reconstruct this driver based on DRM framework when do the upstream work, one lesson we learned here is trying to develop drivers based on the requirements of current linux sub-system.

Thanks for sharing that.

I'd be interested in hearing from different people about what their big areas of concern are (or what they anticipate will be their large areas of work).

Quoted 6 lines
Quoted 3 lines

IMHO it would be useful to discuss these areas, to see if there are technical reasons for these deficiencies, and work to resolve them.

Agree.

Thanks,

I'm not trying to gin up attendees for LinuxFoundation or Linaro events, but if you happen to be there, we are planning on hosting BOFs about this topic at the following upcoming events:
LinuxCon NA - August 19, 12:45, Seattle, WA, USA Linaro Connect - (probably) September 22, Burlingame, CA, USA ELC Europe - October 7, 11:30, Dublin, Ireland

Please drop by if you are interested, or send me an e-mail if you want more details about the current work.
-- Tim

#57 lore raw
Quoted 1 line · Tim Bird

On 07/29/2015 12:14 AM, Bintian wrote:

[...]

Quoted 7 lines

I'm not trying to gin up attendees for LinuxFoundation or Linaro events, but if you happen to be there, we are planning on hosting BOFs about this topic at the following upcoming events:
LinuxCon NA - August 19, 12:45, Seattle, WA, USA Linaro Connect - (probably) September 22, Burlingame, CA, USA ELC Europe - October 7, 11:30, Dublin, Ireland

I am interested in this topic and your current work, the hosting places of above three events are far from China, I am afraid I cannot attend. But Korea is very close to Beijing :)

Thank you Tim,

BR,

Bintian

Quoted 8 lines

Please drop by if you are interested, or send me an e-mail if you want more details about the current work.
-- Tim

.

#58 lore raw
In reply to Steven Rostedt
Quoted 17 lines · Steven Rostedt
Quoted 12 lines · On Thu, 23 Jul 2015 14:14:41 +0200 Pavel Machek <[email protected]> wrote:
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 1 line

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

Quoted 8 lines

Seems like a reasonable topic, especially since KS is being held in South Korea this year.

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

Also, what is expected to be solved at KS?

Questions I had in mind:

1) RGB leds. They are not same as 3 leds. Plus there' hw acceleration on them. How to support them?

2) HW damage: is it kernel's job to protect hardware from user? We currently have no battery over-discharge protection (and its tricky).

3) HW abstraction: do we want to keep the model where kernel hides differences between different machines, so that same userland can run on all of them? Currently that is broken, for example we have 3 "chargers" on N900, and userland gets very confused; or we have 100 mixers, that are pretty much imposible to set up by user..

4) voice link to modem: Nokia people tell us that ALSA is not suitable interface to modem audio. What is the right interface, then?

5) where do we get userland for testing?

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#59 lore raw
Quoted 41 lines · Pavel Machek
Quoted 17 lines · Steven Rostedt
Quoted 12 lines · On Thu, 23 Jul 2015 14:14:41 +0200 Pavel Machek <[email protected]> wrote:
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 1 line

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

Quoted 8 lines

Seems like a reasonable topic, especially since KS is being held in South Korea this year.

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

Also, what is expected to be solved at KS?

Questions I had in mind:

1) RGB leds. They are not same as 3 leds. Plus there' hw acceleration on them. How to support them?

2) HW damage: is it kernel's job to protect hardware from user? We currently have no battery over-discharge protection (and its tricky).

3) HW abstraction: do we want to keep the model where kernel hides differences between different machines, so that same userland can run on all of them? Currently that is broken, for example we have 3 "chargers" on N900, and userland gets very confused; or we have 100 mixers, that are pretty much imposible to set up by user..

Quoted 4 lines

4) voice link to modem: Nokia people tell us that ALSA is not suitable interface to modem audio. What is the right interface, then?

5) where do we get userland for testing?

and the big one... for Android people (not me):

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#60 lore raw
Quoted 45 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:
Quoted 44 lines · Pavel Machek
Quoted 17 lines · Steven Rostedt
Quoted 12 lines · On Thu, 23 Jul 2015 14:14:41 +0200 Pavel Machek <[email protected]> wrote:
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Pavel Machek

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 1 line

Yes. Plus, there seems to be group at Samsung. Trats is a cellphone iirc.

Quoted 8 lines

Seems like a reasonable topic, especially since KS is being held in South Korea this year.

Although is this something to be a core topic or a tech topic? Does this affect all subsystems, or just a set of drivers? Note, a core topic wont get as much time for discussion as a tech topic would.

Also, what is expected to be solved at KS?

Questions I had in mind:

1) RGB leds. They are not same as 3 leds. Plus there' hw acceleration on them. How to support them?

2) HW damage: is it kernel's job to protect hardware from user? We currently have no battery over-discharge protection (and its tricky).

3) HW abstraction: do we want to keep the model where kernel hides differences between different machines, so that same userland can run on all of them? Currently that is broken, for example we have 3 "chargers" on N900, and userland gets very confused; or we have 100 mixers, that are pretty much imposible to set up by user..

4) voice link to modem: Nokia people tell us that ALSA is not suitable interface to modem audio. What is the right interface, then?

Quoted 8 lines
Quoted 1 line

5) where do we get userland for testing?

and the big one... for Android people (not me):

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.
But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

For the second half - it is really a user-space problem. User-space decides when to enter suspend.
(or CONFIG_PM_WAKELOCKS can enable a kernel interface
via /sys/power/wake_lock).

NeilBrown

#61 lore raw
Quoted 4 lines · NeilBrown
Quoted 3 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:

and the big one... for Android people (not me):

Quoted 8 lines
Quoted 4 lines

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.

Yes s2ram is just an additional tool. PM runtime alone can already provide a reasonable battery life for a phone as long as it's properly implemented and the hardware supports it. With reasonable battery life in this case I mean over 10 days in idle mode with system running and timers working.

Quoted 5 lines

But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

And with s2ram the difference is that then the system is not running and timers don't work so it really needs to be optional.

Quoted 4 lines

For the second half - it is really a user-space problem. User-space decides when to enter suspend.
(or CONFIG_PM_WAKELOCKS can enable a kernel interface
via /sys/power/wake_lock).

Yeah agreed.

Regards,

Tony

#62 lore raw
Quoted 20 lines · Tony Lindgren
Quoted 4 lines · NeilBrown
Quoted 3 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:

and the big one... for Android people (not me):

Quoted 8 lines
Quoted 4 lines

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.

Yes s2ram is just an additional tool. PM runtime alone can already provide a reasonable battery life for a phone as long as it's properly implemented and the hardware supports it. With reasonable battery life in this case I mean over 10 days in idle mode with system running and timers working.

Quoted 8 lines
Quoted 5 lines

But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

And with s2ram the difference is that then the system is not running and timers don't work so it really needs to be optional.

Right.

Even with suspend-to-idle we can get less energy usage with respect to runtime idle (device runtime PM plus cpuidle) just because timer events are disabled then.

Quoted 6 lines
Quoted 4 lines

For the second half - it is really a user-space problem. User-space decides when to enter suspend.
(or CONFIG_PM_WAKELOCKS can enable a kernel interface
via /sys/power/wake_lock).

Yeah agreed.

Right.

Thanks,
Rafael

#63 lore raw
Quoted 27 lines · On Sat, 25 Jul 2015 00:26:03 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 26 lines · Tony Lindgren
Quoted 4 lines · NeilBrown
Quoted 3 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:

and the big one... for Android people (not me):

Quoted 8 lines
Quoted 4 lines

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.

Yes s2ram is just an additional tool. PM runtime alone can already provide a reasonable battery life for a phone as long as it's properly implemented and the hardware supports it. With reasonable battery life in this case I mean over 10 days in idle mode with system running and timers working.

Quoted 5 lines

But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

Quoted 9 lines
Quoted 2 lines

And with s2ram the difference is that then the system is not running and timers don't work so it really needs to be optional.

Right.

Even with suspend-to-idle we can get less energy usage with respect to runtime idle (device runtime PM plus cpuidle) just because timer events are disabled then.

Is this just the timer interrupt which keeps the clock up to date, or are there other timer events which keep ticking?

Would it be possible for the wall-clock timer to stop if the system has been idle for a while, and for the RTC to be used to recover the correct time when activity restarts?

Thanks,
NeilBrown

#64 lore raw
Quoted 35 lines · NeilBrown
Quoted 32 lines · On Sat, 25 Jul 2015 00:26:03 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 20 lines · Tony Lindgren
Quoted 4 lines · NeilBrown
Quoted 3 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:

and the big one... for Android people (not me):

Quoted 8 lines
Quoted 4 lines

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.

Yes s2ram is just an additional tool. PM runtime alone can already provide a reasonable battery life for a phone as long as it's properly implemented and the hardware supports it. With reasonable battery life in this case I mean over 10 days in idle mode with system running and timers working.

Quoted 8 lines
Quoted 5 lines

But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

And with s2ram the difference is that then the system is not running and timers don't work so it really needs to be optional.

Right.

Quoted 7 lines
Quoted 4 lines

Even with suspend-to-idle we can get less energy usage with respect to runtime idle (device runtime PM plus cpuidle) just because timer events are disabled then.

Is this just the timer interrupt which keeps the clock up to date, or are there other timer events which keep ticking?

The other events mostly.

Quoted 3 lines

Would it be possible for the wall-clock timer to stop if the system has been idle for a while, and for the RTC to be used to recover the correct time when activity restarts?

We use that mechanism in suspend-to-idle, but it requires the timekeeping to be frozen. I don't think it would be possible to do that for runtime idle without races, though.

Thanks,
Rafael

#65 lore raw
Quoted 46 lines · Rafael J. Wysocki
Quoted 35 lines · NeilBrown
Quoted 32 lines · On Sat, 25 Jul 2015 00:26:03 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 20 lines · Tony Lindgren
Quoted 4 lines · NeilBrown
Quoted 3 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:

and the big one... for Android people (not me):

Quoted 8 lines
Quoted 4 lines

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.

Yes s2ram is just an additional tool. PM runtime alone can already provide a reasonable battery life for a phone as long as it's properly implemented and the hardware supports it. With reasonable battery life in this case I mean over 10 days in idle mode with system running and timers working.

Quoted 8 lines
Quoted 5 lines

But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

And with s2ram the difference is that then the system is not running and timers don't work so it really needs to be optional.

Right.

Quoted 7 lines
Quoted 4 lines

Even with suspend-to-idle we can get less energy usage with respect to runtime idle (device runtime PM plus cpuidle) just because timer events are disabled then.

Is this just the timer interrupt which keeps the clock up to date, or are there other timer events which keep ticking?

The other events mostly.

Quoted 7 lines
Quoted 3 lines

Would it be possible for the wall-clock timer to stop if the system has been idle for a while, and for the RTC to be used to recover the correct time when activity restarts?

We use that mechanism in suspend-to-idle, but it requires the timekeeping to be frozen. I don't think it would be possible to do that for runtime idle without races, though.

Moreover, the "if the system has been idle for a while" condition is not really in line with how runtime idle works. Namely, it works by predicting how much time the given CPU will be idle (on the basis of when the next timer event for it is scheduled among other things) and selecting an idle state for it to go to in accordance with that. So we know upfront how much time the CPU will be idle (at least roughly) and we rely on timer events to wake up CPUs from idle states.

In the suspend-to-idle case we only need to care about events from devices explicitly enabled to wake up the system from sleep and that's why we can safely suspend the timekeeping then.

Thanks,
Rafael

#66 lore raw
Quoted 63 lines · On Thu, 30 Jul 2015 01:23:21 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 46 lines · Rafael J. Wysocki
Quoted 35 lines · NeilBrown
Quoted 32 lines · On Sat, 25 Jul 2015 00:26:03 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 20 lines · Tony Lindgren
Quoted 4 lines · NeilBrown
Quoted 3 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:

and the big one... for Android people (not me):

Quoted 8 lines
Quoted 4 lines

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.

Yes s2ram is just an additional tool. PM runtime alone can already provide a reasonable battery life for a phone as long as it's properly implemented and the hardware supports it. With reasonable battery life in this case I mean over 10 days in idle mode with system running and timers working.

Quoted 8 lines
Quoted 5 lines

But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

And with s2ram the difference is that then the system is not running and timers don't work so it really needs to be optional.

Right.

Quoted 7 lines
Quoted 4 lines

Even with suspend-to-idle we can get less energy usage with respect to runtime idle (device runtime PM plus cpuidle) just because timer events are disabled then.

Is this just the timer interrupt which keeps the clock up to date, or are there other timer events which keep ticking?

The other events mostly.

Quoted 7 lines
Quoted 3 lines

Would it be possible for the wall-clock timer to stop if the system has been idle for a while, and for the RTC to be used to recover the correct time when activity restarts?

We use that mechanism in suspend-to-idle, but it requires the timekeeping to be frozen. I don't think it would be possible to do that for runtime idle without races, though.

Moreover, the "if the system has been idle for a while" condition is not really in line with how runtime idle works. Namely, it works by predicting how much time the given CPU will be idle (on the basis of when the next timer event for it is scheduled among other things) and selecting an idle state for it to go to in accordance with that. So we know upfront how much time the CPU will be idle (at least roughly) and we rely on timer events to wake up CPUs from idle states.

Quoted 4 lines

In the suspend-to-idle case we only need to care about events from devices explicitly enabled to wake up the system from sleep and that's why we can safely suspend the timekeeping then.

Thanks ... this actually helps me understand the point of suspend-to-idle which didn't really make a lot of sense to me before (though it entirely possible that I'm still missing some bits).

A while ago (years?) there was a debate about whether it was really sensible/necessary to use system suspend to save power. This was in the context of Android and suspend-blocker/wake-locks. One school of thought was that with sufficient runtime-PM and appropriate controls of user-space processes, system-wide suspend was not necessary.

You seem to be saying that timer-interrupts are the deal-breaker. The only way to stop timer interrupts indefinitely is using some sort of system-wide suspend, whether suspend-to-RAM or suspend-to-idle.

While it may be possible to achieve significant power savings without using system-wide suspend, there is a limit and system-wide suspend will always allow better savings.

Would that be correct? If so: it is nice to have a clear answer - thanks.

NeilBrown

#67 lore raw
Quoted 75 lines · NeilBrown
Quoted 63 lines · On Thu, 30 Jul 2015 01:23:21 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 46 lines · Rafael J. Wysocki
Quoted 35 lines · NeilBrown
Quoted 32 lines · On Sat, 25 Jul 2015 00:26:03 +0200 "Rafael J. Wysocki" <[email protected]>…
Quoted 20 lines · Tony Lindgren
Quoted 4 lines · NeilBrown
Quoted 3 lines · On Thu, 23 Jul 2015 22:34:29 +0200 Pavel Machek <[email protected]> wrote:

and the big one... for Android people (not me):

Quoted 8 lines
Quoted 4 lines

6) do we need to use s2ram (and then pretend phone is not suspended) to save power on cellphones? If so, do we need new interface for applications to signal "I'd really like to run"?

For the first half of this question, the answer is:
Probably not. runtime-pm should be able to put all devices to sleep,
and cgroup freezer should be able to freeze untrusted processes.

Yes s2ram is just an additional tool. PM runtime alone can already provide a reasonable battery life for a phone as long as it's properly implemented and the hardware supports it. With reasonable battery life in this case I mean over 10 days in idle mode with system running and timers working.

Quoted 8 lines
Quoted 5 lines

But I suspect runtime-pm doesn't provide as much power saving as system suspend, and using the cgroup freezer means lots of changes to userspace.
So lots of work would be needed to meet this goal, if it is a worthwhile goal.

And with s2ram the difference is that then the system is not running and timers don't work so it really needs to be optional.

Right.

Quoted 7 lines
Quoted 4 lines

Even with suspend-to-idle we can get less energy usage with respect to runtime idle (device runtime PM plus cpuidle) just because timer events are disabled then.

Is this just the timer interrupt which keeps the clock up to date, or are there other timer events which keep ticking?

The other events mostly.

Quoted 7 lines
Quoted 3 lines

Would it be possible for the wall-clock timer to stop if the system has been idle for a while, and for the RTC to be used to recover the correct time when activity restarts?

We use that mechanism in suspend-to-idle, but it requires the timekeeping to be frozen. I don't think it would be possible to do that for runtime idle without races, though.

Moreover, the "if the system has been idle for a while" condition is not really in line with how runtime idle works. Namely, it works by predicting how much time the given CPU will be idle (on the basis of when the next timer event for it is scheduled among other things) and selecting an idle state for it to go to in accordance with that. So we know upfront how much time the CPU will be idle (at least roughly) and we rely on timer events to wake up CPUs from idle states.

Quoted 4 lines

In the suspend-to-idle case we only need to care about events from devices explicitly enabled to wake up the system from sleep and that's why we can safely suspend the timekeeping then.

Thanks ... this actually helps me understand the point of suspend-to-idle which didn't really make a lot of sense to me before (though it entirely possible that I'm still missing some bits).

Quoted 7 lines

A while ago (years?) there was a debate about whether it was really sensible/necessary to use system suspend to save power. This was in the context of Android and suspend-blocker/wake-locks. One school of thought was that with sufficient runtime-PM and appropriate controls of user-space processes, system-wide suspend was not necessary.

You seem to be saying that timer-interrupts are the deal-breaker.

Yes, they are.

Quoted 2 lines

The only way to stop timer interrupts indefinitely is using some sort of system-wide suspend, whether suspend-to-RAM or suspend-to-idle.

Right.

Quoted 6 lines

While it may be possible to achieve significant power savings without using system-wide suspend, there is a limit and system-wide suspend will always allow better savings.

Would that be correct? If so: it is nice to have a clear answer - thanks.

Yes, that's correct.

Essentially, what happens is that runtime PM allows us to reach the state in which the system draws as little power as in suspend-to-idle, but it simply doesn't allow the system to stay in that state long enough in one go due to timer interrupts (and possibly other types of interrupt noice that is suppressed by suspending all devices).

Since energy is the power drawn in a given state times the time spent in that state (on the average), that's why the system in suspend-to-idle uses less energy than it would with runtime idle during the same period (modulo the energy spent on suspending and resuming devices etc, of course).

Thanks,
Rafael

#68 lore raw
Quoted 10 lines · Rafael J. Wysocki

Essentially, what happens is that runtime PM allows us to reach the state in which the system draws as little power as in suspend-to-idle, but it simply doesn't allow the system to stay in that state long enough in one go due to timer interrupts (and possibly other types of interrupt noice that is suppressed by suspending all devices).

Since energy is the power drawn in a given state times the time spent in that state (on the average), that's why the system in suspend-to-idle uses less energy than it would with runtime idle during the same period (modulo the energy spent on suspending and resuming devices etc, of course).

We could in theory work to reduce the number of these additional timer and other interrupts further - there was a lot of focus on this in the past (partly for desktop use cases where suspend isn't such a quick out) though with the advent of Android and the wide deployment of suspend to idle that resulted people stopped bothering on the embedded side since suspend to idle is both simple and effective.

#69 lore raw
Quoted 13 lines · Mark Brown
Quoted 10 lines · Rafael J. Wysocki

Essentially, what happens is that runtime PM allows us to reach the state in which the system draws as little power as in suspend-to-idle, but it simply doesn't allow the system to stay in that state long enough in one go due to timer interrupts (and possibly other types of interrupt noice that is suppressed by suspending all devices).

Since energy is the power drawn in a given state times the time spent in that state (on the average), that's why the system in suspend-to-idle uses less energy than it would with runtime idle during the same period (modulo the energy spent on suspending and resuming devices etc, of course).

Quoted 6 lines

We could in theory work to reduce the number of these additional timer and other interrupts further - there was a lot of focus on this in the past (partly for desktop use cases where suspend isn't such a quick out) though with the advent of Android and the wide deployment of suspend to idle that resulted people stopped bothering on the embedded side since suspend to idle is both simple and effective.

In addition to that, while we can reduce the number of those in the kernel, user space can still do things that increase the number of them and we can't really control it. That only depends on what applications are running and users may not be aware of all of the consequences of running them.

By freezing user space during suspend we effectively prevent it from scheduling more timer events in the future.

Thanks,
Rafael

#70 lore raw
In reply to Pavel Machek
Quoted 4 lines · Pavel Machek

Questions I had in mind:

1) RGB leds. They are not same as 3 leds. Plus there' hw acceleration on them. How to support them?

Seems like internally we should treat them as 3 LEDs, but the interface to userspace or to the LED trigger mechanism should group the three brightness values together rather than handling them separately.

Is the hardware acceleration something more than PWM?

- Josh Triplett

#71 lore raw
Quoted 9 lines · On Thu 2015-07-23 14:00:18, [email protected] wrote:
Quoted 4 lines · Pavel Machek

Questions I had in mind:

1) RGB leds. They are not same as 3 leds. Plus there' hw acceleration on them. How to support them?

Seems like internally we should treat them as 3 LEDs, but the interface to userspace or to the LED trigger mechanism should group the three brightness values together rather than handling them separately.

Yes. It should me "make it show magenta" not "set red to x, blue to y, green to z"...

Quoted 1 line

Is the hardware acceleration something more than PWM?

Yes. It can do quite complex patterns autonomously. "Blink red three times, then slowly go to full brightness and back". It can do as complex stuff as blink n times, then delay, for n is prime number.
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#72 lore raw
In reply to Pavel Machek
Quoted 2 lines · Pavel Machek

4) voice link to modem: Nokia people tell us that ALSA is not suitable interface to modem audio. What is the right interface, then?

ALSA is the right interface for this, this is going to be some misunderstanding on their part about how to use it or limitations in the drivers for their particular system (and possibly some unfortunate hardware design, it sounds like they may still be bouncing the voice call through the AP which isn't the most wonderful idea ever). There are rather a lot of production phones using ALSA out there without undue complaints.

#73 lore raw
Quoted 7 lines · Mark Brown
Quoted 2 lines · Pavel Machek

4) voice link to modem: Nokia people tell us that ALSA is not suitable interface to modem audio. What is the right interface, then?

ALSA is the right interface for this, this is going to be some misunderstanding on their part about how to use it or limitations in

That's what I was arguing, but see https://lkml.org/lkml/2015/3/5/606
.

kai> Our take was that ALSA is not the right interface for cmt_speech. The kai> cmt_speech interface in the modem is _not_ a PCM interface as modelled kai> by
kai> ALSA. Specifically:
kai>
kai>- the interface is lossy in both directions
kai>- data is sent in packets, not a stream of samples (could be other kai>- things
kai> than PCM samples), with timing and meta-data
kai> - timing of uplink is of utmost importance

Quoted 4 lines

the drivers for their particular system (and possibly some unfortunate hardware design, it sounds like they may still be bouncing the voice call through the AP which isn't the most wonderful idea ever). There

Actually, sending data through AP is _very_ good idea from security perspective. You don't want hacked baseband to eavesdrop on you, do you?

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#74 lore raw
Quoted 7 lines · Pavel Machek
Quoted 4 lines · Mark Brown

On Thu, Jul 23, 2015 at 10:29:02PM +0200, Pavel Machek wrote:

ALSA is the right interface for this, this is going to be some misunderstanding on their part about how to use it or limitations in

That's what I was arguing, but see https://lkml.org/lkml/2015/3/5/606

I can't view that link since lkml.org was down earlier today when I was working online and now I'm working offline.

Quoted 6 lines

kai> Our take was that ALSA is not the right interface for cmt_speech. The kai> cmt_speech interface in the modem is _not_ a PCM interface as modelled kai> by
kai> ALSA. Specifically:
kai>
kai>- the interface is lossy in both directions

Yay.

Quoted 3 lines

kai>- data is sent in packets, not a stream of samples (could be other kai>- things
kai> than PCM samples), with timing and meta-data

This is what the copy() operation in the driver is for, there are other DSP based devices out there as well as things like USB.

Quoted 1 line

kai> - timing of uplink is of utmost importance

Well, ALSA doesn't impose any latency of its own so there should be no issue there - the overheads should be minimal.

Quoted 8 lines
Quoted 4 lines

the drivers for their particular system (and possibly some unfortunate hardware design, it sounds like they may still be bouncing the voice call through the AP which isn't the most wonderful idea ever). There

Actually, sending data through AP is _very_ good idea from security perspective. You don't want hacked baseband to eavesdrop on you, do you?

Given that the baseband is a key part of the data path it's not like
you're gaining anything there as far as I can see? I suppose you could
argue that the AP is actually an additional attack surface here.

#75 lore raw
Quoted 11 lines · Mark Brown
Quoted 7 lines · Pavel Machek
Quoted 4 lines · Mark Brown

On Thu, Jul 23, 2015 at 10:29:02PM +0200, Pavel Machek wrote:

ALSA is the right interface for this, this is going to be some misunderstanding on their part about how to use it or limitations in

That's what I was arguing, but see https://lkml.org/lkml/2015/3/5/606

I can't view that link since lkml.org was down earlier today when I was working online and now I'm working offline.

It works for me now.

Quoted 13 lines
Quoted 6 lines

kai> Our take was that ALSA is not the right interface for cmt_speech. The kai> cmt_speech interface in the modem is _not_ a PCM interface as modelled kai> by
kai> ALSA. Specifically:
kai>
kai>- the interface is lossy in both directions

Yay.

Quoted 3 lines

kai>- data is sent in packets, not a stream of samples (could be other kai>- things
kai> than PCM samples), with timing and meta-data

Quoted 7 lines

This is what the copy() operation in the driver is for, there are other DSP based devices out there as well as things like USB.

Quoted 1 line

kai> - timing of uplink is of utmost importance

Well, ALSA doesn't impose any latency of its own so there should be no issue there - the overheads should be minimal.

The interface Nokia has is pretty strange. I believe you send timestamp with buffer, and it means "I'd like this packet of data to be sent at that time", or something like that.

Anyway, no need to argue with me, I believe ALSA should be suitable.

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

the drivers for their particular system (and possibly some unfortunate hardware design, it sounds like they may still be bouncing the voice call through the AP which isn't the most wonderful idea ever). There

Quoted 7 lines
Quoted 3 lines

Actually, sending data through AP is _very_ good idea from security perspective. You don't want hacked baseband to eavesdrop on you, do you?

Given that the baseband is a key part of the data path it's not like
you're gaining anything there as far as I can see? I suppose you could
argue that the AP is actually an additional attack surface here.

Actually yes, I believe I'm gaining a lot.

If baseband is directly connected to the microphone, it can eavesdrop on me while the phone appears to be idle.

If data is being sent through the AP, yes, it can eavesdrop on calls (but there are probably easier ways to eavesdrop on calls), but it won't be able to do something funny when the phone appears to be idle.

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#76 lore raw
Quoted 10 lines · Pavel Machek
Quoted 3 lines · Mark Brown

Given that the baseband is a key part of the data path it's not like
you're gaining anything there as far as I can see? I suppose you could
argue that the AP is actually an additional attack surface here.

Actually yes, I believe I'm gaining a lot.

If baseband is directly connected to the microphone, it can eavesdrop on me while the phone appears to be idle.

Oh, right. That's not an issue since there's generally routing control in the rest of the system (within the CODEC and sometimes elsewhere also) so you can isolate the baseband from the local audio sources and only connect it in call. When not in use the CODEC will be powered down and even when in use by the AP you'd usually not route to the baseband.

The baseband normally doesn't have sufficient physical access to relevant control interfaces to get any input.

#77 lore raw
Quoted 12 lines · Mark Brown
Quoted 10 lines · Pavel Machek
Quoted 3 lines · Mark Brown

Given that the baseband is a key part of the data path it's not like
you're gaining anything there as far as I can see? I suppose you could
argue that the AP is actually an additional attack surface here.

Actually yes, I believe I'm gaining a lot.

If baseband is directly connected to the microphone, it can eavesdrop on me while the phone appears to be idle.

Quoted 8 lines

Oh, right. That's not an issue since there's generally routing control in the rest of the system (within the CODEC and sometimes elsewhere also) so you can isolate the baseband from the local audio sources and only connect it in call. When not in use the CODEC will be powered down and even when in use by the AP you'd usually not route to the baseband.

The baseband normally doesn't have sufficient physical access to relevant control interfaces to get any input.

Ok, on many systems you are right, I guess.

That still leaves these reasons to route it though the CPU:

* ability to record calls

* ability to do signal processing on the data, like echo cancel for speakerphone (or perhaps changing your voice to female one)

* ability to do advanced stuff like GSM-to-VOIP gateway.

But yes, connecting baseband directly to audio is simpler...

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#78 lore raw
Quoted 3 lines · Pavel Machek

That still leaves these reasons to route it though the CPU:

* ability to record calls

This is usually done by routing the audio to both the baseband and CPU simultaneously - this gives you the recording without taking the latency hit in the call data path which makes life a lot easier.

It's not that the hardware *can't* route audio to the CPU usually, it's that call quality is extremely sensitive to any additional latency in the path and mobile communications are inherently at the high end of what's acceptable so system designs generally pay attention to ensuring that no additional latency is introduced (like will tend to happen if you have a general purpose OS pushing data around, or in general extra copies).

Quoted 2 lines

* ability to do signal processing on the data, like echo cancel for speakerphone (or perhaps changing your voice to female one)

Right, typically if the system was intended to have these things (I'd be surprised to see something ship without at least echo cancellation) there would be some dedicated DSP in the data path implementing them already. Some of the applications really need extremely low latency sample by sample operation which requires a dedicated processor anyway. This is often part of the baseband, though there can be audio DSPs elsewhere instead or as well.

Quoted 1 line

* ability to do advanced stuff like GSM-to-VOIP gateway.

Yes, though that's a completely different use case and is going to have latency problems anyway.

#79 lore raw
In reply to Pavel Machek
Quoted 8 lines · Pavel Machek
Quoted 7 lines · Mark Brown
Quoted 5 lines · Pavel Machek
Quoted 4 lines · Mark Brown

On Thu, Jul 23, 2015 at 10:29:02PM +0200, Pavel Machek wrote:

ALSA is the right interface for this, this is going to be some misunderstanding on their part about how to use it or limitations in

Quoted 15 lines
Quoted 4 lines
Quoted 1 line

That's what I was arguing, but see https://lkml.org/lkml/2015/3/5/606

I can't view that link since lkml.org was down earlier today when I was working online and now I'm working offline.

It works for me now.

Quoted 8 lines
Quoted 6 lines

kai> Our take was that ALSA is not the right interface for cmt_speech. The kai> cmt_speech interface in the modem is _not_ a PCM interface as modelled kai> by
kai> ALSA. Specifically:
kai>
kai>- the interface is lossy in both directions

Yay.

Well at the point when the audio gets played out of the speaker it's a stream :) I think the issues above are related to reading raw data from the modem before it gets processed further for noise cancellation by the DSP and so on. Eventually it should be just audio stream though.

Quoted 11 lines
Quoted 11 lines
Quoted 3 lines

kai>- data is sent in packets, not a stream of samples (could be other kai>- things
kai> than PCM samples), with timing and meta-data

This is what the copy() operation in the driver is for, there are other DSP based devices out there as well as things like USB.

Quoted 1 line

kai> - timing of uplink is of utmost importance

Well, ALSA doesn't impose any latency of its own so there should be no issue there - the overheads should be minimal.

I believe the fact that that ALSA fifo size could not be changed dynamically between what the modem needs and what should be used for audio playback from PM point of view used to be a problem. Maybe that's already fixed, now I don't know. Just FYI.

Quoted 5 lines

The interface Nokia has is pretty strange. I believe you send timestamp with buffer, and it means "I'd like this packet of data to be sent at that time", or something like that.

Anyway, no need to argue with me, I believe ALSA should be suitable.

Yes ALSA is suitable for sure. It's the raw modem data to audio stream processing part that's weird but that's not ALSA's problem.

Regards,

Tony

#80 lore raw
In reply to Pavel Machek
Quoted 12 lines · Pavel Machek

Hi!

(Please cc me on replies).

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 5 lines

Interested people:

Sebastian Reichel <[email protected]>
Pali Rohár <[email protected]>

I am interested in this topic. Please add me to the list.

Shuah Khan <[email protected]>

You probably already know
the CE Workgroup Device Mainlining Project. Goes over some of the reasons why mainline kernels don't run on phones. Adding Tim Bird to the thread. He did a talk
at ELC back in March of this year about this effort and more information.

http://elinux.org/CE_Workgroup_Device_Mainlining_Project

Very often phone vendors have to make decisions to get the product out and they might not have the resources to upstream and ensure upstream kernels continue to run on their devices.

thanks,
-- Shuah

#81 lore raw
In reply to Pavel Machek

Am Donnerstag, 23. Juli 2015, 12:57:26 schrieb Pavel Machek:

Quoted 9 lines

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

From work I know some MSM8916 phones which came to market over half a year ago

ad just now seem to get basic clock support in mainline.

But I guess the problem is not limited to cellphones but to all mobile consumer electronics, where the development model is based on hacking on some fork of an old kernel.

But I do think the ChromeOS people do quite a lot things right in terms of development model, as I can run a Debian (including 3d-acceleration) on the just released Rockchip Chromebooks with only a minimal number of additional patches against 4.2-rc ;-)

Quoted 4 lines

Interested people:

Sebastian Reichel <[email protected]>
Pali Rohár <[email protected]>

The Openmoko Freerunner brought me into the embedded world in the first place, so I'd definitly be interested ;-)

Heiko Stuebner <[email protected]>

#82 lore raw
In reply to Pavel Machek
Quoted 11 lines · Pavel Machek

Hi!

(Please cc me on replies).

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

I'd like to nominate myself for this topic (and the FPGA topic, but I guess Alan is more suitable there).

Best regards,
Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#83 lore raw
Quoted 12 lines · Pavel Machek
Quoted 11 lines · Pavel Machek

Hi!

(Please cc me on replies).

Significant percentage of phones run Linux kernel today, but geting mainline kernel to work on a phone is very hard to do. (So hard, that newest device that is close to working on recent mainline was made in 2009.) There are multiple obstacles, including huge patches from silicon vendors, missing GNU/Linux userspace support that makes kernel testing hard, interfaces unsuitable for phones and power management problems.

Quoted 4 lines

I'd like to nominate myself for this topic (and the FPGA topic, but I guess Alan is more suitable there).

Best regards, Pavel

I 'd like to nominate myself for this topic.

Thanks and Best regards,