From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 1B84634E762 for ; Wed, 6 May 2026 20:40:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778100053; cv=none; b=IhkcA4vIL1D8JoGkX+hqvUUPJrSqZKhvj4VHVqwsqaarr+8bhn4h5mf547Ypa5q8lCBfNrEXHTJ9REpOnSCPykHW7wUshv83ESTZ9RTSnYzzc+k0W9rZARGV5H6wdGOZehwzqcdI/b+Ze39MHT85FVywJ75oXTuWI+bojGt9gJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778100053; c=relaxed/simple; bh=N1utPvEcBUC2CgJY2X87EWrYwsuzry0dWKDcX8h66DA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rH8Dg43ycFEPE17Ic75qAhDDcelJDW7pYMMtv3UbsGhcKUkAXwyog5ZXPIxxvbksGyOVsTdijevU6XOZQqP5+DNxVeR5O8nKs9QRbgSFjFZH3X6sRMkHOmtxlDKxLYh+bp0IiFPbnw4MNKKHisa0KKiyCnqIS0Y+G+ucv2SqeU8= 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=BIMjQzpe; arc=none smtp.client-ip=209.85.210.169 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="BIMjQzpe" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-83945063f70so654472b3a.0 for ; Wed, 06 May 2026 13:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778100050; x=1778704850; 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=Ab/JEpZ7Fi0qyubDO84DlmrRRJltgbTbtMwqDlljXhg=; b=BIMjQzpeeyTopXwFqVsgfksLN2mbJuj1WTDU/RFyIVutzwgeTPvFdDxpkZC6COUobT Pva7KSrREIRVb5dPNEdZcuR+ZPGfAEj+TuQc+ssBZT4i1jzCxvhF9GKorY5ADvzXLo4H QNG4VH6NadZ2M3fbjI7+sqYdYjhfjGapfRKUSSgJ7hMaV54a9foMIggYjV9km/0hr+Hf cWpVabCDnYuqdjsXTgNWX6sUzYqz43gXD3mGX53BIxw4LbbEQxXXfbHBI0BKxHmDxeab ZWzPPZZH84U7SGlgv8lH6jwiHj237nFbrIo5mIqU5+iAO4c//z63PkM+Jw3prRWKYTKK yetg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778100050; x=1778704850; 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=Ab/JEpZ7Fi0qyubDO84DlmrRRJltgbTbtMwqDlljXhg=; b=L7QkhVpxXO3FEYs03PuRgAbngto7kX/DhSn3wepLpOGLDDwequwnT/udNZl4k9lSAi O/MfIasDd6V55bm8CBxBb5i/idHgXG4SiDA4mEonvRupK9nebFKkfqeYCR/mjZhHOQbB bmHJXTinSQy1+HgbvKqBSEr5uFnjL+0PWfZcZUnKDi4VdQLBCWrwRD3IUE7woTikP6fj XmEnSLjHcbgwbjwbttbdwMYYTW+Ja5NLGxIiv17lK+pziuzDvbJVBQ2j5aozipXRYVvC PcNVXOS2hd7Ca3pHd1X5amtIsQwaXlRyYZOCsZ0cL4oJ/lrYdJLrv36O9jPTxhTut7v5 p3CA== X-Forwarded-Encrypted: i=1; AFNElJ9kbuenSsLtddwQkoF7fqlfaRERdczV6wQh3MJMmkw63SSnDReml7FumlH6yX6iMBmVBh/qDMwR9OUvmqo=@vger.kernel.org X-Gm-Message-State: AOJu0YwgxqfFts6HVTPBaPchtjNZzC9pW7AR6ZkBjtLQ/XjNLC+JbXLR gWzV+V2IUSrGqzsmGLcOqMksyavwC6xFpHPEZEomIBMeYIkGIRN+9gK5 X-Gm-Gg: AeBDieuMfbKKohILdxaW0SzCEHXXCCGlB2KAsEoHNRhupC26g22Hv+TPYzlQp3H3nHZ BOnslTuSvSyACjfqgyLyH3S/hm9nG1I01sPyFxJsgouP7qduEwNnEbBJ8GKLUYYdCs6P+5GQWzc pJgTw80RtW5YeGyxsmBz5eohYvXiubiTe7JzxFrdVnNFqq6aFiiVYrIxesl3J9K3SlDnNRvZMaJ 1A6uyvAQocRgmKgSxo6iZ+D1CpG/hUmxf+lsku374/vDSILaabNjiRWEsWJ2VbTN1lz9a6CJ8ft E6lCy6QxXOG+ScIKzKhUBDIRRRUT5HHSdYjLII93Z1QJFHpOwj5hz4Cs5mapvWfc0D6V61ZGWJf k6Kq+uMALOYv4R9f2KD1hTUgRTmSgKWfHJ6I60yDaKeW9D4uMb/TTu4RsuM+6EEfaALdauX9vJv 8QtO0W9nLU2top1YbcU7YxAhj9txGljEQ= X-Received: by 2002:a05:6a00:3989:b0:837:d331:8700 with SMTP id d2e1a72fcca58-83bb65f40b2mr96595b3a.1.1778100050268; Wed, 06 May 2026 13:40:50 -0700 (PDT) Received: from mincom1 ([14.67.155.79]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8396563f11csm7952185b3a.3.2026.05.06.13.40.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 May 2026 13:40:49 -0700 (PDT) From: Jihong Min To: Greg Kroah-Hartman , Mathias Nyman Cc: Guenter Roeck , Jonathan Corbet , Shuah Khan , Mario Limonciello , Basavaraj Natikar , linux-usb@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-doc@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Jihong Min Subject: [PATCH v2 0/2] AMD PROM21 xHCI temperature hwmon support Date: Thu, 7 May 2026 05:40:32 +0900 Message-ID: X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260506032939.92351-1-hurryman2212@gmail.com> References: <20260506032939.92351-1-hurryman2212@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: 8bit Hi, This series adds hwmon support for the temperature sensor exposed by AMD PROM21 xHCI controllers. The temperature value is read through a vendor-specific index/data register pair in the xHCI PCI MMIO BAR. v1 implemented this directly under drivers/usb/host. Based on review feedback, v2 splits the support into a generic xhci-pci auxiliary-device interface and a standalone hwmon driver under drivers/hwmon. xhci-pci creates the auxiliary child only for PCI IDs matched by its internal table, currently only AMD 1022:43fd, and the hwmon driver binds to that child through the auxiliary bus. The PROM21 hwmon driver registers the hwmon device under the parent PCI function so userspace reports it as a PCI adapter. The auxiliary driver still owns the lifetime and unregisters the hwmon device before xhci-pci tears down the HCD. I tested register access while the parent xHCI PCI function was suspended. The temperature register did not return a valid value without runtime-resuming the device. v2 therefore keeps the default behavior of allowing a temperature read to wake the xHCI PCI device, and adds allow_pm_switch=N for users who prefer reads not to wake the device. In that mode a read returns -EAGAIN while the device is suspended. Changes in v2: - split the original single patch into a two-patch series - add a generic xhci-pci auxiliary-device interface - move PROM21 hwmon support to drivers/hwmon as an auxiliary driver - avoid linking hwmon-specific code into xhci-hcd - add Documentation/hwmon/prom21-hwmon.rst - document register offsets, conversion formula, sysfs attributes, and allow_pm_switch behavior Sincerely, Jihong Min Jihong Min (2): usb: xhci-pci: add generic auxiliary device interface hwmon: add initial support for AMD PROM21 xHCI temperature sensor Documentation/hwmon/index.rst | 1 + Documentation/hwmon/prom21-hwmon.rst | 84 ++++++++ drivers/hwmon/Kconfig | 11 + drivers/hwmon/Makefile | 1 + drivers/hwmon/prom21-hwmon.c | 300 +++++++++++++++++++++++++++ drivers/usb/host/Kconfig | 10 + drivers/usb/host/xhci-pci.c | 114 ++++++++++ 7 files changed, 521 insertions(+) create mode 100644 Documentation/hwmon/prom21-hwmon.rst create mode 100644 drivers/hwmon/prom21-hwmon.c -- 2.53.0