From nobody Sat Feb 7 11:39:10 2026 Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178]) (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 57739223336 for ; Sat, 24 Jan 2026 01:49:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769219362; cv=none; b=XUZwj1MePve1m2BpQsGJ9XSEpjjX1/WlsV8ckBgkQuADhIjemZZ1rKvj111Kw1QhFztkhk9mlnUGoww+z3PVEZkjSiVWytyYxIvAuHupm/C0TRcsN+nkEMPmlyRIq5oRXP5xKYUGU/GzRxXk1W4Dy+EFT315PDTpZh0AFU+1+W8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769219362; c=relaxed/simple; bh=yyHWHTZ3q3DotbU1mpLzfWDbwKx97IS2+wB4iEtV00w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MlpiXldmEhMe3jeommWho0VMS/cmDJcGGDg5y8XlXxz2mIPln6ZOrC/BdFhlE5rXplwVI0By/ig0+bCGJU/QabZup9nLQzv2kCLSBHCiqGK56QwDQkZBoDz5aA1sc7HDhyiOdiGJG0v809ED/oRPWv0xVhBP4P3D71e9gAC9cDA= 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=moF0QcdZ; arc=none smtp.client-ip=74.125.82.178 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="moF0QcdZ" Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-2b720e4dcb4so2863791eec.0 for ; Fri, 23 Jan 2026 17:49:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769219359; x=1769824159; darn=vger.kernel.org; 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=LwReS+VyqVAE69wkUgUOvkftIiDVyESdfXyVkGzdV9k=; b=moF0QcdZe++W5ptyLNjzpFOLk+uc6uV2JpNxY1fKjb5POXB7wnP9rF4PLr+lyylmqA +yDzgpER8Gif2IhL/FtFs6b8aIBbSty2zhBaKKDXoh2MK9oYpTO5/tVSb2JpV1NVuvS2 kQ17rDspaHSTnGETXnBBp6cWaMjYv3U83656aBNZre4Y9HQ4fNWknkoJVAG+LYYqyY0K 7onJlFnRabP+4Rv7ogTs/asgZgHXsM5xqhpr5VUiTTxvzTbRgMF34Yq03kE9+aZQNg16 vDUMxouA48XitdzRXnEvt38vXxFTlEPYWp4id+aUe99quA0L6R8IIvChmAXHuyyVmibv JAzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769219359; x=1769824159; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=LwReS+VyqVAE69wkUgUOvkftIiDVyESdfXyVkGzdV9k=; b=Jx2NECyaOqrjs6V9CpLSJ8fL2XWpawHnAvdL6bbKBwTtUCvMu+JqA+HRk/PBZP5V2W g1TWQOcagFiyUZWsTz1i8vf39iDne47yATRJhGBphGotwVdPyLtJ3mtO56jSb0hbHsge WaqCTiaAH2NCCE5A1JE3NRRzXVvKbvCgtq2uG1kWwN6XlxZP46qLlee6ctkAGyKkhfmE 6Cx7Yu6Y4RWRF4GyiYmhLGmufwWFV82zu+cMJyF4XRZlFdW9gGiD68853540GVKFG8nV XWxsW0YTOLN6Uiaf1ok9QK2OCvkbfrcDaJBsQ8V58blio/ms1jGkmon609ZAUvjUUIRt Y59Q== X-Forwarded-Encrypted: i=1; AJvYcCV8zQU5gQ+C+BuMwXWEscsdQ1Xvd3frt3bu0d5+x4YHPu6pAUJgJG27QenjCmnjAlxVTmJNdmHB/BESK8M=@vger.kernel.org X-Gm-Message-State: AOJu0Yyxon6i0J6AxLyt0+TLHDbEDh5rqpwy3aTccwZy7KxTrQhrEDWB aKq3qk/L911sGuVNPnZISix4Sjgq0FpsUKpPhMYwm0+7g5t55jilljsI X-Gm-Gg: AZuq6aLRsRCQqKgpxibOOIsQqbwxpR6v7x9dWZuvwinU5gGLMXqdJkUz7fTfjU7nQBN YEEFS5e7IgPztqwqDcF1Y+HIX+cotZ2QwDPvpbmq0LKhCk5cqicMbEJFlQWZicwxB/HnE95dCIa rQlt5Hfm29qH8V7DIa/x+HpvyYnLcfIq/KXQEw3+mV0npyKrFZ4FNqqGqh1gPLaEyPDJ2ngemWF fMt7f+SBSzqMp4uIx9jug4pMc7FdyX3orpvx9/szPO60WscVZ1BuS56YQORoPkzWR8BjnCSSbz0 Mk0187qDknrieeIzE7TgcnskQ5iN/zRW+OBvwE/ckGwNqmwDKSNBVPfLrY7RDjATgsDg5ZMgbW/ 8MXIhfUl2VYXMRJATnKAdNR/c36gaZu7JIrQqORd9GfY1pMtFLu2UdH8MlKMHBm4MLguxE88jYD RkOGZBQsB2yKZzbkXFyubJ+9IDwtRrO18P1/KfL5Zo7ZiaVyvxd00QEmLx9SgYjTQ= X-Received: by 2002:a05:7300:ed0e:b0:2a4:3592:c60e with SMTP id 5a478bee46e88-2b739b961cfmr2913536eec.31.1769219359370; Fri, 23 Jan 2026 17:49:19 -0800 (PST) Received: from lappy (108-228-232-20.lightspeed.sndgca.sbcglobal.net. [108.228.232.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b73aa22707sm5160014eec.29.2026.01.23.17.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Jan 2026 17:49:19 -0800 (PST) From: "Derek J. Clark" To: Jiri Kosina , Benjamin Tissoires Cc: Mario Limonciello , Zhixin Zhang , Mia Shao , Mark Pearson , "Pierre-Loup A . Griffais" , "Derek J . Clark" , linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Hughes Subject: [PATCH v3 09/16] HID: Include firmware version in the uevent Date: Sat, 24 Jan 2026 01:49:00 +0000 Message-ID: <20260124014907.991265-10-derekjohn.clark@gmail.com> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260124014907.991265-1-derekjohn.clark@gmail.com> References: <20260124014907.991265-1-derekjohn.clark@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Mario Limonciello Userspace software fwupd probes some HID devices when the daemon starts up to determine the current firmware version in order to be able to offer updated firmware if the manufacturer has made it available. In order to do this fwupd will detach the existing kernel driver if one is present, send a HID command and then reattach the kernel driver. This can be problematic if the user is using the HID device at the time that fwupd probes the hardware and can cause a few frames of input to be dropped. In some cases HID drivers already have a command to look up the firmware version, and so if that is exported to userspace fwupd can discover it and avoid needing to detach the kernel driver until it's time to update the device. Introduce a new member in the struct hid_device for the version and export a new uevent variable HID_FIRMWARE_VERSION that will display the version that HID drivers obtained. Cc: Richard Hughes Signed-off-by: Mario Limonciello --- drivers/hid/hid-core.c | 5 +++++ include/linux/hid.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index a5b3a8ca2fcb..524f2b9ed512 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c @@ -2887,6 +2887,11 @@ static int hid_uevent(const struct device *dev, stru= ct kobj_uevent_env *env) if (add_uevent_var(env, "MODALIAS=3Dhid:b%04Xg%04Xv%08Xp%08X", hdev->bus, hdev->group, hdev->vendor, hdev->product)) return -ENOMEM; + if (hdev->firmware_version) { + if (add_uevent_var(env, "HID_FIRMWARE_VERSION=3D0x%04llX", + hdev->firmware_version)) + return -ENOMEM; + } =20 return 0; } diff --git a/include/linux/hid.h b/include/linux/hid.h index a4ddb94e3ee5..8249da55c9ba 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h @@ -698,6 +698,7 @@ struct hid_device { char name[128]; /* Device name */ char phys[64]; /* Device physical location */ char uniq[64]; /* Device unique identifier (serial #) */ + u64 firmware_version; /* Firmware version */ =20 void *driver_data; =20 --=20 2.52.0