From patchwork Fri Feb 17 23:56:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrico Mioso X-Patchwork-Id: 1744486 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=dsNxwp4p; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=HDwEiRKN; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PJTMV1SwRz1yYg for ; Sat, 18 Feb 2023 11:00:06 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VzF/je9yuXi03r54mdRkqgfI6DIE9/1ZilQ+7ChqmSk=; b=dsNxwp4pg1Jtok 0Uxuman1jBo2KkVUAnuFfe3/d2GUVxSaKZIW+bDgnYh1kcUY0mb3RUwiuA+sj/7C5DlbEZrqOARhb p0vB0zqy00a8+FJnr+dWDcqEnfdeH/cUWB8I69prVpgK2uqLfqanJZ7fv/3uLPOAGQMfDYGajGm2s A3DryENO+Pua+jIulAN5wYMZ2x5qcOl89iV1j4DxWpRCQcWnkKMIzdTs5Q4AxGhZDyehRx6r7MuJT BpIuQPHTUAveV0G0t2XHB9IB3rSl17XKPvlTOCG6XXnkaqJ/d89NaKzytlqWWPXwk+cCgaXoSL7g4 92JuGnA295/Pdxwoa88g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTAbs-00Fzcc-Ux; Fri, 17 Feb 2023 23:57:49 +0000 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTAbR-00Fza1-Iw for openwrt-devel@lists.openwrt.org; Fri, 17 Feb 2023 23:57:24 +0000 Received: by mail-wr1-x429.google.com with SMTP id r11so2638489wru.1 for ; Fri, 17 Feb 2023 15:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uSBw8AWRw8rqqhSwgkKx9CgEVqeWBbmYykqNrOKMFNI=; b=HDwEiRKNzeRUpkGiRAytc9Ionxmxi79MMRem8XrWPUbMuhrXDuqPSsyADl99cn5/2X lEjPxWua8iCmZsYJlGY0MNU3XoR+mezP69GnQi7gcoF5vJVOB2iFvBdYxFde34FY5yNe h8/SrWhH88vTTeNR0NBLiORHGwxtSKc7dLFuycDrsln+Xu2ydWlX6mC3Ks38B936gYYT M888BC/csCrzApmIcs+DdhTenSGjjEdlBMP38w/85c7Rsojh06jss7CEAXfYXQiZs6pa yaTag7f3Z97qnyQDVz6Ch2Nzr4YDKi40o1y3GPFEjMpd6IAgPPthgWIWsSRfX3KcByEK /QrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uSBw8AWRw8rqqhSwgkKx9CgEVqeWBbmYykqNrOKMFNI=; b=M/+FMeCOeCBTUhKfmK3qudmM7g4xCzLLRBk0M3Wj2ce4zsskeKZcsFcpwVVxOm0QFS Zr+FQW4pbOLgxwWuf5gkucg74gshHEGC+AZqUvhjbkMilR6DF1BHKjccXssc5aT69XiM hohvdM6WN5gRYKi2Wis5qnhdJmzs6NK30L590wZ1j8XVOip2CEtIKAgUnrDjZdh2VzvP gFVGylir2t3hskN72p06pMD0BLKhA8heqNe8b0bQxBaaMB4Cxxmbyad57I3W3/gpp8xR W9zwWkNGjZQBZnf2FR2kB4tKIYjl7CE/hwsN6BCypQBwJbAs22t3KgfcM+2yoEmNWY66 hHtA== X-Gm-Message-State: AO0yUKX7Ait4y/30dhstratTNXUp1DCzS84ENQUrh9gec61R/Hg/oSfv GxgQUisWZcVr+TZhFY4RXohaRR31DcuCWA== X-Google-Smtp-Source: AK7set9zZhccVc7p7VeAgjEnBnlW3ihleEtEOrbEhAFTG3wj8QZXZf+6WoFsrCgX9imch0jxTQtN0Q== X-Received: by 2002:a5d:688e:0:b0:2c5:8d06:75c2 with SMTP id h14-20020a5d688e000000b002c58d0675c2mr5924424wru.35.1676678238884; Fri, 17 Feb 2023 15:57:18 -0800 (PST) Received: from localhost.localdomain (h17-ipv4-77-240-224.mynet.it. [77.240.224.17]) by smtp.gmail.com with ESMTPSA id b16-20020adfee90000000b002c592535839sm4889155wro.17.2023.02.17.15.57.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 15:57:18 -0800 (PST) From: Enrico Mioso To: openwrt-devel@lists.openwrt.org Cc: Enrico Mioso , Andre Valentin , Karol Przybylski Subject: [PATCH 1/2] ipq807x: ZyXEL NBG7815: add fan support Date: Sat, 18 Feb 2023 00:56:51 +0100 Message-Id: <20230217235652.2184875-2-mrkiko.rs@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230217235652.2184875-1-mrkiko.rs@gmail.com> References: <20230217235652.2184875-1-mrkiko.rs@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230217_155721_653891_ED105889 X-CRM114-Status: GOOD ( 13.06 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Add on/off fan support for the ZyXEL NBG7815. Single CPU cores, cluster CPU temperatures and the Aquantia PHY temperature sensor are monitored. The tmp103 sensor is missing from this patch, and can be [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:429 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [mrkiko.rs[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Add on/off fan support for the ZyXEL NBG7815. Single CPU cores, cluster CPU temperatures and the Aquantia PHY temperature sensor are monitored. The tmp103 sensor is missing from this patch, and can be added later, when kernel is bumped to 6.x, as it seems to require non-trivial hwmon backporting. Add kmod-phy-aquantia as default package while at it. Note: this patch has been marked RFT, since temperature values tuning is needed from someone actively using this device in high load conditions. Thanks to robimarko for helping me out. CC: Andre Valentin CC: Karol Przybylski Signed-off-by: Enrico Mioso --- .../arm64/boot/dts/qcom/ipq8074-nbg7815.dts | 119 ++++++++++++++++++ target/linux/ipq807x/image/generic.mk | 2 +- 2 files changed, 120 insertions(+), 1 deletion(-) diff --git a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts index 537dd52032..0ec602cf31 100644 --- a/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts +++ b/target/linux/ipq807x/files/arch/arm64/boot/dts/qcom/ipq8074-nbg7815.dts @@ -39,6 +39,22 @@ gpios = <&tlmm 54 GPIO_ACTIVE_LOW>; }; }; + + fan: gpio_fan { + compatible = "gpio-fan"; + gpios = <&tlmm 21 GPIO_ACTIVE_HIGH>; + gpio-fan,speed-map = <0 0 + 4500 1>; + #cooling-cells = <2>; + }; + + thermal-zones { + aqr_thermal: aqr-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + thermal-sensors = <&aqr113c>; + }; + }; }; &tlmm { @@ -291,6 +307,7 @@ compatible = "ethernet-phy-ieee802.3-c45"; reg = <8>; reset-gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + #thermal-sensor-cells = <0>; }; }; @@ -443,3 +460,105 @@ qcom,ath11k-calibration-variant = "Zyxel-NBG7815"; }; + +&cpu0_thermal { + trips { + cpu0_active: cpu0-active { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&cpu0_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + +&cpu1_thermal { + trips { + cpu1_active: cpu1-active { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&cpu1_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + +&cpu2_thermal { + trips { + cpu2_active: cpu2-active { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&cpu2_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + +&cpu3_thermal { + trips { + cpu3_active: cpu3-active { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&cpu3_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + +&cluster_thermal { + trips { + cluster_active: cluster-active { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&cluster_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + +&aqr_thermal { + trips { + aqr_thermal_active: aqr-thermal-active { + temperature = <70000>; + hysteresis = <5000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&aqr_thermal_active>; + cooling-device = <&fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; diff --git a/target/linux/ipq807x/image/generic.mk b/target/linux/ipq807x/image/generic.mk index 38770a5f24..bbdb8c5d8b 100644 --- a/target/linux/ipq807x/image/generic.mk +++ b/target/linux/ipq807x/image/generic.mk @@ -141,6 +141,6 @@ define Device/zyxel_nbg7815 IMAGES += factory.bin sysupgrade.bin IMAGE/factory.bin := append-rootfs | pad-rootfs | pad-to 64k IMAGE/sysupgrade.bin/squashfs := append-rootfs | pad-to 64k | sysupgrade-tar rootfs=$$$$@ | append-metadata - DEVICE_PACKAGES := ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci e2fsprogs kmod-fs-ext4 losetup kmod-hwmon-tmp103 + DEVICE_PACKAGES := ipq-wifi-zyxel_nbg7815 kmod-ath11k-pci e2fsprogs kmod-fs-ext4 losetup kmod-hwmon-tmp103 kmod-hwmon-gpiofan kmod-phy-aquantia endef TARGET_DEVICES += zyxel_nbg7815 From patchwork Fri Feb 17 23:56:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enrico Mioso X-Patchwork-Id: 1744485 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=Lqw4teFG; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=dZKKLMIY; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PJTMT3bglz240j for ; Sat, 18 Feb 2023 11:00:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=F7fJp9Ps2wjTZF9ws1TtUwAgN2JgAGPZ7ydumZ9w58c=; b=Lqw4teFGx1dYek NMegG+P09iY7tshtD7G+ID+KjivheSqtVTy8Rp/1YfdoytR93zRt2grCv8oLd5UkMBhuPWVDnJ9uq Pm/ek8ohvqh79K/7edPv8SFff+rw/NioHiemELd4My9/uHt6Rj5MN84TrVVig+VVnDHZa2EHUKdEY /AuyLpNJ1Dc1GicsovoIGu/Y5sTkMsAB2tMe+C5pwRugLQYqkJd2H4bUOf+r6S9KKMQkN/LAiLBzX XukejX+7Kv6ceDB1mPWxC/VfFBtyGJ7V4UHPTvCjyv9c+90Y2ZAWigmwUP6F9J5Hx1wPwZM7v/z/I pbiXYj5gn0y+Xz6mr1dg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTAbg-00Fzbt-VV; Fri, 17 Feb 2023 23:57:37 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pTAbR-00Fza3-J8 for openwrt-devel@lists.openwrt.org; Fri, 17 Feb 2023 23:57:22 +0000 Received: by mail-wr1-x433.google.com with SMTP id e10so2631117wrg.4 for ; Fri, 17 Feb 2023 15:57:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=gexO5a0Urd4CU1GDjM8bO4esmGqK/gTElSdcUjDT1XE=; b=dZKKLMIYWunoETGgYZaTadVOmPbk2BBh5kYnC3lKHvfbVADBO19xZcodWuvrTBk1Y/ B7HHJdIhomRD28Ob/mdZlKezJF3nPtY0n7YAFWF6boenxya3tzr1w8cVTAQuOo9uYA6w qpjN3wPXCR3E9Ed3wus7uuwgejrz1t+WJnN9hiOQ0VRHNbpqOXdKYdl8zHGAQL04TQAZ Ss00SVB5pmx1Um4bsZK8dnf4vtc/WdUY+9EPUYzkxz3jSGO/lv70uXI435tvMdrhBruL afL/KCFZ1z7PKK3FTV/DdF1jReOobuKXt/cLfHfxo+3FWgN/2E43JIXegz04TP2hFYRf w08A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=gexO5a0Urd4CU1GDjM8bO4esmGqK/gTElSdcUjDT1XE=; b=wtK4fbvw6eKk5AYgOWiIdPrAhxqINru9UkxGBD0aUs64QfsjQ+DlJ4gEUR6Cudxj5t 66axAGM5n5lDmzd9fsr9MMjZfGlHaL/YH2xThHi4DGrhJOzyyuZ1AwJDZpP27lK15ZEk AI8uaXisifaYVvlVE4On/cscsG5gn1J/4G+xEdfGGwC5SjsDx3LacStXMRV8qrWadCE4 zTANUXgoMtsnjPlnD9gWX3EDq1eAUerielnUj6k4g/50Wf0NanKEgtnKeuFBqvR9MStY 0UW3YI8WSfZ3kldZmOfKj6IwhpPDo2/qQkpPmwBm5RGztRcXB6ImYn2ahClmJN+xvLYD UDjQ== X-Gm-Message-State: AO0yUKVtG4dBi3qGR//v+wLiO3VOeq1stCQ+SIt7b1Uf/lBBeSD+D1G+ P0BCH9sJ9O7PQig54TnbTOwE79PD/JAwuQ== X-Google-Smtp-Source: AK7set9QBcjzTNhRoLCtKCPS/7LQGzv7cqtijy8a3tWmSkpqqA9HS08w1tffQ3DXCXv624B5iRbU3w== X-Received: by 2002:a5d:50d1:0:b0:2c6:6e83:4596 with SMTP id f17-20020a5d50d1000000b002c66e834596mr2751238wrt.41.1676678239684; Fri, 17 Feb 2023 15:57:19 -0800 (PST) Received: from localhost.localdomain (h17-ipv4-77-240-224.mynet.it. [77.240.224.17]) by smtp.gmail.com with ESMTPSA id b16-20020adfee90000000b002c592535839sm4889155wro.17.2023.02.17.15.57.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Feb 2023 15:57:19 -0800 (PST) From: Enrico Mioso To: openwrt-devel@lists.openwrt.org Cc: Enrico Mioso , Andre Valentin , Karol Przybylski Subject: [PATCH 2/2] hack-5.15: add Aquantia PHY hwmon temperature clamp patch Date: Sat, 18 Feb 2023 00:56:52 +0100 Message-Id: <20230217235652.2184875-3-mrkiko.rs@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230217235652.2184875-1-mrkiko.rs@gmail.com> References: <20230217235652.2184875-1-mrkiko.rs@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230217_155721_658334_2D66CE0C X-CRM114-Status: GOOD ( 13.81 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: This is needed to avoid failures in the thermal subsystem while using this driver via hwmon subsystem. CC: Andre Valentin CC: Karol Przybylski Signed-off-by: Enrico Mioso --- ...-clamp-temperature-value-in-aqr_hwmo.patch | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:433 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [mrkiko.rs[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This is needed to avoid failures in the thermal subsystem while using this driver via hwmon subsystem. CC: Andre Valentin CC: Karol Przybylski Signed-off-by: Enrico Mioso --- ...-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 +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 +--- + 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 +