From: Alexander Gordeev <agordeev@redhat.com>
To: linux-kernel@vger.kernel.org
Cc: Alexander Gordeev <agordeev@redhat.com>, linux-ide@vger.kernel.org
Subject: [PATCH RESEND v3 1/6] AHCI: Cleanup checking of multiple MSIs/SLM modes
Date: Sun, 21 Sep 2014 15:19:24 +0200 [thread overview]
Message-ID: <e5b010c7698160c8b93c92e7463f5dbb4cf33e52.1411297686.git.agordeev@redhat.com> (raw)
In-Reply-To: <cover.1411297686.git.agordeev@redhat.com>
Sharing Last Message (SLM) mode is currently checked in two
functions: ahci_host_activate() and ahci_init_interrupts().
This update consolidates SLM mode check with activation of
multiple MSIs mode.
Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Cc: linux-ide@vger.kernel.org
---
drivers/ata/ahci.c | 18 +++++++-----------
drivers/ata/ahci.h | 2 +-
2 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index a0cc0ed..7a86b32 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -1221,6 +1221,9 @@ static int ahci_init_interrupts(struct pci_dev *pdev, unsigned int n_ports,
goto single_msi;
}
+ if (nvec > 1)
+ hpriv->flags |= AHCI_HFLAG_MULTI_MSI;
+
return nvec;
single_msi:
@@ -1237,7 +1240,6 @@ intx:
* ahci_host_activate - start AHCI host, request IRQs and register it
* @host: target ATA host
* @irq: base IRQ number to request
- * @n_msis: number of MSIs allocated for this host
* @irq_handler: irq_handler used when requesting IRQs
* @irq_flags: irq_flags used when requesting IRQs
*
@@ -1251,14 +1253,10 @@ intx:
* RETURNS:
* 0 on success, -errno otherwise.
*/
-int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis)
+int ahci_host_activate(struct ata_host *host, int irq)
{
int i, rc;
- /* Sharing Last Message among several ports is not supported */
- if (n_msis < host->n_ports)
- return -EINVAL;
-
rc = ata_host_start(host);
if (rc)
return rc;
@@ -1306,7 +1304,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
struct device *dev = &pdev->dev;
struct ahci_host_priv *hpriv;
struct ata_host *host;
- int n_ports, n_msis, i, rc;
+ int n_ports, i, rc;
int ahci_pci_bar = AHCI_PCI_BAR_STANDARD;
VPRINTK("ENTER\n");
@@ -1459,9 +1457,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
*/
n_ports = max(ahci_nr_ports(hpriv->cap), fls(hpriv->port_map));
- n_msis = ahci_init_interrupts(pdev, n_ports, hpriv);
- if (n_msis > 1)
- hpriv->flags |= AHCI_HFLAG_MULTI_MSI;
+ ahci_init_interrupts(pdev, n_ports, hpriv);
host = ata_host_alloc_pinfo(&pdev->dev, ppi, n_ports);
if (!host)
@@ -1514,7 +1510,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_master(pdev);
if (hpriv->flags & AHCI_HFLAG_MULTI_MSI)
- return ahci_host_activate(host, pdev->irq, n_msis);
+ return ahci_host_activate(host, pdev->irq);
return ata_host_activate(host, pdev->irq, ahci_interrupt, IRQF_SHARED,
&ahci_sht);
diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h
index 59ae0ee..a2a31af 100644
--- a/drivers/ata/ahci.h
+++ b/drivers/ata/ahci.h
@@ -392,7 +392,7 @@ irqreturn_t ahci_interrupt(int irq, void *dev_instance);
irqreturn_t ahci_hw_interrupt(int irq, void *dev_instance);
irqreturn_t ahci_thread_fn(int irq, void *dev_instance);
void ahci_print_info(struct ata_host *host, const char *scc_s);
-int ahci_host_activate(struct ata_host *host, int irq, unsigned int n_msis);
+int ahci_host_activate(struct ata_host *host, int irq);
void ahci_error_handler(struct ata_port *ap);
static inline void __iomem *__ahci_port_base(struct ata_host *host,
--
1.8.3.1
next prev parent reply other threads:[~2014-09-21 13:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-21 13:19 [PATCH RESEND v3 0/6] AHCI: Optimize interrupt processing Alexander Gordeev
2014-09-21 13:19 ` Alexander Gordeev [this message]
2014-09-23 20:18 ` [PATCH RESEND v3 1/6] AHCI: Cleanup checking of multiple MSIs/SLM modes Tejun Heo
2014-09-21 13:19 ` [PATCH RESEND v3 2/6] AHCI: Move host activation code into ahci_host_activate() Alexander Gordeev
2014-09-23 20:22 ` Tejun Heo
2014-09-23 20:55 ` Tejun Heo
2014-09-21 13:19 ` [PATCH RESEND v3 3/6] AHCI: Make few function names more descriptive Alexander Gordeev
2014-09-23 20:22 ` Tejun Heo
2014-09-21 13:19 ` [PATCH RESEND v3 4/6] AHCI: Get rid of redundant arg to ahci_handle_port_interrupt() Alexander Gordeev
2014-09-21 13:19 ` [PATCH RESEND v3 5/6] AHCI: Optimize single IRQ interrupt processing Alexander Gordeev
2014-09-23 20:57 ` Tejun Heo
2014-09-24 10:42 ` Alexander Gordeev
2014-09-24 13:04 ` Tejun Heo
2014-09-24 13:27 ` Chuck Ebbert
2014-09-24 13:36 ` Tejun Heo
2014-09-24 14:08 ` Alexander Gordeev
2014-09-24 14:39 ` Tejun Heo
2014-09-24 14:59 ` Alexander Gordeev
2014-09-25 3:27 ` Tejun Heo
2014-10-01 15:31 ` Alexander Gordeev
2014-10-01 15:39 ` Alexander Gordeev
2014-10-05 2:23 ` Tejun Heo
2014-10-05 16:16 ` Tejun Heo
2014-10-06 7:27 ` Alexander Gordeev
2014-10-06 12:58 ` Tejun Heo
2014-10-06 13:24 ` Alexander Gordeev
2014-10-06 14:54 ` Tejun Heo
2014-09-25 3:00 ` Elliott, Robert (Server Storage)
2014-09-21 13:19 ` [PATCH RESEND v3 6/6] AHCI: Do not read HOST_IRQ_STAT reg in multi-MSI mode Alexander Gordeev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e5b010c7698160c8b93c92e7463f5dbb4cf33e52.1411297686.git.agordeev@redhat.com \
--to=agordeev@redhat.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®