From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754499Ab2I0E7V (ORCPT ); Thu, 27 Sep 2012 00:59:21 -0400 Received: from mail-qc0-f174.google.com ([209.85.216.174]:49561 "EHLO mail-qc0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751508Ab2I0E7T (ORCPT ); Thu, 27 Sep 2012 00:59:19 -0400 Message-ID: <5063DD23.5050504@pobox.com> Date: Thu, 27 Sep 2012 00:59:15 -0400 From: Jeff Garzik User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 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 Subject: Re: [PATCH v2 -tip 5/5] AHCI: Support multiple MSIs References: <9d8eb2d4cef15f1ac63753d543c27f7aac7ac2b4.1346653435.git.agordeev@redhat.com> In-Reply-To: <9d8eb2d4cef15f1ac63753d543c27f7aac7ac2b4.1346653435.git.agordeev@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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.