Re: [PATCH v7 3/4] drivers/acpi: Introduce Platform Firmware Runtime Update Telemetry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Oct 27, 2021 at 03:08:05PM +0800, Chen Yu wrote:
> Platform Firmware Runtime Update(PFRU) Telemetry Service is part of RoT
> (Root of Trust), which allows PFRU handler and other PFRU drivers to
> produce telemetry data to upper layer OS consumer at runtime.
> 
> The linux provides interfaces for the user to query the parameters of

Linux kernel

> telemetry data, and the user could read out the telemetry data
> accordingly.
> 
> The corresponding userspace tool and man page will be introduced at
> tools/power/acpi/pfru.

...

> +#include <linux/acpi.h>
> +#include <linux/device.h>
> +#include <linux/err.h>
> +#include <linux/errno.h>
> +#include <linux/file.h>
> +#include <linux/fs.h>
> +#include <linux/miscdevice.h>
> +#include <linux/module.h>
> +#include <linux/mm.h>
> +#include <linux/platform_device.h>
> +#include <linux/string.h>
> +#include <linux/uaccess.h>
> +#include <linux/uio.h>
> +#include <linux/uuid.h>

+ blank line?

> +#include <uapi/linux/pfru.h>

...

> +static DEFINE_IDA(pfru_log_ida);

Do you need any mutex against operations on IDA? (I don't remember
if it incorporates any synchronization primitives).

...

Looking into the code I have feelings of déjà-vu. Has it really had
nothing in common with the previous patch?

...

> +static int valid_log_level(int level)
> +{
> +	return level == LOG_ERR || level == LOG_WARN ||
> +		level == LOG_INFO || level == LOG_VERB;

Indentation.

> +}

...


This ordering in ->probe() is not okay:
	devm_*()
	non-devm_*()
	devm_*()
	non-devm_*()

One mustn't interleave these. The allowed are:

Case 1:
	non-devm_*()

Case 2:
	devm_*()

Case 3:
	devm_*()
	non-devm_*()

Otherwise in ->remove() you have wrong release ordering which may hide
subtle bugs.

Above comment is applicable to the other patch as well as some comments
from there are applicable here.

-- 
With Best Regards,
Andy Shevchenko





[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux