Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp1246280lqb; Thu, 18 Apr 2024 04:46:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXDP8ZO3xB+iIIUZKtwbECJ8L6DMLl8vmf5okjPmIdNLQ37izO1P9wO4I+y9ffxslzeqyM6tf+T+Ut1Bm1Rc3CZkHxKWSYkFGySe2kTcw== X-Google-Smtp-Source: AGHT+IFTNjI2D1311LW7KXQK6lp/ioL793OSyFUKAv6Lud6nxTUAce+e89VbgDUF72UqdU//Ej+J X-Received: by 2002:a37:f503:0:b0:78e:de2e:9127 with SMTP id l3-20020a37f503000000b0078ede2e9127mr2574492qkk.10.1713440776002; Thu, 18 Apr 2024 04:46:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713440775; cv=pass; d=google.com; s=arc-20160816; b=aT8YvDed2+95ZUo1SNUHKb/nAkAPn0408vAf7j3qeXJNXMpNFaQO2PtBrisKYGHZ9q 9UpOOydoK1ce1YIR6jHLYx6iZu31LBuY8iKImyDep8hJtXhPaTUwlEuvv8762aRw78QQ 4SGzmF9IOJDDb2U1IXFHf2Kn552IR/t24Y4edCW5WuxEEJsd7/nwcn79vjqW9hQxvMLi En+M4oN2CFaIT4Ysk8cV268zqCTaHXM19Ln7o1BKAfnwD2aWhGf3mduM+NlRWwMbbjGY nkV/7XHWv3K84N6pM7RqYHOb+2sNDHNIWp1rG0e9CZfK1QwjodbqPUc0CrRfeaXwDeB2 Y93Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tse31PpId242mWCWoF9F68b2IO88pQ6rFBjaTyilK9M=; fh=l7APaD3+EjDS1OSRrK1EtD817zTV2YWbyD5YzY0AHHs=; b=A+E51EKxAfsARpX18zmqbv7tdXpoNffvnqVB3bQBHWA1z9s32Q7tGYsO5ZIZ6pjL79 YlIJiL6OSqCMhokJgRy7UKl2oxOGw8a0pvQ8oB/dbQzigkQHjSo0I9icYnUWlO39QKAZ 2C8CFQFgOk2k4AO55SPdNwK+EMZGIZHUmvxBC5S3I60Kw8Sb+tJxAQwYto1WfbXPdWXC lZ1qaGcYUnfqBtXNvFKUsSuQf6EPREIm03T8VftMFJQLiClBYZbJ9inqtbjOCHgX3xUF TjJXCA43QfOKzf50BtlPWIusPHQ4y/ZUe0NK/dPS1fjg3VZYdvq0MRoUqWD7BUot3ktX WYNA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=iQo+TlDy; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-149995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149995-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cz2-20020a05620a36c200b0078d5e8ed907si1277418qkb.44.2024.04.18.04.46.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:46:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-149995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=iQo+TlDy; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-149995-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-149995-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B76061C224B5 for ; Thu, 18 Apr 2024 11:46:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 908D415ECDA; Thu, 18 Apr 2024 11:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="iQo+TlDy" Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 73CF115E5DA for ; Thu, 18 Apr 2024 11:46:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713440767; cv=none; b=LFsvMzDURImMSn7NSXmhtRHHvjwwXBJG8g8PyNU7qbG26bP4OrMPWHxrMO0PAhROrxDNWuO5IXaxEQTL6se4N3oA8ZLB21RDMnIoHNaR2vsTbA3B2UaSb0J1vufPfVDzU7HaIOPn0beZA3zagjPLfI0ErPkb/Omp1wUSAvCfAxQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713440767; c=relaxed/simple; bh=RRGuCpmn9QpJJtwiZl5qPKqvfeSljByY3/4eHt18EWs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ui7Bs2xoHUG/qQtHLXhPVC0YFsVE85PgWedtxdhKPeBFoGneaFkooBDlbnhV0VTaJGFM/4MHKssykYxbZVhinKZe2IQ7aTmGS0GKzObGHLoy+HcY51/jHP3elKl8jDkGUv/xLmqALelPIvZI3XGYpQM4lEk01KVjCpQTC5D5cpc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=iQo+TlDy; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1e65a1370b7so8119835ad.3 for ; Thu, 18 Apr 2024 04:46:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713440765; x=1714045565; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=tse31PpId242mWCWoF9F68b2IO88pQ6rFBjaTyilK9M=; b=iQo+TlDywmHMl4Buq7NOY0BwGRvebw27unc4YP03pPwcPemPAms43l7rGhj3hw7jC5 jK8rdRo1RS+LPM22dC9Rd2iXbuuZDOhkt+ibIxG7+e38898IxQVqp0qTXuB6ne3KHE5W nm46xElg/pj4z2XH2mJqUqxx0MxqXfl+p9je3kn77NEJN5kwtOKYTuy69AY1Qu4SEcMB LQ21dEiiyOqwmLhk8kGmgCotVCX8f7DImiPAHFqnd4T9bhu06NIrS4IhSXbTb8AQkylu gYdlNXd7atb4do6kkJ81V2elkTQrn1p5QmlcyfBP2bXSGT+PkjtFVZUo+UzG05w9/Dks yPyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713440765; x=1714045565; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=tse31PpId242mWCWoF9F68b2IO88pQ6rFBjaTyilK9M=; b=dHYJTA2HZVQBO8XB4kWC1wafNcS5ZvV6vCFcJkkSqICYfuzEMgfI1K/Fg/ymllvgyu 3DGau2X7yhRyLyFpY+mcHSMUbU51LimZMBXPuf+87vCotCPjVrFeKfy+MGVZ3K5t6lKp wWFrLQ7BG0F8g/+wXn3jpFz9qRVKLuPysmGWDpeMXBBqr+vNK4eTMIA6PQO3tfmIcds0 GPRwStANs5ZVcnlK8X7dLZwwNOECSWLDiMDHnoP1w/86A06a+bOW2CiCZvP0GHa4zhCo CPuJB3Ja7rEqR/pNvbYKi1UNieCbEClSmfO6O0qVUyEh5YvoMe40api6E0FHL2wPx2Jm 1FCA== X-Forwarded-Encrypted: i=1; AJvYcCUPpLr2tgLua0uRfhEAx/dNfCnb7w8urZyG9TZzge/qmD9qwEC7DkanFakY/lM9P9k0byV2ErGfJWQ/8IbVOOhMtatno5nv1KJOn5+y X-Gm-Message-State: AOJu0YzowBWxbNx3w70MDCA5ZBZgZ0NFxsA1O8zN5hH4mplHYTrFYMaL annYjY6DD1M6ca5e90+7ZaQc68vfH8B+ErcCy/Yqz4/9C7u+apSa2XVevY/hv54= X-Received: by 2002:a17:902:ec90:b0:1e4:911b:7a6b with SMTP id x16-20020a170902ec9000b001e4911b7a6bmr3458551plg.61.1713440764817; Thu, 18 Apr 2024 04:46:04 -0700 (PDT) Received: from sunil-laptop ([106.51.189.72]) by smtp.gmail.com with ESMTPSA id x1-20020a170902ec8100b001e5cadbdf8csm1327734plg.37.2024.04.18.04.45.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Apr 2024 04:46:04 -0700 (PDT) Date: Thu, 18 Apr 2024 17:15:53 +0530 From: Sunil V L To: Bjorn Helgaas Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org, acpica-devel@lists.linux.dev, Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , "Rafael J . Wysocki" , Len Brown , Bjorn Helgaas , Anup Patel , Thomas Gleixner , Samuel Holland , Robert Moore , Haibo1 Xu , Conor Dooley , Andrew Jones , Atish Kumar Patra , Andrei Warkentin , Marc Zyngier , =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= Subject: Re: [RFC PATCH v4 03/20] PCI: Make pci_create_root_bus() declare its reliance on MSI domains Message-ID: References: <20240416204653.GA164172@bhelgaas> 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-Disposition: inline In-Reply-To: Hi Bjorn, On Wed, Apr 17, 2024 at 09:03:13PM +0530, Sunil V L wrote: > > I think fundamentally there are two issues here. > > 1) MSI domain should have been setup properly when > pci_register_host_bridge() is called. I see that pci_arch_init() which > is supposed to get called early calls x86_create_pci_msi_domain(). > pci_register_host_bridge() also calls pci_set_bus_msi_domain() to setup > the MSI domain which can walk up to host bridge to find. So, not sure > why PCI_BUS_FLAGS_NO_MSI is getting set. Is there an issue in walking up > the tree? > I think I understand now why this is happening on X86. In X86, even though x86_create_pci_msi_domain() sets up the MSI domain, it never informs IRQ framework. Only later in pcibios_device_add(), the device's MSI domain will be set which is too late for this bridge logic. So, when pci_set_bus_msi_domain() is called from pci_register_host_bridge(), it will not get it. It works in RISC-V (I guess ARM64 as well) because, the irqchip driver for MSI controller registers using pci_msi_register_fwnode_provider(). But, if we set bridge->msi_domain = true in X86, it will disable MSI even though it supports MSI which is really bad. Please correct me if I am wrong with the analysis. If correct, what do you think the way forward if using CONFIG option is not good? I tried to register the domain in below commit but I don't feel it is a cleaner way. https://github.com/vlsunil/linux/commit/d6cf76f10c225c94fffb286b7a3e803a4e37df54 Thanks, Sunil