From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 B154139656E for ; Mon, 18 May 2026 21:37:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779140240; cv=none; b=fDKwkg2pvXSB6zptLric8t1iL12c+ABqY9B+Fp0Gyi2f7nonBPf9jorYcBVRPA8JMD1zCsQ7Ht4peQASGjX2usmUIjp8znlncA09oWj9fe+EhFV99z6R4JCo9VxVXlqalEKOdOQ2Tjz7GAxMW76a48+52sKuc9xrDs8eOuxt4rs= 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.48 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-f48.google.com with SMTP id ffacd0b85a97d-43d7e23defbso1557862f8f.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=r4ur+SFgAz/kMJGnCIEubis8rK8QLn+vdXjOah/gQD4cnZMnfnGoF+Qu6+DQzFbtUA uAK0ERss9Z8C5yXgPa21NIX31OOtYv/d/4WS/9QpApXvMqiFfgK9Mmz5YAdwFRrNgD0s 6/0W4y/4yUM0dOfkzmqweJBWRZDNqDcar2KPB+2djixqkUkCmeJkQlxSzc9hcf1WrYyu GKl6B8dgeLryEgWXSuDc4+lkdbit0YN90l2OnNx0T1ngeJ2U/8NkR4XfzW30xG5SYc5L OnkxbZVa1xpBr0NC5/EvSUT294+2flup2bvz7cT2hp3KDnI4pEpE+P/f5/NDRbR66X+s m+Kg== X-Forwarded-Encrypted: i=1; AFNElJ/jdg3afGDSj2x6Pj0QOTmVRwDUSVzl1P9jFpKw3vrWJEHgJF1uYfIGSY+2bLY5bmBeLHRG1zyQUIyg16I=@vger.kernel.org X-Gm-Message-State: AOJu0YxB1pCL9Ye2XXHnndGPHsrHTbLtQ4QZNitME+bZ5C8BvgmB/Q4r mN1uSe/EejAYiC8tTJhjJ5z+AG+J3JMdrIB7K65OghYKq7qStV3r5HoKLBDcmaQV X-Gm-Gg: Acq92OFe3oTjPsANeZfh28tJJyR6rR2aX3UssaxSnRghE4al13Gg4+7XjO8iwt+nnAG KZwt293fqzEXbmlwxiIl3EQ0EraJbdirV3JU+vSzVuggpK3AiArn5HAi/01c6cqLXiIWeymu/N/ lNxW//qLSSuLukQDsLAXXFD/QMv7uZJ7RGkNd1lZr7VpHhfxMPNf18OoE4tMhHzRvqSsQUCiJA1 fPN4NKcku+GJ9qgXp1iPK7pg1PE68kcM3BbqquASY3mNbhJAa/CbI3UKQ1kAVV6E9/L2XZP5qEX tf0j1Kcy+AOmrDld2eqBNIGdNgN06UzMTtGgodBI7+auxcd5lO5HSLyREx2BTL4ePV2X/d24qN2 cD6zk6wa/t+GEnDW01OKUUQRR2UokvIx7gHoxj19Rl1sWv73W119aHgPaSMMF3ftJs9ykwoiZbe gE6nG1eWr9xgzWfEaF1E0+TDJu5U82RlZd 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-kernel@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