[PATCH 2/2] hack-5.15: add Aquantia PHY hwmon temperature clamp patch

Robert Marko robimarko at gmail.com
Sat Feb 18 03:45:34 PST 2023


On Sat, 18 Feb 2023 at 00:58, Enrico Mioso <mrkiko.rs at gmail.com> wrote:
>
> This is needed to avoid failures in the thermal subsystem while using this
> driver via hwmon subsystem.

This should be submitted upstream, we have enough hacks already and
you will get proper feedback from Guenter rather fast whether this is a bug
in hwmon or the driver needs fixups.

Regards,
Robert
>
> CC: Andre Valentin <avalentin at marcant.net>
> CC: Karol Przybylski <karol.przybylski at esm-technology.pl>
> Signed-off-by: Enrico Mioso <mrkiko.rs at gmail.com>
> ---
>  ...-clamp-temperature-value-in-aqr_hwmo.patch | 30 +++++++++++++++++++
>  1 file changed, 30 insertions(+)
>  create mode 100644 target/linux/generic/hack-5.15/726-net-phy-aquantia-clamp-temperature-value-in-aqr_hwmo.patch
>
> diff --git a/target/linux/generic/hack-5.15/726-net-phy-aquantia-clamp-temperature-value-in-aqr_hwmo.patch b/target/linux/generic/hack-5.15/726-net-phy-aquantia-clamp-temperature-value-in-aqr_hwmo.patch
> new file mode 100644
> index 0000000000..36f0b37130
> --- /dev/null
> +++ b/target/linux/generic/hack-5.15/726-net-phy-aquantia-clamp-temperature-value-in-aqr_hwmo.patch
> @@ -0,0 +1,30 @@
> +From 7bfceb1036d2ccda7b8e1e177e834c1cea9f0858 Mon Sep 17 00:00:00 2001
> +From: Enrico Mioso <mrkiko.rs at gmail.com>
> +Date: Sat, 18 Feb 2023 00:27:55 +0100
> +Subject: [PATCH] net: phy: aquantia: clamp temperature value in aqr_hwmon_set
> +
> +This patch is still under evaluation and is not guaranteed to be correct,
> +therefore it is submitted here in hack form. :)
> +
> +Signed-off-by: Enrico Mioso <mrkiko.rs at gmail.com>
> +---
> + drivers/net/phy/aquantia_hwmon.c | 3 +--
> + 1 file changed, 1 insertion(+), 2 deletions(-)
> +
> +diff --git a/drivers/net/phy/aquantia_hwmon.c b/drivers/net/phy/aquantia_hwmon.c
> +index 19c4c280a6cd..6444055e720c 100644
> +--- a/drivers/net/phy/aquantia_hwmon.c
> ++++ b/drivers/net/phy/aquantia_hwmon.c
> +@@ -70,8 +70,7 @@ static int aqr_hwmon_set(struct phy_device *phydev, int reg, long value)
> + {
> +       int temp;
> +
> +-      if (value >= 128000 || value < -128000)
> +-              return -ERANGE;
> ++      clamp_val(value, -128000, 128000);
> +
> +       temp = value * 256 / 1000;
> +
> +--
> +2.39.2
> +
> --
> 2.39.2
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list