From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751984AbbJDRgN (ORCPT ); Sun, 4 Oct 2015 13:36:13 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:34886 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751791AbbJDRfj (ORCPT ); Sun, 4 Oct 2015 13:35:39 -0400 From: Vlad Zolotarov To: linux-kernel@vger.kernel.org, mst@redhat.com, hjk@hansjkoch.de, regkh@linuxfoundation.org, corbet@lwn.net Cc: bruce.richardson@intel.com, avi@cloudius-systems.com, gleb@cloudius-systems.com, stephen@networkplumber.org, alexander.duyck@gmail.com, Vlad Zolotarov Subject: [PATCH v2 3/3] Documentation: update uio-howto Date: Sun, 4 Oct 2015 20:35:26 +0300 Message-Id: <1443980126-10583-4-git-send-email-vladz@cloudius-systems.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1443980126-10583-1-git-send-email-vladz@cloudius-systems.com> References: <1443980126-10583-1-git-send-email-vladz@cloudius-systems.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change the chapters related to uio_pci_generic that refer interrupt mode. Add the relevant explanation regarding MSI and MSI-X interrupt modes support. Signed-off-by: Vlad Zolotarov --- Documentation/DocBook/uio-howto.tmpl | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index cd0e452..a176129 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl @@ -46,6 +46,12 @@ GPL version 2. + 0.10 + 2015-10-04 + vz + Added MSI and MSI-X support to uio_pci_generic. + + 0.9 2009-07-16 mst @@ -935,15 +941,32 @@ and look in the output for failure reasons Things to know about uio_pci_generic -Interrupts are handled using the Interrupt Disable bit in the PCI command +Interrupts are handled either as MSI-X or MSI interrupts (if the device supports it) or +as legacy INTx interrupts. By default INTx interrupts are used. + + +uio_pci_generic automatically configures a device to use INTx interrupt for backward +compatibility. If INTx are not available MSI-X interrupts will be used if the device +supports it and if not MSI interrupts are going to be used. If none of the interrupts +modes is supported probe() will fail. + + +To get the used interrupt mode application has to use UIO_PCI_GENERIC_INT_MODE_GET ioctl +command. +UIO_PCI_GENERIC_IRQ_NUM_GET ioctl command may be used to get the total number of IRQs. +Then UIO_PCI_GENERIC_IRQ_SET ioctl command may be used to bind a specific eventfd to a specific +IRQ vector. + + +Legacy interrupts are handled using the Interrupt Disable bit in the PCI command register and Interrupt Status bit in the PCI status register. All devices compliant to PCI 2.3 (circa 2002) and all compliant PCI Express devices should support these bits. uio_pci_generic detects this support, and won't bind to devices which do not support the Interrupt Disable Bit in the command register. -On each interrupt, uio_pci_generic sets the Interrupt Disable bit. -This prevents the device from generating further interrupts +If legacy interrupts are used, uio_pci_generic sets the Interrupt Disable bit on +each interrupt. This prevents the device from generating further interrupts until the bit is cleared. The userspace driver should clear this bit before blocking and waiting for more interrupts. -- 2.1.0