Skip to content

sensors: upgrade 1.2.1 -> 2.0.0#2562

Open
bmasta018 wants to merge 1 commit into
qualcomm-linux:masterfrom
bmasta018:shikra-release
Open

sensors: upgrade 1.2.1 -> 2.0.0#2562
bmasta018 wants to merge 1 commit into
qualcomm-linux:masterfrom
bmasta018:shikra-release

Conversation

@bmasta018

Copy link
Copy Markdown
Contributor

Upgraded sensor binaries from 1.2.1 to 2.0.0. Add nanopb based proto compilation. Enabled the sensors features for Shikra target

Upgraded sensor binaries from 1.2.1 to 2.0.0. Add nanopb based
proto compilation. Enabled the sensors features for Shikra target

Signed-off-by: Bhanu Vivek Matsa <bmasta@qti.qualcomm.com>
install -d ${D}${sysconfdir}/sensors/config
install -d ${D}${sysconfdir}/sensors/registry
install -d ${D}${systemd_system_unitdir}
install -d ${D}/lib/firmware/qcom/shikra/sensors/config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is a part of the firmware?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is accessed as a part of readonly (/lib/firmware/qcom/shikra/) and we are using this directory to place our registry files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not the firmware, so keep it away from that dir. Follow what has been established beforehand,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The RFS upstream driver translates remoteproc readonly path to /lib/firmware/qcom/shikra/ and readwrite path to /var/lib/tqftpserv only, so these paths added as per RFS team suggestion.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR needs to explain, why is it being loaded via TQFTP, how does it differ from the previous platforms, etc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, form my point of view, all registry changes should be at the same place (/usr/share/qcom/SoC/Vendor/device/sensors/registry) and then, if necessary, symlinked to the TQFTP location.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR needs to explain, why is it being loaded via TQFTP, how does it differ from the previous platforms, etc.

So far, we have only supported targets that use the QMI framework as the communication mechanism for sensors. This is the first target(Shikra) to support the GLINK communication mechanism, which requires a different registry path due to RFS requirements.
As a result, we currently maintain separate sns_reg_config configurations for the two variants to ensure that each uses its own output directory. Consolidating the registry into a single location would cause the output directory of one target to overwrite that of the other, even when using symlinks.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. Perfect. That's why we invented directories under /usr/share/qcom. It matches older devices, which loaded registry via the DSP calls.

install -d ${D}${systemd_system_unitdir}
install -d ${D}/lib/firmware/qcom/shikra/sensors/config
install -d ${D}${sysconfdir}/udev/rules.d
install -d ${D}/var/lib/tqftpserv/sensors/registry

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it accessed as /read write ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is accessed as readwrite. (/var/lib/tqftpserv)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, how do we share it between different boards? Consider a rootfs working for Shikra and some other platform which also needs to ship those files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So currently we are using two different communication mechanisms namely QMI framework and Glink,All the targets using QMI framework will be using etc/sensors/config as input directory for registry whereas the current target shikra is using:/lib/firmware/qcom/shikra/sensors/config.We are currently using SOC id to distinguish between the targets for which the communication mechanism needs to be picked.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, for Glink communications we really expect a proper kernel driver, exporting necessary methods. No, using rpmsgexport is not a good or viable idea.

Second, as your commit messages lack explanations, I can only repeat myself. No, sensors configs are not firmware. If they are shared between targets, reuse /etc/sensors/config. If they are not, move them to /usr/share/qcom/SoC/Vendor/Device tree (see the link that I posted earlier). Extend tqftpserv to load data from that directory in some way.

The most important, start explaining why you are doing something in the commit messages. Then you will get more sensible responses from the maintainers and reviewers. Otherwise the only response you can get is "this doesn't match my view on the way things should be done, NAK".

Last, but not least. As a warning. #1907 has been open for a long time. Beforehand I also have been trying to get them published for a long time. After this PR lands, I'm going to block all future non-fixes updates to sensors binaries until there is at least some progress on that issue. If there are internal OSR tickets, please cc me on them so that I can monitor the progress. We need to stop ignoring our devices and at least provide necessary data so that the community can pick them up.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we distinguish two different SoCs using TQFTP for providing registry? If Shikra+1 uses the same approach, how would you handle it?

install -m 0644 ${S}/etc/sensors/sns_reg_config ${D}${sysconfdir}/sensors/
install -m 0644 ${S}/etc/sensors/config/* ${D}${sysconfdir}/sensors/config/
install -m 0644 ${S}/etc/sensors/registry/sns_reg_version ${D}${sysconfdir}/sensors/registry/
install -m 0644 ${S}/lib/firmware/qcom/shikra/sensors/config/* ${D}/lib/firmware/qcom/shikra/sensors/config/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely not a firmware. Install sensors configs to their place, under /use/share/qcom

install -m 0644 ${S}/lib/firmware/qcom/shikra/sensors/sns_reg_config ${D}/lib/firmware/qcom/shikra/sensors/
install -m 0644 ${S}/etc/udev/rules.d/99-rpmsg.rules ${D}${sysconfdir}/udev/rules.d/
install -m 0644 ${S}/var/lib/tqftpserv/sensors/registry/sns_reg_version ${D}/var/lib/tqftpserv/sensors/registry/
install -m 0644 ${S}/var/lib/tqftpserv/sensors/registry/sensors_registry ${D}/var/lib/tqftpserv/sensors/registry/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registry is also a part of /use/share/qcom, to be installed in a device-specific path per my understanding.


FILES:${PN} += "/lib/firmware/qcom/shikra/sensors/*"

INSANE_SKIP:${PN} += "usrmerge"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain why we need this INSANE_SKIP?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The INSANE_SKIP was added because the sensor firmware is expected to be installed under /lib/firmware/qcom/sensors/. Without this, the files were being packaged under /usr/lib/firmware/qcom/sensors/, which is not the desired install location.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And isn't it exactly the same because of the /lib -> /usr/lib symlink?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The INSANE_SKIP was added because the sensor firmware is expected to be installed under /lib/firmware/qcom/sensors/. Without this, the files were being packaged under /usr/lib/firmware/qcom/sensors/, which is not the desired install location.

You should avoid using "/lib" or "/var" for the target rootfs and instaed use the bitbake variables for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants