From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyrill Gorcunov Subject: [patch 1/2] kvm tools: Fix up PCI pin assignment to conform specification Date: Sat, 07 May 2011 18:55:15 +0400 Message-ID: <20110507145636.099751964@gmail.com> References: <20110507145514.476517775@gmail.com> Cc: levinsasha928@gmail.com, asias.hejun@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org, Cyrill Gorcunov To: penberg@kernel.org, mingo@elte.hu Return-path: Received: from mail-ey0-f174.google.com ([209.85.215.174]:53282 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755158Ab1EGO4l (ORCPT ); Sat, 7 May 2011 10:56:41 -0400 Received: by eyx24 with SMTP id 24so1211742eyx.19 for ; Sat, 07 May 2011 07:56:40 -0700 (PDT) Content-Disposition: inline; filename=kvm-tools-irq-pins Sender: kvm-owner@vger.kernel.org List-ID: Only 4 pins are allowed for every PCI compilant device. Mutlifunctional devices can use up to all INTA#,B#,C#,D# pins, for our sindle function devices pin INTA# is enough. Signed-off-by: Cyrill Gorcunov --- tools/kvm/irq.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) Index: linux-2.6.git/tools/kvm/irq.c ===================================================================== --- linux-2.6.git.orig/tools/kvm/irq.c +++ linux-2.6.git/tools/kvm/irq.c @@ -7,7 +7,6 @@ #include #include -static u8 next_pin = 1; static u8 next_line = 3; static u8 next_dev = 1; static struct rb_root pci_tree = RB_ROOT; @@ -71,7 +70,13 @@ int irq__register_device(u32 dev, u8 *nu *node = (struct pci_dev) { .id = dev, - .pin = next_pin++, + /* + * PCI supports only INTA#,B#,C#,D# per device. + * B#,C#,D# are allowed for multifunctional + * devices so stick with INTA# for our single + * function devices. + */ + .pin = 1, }; INIT_LIST_HEAD(&node->lines);