On 05/05/2021 11:42, Nandor Han wrote:
In order to have a robust system we want to be able to identify and take
actions if a boot loop occurs. This is possible by using the bootcount
feature, which can be used to identify the number of times device has
booted since bootcount was last time reset. Bootcount feature (1)
requires a collaboration between bootloader and user-space, where
the bootloader will increase a counter and user-space reset it.
If the counter is not reset and a pre-established threshold is reached,
bootloader can react and take action.
This is the kernel side implementation, which can be used to
identify the number of times device has booted since bootcount was
last time reset.
If I understand this correctly, this driver is basically exposing a nvmem cell via sysfs.
Firstly, This sounds like totally a generic functionality that needs to go into nvmem core rather than individual drivers.
Do you see any reason for this not be in core?
Secondly, creating sysfs entries like this in probe will race with userspace udev. udev might not notice this new entry in such cases.
Thirdly, You would need to document this in Documentation/ABI/
Finally I noticed that the changes to snvs_lpgpr.c have not been cced to the original author.