Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752752Ab3JYJMM (ORCPT ); Fri, 25 Oct 2013 05:12:12 -0400 Received: from mx0.aculab.com ([213.249.233.131]:43545 "HELO mx0.aculab.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751586Ab3JYJML (ORCPT ); Fri, 25 Oct 2013 05:12:11 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Subject: RE: [PATCH RFC v2 12/29] PCI/MSI: Introduce pcim_enable_msi*() family helpers Date: Fri, 25 Oct 2013 10:10:02 +0100 Message-ID: In-Reply-To: <5269D5D1.60103@start.ca> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH RFC v2 12/29] PCI/MSI: Introduce pcim_enable_msi*() family helpers Thread-Index: Ac7RKNtOk6v5A3pDTFiVQ12x1oawfgAOCgjg References: <6bc575621ef70f72b206e4aa944acd32f1a75718.1382103786.git.agordeev@redhat.com> <20131024105158.GB13159@mtj.dyndns.org> <20131024114133.GA26610@dhcp-26-207.brq.redhat.com> <5269D5D1.60103@start.ca> From: "David Laight" To: "Mark Lord" , "Alexander Gordeev" Cc: "Tejun Heo" , , "Bjorn Helgaas" , "Michael Ellerman" , "Benjamin Herrenschmidt" , "Ben Hutchings" , "H. Peter Anvin" , Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id r9P9CFMV023704 Content-Length: 1090 Lines: 26 > > pcim_enable_msix_min_max(struct pci_dev *dev, struct msix_entry *entries, > > unsigned int minvec, unsigned int maxvec); > > The hardware I have in mind here works only for powers of two. > Eg. 16, 8, 4, 2, or 1 MSI-X vector. Not the odd values in between. > > But it appears I can still just use a loop for that case, > calling the new function above instead of the old functions. You'd either have to loop with min and max the same (starting at 16), or do a single call with min=1 and max=16 and the release the unwanted ones. The latter might be preferred because it might stop an annoying trace about the system not having enough MSI interrupts. What this doesn't resolve is a driver requesting a lot of interrupts early on and leaving none for later drivers. Really the system needs to allocate the minimum number to all drivers before giving out any extra ones - I've NFI how this would be arranged! David ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?