Skip to contentSkip to conversation

firmware: add driver data API

PATCH Superseded Luis R. Rodriguez 11 participants 98 messages Mar 30, 2017 – Jun 27, 2017 Page 2 of 2

Subsystems (7)
lore
Share & tools
lore
maintainer
#83 lore raw

Re: [PATCH v9 1/5] firmware: add extensible driver data params

In reply to Luis R. Rodriguez
Quoted 6 lines · Luis R. Rodriguez
Quoted 2 lines

It's also blocking real bug fixes and features that people want addressed, which isn't acceptable.

What? What bugs ? I have addressed *every single* stable issue in queue and have sent patches for them and they do not depend in any way on any of this series!

Ok, so we are all caught up now with bug fixes? That's good, I was not aware of that, so nevermind that objection, my fault.

greg k-h

author maintainer
#84 lore raw

Re: [PATCH v9 1/5] firmware: add extensible driver data params

Quoted 10 lines · Greg KH
Quoted 6 lines · Luis R. Rodriguez
Quoted 2 lines

It's also blocking real bug fixes and features that people want addressed, which isn't acceptable.

What? What bugs ? I have addressed *every single* stable issue in queue and have sent patches for them and they do not depend in any way on any of this series!

Ok, so we are all caught up now with bug fixes? That's good, I was not aware of that, so nevermind that objection, my fault.

Yes. I've been following up on all actively reported bugs and have even implemented better alternatives based on discussions.

Luis

author maintainer
#78 lore raw

Re: [PATCH v9 1/5] firmware: add extensible driver data params

In reply to Greg KH
Quoted 10 lines · Greg KH
Quoted 9 lines · Luis R. Rodriguez
Quoted 8 lines · Linus Torvalds
Quoted 6 lines · Luis R. Rodriguez

Ah, yes! Here is what I believe seems to be the *crux* issue of these patch series and I'm happy we have finally landed on it. Yes, indeed the new API proposed here provides more flexibility, and it does so by embracing a "data driven" API Vs the traditional procedural APIs we have seen for *the firmware API*.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

This has been going on forever. Everybody hates your data-driven one.

Before you, the only person who had expressed disdain here was Greg.

Very few people actually review code, you know that.

Using that logic, then of course "everybody" was *very* fitting ;)

Then again others who actually are working on extending the firmware API (Yi Li), or maintaining vendor trees (Vikram), did express their opinions on the current codebase and their appreciate for the changes I made, however this went selectively unnoticed.

Quoted 10 lines
Quoted 8 lines
Quoted 4 lines

Things like that may be ok as an internal implementation, but even there it's questionable if it then means a big disconnect between what people actually use (the normal functional model) and the implementation.

A vendor tree implemented their *own* solution and were willing to maintain it despite this likely making it hard to port stable fixes. That I think says a lot for a need...

What vendor tree? Where was it shipped?

The msm-3.18 kernel [0], so assuming this goes to mobile devices, this could mean millions of devices.

https://source.codeaurora.org/quic/la/kernel/msm-3.18/commit/drivers/base/firmware_class.c?h=msm-3.18&id=7aa7efd3c150840369739893a84bd1d9f9774319

Quoted 1 line

Why was it external and how is it different from your patches?

As is typical with external trees -- it would seem Vikram actually wrote the original request_firmware_into_buf() API for the msm tree. It contained the fw_desc changes. Stephen Boyd seems to have worked on the actual upstreaming effort and he dropped that fw_desc effort from the upstreaming effort.

Vikarm noted he had had a similar internal discussion with Stephen Stephen Boyd as I am with you on this thread back when request_firmware_into_buf() was being upstreamed [0]. He noted that back then reason for this proposed change was that "the number of things being passed around between layers of functions inside firmware_class seemed a bit untenable". I will note around that time I had proposed a similar change using the fw_desc name, it was only later that this renamed to a params postfix as Linus did not like the descriptor name.

[0] https://lkml.kernel.org/r/[email protected]

The only difference is that his patch does only modifying the private members of the internal API and routines from my patch 1/5, and he kept the "descriptor" name Linus disliked a while ago. This is precisely why AKASHI noted I could split up my patch 1 in more ways in this series to help *patch review*.

Quoted 1 line

Was it used because your version has taken so long to be submitted/reviwed?

Vikram would have a better idea as he is the one who authored it, but it would seem this effort was in parallel to my own at that time.

Quoted 8 lines
Quoted 5 lines

There are still other requirements and features in the pipeline for which we can consider parameters to parse for, rather than adding new API. Case in point, do we want *one* API just to disable the firmware cache? Specially knowing that another feature in the pipeline later would make use of this as a requirement?

Again, I do not care! You can not justify patches today with some mythical thing in the future that might never even happen.

