lkml.org 
[lkml]   [2024]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5 7/8] thermal: Add PCIe cooling driver
On Wed,  8 May 2024 16:47:43 +0300
Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> wrote:

> Add a thermal cooling driver to provide path to access PCIe bandwidth
> controller using the usual thermal interfaces.
>
> A cooling device is instantiated for controllable PCIe Ports from the
> bwctrl service driver.
>
> The thermal side state 0 means no throttling, i.e., maximum supported
> PCIe Link Speed.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
> Acked-by: Rafael J. Wysocki <rafael@kernel.org> # From the cooling device interface perspective

> +struct thermal_cooling_device *pcie_cooling_device_register(struct pci_dev *port)
> +{
> + struct thermal_cooling_device *cdev;
> + char *name;
> +
> + name = kasprintf(GFP_KERNEL, COOLING_DEV_TYPE_PREFIX "%s", pci_name(port));
> + if (!name)
> + return ERR_PTR(-ENOMEM);
> +
> + cdev = thermal_cooling_device_register(name, port, &pcie_cooling_ops);
> + kfree(name);

__free? Only small saving, but I think it's just about worth it to
give you
return thermal_cooling_device_register()
and drop the local cdev variable.


> +
> + return cdev;
> +}

Otherwise LGTM
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>



\
 
 \ /
  Last update: 2024-05-09 13:59    [W:0.096 / U:1.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site