From patchwork Sat May 7 14:55:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cyrill Gorcunov X-Patchwork-Id: 764442 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p47Eujci001995 for ; Sat, 7 May 2011 14:56:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755458Ab1EGO4m (ORCPT ); Sat, 7 May 2011 10:56:42 -0400 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:user-agent:date:from:to:cc:subject :references:content-disposition; bh=/I6Al2/nBd4L/kTmQP6Q+MetP3Rr4kkJTo2riWQRP+U=; b=gFzAMwKutr7zzcQrNI8T+xCmqZMIa9DLhhSEo77v0JtSo9I3lKQByPkX/lSbkWhTwY pYazz7X7DbRFQ4VrB7f4jaWONJe5H+MQozLYKJLMFRF07sN9B7JF6KBfRrk8A44egRIl Dyq82gXy4KOQnyLpH8CybixZag38HdZdl5e8k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:user-agent:date:from:to:cc:subject:references :content-disposition; b=MO6Z3+ttkr3Upx80PVqalSi7gImXVboh5Lxf7IiYnvK8ahRHpOpNuaMXBe6FEsgDWk P5PbS1R/nPx9kNxwDZ3eSd2xF0e9K2bjlfJIObAVIEFJUGpsnaSuB/l6p9wO/NcwpwJe SpSy+LsqDSWsT452ubNHG7Daf5uLGWBY3XDS8= Received: by 10.213.32.81 with SMTP id b17mr1629754ebd.40.1304780200552; Sat, 07 May 2011 07:56:40 -0700 (PDT) Received: from gorcunov (95-26-151-249.broadband.corbina.ru [95.26.151.249]) by mx.google.com with ESMTPS id k32sm2133257eea.13.2011.05.07.07.56.37 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 07 May 2011 07:56:39 -0700 (PDT) Received: by gorcunov (Postfix, from userid 1000) id 5AA8C9B; Sat, 7 May 2011 18:56:36 +0400 (MSD) Message-Id: <20110507145636.099751964@gmail.com> User-Agent: quilt/0.47-1 Date: Sat, 07 May 2011 18:55:15 +0400 From: Cyrill Gorcunov To: penberg@kernel.org, mingo@elte.hu Cc: levinsasha928@gmail.com, asias.hejun@gmail.com, prasadjoshi124@gmail.com, kvm@vger.kernel.org, Cyrill Gorcunov Subject: [patch 1/2] kvm tools: Fix up PCI pin assignment to conform specification References: <20110507145514.476517775@gmail.com> Content-Disposition: inline; filename=kvm-tools-irq-pins Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Sat, 07 May 2011 14:56:45 +0000 (UTC) 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(-) -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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);