From owner-freebsd-hackers@FreeBSD.ORG Wed Feb 26 19:22:49 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8C1AA974 for ; Wed, 26 Feb 2014 19:22:49 +0000 (UTC) Received: from mail-ob0-x232.google.com (mail-ob0-x232.google.com [IPv6:2607:f8b0:4003:c01::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 58D94115A for ; Wed, 26 Feb 2014 19:22:49 +0000 (UTC) Received: by mail-ob0-f178.google.com with SMTP id va2so1251970obc.23 for ; Wed, 26 Feb 2014 11:22:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=tRXbytJ8oBZm9BMrTQhDsVHiYnZVekgdNSdxgq5cLKs=; b=QY4mxLSAPtiEM7UrGSV8YD7cjq6K9zX+gc5MRSOL7DTimqMlbrltkwJ5ucPxp45mII T3B7QiDfZFISjFVhESFwSyHDTGto7/R0lZ5mCaNGsO2XY5Hm9mC6XPW0dfM9Zkt1sHFV awlQ8/3NipZrNyMpmeCWi8TkRRnxDhUVdZITBKhmw3XhlL6lQ0pXcoL+y80D5N0M6FcI mtxR72JwGL1QW/h3hjM5Sa1Vgc/MwtptZOgIxgCzdmGYv/KIuqOSJhANPLQzur+qME9n 45xebqbMyguO0aRbk3mGMMiRZvGXZ5xQ4WBqG9MoSoGApARhD4ojw6wF+bt0sG7fUuW3 eISg== MIME-Version: 1.0 X-Received: by 10.182.24.69 with SMTP id s5mr4267720obf.35.1393442568394; Wed, 26 Feb 2014 11:22:48 -0800 (PST) Received: by 10.76.130.196 with HTTP; Wed, 26 Feb 2014 11:22:48 -0800 (PST) Date: Wed, 26 Feb 2014 14:22:48 -0500 Message-ID: Subject: [PATCH] Add MSI support to puc(9) From: Ryan Stone To: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 19:22:49 -0000 The Exar XR17V358 is a PCIe device and it supports a single MSI interrupt. This patch will make puc(9) use an MSI interrupt on devices that declare that they support it: http://people.freebsd.org/~rstone/patches/puc_msi.diff This patch may be overly paranoid; I was worried that it's wasn't guaranteed that I could always call pci_alloc_msi() (forgetting that the P in puc stands for PCI) so I added a new puc_cfg_cmd that individual device config methods could implement to advertise support rather than depending on pci_alloc_msi() to behave sanely. I have tested the patch on both a XR17V358 and a XR17V258 (which is a legacy PCI device that does not support PCI)