From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [PATCH v2 -tip 5/5] AHCI: Support multiple MSIs Date: Thu, 27 Sep 2012 00:59:15 -0400 Message-ID: <5063DD23.5050504@pobox.com> References: <9d8eb2d4cef15f1ac63753d543c27f7aac7ac2b4.1346653435.git.agordeev@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9d8eb2d4cef15f1ac63753d543c27f7aac7ac2b4.1346653435.git.agordeev@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: Alexander Gordeev Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Thomas Gleixner , Bjorn Helgaas , Suresh Siddha , Yinghai Lu , Matthew Wilcox , x86@kernel.org, linux-pci@vger.kernel.org, linux-ide@vger.kernel.org List-Id: linux-ide@vger.kernel.org On 09/03/2012 05:20 AM, Alexander Gordeev wrote: > Take advantage of multiple MSIs implementation on x86 - on systems with > IRQ remapping AHCI ports not only get assigned separate MSI vectors - > but also separate IRQs. As result, interrupts generated by different > ports could be serviced on different CPUs rather than on a single one. > > In cases when number of allocated MSIs is less than requested the Sharing > Last MSI mode does not get used, no matter implemented in hardware or not. > Instead, the driver assumes the advantage of multiple MSIs is negated and > falls back to the single MSI mode as if MRSM bit was set (some Intel chips > implement this strategy anyway - MRSM bit gets set even if the number of > allocated MSIs exceeds the number of implemented ports). > > Signed-off-by: Alexander Gordeev > --- > drivers/ata/ahci.c | 14 ++-- > drivers/ata/ahci.h | 5 + > drivers/ata/libahci.c | 211 +++++++++++++++++++++++++++++++++++++++++++++++-- > 3 files changed, 218 insertions(+), 12 deletions(-) OK, round 2 :) Reviewed the locking twice, and cannot find any problems there. That was my main concern. Other problems noted: 1) Including linux/pci.h into libahci.c should have been a hint ;p libahci is entirely PCI-free, AHCI-specific code. All code that is specific to PCI hosts goes into ahci.c. Anything in libahci needs to be purely iomem read/write, standard AHCI DMA data structure manipulation, etc. This is shared with ahci_platform. So, move the PCI specific code back into ahci.c. Thus, ahci_hw_interrupt appears like libahci material, but ahci_init_interrupts is not. 2) don't manually add new "static inline", let the compiler figure it out 3) spinlock init, such as in e.g. ahci_set_per_port_lock() should occur with the rest of ahci_port_priv initialization, inside ahci_port_start() Otherwise it looks OK and ready for merging, after these updates.