Some of these features are things actually being discussed for a while, so to say they are mythical is not accurate. I can trace back firmware signing discussions back to 2015, along with Plumbers in person discussions where we seem to have agreed upon a path forward among a few folks who disagreed on a technical basis. Linaro has a clear interest so AKASHI picked up that work now as I have been busy with general maintainer duties. The fact that Linus just suggested an alternative approach to a params approach is new, and yet to be reviewe by AKASHI for firmware signing.

Granting the option to make async firmware optional was discussed since December 2016 by RafaÅ [1]. It was only later during my driver data API changes that Hans noted the nvram part was actually *not* optional [2] so this requirement dropped. *However* as the maintainer I believ ethis requirement *is sensible* and would not be surprised if alternative firmware already exists where this is what is intended.

The streaming support for FPGAs has been going through a round of reviews since March [3]. The fact that you only become aware or jump into review now does not make them mythical.

[1] https://lkml.kernel.org/r/CACna6rxOGo0e9U7eXpUgnnBuxL+x1B0JBf9ZBq2WPbaBE=YZ-g@mail.gmail.com
[2] https://lkml.kernel.org/r/[email protected]
[3] https://lkml.kernel.org/r/[email protected]

Quoted 3 lines

Again, as it stands, this patch series is unacceptable, and the added complexity of a crazy api that goes against almost all normal in-kernel apis, is only one part of the reason.

Back to the *real* highlight and *crux* of this thread:

This a paradigm position, and I'm fine to go with it! I sure hope my original logic here is not forgotten, the goal was to demo and show an API which mitigates unnecessary collateral evolutions. I'll also note an *alternative* has not yet been clearly suggested, so I'd be *delighted* to hear alternatives.

Quoted 1 line

The other being the loads of added code for no apparent benifit at all.

I can split up patches as AKASHI suggested.

Quoted 1 line

So please both fix the api to be "normal",

Will do, but an alternative to the approach would be appreciated. Take the optional firmware for async requests as a good example to start with.

Quoted 3 lines

and show as to why these
patches are actually needed _today_, otherwise we can just live with what we have now just fine and muddle along like always.

I think a cleanup for the internal API, flags, and things shuffling back and forward makes sense already so will start off with *just that*.

Luis

#79 lore raw

Re: [PATCH v9 1/5] firmware: add extensible driver data params

Quoted 86 lines · Luis R. Rodriguez
Quoted 10 lines · Greg KH
Quoted 9 lines · Luis R. Rodriguez
Quoted 8 lines · Linus Torvalds
Quoted 6 lines · Luis R. Rodriguez

Ah, yes! Here is what I believe seems to be the *crux* issue of these patch series and I'm happy we have finally landed on it. Yes, indeed the new API proposed here provides more flexibility, and it does so by embracing a "data driven" API Vs the traditional procedural APIs we have seen for *the firmware API*.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

This has been going on forever. Everybody hates your data-driven one.

Before you, the only person who had expressed disdain here was Greg.

Very few people actually review code, you know that.

Using that logic, then of course "everybody" was *very* fitting ;)

Then again others who actually are working on extending the firmware API (Yi Li), or maintaining vendor trees (Vikram), did express their opinions on the current codebase and their appreciate for the changes I made, however this went selectively unnoticed.

Quoted 10 lines
Quoted 8 lines
Quoted 4 lines

Things like that may be ok as an internal implementation, but even there it's questionable if it then means a big disconnect between what people actually use (the normal functional model) and the implementation.

A vendor tree implemented their *own* solution and were willing to maintain it despite this likely making it hard to port stable fixes. That I think says a lot for a need...

What vendor tree? Where was it shipped?

The msm-3.18 kernel [0], so assuming this goes to mobile devices, this could mean millions of devices.

https://source.codeaurora.org/quic/la/kernel/msm-3.18/commit/drivers/base/firmware_class.c?h=msm-3.18&id=7aa7efd3c150840369739893a84bd1d9f9774319

Quoted 1 line

Why was it external and how is it different from your patches?

As is typical with external trees -- it would seem Vikram actually wrote the original request_firmware_into_buf() API for the msm tree. It contained the fw_desc changes. Stephen Boyd seems to have worked on the actual upstreaming effort and he dropped that fw_desc effort from the upstreaming effort.

Vikarm noted he had had a similar internal discussion with Stephen Stephen Boyd as I am with you on this thread back when request_firmware_into_buf() was being upstreamed [0]. He noted that back then reason for this proposed change was that "the number of things being passed around between layers of functions inside firmware_class seemed a bit untenable". I will note around that time I had proposed a similar change using the fw_desc name, it was only later that this renamed to a params postfix as Linus did not like the descriptor name.

[0] https://lkml.kernel.org/r/[email protected]

