Re: [PATCH v2 -tip 5/5] AHCI: Support multiple MSIs

From: Jeff Garzik
Date: Thu Sep 27 2012 - 01:00:08 EST


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 <agordeev@xxxxxxxxxx>
---
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.




--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/