From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0395B369D6A for ; Mon, 24 Aug 2026 17:51:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787593864; cv=none; b=iNAOUMrNr4BLxzAl+3EGGQoR56b2iFSp+Z/p8FqXMPIHWm7Kz6ubZ4e1UccxBISx9pRW0L6Nnxjlm4rAwz2QxK0w4T5Rf3aj48c4GPRXhSDA57doP+4ElzNIqfUP2dzomsL4s4tAR/7/QV+YKXU4hKwHHqeQkWVhqhgfDrOVQ7Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787593864; c=relaxed/simple; bh=j+4P5I1w7yupkjtI1aHIdS2EV8F3BTV+hCLwZ4e00/Q=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=do1ENfgcplZ6jMyEFn822TCGBqUs7xP4bOlyefvtccA4qseZIGcQcD5na0nIPH03++VJ2sNjNkCiuKn7n8gdPsv9Qva6pjX87W0pEPSM89Cz72EbImW1H+FnNWrhN0GB8dWKAJbEIEU3veYFT+8JfnPrivEeE2qtv/WQ1mxuSiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qLsQeXgz; arc=none smtp.client-ip=209.85.215.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qLsQeXgz" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-cb5b8572b70so4514474a12.2 for ; Mon, 24 Aug 2026 10:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787593862; x=1788198662; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=tAf9E7CenHe6l5YzESk+eJosOnuoeSazKjhyH+9ql1Q=; b=qLsQeXgzu+15APZs86ZxH5A4GWc0YvJppIAxI8cgH1VAekYqW1OXsOvwtr0yFqsrIo HWiFb9Ee7tnpw5Got1QbAVpWrKsolAOCMMYLZHfk9dQzhQETMrEIJxojR81ceduU1TXC qt04DBFoPj16Jr8SHTZFJBTDSbG0p0sd1aqDQCeNiJn3HPJbrWcmviQxbrcapk8g6JvD AyG7IWOP56lpph1ax1/GurpUlwm4jN7trLz3uaWXdFD8IzFV59ITt9XbB6b8KWl03lNo TfxC+Zu3CoXMB6BkUj5aVehmPzurxmPHl1wUWAOMLh/7rIAtGLaxeTUZqO0RLO+JW2dT D94g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787593862; x=1788198662; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tAf9E7CenHe6l5YzESk+eJosOnuoeSazKjhyH+9ql1Q=; b=kPOKZtI+Hpi8IXt8B+noj+lKru0GekjWOt8wISswhB/ijl6P4U9R/THTCeUW5fxL9w siX1yZIfn8V8aoJlJCcSKwVdt30J294M7bQw0+d7bC3M+Nj1uxtDTa7Ht02RY9kNYKHM SNd50WfYrOdf9nuXmSyHD0C1oUvyvvE8GGDjWG9XUIaQQ8CEHzX7EhiyvkEC7P5ubHb7 ErjRWzWpLKEb2B4ppkmgKaZ1xa/a0qcQgus6b+QvQ4W7ZnrJUT7Po6TaGvUcQfNBI10b vvv1NvLUQkzEp/m8zZm6NYU3gwY92TiztHG5FQ+hE7TonwuEginjaRNCLcp0OMSmzYjk BXNQ== X-Forwarded-Encrypted: i=1; AHgh+Rqsb1dpA7WCj8QBpb+fBktnyFXHbYhd65Bfgk+evsESnmGurxr2My1cgPDvSG4UmvXBJv0oZXxrBZSMuKE=@vger.kernel.org X-Gm-Message-State: AFuF++nUkAUwN2cTSaFT+er07FhJszeUbSq+dYTT+J984+yJqyOsCbSH ABYfBdp0Qx1y5cCF5HfldSoONHkFtN2EICu0j2xs6+0ZJVLPcGqslVpx X-Gm-Gg: AR+sD11JPFaaYUKI78OMeB61mfjfBsSQZ7vx9McDqCKdRsA9S5MORClxwN7U8+Jst0d 1E2kjTgOkBKFo231mzdB8Ghr1EC4eXSNQiYgoubGU2OSzY1rw0WZchzglyTSb3xsF/6i36Sq29V 8scR6sHZTC+MyTUWlKn3i0SJVOtXMaHX2MjQUYGj42s077+TO6cKNfL6cqFlscB4J+bWQocjGvE 72r1S3I6av2E5yGAkqw+ilNulo2GDpZlM7usvj/F/pg+6r8HhrkQL5yAVWsSAZMBYQVVNL4S6wq p8EnOTe0ajdn8PTJ9UEK4I1xugHOJzluWK6IJ1yWHa47rUE0rue0k8Si05jVA0oC0Oj0/EgqNFs ZzhBU59ycDEbyuPJUCA1YcP5zq6GWzvR67NEUb3+pURUFaf9xtdC2vMzuc6gF/Z719377S1p3Kv yjM1dKJ6SVCtDhp0wek0SS/+q9KuqJGIdwLGWjuQEpIKbINgIuXIYC343fd0leDo0M1XZMNlBdf 0hOBw== X-Received: by 2002:a05:6a20:918c:b0:3cc:8f53:26c0 with SMTP id adf61e73a8af0-3cd301a21c1mr51934883637.17.1787593862323; Mon, 24 Aug 2026 10:51:02 -0700 (PDT) Received: from localhost ([2620:10d:c090:500::4:ddd2]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-327f91d2d1esm29482466eec.17.2026.08.24.10.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Aug 2026 10:51:01 -0700 (PDT) From: Zinc Lim To: Alexander Duyck , Jakub Kicinski , Andrew Lunn , "David S . Miller" , Eric Dumazet , Paolo Abeni , Guenter Roeck , Simon Horman , Mohsin Bashir Cc: kernel-team@meta.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, zinclim@meta.com, Zinc Lim Subject: [PATCH net-next v2 0/6] eth: fbnic: expand hwmon sensor support Date: Mon, 24 Aug 2026 10:50:53 -0700 Message-ID: <20260824175059.2485048-1-limzhineng2@gmail.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit fbnic currently exposes only the raw temperature and voltage readings (temp1_input, in0_input) via hwmon. This series builds that out into a complete sensor interface and hardens the read path. The firmware capability response already carries per-board sensor thresholds, and the firmware can asynchronously report when a sensor crosses one of them. This series surfaces both to userspace and cleans up the supporting plumbing: - Move the sensor read logic out of fbnic_mac, closer to its only caller in the hwmon code, and drop the now-unused get_sensor op. - Expose all hwmon attributes unconditionally as read-only (0444). - Cache the temperature and voltage readings for the current jiffy so a burst of attribute reads issues a single firmware round-trip. - Parse and expose the temperature (min/max/crit) and voltage (min/max) thresholds. Thresholds the firmware did not populate read back as -ENODATA. - Add the corresponding alarm attributes, computed by comparing a live reading against the stored thresholds. - Translate the firmware's sensor-threshold-exceeded message into an hwmon event so userspace is notified on the relevant attribute. Changes from v1: - Addressed Jakub's patch 6 feedback on including a if (!IS_REACHABLE(CONFIG_HWMON)) return; guard. Zinc Lim (6): eth: fbnic: move sensor read logic out of fbnic_mac eth: fbnic: expose all hwmon attributes unconditionally as read-only eth: fbnic: cache hwmon sensor readings eth: fbnic: report temperature and voltage thresholds via hwmon eth: fbnic: report temperature and voltage alarms via hwmon eth: fbnic: firmware notifies hwmon on sensor threshold events drivers/net/ethernet/meta/fbnic/fbnic.h | 8 + drivers/net/ethernet/meta/fbnic/fbnic_fw.c | 75 +++++ drivers/net/ethernet/meta/fbnic/fbnic_fw.h | 30 ++ drivers/net/ethernet/meta/fbnic/fbnic_hwmon.c | 263 ++++++++++++++++-- drivers/net/ethernet/meta/fbnic/fbnic_mac.c | 55 ---- drivers/net/ethernet/meta/fbnic/fbnic_mac.h | 2 - 6 files changed, 349 insertions(+), 84 deletions(-) -- 2.53.0-Meta