[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240509125936.00004f30@Huawei.com>
Date: Thu, 9 May 2024 12:59:36 +0100
From: Jonathan Cameron <Jonathan.Cameron@...wei.com>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>
CC: <linux-pci@...r.kernel.org>, Bjorn Helgaas <bhelgaas@...gle.com>, "Lorenzo
Pieralisi" <lorenzo.pieralisi@....com>, Rob Herring <robh@...nel.org>,
Krzysztof Wilczyński <kw@...ux.com>, Lukas Wunner
<lukas@...ner.de>, Alexandru Gagniuc <mr.nuke.me@...il.com>, "Krishna
chaitanya chundru" <quic_krichai@...cinc.com>, Srinivas Pandruvada
<srinivas.pandruvada@...ux.intel.com>, "Rafael J. Wysocki"
<rafael@...nel.org>, <linux-pm@...r.kernel.org>, Daniel Lezcano
<daniel.lezcano@...aro.org>, Zhang Rui <rui.zhang@...el.com>, Lukasz Luba
<lukasz.luba@....com>, <linux-kernel@...r.kernel.org>, Amit Kucheria
<amitk@...nel.org>, Christophe JAILLET <christophe.jaillet@...adoo.fr>
Subject: Re: [PATCH v5 7/8] thermal: Add PCIe cooling driver
On Wed, 8 May 2024 16:47:43 +0300
Ilpo Järvinen <ilpo.jarvinen@...ux.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@...ux.intel.com>
> Acked-by: Rafael J. Wysocki <rafael@...nel.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@...wei.com>
Powered by blists - more mailing lists