From patchwork Fri Mar 22 13:39:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C97BB1669 for ; Fri, 22 Mar 2019 13:40:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A95522A78E for ; Fri, 22 Mar 2019 13:40:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D0512A7CF; Fri, 22 Mar 2019 13:40:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 47AAF2A7CE for ; Fri, 22 Mar 2019 13:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9wh9EwFSlq1EnGytsVYt4ov3Dippch3jxb5hcE4AiAE=; b=lSnvpDc3djaalS ZGvM88HPKV80/Qqfk4crCECUKALoHu3tfxFZEplm8CBm3mUrKZqPGw2XsYsa78rkw6k0V/KMPk9jq m1oTh3d4zVDgP5NGtzzwm6W+YTQjJiWyig4+tOpJeW206GwBJlsLqnadma3CQHNMrLx9vI/Qsu2EC Nlzpk1pJUUK6kEFJr/hKmnQMBcr2ZrUd/bvnKvFMliRKFET16fxM+2ml2TkQUgvA/OE4XRoGs24WF 5G/1Heey7gRh/wqu2J0/3Ut/5qyAAV2ZlU1VL1UbzUzDe72KxRV9v5pX395IomwhpwwXXIT2LVCfA qAURO03Jh5baikM6Wm9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPM-0006Hg-1y; Fri, 22 Mar 2019 13:40:28 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPB-000670-9B for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:19 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 2F061100012; Fri, 22 Mar 2019 13:40:11 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 01/10] ata: libahci: Ensure the host interrupt status bits are cleared Date: Fri, 22 Mar 2019 14:39:54 +0100 Message-Id: <20190322134003.4893-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064017_473107_56DDE74B X-CRM114-Status: GOOD ( 12.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP ahci_multi_irqs_intr_hard() is going to be used as interrupt handler to support SATA per-port interrupts. The current logic is to check and clear the SATA port interrupt status register only. To avoid spurious IRQs and interrupt storms, it will be needed to clear the port interrupt bit in the host interrupt status register as well. Signed-off-by: Miquel Raynal --- drivers/ata/libahci.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 692782dddc0f..9db6f488db59 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -1912,7 +1912,10 @@ static void ahci_port_intr(struct ata_port *ap) static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance) { struct ata_port *ap = dev_instance; + struct ata_host *host = ap->host; + struct ahci_host_priv *hpriv = host->private_data; void __iomem *port_mmio = ahci_port_base(ap); + void __iomem *mmio = hpriv->mmio; u32 status; VPRINTK("ENTER\n"); @@ -1924,6 +1927,8 @@ static irqreturn_t ahci_multi_irqs_intr_hard(int irq, void *dev_instance) ahci_handle_port_interrupt(ap, port_mmio, status); spin_unlock(ap->lock); + writel(BIT(ap->port_no), mmio + HOST_IRQ_STAT); + VPRINTK("EXIT\n"); return IRQ_HANDLED; From patchwork Fri Mar 22 13:39:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 589581669 for ; Fri, 22 Mar 2019 13:41:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA562A785 for ; Fri, 22 Mar 2019 13:41:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23A732A65F; Fri, 22 Mar 2019 13:41:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 647642A785 for ; Fri, 22 Mar 2019 13:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pqtef1W7mIKp16UmqXT9gOyNwulLkBHoqU3Xvq9jNUI=; b=gwFlNoKJqeJSKC 9QuMVlapI4LjV8K83dPmwvyBj/ldXcRBWWOVfSbF8lZRS/4SRmf7dlbR6NE+9LkiJ2FMIXl1PQBrJ RbzDu8iq35FMM1BM+A69UArdvK34J3mQ9ezxjI9TiDZvSPOgIdxiEnZGsjMDc/ahGERD1Hz8OmDUb S+mf6iNRloRyH2DkDzCr/83gvJ7J4Ic7K26lN/KsXLO5/G4hA8ZhKs5FjvCTWHrDZCDn/7HFgRCXg HLhmKbXH18RPk8W5Oe3G2c7j5U4P4TyPdOndX/0k0AcbhJKLDrYtgzgW/E4zyQlFNM4RTfoqJfTDh UN3yZew1FNH4Z9CWV0KA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KQ4-0007DD-Ub; Fri, 22 Mar 2019 13:41:12 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPE-000684-90 for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:22 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id CE8C3100014; Fri, 22 Mar 2019 13:40:14 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 02/10] ata: ahci: Support per-port interrupts Date: Fri, 22 Mar 2019 14:39:55 +0100 Message-Id: <20190322134003.4893-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064020_612405_4A066811 X-CRM114-Status: GOOD ( 20.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Right now the ATA core only allows IPs to use a single interrupt. Some of them (for instance the Armada-CP110 one) actually has one interrupt per port. Add some logic to support such situation. We consider that either there is one single interrupt declared in the main IP node, or there are per-port interrupts, each of them being declared in the port sub-nodes. Signed-off-by: Miquel Raynal Reviewed-by: Hans de Goede --- drivers/ata/acard-ahci.c | 2 +- drivers/ata/ahci.c | 8 +++- drivers/ata/ahci.h | 3 +- drivers/ata/libahci.c | 2 +- drivers/ata/libahci_platform.c | 67 ++++++++++++++++++++++++++++------ drivers/ata/sata_highbank.c | 2 +- 6 files changed, 68 insertions(+), 16 deletions(-) diff --git a/drivers/ata/acard-ahci.c b/drivers/ata/acard-ahci.c index 583e366be7e2..9414b81e994c 100644 --- a/drivers/ata/acard-ahci.c +++ b/drivers/ata/acard-ahci.c @@ -434,7 +434,7 @@ static int acard_ahci_init_one(struct pci_dev *pdev, const struct pci_device_id if (!hpriv) return -ENOMEM; - hpriv->irq = pdev->irq; + hpriv->irqs[0] = pdev->irq; hpriv->flags |= (unsigned long)pi.private_data; if (!(hpriv->flags & AHCI_HFLAG_NO_MSI)) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 021ce46e2e57..bc37a34fa043 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1817,7 +1817,13 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) /* legacy intx interrupts */ pci_intx(pdev, 1); } - hpriv->irq = pci_irq_vector(pdev, 0); + + hpriv->irqs = devm_kzalloc(dev, sizeof(*hpriv->irqs) * n_ports, + GFP_KERNEL); + if (!hpriv->irqs) + return -ENOMEM; + + hpriv->irqs[0] = pci_irq_vector(pdev, 0); if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss) host->flags |= ATA_HOST_PARALLEL_SCAN; diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h index 8810475f307a..f569f6a0d9f5 100644 --- a/drivers/ata/ahci.h +++ b/drivers/ata/ahci.h @@ -363,7 +363,7 @@ struct ahci_host_priv { struct phy **phys; unsigned nports; /* Number of ports */ void *plat_data; /* Other platform data */ - unsigned int irq; /* interrupt line */ + unsigned int *irqs; /* interrupt line(s) */ /* * Optional ahci_start_engine override, if not set this gets set to the * default ahci_start_engine during ahci_save_initial_config, this can @@ -434,6 +434,7 @@ void ahci_print_info(struct ata_host *host, const char *scc_s); int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht); void ahci_error_handler(struct ata_port *ap); u32 ahci_handle_port_intr(struct ata_host *host, u32 irq_masked); +int ahci_get_per_port_irq_vector(struct ata_host *host, int port); static inline void __iomem *__ahci_port_base(struct ata_host *host, unsigned int port_no) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 9db6f488db59..9d275ad4e14c 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c @@ -2600,7 +2600,7 @@ static int ahci_host_activate_multi_irqs(struct ata_host *host, int ahci_host_activate(struct ata_host *host, struct scsi_host_template *sht) { struct ahci_host_priv *hpriv = host->private_data; - int irq = hpriv->irq; + int irq = hpriv->irqs[0]; int rc; if (hpriv->flags & AHCI_HFLAG_MULTI_MSI) { diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 81b1a3332ed6..347ff14aedd2 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include "ahci.h" @@ -95,6 +96,14 @@ static void ahci_platform_disable_phys(struct ahci_host_priv *hpriv) } } +int ahci_get_per_port_irq_vector(struct ata_host *host, int port) +{ + struct ahci_host_priv *hpriv = host->private_data; + + return hpriv->irqs[port]; +} +EXPORT_SYMBOL_GPL(ahci_get_per_port_irq_vector); + /** * ahci_platform_enable_clks - Enable platform clocks * @hpriv: host private area to store config values @@ -385,6 +394,7 @@ static int ahci_platform_get_regulator(struct ahci_host_priv *hpriv, u32 port, * or for non devicetree enabled platforms a single clock * 4) resets, if flags has AHCI_PLATFORM_GET_RESETS (optional) * 5) phys (optional) + * 6) interrupt(s) * * RETURNS: * The allocated ahci_host_priv on success, otherwise an ERR_PTR value @@ -396,7 +406,7 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, struct ahci_host_priv *hpriv; struct clk *clk; struct device_node *child; - int i, enabled_ports = 0, rc = -ENOMEM, child_nodes; + int i, enabled_ports = 0, rc = -ENOMEM, child_nodes, ctrl_irq; u32 mask_port_map = 0; if (!devres_open_group(dev, NULL, GFP_KERNEL)) @@ -489,10 +499,30 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, goto err_out; } + hpriv->irqs = devm_kzalloc(dev, sizeof(*hpriv->irqs) * hpriv->nports, + GFP_KERNEL); + if (!hpriv->irqs) { + rc = -ENOMEM; + goto err_out; + } + + ctrl_irq = platform_get_irq(pdev, 0); + if (ctrl_irq < 0) { + if (ctrl_irq == -EPROBE_DEFER) { + rc = ctrl_irq; + goto err_out; + } + ctrl_irq = 0; + } + + if (ctrl_irq > 0) + hpriv->irqs[0] = ctrl_irq; + if (child_nodes) { for_each_child_of_node(dev->of_node, child) { u32 port; struct platform_device *port_dev __maybe_unused; + int port_irq; if (!of_device_is_available(child)) continue; @@ -521,6 +551,18 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, } #endif + if (!ctrl_irq) { + port_irq = of_irq_get(child, 0); + if (!port_irq) + port_irq = -EINVAL; + if (port_irq < 0) { + rc = port_irq; + goto err_out; + } + + hpriv->irqs[port] = port_irq; + } + rc = ahci_platform_get_phy(hpriv, port, dev, child); if (rc) goto err_out; @@ -548,6 +590,18 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, if (rc == -EPROBE_DEFER) goto err_out; } + + if (!ctrl_irq && !enabled_ports) { + dev_err(&pdev->dev, "No IRQ defined\n"); + rc = -ENODEV; + goto err_out; + } + + if (!ctrl_irq && enabled_ports > 1) { + hpriv->flags |= AHCI_HFLAG_MULTI_MSI; + hpriv->get_irq_vector = ahci_get_per_port_irq_vector; + } + pm_runtime_enable(dev); pm_runtime_get_sync(dev); hpriv->got_runtime_pm = true; @@ -584,16 +638,7 @@ int ahci_platform_init_host(struct platform_device *pdev, struct ata_port_info pi = *pi_template; const struct ata_port_info *ppi[] = { &pi, NULL }; struct ata_host *host; - int i, irq, n_ports, rc; - - irq = platform_get_irq(pdev, 0); - if (irq <= 0) { - if (irq != -EPROBE_DEFER) - dev_err(dev, "no irq\n"); - return irq; - } - - hpriv->irq = irq; + int i, n_ports, rc; /* prepare host */ pi.private_data = (void *)(unsigned long)hpriv->flags; diff --git a/drivers/ata/sata_highbank.c b/drivers/ata/sata_highbank.c index c8fc9280d6e4..dcfdab20021b 100644 --- a/drivers/ata/sata_highbank.c +++ b/drivers/ata/sata_highbank.c @@ -496,7 +496,7 @@ static int ahci_highbank_probe(struct platform_device *pdev) return -ENOMEM; } - hpriv->irq = irq; + hpriv->irqs[0] = irq; hpriv->flags |= (unsigned long)pi.private_data; hpriv->mmio = devm_ioremap(dev, mem->start, resource_size(mem)); From patchwork Fri Mar 22 13:39:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865739 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 461FE139A for ; Fri, 22 Mar 2019 13:40:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 225C62A785 for ; Fri, 22 Mar 2019 13:40:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 168FA2A7C2; Fri, 22 Mar 2019 13:40:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C1C2B2A6D3 for ; Fri, 22 Mar 2019 13:40:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vadouOXeiG3ynilrJS7eU0Y3aGGMW+TyQc+YpIpgvcM=; b=gy4n8xLPwDZCNN UmcIlUJQX03xPkyMV4PYihg1cMIgCKqSsojqYiDPgd0Sw11kG0dTdja48PWUFaDa/cpFM3+UZtSOR kNL2hMwC0dC1ga/rDNWtK9NT1YTNFSDnrCl3B5Wf/NitnM64PAZyxSLsdEfJ/6jf6ekQOuwSyGZjS XmyNOaQYjSQKaJnqajYtzEkXYIMhUaHANPpPHgAxqiXJV8DFbfZmAkqef9VhO822gb9BGxJSHxwFc ymV9aF6m6MlRau/Bag2gzlI+iQ9I7XB1i3dy0MUCo5llXEEKOknbzU7TGyUFRoBl8RLMxQXDU06TS CPLJY28XeAZ2rRlbQSpw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPl-0006jd-1T; Fri, 22 Mar 2019 13:40:53 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPH-00069w-Es for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:26 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 7A65710001B; Fri, 22 Mar 2019 13:40:18 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 03/10] dt-bindings: ata: Update ahci bindings with possible per-port interrupts Date: Fri, 22 Mar 2019 14:39:56 +0100 Message-Id: <20190322134003.4893-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064024_059093_368BAEC2 X-CRM114-Status: GOOD ( 10.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Update bindings to reflect the fact that a SATA IP can either have: - only one interrupt: in this case an 'interrupts' property is declared at the root of the node; or - each SATA port can have their own interrupt: in this case there is one 'interrupts' property per port/sub-node and none at the root. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/ata/ahci-platform.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index e30fd106df4f..80261e2845b0 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -53,6 +53,12 @@ And at least one of the following properties: - phys : reference to the SATA PHY node - target-supply : regulator for SATA target power +Sub-nodes optional properties: +- interrupts : , please + note that either the root SATA node has the + interrupts property, or there is one per SATA + port, but not both at the same time. + Examples: sata@ffe08000 { compatible = "snps,spear-ahci"; From patchwork Fri Mar 22 13:39:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 384EF1669 for ; Fri, 22 Mar 2019 13:41:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14A952A6E5 for ; Fri, 22 Mar 2019 13:41:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 124822A7D9; Fri, 22 Mar 2019 13:41:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B92F92A7CD for ; Fri, 22 Mar 2019 13:41:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zUyFswUABCHxYpdz97enDJJe85/08wdcUxcna10E3C0=; b=F0RbRu6Rt+JJZ1 lzruHBfd7vep40bJwWg87OTVfQvgphB+z14gbtpHHFa9JUF8MFc0tGkzobapNvm3rgRn65+NTWBvB /9BDbM5+9K9CN5BOBoKIPpXAGoMKYOx8H7CzwZxwd8tvqciBRvJs29delNHGb5n3y4o67Segk20JH JWtZt/ucclwVrhzCBvHPiIe7jrmAYyJKMXWTFKP/WsjNQGAVSPdVDF6roBS4btL07ETgRArYjd3H/ SRLBk0fqYptO4EFHHnF44CzNo0AELw/C4df6A5rDMccavSQ743KQJ9YqiTYuu++Qt6USUcm+F47mW KEDiHKqng/v8iwbAFpHA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPs-0006xB-CE; Fri, 22 Mar 2019 13:41:00 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPK-0006Eb-Rf for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:31 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 217BE100002; Fri, 22 Mar 2019 13:40:21 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 04/10] ata: ahci: mvebu: Rename a platform data flag Date: Fri, 22 Mar 2019 14:39:57 +0100 Message-Id: <20190322134003.4893-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064027_462893_6A6F3A79 X-CRM114-Status: GOOD ( 14.68 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Before adding more entries in the platform data structure, rename the flags entry to be more precise and name it host_flags. Signed-off-by: Miquel Raynal --- drivers/ata/ahci_mvebu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index d4bba3ace45d..43bb2db59698 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -30,7 +30,7 @@ struct ahci_mvebu_plat_data { int (*plat_config)(struct ahci_host_priv *hpriv); - unsigned int flags; + unsigned int host_flags; }; static void ahci_mvebu_mbus_config(struct ahci_host_priv *hpriv, @@ -196,7 +196,7 @@ static int ahci_mvebu_probe(struct platform_device *pdev) if (IS_ERR(hpriv)) return PTR_ERR(hpriv); - hpriv->flags |= pdata->flags; + hpriv->flags |= pdata->host_flags; hpriv->plat_data = (void *)pdata; rc = ahci_platform_enable_resources(hpriv); @@ -227,7 +227,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_380_plat_data = { static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { .plat_config = ahci_mvebu_armada_3700_config, - .flags = AHCI_HFLAG_SUSPEND_PHYS, + .host_flags = AHCI_HFLAG_SUSPEND_PHYS, }; static const struct of_device_id ahci_mvebu_of_match[] = { From patchwork Fri Mar 22 13:39:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865747 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 91CD1139A for ; Fri, 22 Mar 2019 13:41:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6C8762A6A0 for ; Fri, 22 Mar 2019 13:41:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 607C92A6E7; Fri, 22 Mar 2019 13:41:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EAE202A6A0 for ; Fri, 22 Mar 2019 13:41:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ps1Ykf5XbslhOmWdnhaurpGP5/2FD8M8DSo+jkPMVaA=; b=JMgD7DTdEXZT7n Io5jo0itoYjGotqJ61U0T+4fr2lrcuG8T+WKTIcaPPrTyqYz5hS+GZamQ84iL+Majtp5sYBdHWZqc 0U6pCboSp5WtLkcIRXLDtMR1G2U8gFCMuva2JrkYIQerw6wLxyai8LG5eKrqNVkHCpBZE3NAc1uTv V9mwBCvRp3wrTj1NijOboK20RIO8Y/gcHCt6avDHNWmMbbbjS0q5B8K0JNwJ9aEx/GXwK6HmbuGT8 u+zMvkkp770vdC9eGMLMB/cUxJeQYjiQfgI7EPrfdg+4n5AdQl7ryQJOp8GmaHbLF3n8aX72qUMa0 +Uyjl0oPHMiIYH7y/gFA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KQQ-0007hE-Hq; Fri, 22 Mar 2019 13:41:34 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPN-0006Jt-Vn for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:38 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 5E8A810000D; Fri, 22 Mar 2019 13:40:25 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 05/10] ata: ahci: mvebu: Add a parameter to a platform data callback Date: Fri, 22 Mar 2019 14:39:58 +0100 Message-Id: <20190322134003.4893-6-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064030_949944_CBD0DEB5 X-CRM114-Status: GOOD ( 15.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Before using the ahci_mvebu.c driver with Armada 8k hardware (right now it is using the ahci_platform.c generic driver), let's add a 'struct device' pointer to the argument list of the ->plat_config() callback. This parameter will be used by the A8k's callback. Signed-off-by: Miquel Raynal --- drivers/ata/ahci_mvebu.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index 43bb2db59698..507ee7c5437c 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -29,7 +29,7 @@ #define AHCI_WINDOW_SIZE(win) (0x68 + ((win) << 4)) struct ahci_mvebu_plat_data { - int (*plat_config)(struct ahci_host_priv *hpriv); + int (*plat_config)(struct ahci_host_priv *hpriv, struct device *dev); unsigned int host_flags; }; @@ -67,7 +67,8 @@ static void ahci_mvebu_regret_option(struct ahci_host_priv *hpriv) writel(0x80, hpriv->mmio + AHCI_VENDOR_SPECIFIC_0_DATA); } -static int ahci_mvebu_armada_380_config(struct ahci_host_priv *hpriv) +static int ahci_mvebu_armada_380_config(struct ahci_host_priv *hpriv, + struct device *dev) { const struct mbus_dram_target_info *dram; int rc = 0; @@ -83,7 +84,8 @@ static int ahci_mvebu_armada_380_config(struct ahci_host_priv *hpriv) return rc; } -static int ahci_mvebu_armada_3700_config(struct ahci_host_priv *hpriv) +static int ahci_mvebu_armada_3700_config(struct ahci_host_priv *hpriv, + struct device *dev) { u32 reg; @@ -162,7 +164,7 @@ static int ahci_mvebu_resume(struct platform_device *pdev) struct ahci_host_priv *hpriv = host->private_data; const struct ahci_mvebu_plat_data *pdata = hpriv->plat_data; - pdata->plat_config(hpriv); + pdata->plat_config(hpriv, &pdev->dev); return ahci_platform_resume_host(&pdev->dev); } @@ -205,7 +207,7 @@ static int ahci_mvebu_probe(struct platform_device *pdev) hpriv->stop_engine = ahci_mvebu_stop_engine; - rc = pdata->plat_config(hpriv); + rc = pdata->plat_config(hpriv, &pdev->dev); if (rc) goto disable_resources; From patchwork Fri Mar 22 13:39:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C164139A for ; Fri, 22 Mar 2019 13:41:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16E342A6E5 for ; Fri, 22 Mar 2019 13:41:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 14B5D2A7CF; Fri, 22 Mar 2019 13:41:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ABC1F2A6E5 for ; Fri, 22 Mar 2019 13:41:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jA5bjw0jzIldizxT6E+E2tV8GQZO2EAC274OxdohIug=; b=CtGHJkMSrf978G TPVPM+y/RienFjmbROcmQaEE3Hqxy1CJtMVyJsxMC+FEiYRjmTClN0uFEvwOhtoSFJIC1/PP71tsr Wyw2snnaOlBLhCGn4w3hfO+Z093apnjxVAVyxoaJPcr4MqBdF+r7ctyFPZKS+UVz2CZjq8GD1xChH Myn58yeHUqalB2AQmuJ8IbbYAkl+sfOwPT6yiCsk2Ofvd1RJHrUOVA21ksiqnGcZYkjCKQeKwPeex 7n23dfxPYlViS/2at5x++qywJjBbZEcoszmLo6+0v8SgkZPPhSWKL8nuaianb4W4wUuv9OSh0BdrX 2oL2UlbCpS9SyElIQ9VA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KQE-0007SI-L3; Fri, 22 Mar 2019 13:41:22 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPR-0006Pm-N7 for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:38 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 9FF0F10000E; Fri, 22 Mar 2019 13:40:28 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 06/10] dt-bindings: ata: Update ahci_mvebu bindings Date: Fri, 22 Mar 2019 14:39:59 +0100 Message-Id: <20190322134003.4893-7-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064034_502401_E7CC4A3F X-CRM114-Status: GOOD ( 10.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Update bindings with the already in use Armada 8k compatible. Signed-off-by: Miquel Raynal Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/ata/ahci-platform.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt index 80261e2845b0..a1e6a3a27ee3 100644 --- a/Documentation/devicetree/bindings/ata/ahci-platform.txt +++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt @@ -17,6 +17,7 @@ Required properties: - "ibm,476gtr-ahci" - "marvell,armada-380-ahci" - "marvell,armada-3700-ahci" + - "marvell,armada-8k-ahci" - "snps,dwc-ahci" - "snps,spear-ahci" - "generic-ahci" From patchwork Fri Mar 22 13:40:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865749 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F2571669 for ; Fri, 22 Mar 2019 13:41:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EC0528535 for ; Fri, 22 Mar 2019 13:41:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52633287D4; Fri, 22 Mar 2019 13:41:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C39702A7CC for ; Fri, 22 Mar 2019 13:41:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=0iqUqRKEDajrev956/Um54rbp+3eAYa5/lopQuKWduA=; b=Wc8H2VG6YZD8nn mr1ApR0sWUPZI9zR7+wYh/qZjVh3VuPgGLYg8CFMV+1g5S+bTALdZDSMDFYcmYdgbwjDAD92QOP/B nZAAsrQGxLcjkVR1lmWLtKM/j5e0/1qtVrrpvKNDoSMvzNOAnI0WMd4Z3YhlXWKBefQns9e4XgFdl npMbLtpEwcdGnOWZCwFe9bhrHcZNxJN7z6Elf8jWUBT8Ejwxc/VaKigUAXQxlm9kZDhkT7zGnl+o+ TGPK2NSHKasETi+1MkfsaHFJr4Vlhj9ztYzSxLrCbwezjSIHfgRRZmahvWU0JdTRICTdEQZxjY9s3 pGUufvmcspG1E+nhJFVQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KQb-0007xT-GO; Fri, 22 Mar 2019 13:41:45 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPU-0006UC-MA for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:42 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 37A5E100006; Fri, 22 Mar 2019 13:40:32 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 07/10] ata: ahci: mvebu: Support A8k compatible Date: Fri, 22 Mar 2019 14:40:00 +0100 Message-Id: <20190322134003.4893-8-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064037_578803_477F3363 X-CRM114-Status: GOOD ( 12.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The ahci_platform.c driver was historically the one bound to the A8k AHCI compatible string, but before adding a quirk for this compatible, it is probably cleaner to put all Marvell EBU code in one place: the ahci_mvebu.c driver. Signed-off-by: Miquel Raynal --- drivers/ata/ahci_mvebu.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index 507ee7c5437c..8671aa8179fa 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -98,6 +98,12 @@ static int ahci_mvebu_armada_3700_config(struct ahci_host_priv *hpriv, return 0; } +static int ahci_mvebu_armada_8k_config(struct ahci_host_priv *hpriv, + struct device *dev) +{ + return 0; +} + /** * ahci_mvebu_stop_engine * @@ -232,6 +238,10 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { .host_flags = AHCI_HFLAG_SUSPEND_PHYS, }; +static const struct ahci_mvebu_plat_data ahci_mvebu_armada_8k_plat_data = { + .plat_config = ahci_mvebu_armada_8k_config, +}; + static const struct of_device_id ahci_mvebu_of_match[] = { { .compatible = "marvell,armada-380-ahci", @@ -241,6 +251,10 @@ static const struct of_device_id ahci_mvebu_of_match[] = { .compatible = "marvell,armada-3700-ahci", .data = &ahci_mvebu_armada_3700_plat_data, }, + { + .compatible = "marvell,armada-8k-ahci", + .data = &ahci_mvebu_armada_8k_plat_data, + }, { }, }; MODULE_DEVICE_TABLE(of, ahci_mvebu_of_match); From patchwork Fri Mar 22 13:40:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865771 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C6A671390 for ; Fri, 22 Mar 2019 13:53:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1EFC2A7D3 for ; Fri, 22 Mar 2019 13:53:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 95EBD2A7D9; Fri, 22 Mar 2019 13:53:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 91A872A7D6 for ; Fri, 22 Mar 2019 13:53:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OihOW1C3SDbZ4pZzK/9IuA4qFlQ9GYoim6+SfWt0Mw8=; b=eG19yoZVqXKbcY f9NPlrFDtmUJLLfQnAiTYuqc418HL6XxA97EQTXQUwwMHGiIhHQ7gE9PuuXOUOLdunronvK17J6ZP v9MuNymIX3RGijtCkqpWXVEPZSZ708EWscWo0OyfWZSKLuhN7U9F9Bg+ayw6xOLMZDGPWlsuD+/OH xAw1hBkMbcqscDgxOVHfuQTwjoI9sVWgSx9zel2h0X2qZ/jYcWhLznqFRyUspUHJoDJ1ZevoEnkKD qce99LvO9AmJZQEx+xVkRFoHgUikCKQVYbooX6eGvoswPxur5pa58ibYU7W/sBp+YhNM+frw6TnKJ CtvRA0HV0j/XJwBWJJyQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7Kc7-00031L-HL; Fri, 22 Mar 2019 13:53:39 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPY-0006Yw-6C for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:48 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 412BB10001A; Fri, 22 Mar 2019 13:40:35 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 08/10] ata: ahci: mvebu: Add support for A8k legacy DT bindings Date: Fri, 22 Mar 2019 14:40:01 +0100 Message-Id: <20190322134003.4893-9-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064040_943309_EACB0F5F X-CRM114-Status: GOOD ( 19.63 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The CP110 SATA unit has 2 ports, and a dedicated ICU entry per port. In the past, the AHCI SATA driver only supported one interrupt per SATA unit. To solve this conflict, the 2 SATA wired interrupts in the South-Bridge got configured as 1 GIC interrupt in the North-Bridge, regardless of the number of SATA ports actually enabled/in use, and the DT bindings only referenced the interrupt of one port. Since then, this limitation has been addressed and this patch ensures backward compatibility with old DTs not describing SATA ports correctly directly from the AHCI MVEBU driver. This way, we will be able to drop the hack from the ICU driver. IOW, when the A8k compatible string is used and there is no sub-nodes in the DT, we fake the creation and mapping of the second (missing) interrupt. Signed-off-by: Miquel Raynal --- drivers/ata/ahci_mvebu.c | 29 ++++++++++++++++++++++++++++- drivers/ata/libahci_platform.c | 3 +++ include/linux/ahci_platform.h | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c index 8671aa8179fa..8c981b8d6e4d 100644 --- a/drivers/ata/ahci_mvebu.c +++ b/drivers/ata/ahci_mvebu.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include "ahci.h" @@ -28,9 +29,13 @@ #define AHCI_WINDOW_BASE(win) (0x64 + ((win) << 4)) #define AHCI_WINDOW_SIZE(win) (0x68 + ((win) << 4)) +#define ICU_SATA0_ICU_ID 109 +#define ICU_SATA1_ICU_ID 107 + struct ahci_mvebu_plat_data { int (*plat_config)(struct ahci_host_priv *hpriv, struct device *dev); unsigned int host_flags; + unsigned int resource_flags; }; static void ahci_mvebu_mbus_config(struct ahci_host_priv *hpriv, @@ -101,6 +106,27 @@ static int ahci_mvebu_armada_3700_config(struct ahci_host_priv *hpriv, static int ahci_mvebu_armada_8k_config(struct ahci_host_priv *hpriv, struct device *dev) { + struct device_node *np = of_irq_find_parent(dev->of_node); + struct irq_data *irqd = irq_get_irq_data(hpriv->irqs[0]); + int host_irq = irqd ? irqd_to_hwirq(irqd) : 0; + int missing_irq = (host_irq == ICU_SATA1_ICU_ID) ? + ICU_SATA0_ICU_ID : ICU_SATA1_ICU_ID; + struct irq_fwspec fwspec = { + .fwnode = of_node_to_fwnode(np), + .param_count = 2, + .param = {missing_irq, IRQ_TYPE_LEVEL_HIGH}, + }; + + if (of_get_child_count(dev->of_node)) + return 0; + + hpriv->irqs[1] = irq_create_fwspec_mapping(&fwspec); + if (hpriv->irqs[1]) { + hpriv->flags |= AHCI_HFLAG_MULTI_MSI; + hpriv->get_irq_vector = ahci_get_per_port_irq_vector; + hpriv->mask_port_map = GENMASK(1, 0); + } + return 0; } @@ -200,7 +226,7 @@ static int ahci_mvebu_probe(struct platform_device *pdev) if (!pdata) return -EINVAL; - hpriv = ahci_platform_get_resources(pdev, 0); + hpriv = ahci_platform_get_resources(pdev, pdata->resource_flags); if (IS_ERR(hpriv)) return PTR_ERR(hpriv); @@ -240,6 +266,7 @@ static const struct ahci_mvebu_plat_data ahci_mvebu_armada_3700_plat_data = { static const struct ahci_mvebu_plat_data ahci_mvebu_armada_8k_plat_data = { .plat_config = ahci_mvebu_armada_8k_config, + .resource_flags = AHCI_PLATFORM_A8K_QUIRK, }; static const struct of_device_id ahci_mvebu_of_match[] = { diff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c index 347ff14aedd2..620e5f27fdd7 100644 --- a/drivers/ata/libahci_platform.c +++ b/drivers/ata/libahci_platform.c @@ -484,6 +484,9 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev, if (!child_nodes) hpriv->nports = 1; + if (!child_nodes && flags & AHCI_PLATFORM_A8K_QUIRK) + hpriv->nports = 2; + hpriv->phys = devm_kcalloc(dev, hpriv->nports, sizeof(*hpriv->phys), GFP_KERNEL); if (!hpriv->phys) { rc = -ENOMEM; diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h index eaedca5fe6fc..57465ba6bb15 100644 --- a/include/linux/ahci_platform.h +++ b/include/linux/ahci_platform.h @@ -44,5 +44,6 @@ int ahci_platform_suspend(struct device *dev); int ahci_platform_resume(struct device *dev); #define AHCI_PLATFORM_GET_RESETS 0x01 +#define AHCI_PLATFORM_A8K_QUIRK 0x02 #endif /* _AHCI_PLATFORM_H */ From patchwork Fri Mar 22 13:40:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10865773 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9EADE1390 for ; Fri, 22 Mar 2019 13:53:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D7942A04A for ; Fri, 22 Mar 2019 13:53:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 716A52A7DB; Fri, 22 Mar 2019 13:53:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1826F2A7CC for ; Fri, 22 Mar 2019 13:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5NStne7x7qW7dpwD/GKjIekKOlnq4V71eu1P20FWH3c=; b=KnVH3cIbspkWLe mKbP1ebu7MgEwAWkXT7e13kP9C6l3+WAR7mXhRuQbVn1O8MPhbBq34RDSXTHYATRKcDfQClhALCe/ upP5Ny4owLUKkm+N+QoAfshWi0SBsSrYyyqAXHLul6bf5L+2tIXLoKUMPPhrpdZnaSKhwDpwQsTTW hn/qVv7HFTJPBevv4+QjsPInyaALwjtilPE2g20e6LHxkZVuPQcuavNPIcvCQcAs5ZrQ39I7i4qUU Zg1GbyRPbgNKB+Hd983chYGkZevyq5fk1l16Ya+0OavK7NVFuVMG//5up45Vt11EFKLV0TIJb2ieU G+l/sWXLATSGKtNk83tA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KcD-00038E-JJ; Fri, 22 Mar 2019 13:53:45 +0000 Received: from relay11.mail.gandi.net ([217.70.178.231]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7KPb-0006dY-1r for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 13:40:50 +0000 Received: from localhost.localdomain (aaubervilliers-681-1-92-153.w90-88.abo.wanadoo.fr [90.88.33.153]) (Authenticated sender: miquel.raynal@bootlin.com) by relay11.mail.gandi.net (Postfix) with ESMTPSA id 6410A100012; Fri, 22 Mar 2019 13:40:38 +0000 (UTC) From: Miquel Raynal To: Gregory Clement , Jason Cooper , Andrew Lunn , Sebastian Hesselbarth , Rob Herring , Mark Rutland , Jens Axboe , Hans de Goede , Thomas Gleixner , Marc Zyngier Subject: [PATCH v3 09/10] irqchip/irq-mvebu-icu: Remove the double SATA ports interrupt hack Date: Fri, 22 Mar 2019 14:40:02 +0100 Message-Id: <20190322134003.4893-10-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190322134003.4893-1-miquel.raynal@bootlin.com> References: <20190322134003.4893-1-miquel.raynal@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_064043_572140_1502F131 X-CRM114-Status: GOOD ( 13.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Baruch Siach , Antoine Tenart , Maxime Chevallier , Nadav Haklai , linux-ide@vger.kernel.org, Thomas Petazzoni , Miquel Raynal , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP When writing the driver, a hack was introduced to configure both SATA interrupts regardless of the port in use to overcome a limitation in the SATA core. Now that this limitation has been addressed and the hack moved in the (historically) responsible SATA driver, ahci_{platform,mvebu}.c, let's clean this driver section. Signed-off-by: Miquel Raynal --- drivers/irqchip/irq-mvebu-icu.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/drivers/irqchip/irq-mvebu-icu.c b/drivers/irqchip/irq-mvebu-icu.c index 547045d89c4b..f3b43f63fe2e 100644 --- a/drivers/irqchip/irq-mvebu-icu.c +++ b/drivers/irqchip/irq-mvebu-icu.c @@ -38,8 +38,6 @@ /* ICU definitions */ #define ICU_MAX_IRQS 207 -#define ICU_SATA0_ICU_ID 109 -#define ICU_SATA1_ICU_ID 107 struct mvebu_icu_subset_data { unsigned int icu_group; @@ -111,22 +109,6 @@ static void mvebu_icu_write_msg(struct msi_desc *desc, struct msi_msg *msg) } writel_relaxed(icu_int, icu->base + ICU_INT_CFG(d->hwirq)); - - /* - * The SATA unit has 2 ports, and a dedicated ICU entry per - * port. The ahci sata driver supports only one irq interrupt - * per SATA unit. To solve this conflict, we configure the 2 - * SATA wired interrupts in the south bridge into 1 GIC - * interrupt in the north bridge. Even if only a single port - * is enabled, if sata node is enabled, both interrupts are - * configured (regardless of which port is actually in use). - */ - if (d->hwirq == ICU_SATA0_ICU_ID || d->hwirq == ICU_SATA1_ICU_ID) { - writel_relaxed(icu_int, - icu->base + ICU_INT_CFG(ICU_SATA0_ICU_ID)); - writel_relaxed(icu_int, - icu->base + ICU_INT_CFG(ICU_SATA1_ICU_ID)); - } } static struct irq_chip mvebu_icu_nsr_chip = {