From patchwork Thu Sep 8 09:05:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 667393 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3sVDw33JJJz9s9N for ; Thu, 8 Sep 2016 19:06:11 +1000 (AEST) Received: from ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3sVDw31MN8zDsTr for ; Thu, 8 Sep 2016 19:06:11 +1000 (AEST) X-Original-To: slof@lists.ozlabs.org Delivered-To: slof@lists.ozlabs.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3sVDvv4H3KzDsTF for ; Thu, 8 Sep 2016 19:06:03 +1000 (AEST) Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CBFCDC008176; Thu, 8 Sep 2016 09:06:01 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-48.ams2.redhat.com [10.36.116.48]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8895wd1010467; Thu, 8 Sep 2016 05:06:00 -0400 From: Thomas Huth To: slof@lists.ozlabs.org Date: Thu, 8 Sep 2016 11:05:56 +0200 Message-Id: <1473325558-469-2-git-send-email-thuth@redhat.com> In-Reply-To: <1473325558-469-1-git-send-email-thuth@redhat.com> References: <1473325558-469-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 08 Sep 2016 09:06:01 +0000 (UTC) Subject: [SLOF] [PATCH 1/3] Fix bad interrupt pin numbering in interrupt-map property of PCI bridges X-BeenThere: slof@lists.ozlabs.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Patches for https://github.com/aik/SLOF" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: slof-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "SLOF" The legacy PCI interrupts in the device tree are enumerated from 1 to 4. However, the code in pci-gen-irq-map-one generates numbers between 0 and 3 instead. This renders devices unusable by Linux in case they should use IRQ 4. For example, when starting QEMU with qemu-system-ppc64 ... \ -device pci-bridge,bus=pci.0,id=bridge1,chassis_nr=1,addr=0x6 \ -device virtio-balloon-pci,id=balloon0,bus=bridge1,addr=3 Linux can not use the balloon device since it is unable to determine the right IRQ number in this case. To fix this issue, we've simply got to make sure that the IRQ numbers are in the range from 1 to 4 instead of 0 to 3. Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=1366953 Signed-off-by: Thomas Huth --- board-qemu/slof/pci-interrupts.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board-qemu/slof/pci-interrupts.fs b/board-qemu/slof/pci-interrupts.fs index e11b779..aec1106 100644 --- a/board-qemu/slof/pci-interrupts.fs +++ b/board-qemu/slof/pci-interrupts.fs @@ -1,6 +1,6 @@ : pci-gen-irq-map-one ( prop-addr prop-len slot pin -- prop-addr prop-len ) - 2dup + 4 mod ( prop-addr prop-len slot pin parentpin ) + 2dup + 1- 3 and 1+ ( prop-addr prop-len slot pin parentpin ) >r >r ( prop-addr prop-len slot R: swizzledpin pin ) \ Child slot#