Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp966959pxv; Fri, 25 Jun 2021 02:25:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7WHEki/06U8tzJyVB7MBhEKCpdHLYNHFHKnm3LkPZ5hoZJuK4h/CN6zXegGh44P7DXcZp X-Received: by 2002:a17:906:a20b:: with SMTP id r11mr9750662ejy.221.1624613120264; Fri, 25 Jun 2021 02:25:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624613120; cv=none; d=google.com; s=arc-20160816; b=USQeORvN9F4IFSM+iWOZS1Q7LyvcYFv/YB9JuiOseYoud8BdcFLWMhEwnInCOSFYjx MEJxcH43+cgrxuk83QjErsvHfCWPsicDiitw5fbFj5+mz6C+JoTTk5Hqkr7dOxl5pmo7 FeDiSpSzhbhm4iU1YMjutfD53rukGCG7OCb5Dl/zgbxtlCwZIWUbf56Bnz7hDBoGfDES TmwRiNyGC4EDnK25YyC4tRheWhkdorN0LQzGvdaCLG81Yx1tTZwkM+eKmJKTR17K6Nic /4W9wujhbJXXTyb5Q9uYXM0UPU7fRrVde0PUC8MkNnjc1AMhYk6Pl7UHNmQ0R5+twQUe Vx/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=kxJqDHjctyK/a4iu1yH/h9VrGmfkRQAc3pIBF/yf3tU=; b=xjXcwsm5AAlD2idI39lfrCvkRYBqtGtn+rx2kqAtBgdfBeAEBewIyKFf5JF/3yNDtR /4NB8cBjg8OUEhFjCrOL6w+TUqEmdpHV24WYt9zA+LZCmNvFx9qOUO8yLW7dBlezG24E b+a0EGE1XnNFoJJp3LpnTZmgAEe1K/4nVsEbEV+jNcE2VNeGIlKyJ9s4XvieLa6MXzmd p8kKgvNE+3Ekuc1Jew25CEg0Mz/fhseiI0/e3rG3hny7uHLmhU1PTjBW4BboKGL4BKP4 omQ0wIuA8jM+SPDaZ9xYU/7GhaBS3cB02n/sl4zLaiqvMVhwH+izeUiaZt5AgPmtbhv1 fcpw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jl10si5290432ejc.296.2021.06.25.02.24.56; Fri, 25 Jun 2021 02:25:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231298AbhFYJZq (ORCPT + 99 others); Fri, 25 Jun 2021 05:25:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231294AbhFYJZp (ORCPT ); Fri, 25 Jun 2021 05:25:45 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CEDB5C061767; Fri, 25 Jun 2021 02:23:24 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 24D359200B3; Fri, 25 Jun 2021 11:23:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 1E3DD92009D; Fri, 25 Jun 2021 11:23:24 +0200 (CEST) Date: Fri, 25 Jun 2021 11:23:24 +0200 (CEST) From: "Maciej W. Rozycki" To: Bjorn Helgaas , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" cc: x86@kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] x86/PCI: Include function number in $PIR table dump In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Contrary to the PCI BIOS specification[1] some systems include the PCI function number for motherboard devices in their $PIR table, e.g. this is what the Tyan Tomcat IV S1564D board reports: 00:14 slot=01 0:60/deb8 1:61/deb8 2:62/deb8 3:63/deb8 00:13 slot=02 0:61/deb8 1:62/deb8 2:63/deb8 3:60/deb8 00:12 slot=03 0:62/deb8 1:63/deb8 2:60/deb8 3:61/deb8 00:11 slot=04 0:63/deb8 1:60/deb8 2:61/deb8 3:62/deb8 00:07 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:00/deb8 00:07 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:63/deb8 Print the function number then in the debug $PIR table dump: 00:14.0 slot=01 0:60/deb8 1:61/deb8 2:62/deb8 3:63/deb8 00:13.0 slot=02 0:61/deb8 1:62/deb8 2:63/deb8 3:60/deb8 00:12.0 slot=03 0:62/deb8 1:63/deb8 2:60/deb8 3:61/deb8 00:11.0 slot=04 0:63/deb8 1:60/deb8 2:61/deb8 3:62/deb8 00:07.1 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:00/deb8 00:07.2 slot=00 0:00/deb8 1:00/deb8 2:00/deb8 3:63/deb8 References: [1] "PCI BIOS Specification", Revision 2.1, PCI Special Interest Group, August 26, 1994, Table 4-1 "Layout of IRQ routing table entry.", p. 12 Signed-off-by: Maciej W. Rozycki --- arch/x86/pci/irq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) linux-x86-debug-pirq-fn.diff Index: linux-macro-ide/arch/x86/pci/irq.c =================================================================== --- linux-macro-ide.orig/arch/x86/pci/irq.c +++ linux-macro-ide/arch/x86/pci/irq.c @@ -129,7 +129,8 @@ static void __init pirq_peer_trick(void) #ifdef DEBUG { int j; - DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); + DBG(KERN_DEBUG "%02x:%02x.%x slot=%02x", + e->bus, e->devfn / 8, e->devfn % 8, e->slot); for (j = 0; j < 4; j++) DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); DBG("\n");