From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 C6F7539936D for ; Mon, 18 May 2026 21:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779140240; cv=none; b=JNL9CjlDtT4ovPdNuNmaegT4vmE95dJBmF7bFAF8f9eSgDN+d880RC0NSPadN9SJSIQZjLmnzNnbbIA/lIO2Ir2R3QAvzR3NWSd3q3L6OQ+lY+oe7s7m/vR9xvhPfM4ZIs2VZBnSbi/nXQ4Mq1Uw1KeUqegvYSIM2lx06VsJMQU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779140240; c=relaxed/simple; bh=i43GTxdyMK+VdcaWSoLpBbK8zz90hQn9yi4OJpouGdo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=e+kPanhO/ZWKbX7JySNpqo/KalVdqlrKDS9wzKDEF58BVvF4DYVsiy2VhWuIqjyd2HRQ/fGf2ooZQo8NVE3uw2KxJKg2ao8CpB5JvX8DCJj3q2LU7m0QOwdbgeb6YffzAsvQDnFs5C/bt6x/N1Dvl8Eo9zQV/KEgt2drRJB2KUM= 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=P9w1Fmt5; arc=none smtp.client-ip=209.85.221.47 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="P9w1Fmt5" Received: by mail-wr1-f47.google.com with SMTP id ffacd0b85a97d-43d7e23defbso1557860f8f.0 for ; Mon, 18 May 2026 14:37:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779140237; x=1779745037; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=FBg9aPiRES77DI0TewWq2NXl4MY6GQ2hEKLNnK9/Z5g=; b=P9w1Fmt5l8L3QQ9qR3mbGw8wUtGTw0raoIOd+cap/Bp+FqKCLQPn2RMSRnmv9oKlqy dx5NAZzydEyMmoU4GQ8o0hwrXZ+rRz2hhVfr0xBAUNDNyIwhMS0xLKw3x3VzsXF/dxNG Ejz0hSI475pAFdproGW3ONtMUq91F6Qq7ccDs05JvP6bU1v6WdtNtgBlYu34k596amrj 1xueNXvAlhTd9WT0bxGxfJKcm3XQwO6n1kSqMFAgQzko3h8B2dMQmihRhinqumzLkG7A /yj7W+0pK4afsc14djjxNS3peijYZ0wmryV5qvcpblB4uV9jWwQgRUzcBt4WQkrjoWKk 4smg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779140237; x=1779745037; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=FBg9aPiRES77DI0TewWq2NXl4MY6GQ2hEKLNnK9/Z5g=; b=ZrlZYtedhhKufEuaP5jWk1ZFVl9YxRQYzZjiTtLSxVAF5LoXlGZPaHq0hqWjBFGZrB 7fdoVrLdyNPZx6VUbvwgUXKeHpcInGGs20i1eIpR8VKamgy98H0a/gOnoRqwhR8jMzGt jny0zXKqFKvTsR+gLAs/a7TwUzvGxvaBGmFQWlu8rM+iOAxIOP3CZ0v4Duhpnxcg9ejl 35kyhM7l9qCNAHlU5zd3+fTZzYoE7dD/x4EDGKtoVfB43xEldu46mtMKxbGB2aiP1sSC qQ059wwvbDwt5vyWsMR3FA63ys+OhaJC1MOKFrVkzjesDGlOR8XL/px4NmKJm+oRVkcl Napw== X-Forwarded-Encrypted: i=1; AFNElJ+aBoOgGuZY3je57JwcLGkqloYJJwCSwa4QKjXEEXGNJ3WA32U6/dZ6s5N1Cv6yKee9ORJXdDmyByI=@vger.kernel.org X-Gm-Message-State: AOJu0Yxu2RnznRHAUE4tl+79gz6Xa81jWD0JeFWTVz1pELZhJu5tMocW np9ZCRCmCJ2YvtRZpjGJJXvtVAZJydr2M8Unkfu94Gdp00/Vj8IqiUyJ X-Gm-Gg: Acq92OHPdDXmuJK7R89GcjNBUS4zfkmFZAjhuQ4bVAZTUdA3HIa4+xaxN5iL0Icuuse nEh/90h1OxGqadQDLPARQoOap875kOH0C2prOjEsiIctM02+h5DVab+heuXHU+8XJepFwTVCblv DDNWgQeW10qV58N1CmBqsvMGCGGGOjEI2U8y09G1H9CMo30lvlwId+GZvZEhz3X8iUIqI7pijKJ weu+On2o8hL9X8RvXEBLCU5yVpoXR6Cy2mYPbHnzsbym1bypabcQ6RMywH0MRtZbFlXVibMSFJw nxlA6dPwgIs1vDXNFw+Nk11C2WucOQDCqCivUD6abJS9mwedZpU/4CT5p7IMZCAYwX6MwgJK4Ci dlQANuWQu/nvqhBo5R9ZYYANr8Vilf/YnLqvM7qUpnIa9Ay26fK66GQHkajt7fZwTejMyjdTo+o jJI6we14UNenh8uQZnbuvcR9agdXEBMi8Y X-Received: by 2002:a05:6000:4014:b0:441:1fa5:4577 with SMTP id ffacd0b85a97d-45e5c5f20f3mr25992706f8f.26.1779140237042; Mon, 18 May 2026 14:37:17 -0700 (PDT) Received: from foxbook (bfk48.neoplus.adsl.tpnet.pl. [83.28.48.48]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da0a19a0csm38301497f8f.20.2026.05.18.14.37.15 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 18 May 2026 14:37:16 -0700 (PDT) Date: Mon, 18 May 2026 23:37:11 +0200 From: Michal Pecio To: Jihong Min Cc: Greg Kroah-Hartman , Mathias Nyman , 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, "Mario Limonciello (AMD)" , Yaroslav Isakov Subject: Re: [PATCH v6 1/2] usb: xhci-pci: add AMD Promontory 21 PCI glue Message-ID: <20260518233711.4c99cc72.michal.pecio@gmail.com> In-Reply-To: <144ec61c-4cc1-4986-a16c-7c1b99f3a72e@gmail.com> References: <20260517130407.795157-1-hurryman2212@gmail.com> <20260517130407.795157-2-hurryman2212@gmail.com> <20260517232147.34931718.michal.pecio@gmail.com> <144ec61c-4cc1-4986-a16c-7c1b99f3a72e@gmail.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Tue, 19 May 2026 05:30:47 +0900, Jihong Min wrote: > On 5/18/26 06:21, Michal Pecio wrote: > > Instead of the X86 heuristic, would it be possible to build glue > > code if and only if SENSORS_PROM21_XHCI is enabled? > > > > This seems to work: > > > > config SENSORS_PROM21_XHCI > > tristate "AMD Promontory 21 xHCI temperature sensor" > > - depends on USB_XHCI_PCI_PROM21 > > + depends on USB_XHCI_PCI > > > > config USB_XHCI_PCI_PROM21 > > tristate > > - depends on X86 > > depends on USB_XHCI_PCI > > - default USB_XHCI_PCI > > + default USB_XHCI_PCI if SENSORS_PROM21_XHCI != 'n' > > select AUXILIARY_BUS > > > > I don't know if it's the best way, perhaps it would be preferable > > for the hwmon driver to select the glue, but then I'm not sure how > > to force glue to become 'y' when xhci-pci is 'y'. > > I think I should keep the current hidden glue option for now. > > The PROM21 PCI glue is part of the PCI binding path for the xHCI > controller when enabled, while SENSORS_PROM21_XHCI is only the > optional user-visible hwmon driver. Tying the glue to the hwmon > option would make the sensor option affect which driver binds the USB > controller. That's true. Making this possible is the whole purpose of "if IS_ENABLED" here: > static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) > { > if (IS_ENABLED(CONFIG_USB_XHCI_PCI_RENESAS) && > pci_match_id(pci_ids_renesas, dev)) > return -ENODEV; > > + if (IS_ENABLED(CONFIG_USB_XHCI_PCI_PROM21) && > + pci_match_id(pci_ids_prom21, dev)) > + return -ENODEV; > + > return xhci_pci_common_probe(dev, id); > } Currently, you have a weird situation where xhci-pci-prom21 always binds on x86 and xhci-pci on other platforms (with the unofficial PCIe card you mentioned), plus the sensor cannot work on other platforms. > As Guenter pointed out, that would be too strong; the USB controller > should not depend on whether the optional hwmon driver is enabled. One could further argue that neither should it care whether some hwmon driver exists at all, or which kernel releases it exists in :) Regards, Michal