The only difference is that his patch does only modifying the private members of the internal API and routines from my patch 1/5, and he kept the "descriptor" name Linus disliked a while ago. This is precisely why AKASHI noted I could split up my patch 1 in more ways in this series to help *patch review*.

Quoted 1 line

Was it used because your version has taken so long to be submitted/reviwed?

Vikram would have a better idea as he is the one who authored it, but it would seem this effort was in parallel to my own at that time.

Quoted 8 lines
Quoted 5 lines

There are still other requirements and features in the pipeline for which we can consider parameters to parse for, rather than adding new API. Case in point, do we want *one* API just to disable the firmware cache? Specially knowing that another feature in the pipeline later would make use of this as a requirement?

Again, I do not care! You can not justify patches today with some mythical thing in the future that might never even happen.

Some of these features are things actually being discussed for a while, so to say they are mythical is not accurate. I can trace back firmware signing discussions back to 2015, along with Plumbers in person discussions where we seem to have agreed upon a path forward among a few folks who disagreed on a technical basis. Linaro has a clear interest so AKASHI picked up that work now as I have been busy with general maintainer duties. The fact that Linus just suggested an alternative approach to a params approach is new, and yet to be reviewe by AKASHI for firmware signing.

Quoted 6 lines

Granting the option to make async firmware optional was discussed since December 2016 by RafaÅ [1]. It was only later during my driver data API changes that Hans noted the nvram part was actually *not* optional [2] so this requirement dropped. *However* as the maintainer I believ ethis requirement *is sensible* and would not be surprised if alternative firmware already exists where this is what is intended.

I believe there was a misunderstanding of my patch by Hans. The point of my patch was to don't display warning *IF* we can use alternative soruce and get the NVRAM (firmware) from platform data (special partition used by the bootloader and accessible by the operating system).

author maintainer
#80 lore raw

Re: [PATCH v9 1/5] firmware: add extensible driver data params

Quoted 18 lines · Rafał Miłecki
Quoted 10 lines · Luis R. Rodriguez
Quoted 8 lines · Greg KH
Quoted 5 lines

There are still other requirements and features in the pipeline for which we can consider parameters to parse for, rather than adding new API. Case in point, do we want *one* API just to disable the firmware cache? Specially knowing that another feature in the pipeline later would make use of this as a requirement?

Again, I do not care! You can not justify patches today with some mythical thing in the future that might never even happen.

Quoted 6 lines

Granting the option to make async firmware optional was discussed since December 2016 by RafaÅ [1]. It was only later during my driver data API changes that Hans noted the nvram part was actually *not* optional [2] so this requirement dropped. *However* as the maintainer I believ ethis requirement *is sensible* and would not be surprised if alternative firmware already exists where this is what is intended.

Quoted 4 lines

I believe there was a misunderstanding of my patch by Hans. The point of my patch was to don't display warning *IF* we can use alternative soruce and get the NVRAM (firmware) from platform data (special partition used by the bootloader and accessible by the operating system).

Oh, are you saying the optional async firmware loading is still a requirement for this driver? Are you, Hans, and Arend Van Spriel in agreement on this?

If so then that definitely makes 3 effective changes in my radar for extensions to the firmware API.

Luis

#81 lore raw

Re: [PATCH v9 1/5] firmware: add extensible driver data params

In reply to Luis R. Rodriguez
Quoted 63 lines · Luis R. Rodriguez
Quoted 10 lines · Greg KH
Quoted 9 lines · Luis R. Rodriguez
Quoted 8 lines · Linus Torvalds
Quoted 6 lines · Luis R. Rodriguez

Ah, yes! Here is what I believe seems to be the *crux* issue of these patch series and I'm happy we have finally landed on it. Yes, indeed the new API proposed here provides more flexibility, and it does so by embracing a "data driven" API Vs the traditional procedural APIs we have seen for *the firmware API*.

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

This has been going on forever. Everybody hates your data-driven one.

Before you, the only person who had expressed disdain here was Greg.

Very few people actually review code, you know that.

Using that logic, then of course "everybody" was *very* fitting ;)

Then again others who actually are working on extending the firmware API (Yi Li), or maintaining vendor trees (Vikram), did express their opinions on the current codebase and their appreciate for the changes I made, however this went selectively unnoticed.

Quoted 10 lines
Quoted 8 lines
Quoted 4 lines

Things like that may be ok as an internal implementation, but even there it's questionable if it then means a big disconnect between what people actually use (the normal functional model) and the implementation.

A vendor tree implemented their *own* solution and were willing to maintain it despite this likely making it hard to port stable fixes. That I think says a lot for a need...

What vendor tree? Where was it shipped?

The msm-3.18 kernel [0], so assuming this goes to mobile devices, this could mean millions of devices.

https://source.codeaurora.org/quic/la/kernel/msm-3.18/commit/drivers/base/firmware_class.c?h=msm-3.18&id=7aa7efd3c150840369739893a84bd1d9f9774319

Quoted 1 line

Why was it external and how is it different from your patches?

As is typical with external trees -- it would seem Vikram actually wrote the original request_firmware_into_buf() API for the msm tree. It contained the fw_desc changes. Stephen Boyd seems to have worked on the actual upstreaming effort and he dropped that fw_desc effort from the upstreaming effort.

Vikarm noted he had had a similar internal discussion with Stephen Stephen Boyd as I am with you on this thread back when request_firmware_into_buf() was being upstreamed [0]. He noted that back then reason for this proposed change was that "the number of things being passed around between layers of functions inside firmware_class seemed a bit untenable". I will note around that time I had proposed a similar change using the fw_desc name, it was only later that this renamed to a params postfix as Linus did not like the descriptor name.

[0] https://lkml.kernel.org/r/[email protected]

The only difference is that his patch does only modifying the private members of the internal API and routines from my patch 1/5, and he kept the "descriptor" name Linus disliked a while ago. This is precisely why AKASHI noted I could split up my patch 1 in more ways in this series to help *patch review*.

Quoted 5 lines
Quoted 1 line

Was it used because your version has taken so long to be submitted/reviwed?

Vikram would have a better idea as he is the one who authored it, but it would seem this effort was in parallel to my own at that time.

I must shamefully admit that the story is a bit older - the patch I originally worked on was on a v3.4 based tree. We had been forward porting it until Stephen Boyd was kind enough (or tired of it) to take time out of his clock maintainer-ship and upstream the request_firmware_into_buf API. At that point of time it seemed that the 'desc' approach was unnecessary, and I agreed. So Luis's series came in much later and wasn't a factor in forward-porting the patches.
While it does seem that the _internal_ implementation of
firmware_class can be a bit friendlier to adding the features that are on their way, I can't say the same about the API being exposed to drivers in mainline; maintainers and folks with more experience in kernel API evolution are better equipped to answer that question.

Thanks,
Vikram

author maintainer
#82 lore raw

Re: [PATCH v9 1/5] firmware: add extensible driver data params

Quoted 11 lines · Vikram Mulukutla
Quoted 7 lines · Luis R. Rodriguez
Quoted 2 lines · Greg KH

Was it used because your version has taken so long to be submitted/reviwed?

Vikram would have a better idea as he is the one who authored it, but it would seem this effort was in parallel to my own at that time.

I must shamefully admit that the story is a bit older - the patch I originally worked on was on a v3.4 based tree.

Oh wow so we had *two* separate parallel efforts to simplify this code somehow...

My earliest sysdata API was based on v4.2-rc5 [0], this was after we decided we *wanted* to enable to pass more arguments for fw signing from the start, to enable custom fw criteria, as my original fw signing effort was completely transparent to the API and matched what we did with module signing [1], and based on v4.1-rc3.

Only difference is you just worked on the internal data tossed around. I provided a way to also use this for growing the API.

[0] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=20150805-sysdata
[1] https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/log/?h=fw-signing-v2-20150513

Quoted 5 lines

We had been forward
porting it until Stephen Boyd was kind enough (or tired of it) to take time out of his clock maintainer-ship and upstream the request_firmware_into_buf API. At that point of time it seemed that the 'desc' approach was unnecessary, and I agreed.

It was very much needed and it could have helped. Next time please just send patches right away!

Quoted 7 lines

So Luis's series came
in much later and wasn't a factor in forward-porting the patches.
While it does seem that the _internal_ implementation of
firmware_class can be a bit friendlier to adding the features that are on their way, I can't say the same about the API being exposed to drivers in mainline; maintainers and folks with more experience in kernel API evolution are better equipped to answer that question.

I actually am not aware how seriously the postulation to the problem I decided to take on is being considered here...

Some of it may seem straight forward to some based on experience, but due to the size of the kernel inspired by my prior effort to study collateral evolutions for both forward and backporting purposes, I've decided to take on the problem in a bit different light.

Just as your primary reason for your changes was that "the number of things being passed around between layers of functions inside firmware_class seemed a bit untenable", I also believed that the way in which we were loosely growing the firmware API through unnecessary collateral evolutions was untenable.

I will confess that growing the API was just one consideration, another long term lofty goal also aims towards automatic test driver generation, and enough is sprinkled on test_driver_data.c that I hope some could infer perhaps how I started thinking that might be possible one day.

I'm happy to park such effort, so long as we just decide with a path forward so we can move on and chug on. Perhaps in the future some folks may want to re-evaluate and consider the approach a bit further.

Luis