From patchwork Tue May 21 14:30:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953925 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 621EB112C for ; Tue, 21 May 2019 14:31:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EE5E1FE8D for ; Tue, 21 May 2019 14:31:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 42EF42862D; Tue, 21 May 2019 14:31:11 +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 EB0091FE8D for ; Tue, 21 May 2019 14:31:10 +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=kigVm0JXju6qbp uxLsrrUVGFAZ7IK86cN9fYY0emaszhZ715rwMo3tn28KLTskpsZadFW54EmpOPyCKtbqgYjCGGOsY baqNfbfXzlYErsWQBRDXe4vMKkpv0los33+d04t1zETDk6AWg7ubeaR0NBFPQPhH2idPcshw0vGXP 2DpGm6rbbkUT3xtEDrCH+VqtezayLBNmP6qeEuhR4Quwt+VXHnwlSZVo8mcE8epOYIGP/P0GwDNUD W4QHRSIuPLrQCFLFAwrQVJ14hhqfFfmWt8fMBSefeyb4ZdGp0/FX2dERBVqZkVUMg5oNKLdFL0C0F 9jSRvfpk3DIOA5TDCcNw==; 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 1hT5nF-0000pc-TE; Tue, 21 May 2019 14:31:05 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5n7-0000fE-Np for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:01 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 845F224001D; Tue, 21 May 2019 14:30:47 +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 v4 01/10] ata: libahci: Ensure the host interrupt status bits are cleared Date: Tue, 21 May 2019 16:30:14 +0200 Message-Id: <20190521143023.31810-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073058_159332_B34F8D8E X-CRM114-Status: GOOD ( 12.38 ) 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 Tue May 21 14:30:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953927 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 E1A1A1395 for ; Tue, 21 May 2019 14:31:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAAB2268AE for ; Tue, 21 May 2019 14:31:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BD764285D1; Tue, 21 May 2019 14:31:25 +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 2677B268AE for ; Tue, 21 May 2019 14:31:25 +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=Azc/KwZZQCXExa EJzGhDZiQCH4Je4TRbIxBnZRK5E7uOfwh8t6HJGDoZeGlBSYpVNJlMlNRCJ/2ocZBXFHUPfQXgwwj P/fd3ebddjv4Y616eqzDb3VtDbIB9c8BhiabXk8pHQdzmiLUkBiadNTlcyuBc2zg5XwxASlSSJsYm 7ftVAdT5eXUfFiKLqeIHvKBsnTdLKckxDiTTY5pN5LZevA4EGGpWjfZg677oM8W+Odio5z7p2FQUv JlGHUmC2C9Tjnhh0Hlu66Yhdf8AkTfm46KxPsz6oObPyfrboHaQU7stw+/dw8DrFCX2+22UspXu89 GcLNrYImfpFN/hAWmUyA==; 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 1hT5nU-00017W-Jo; Tue, 21 May 2019 14:31:20 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5nG-0000pr-Fv for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:13 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 30B1B240004; Tue, 21 May 2019 14:30:56 +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 v4 02/10] ata: ahci: Support per-port interrupts Date: Tue, 21 May 2019 16:30:15 +0200 Message-Id: <20190521143023.31810-3-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073107_295777_64A0061D X-CRM114-Status: GOOD ( 20.50 ) 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 Tue May 21 14:30:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953931 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 CE2B21395 for ; Tue, 21 May 2019 14:31:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BBC651FE8D for ; Tue, 21 May 2019 14:31:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AF1AA284BD; Tue, 21 May 2019 14:31:35 +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 629CA1FE8D for ; Tue, 21 May 2019 14:31:35 +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=cV6MYI+0Ft2rn/ HacutkCzvRxnCivBF7qpRikapuYW/+oS3ffD7sFKZ3TCHpdKZbJ5Xy8rfeDKV9STQmWbig2MSveg0 3uN4gkiWllPAMqyBwojxI2Ghl6yXGTa2xVF8p9OMXM9eIFmw2Sa0wQq6Owo3rCvkxS7/IeYxh8cK6 6z0tQbNfTJXLNOHuU0925GKHbYSGPKffCw4hfzR3j0P2Y5APasXgJDjIBM27mcdLXqWBbw3tjiEWJ mCwPWcit0T0jVu5VDa/BaZWe0SU+GAb4VS1yqyQGLEBMz+9dXpRX3t9qROFw/go+nhNYWfSDEkwlp aFCgxE+udlVZ2fxmpQGg==; 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 1hT5nh-0001Om-6C; Tue, 21 May 2019 14:31:33 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5nM-0000zg-QU for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:16 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 26211240011; Tue, 21 May 2019 14:31:04 +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 v4 03/10] dt-bindings: ata: Update ahci bindings with possible per-port interrupts Date: Tue, 21 May 2019 16:30:16 +0200 Message-Id: <20190521143023.31810-4-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073113_089563_DC0D70CC X-CRM114-Status: GOOD ( 10.71 ) 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 Tue May 21 14:30:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953933 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 1EA07112C for ; Tue, 21 May 2019 14:31:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0DE95268AE for ; Tue, 21 May 2019 14:31:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 020BC1FE8D; Tue, 21 May 2019 14:31:46 +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 719E42862D for ; Tue, 21 May 2019 14:31:46 +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=mvQ3f6CQNiuMGI BNXo0+PY3mWN2aZ8KuYJMGiPavXPkMsF2NSfz5u/fRIubWF0a1JY0pRT7dJZXwHooRpTcRAz2bx8c GT69z/Li3Q+KItT/XOUKuxvL3Ify/C6GnATt7ekwYyKUYYp+WK2/8Zk+bdGKkuTAf2WuCAPPW55Uo DhiwKW5dS+1KpLLguU+biHQldax+aukVhDKaERNYxf4FZbHHeVifMy4Fa+0+phaJCz9Wr3AGda+Xw 3rKBfyJSO1tcyFt3Ts6BQK1BR876jxPqS2nAiwgkT7VhK1eK62WVt0mXQs/EJP7h0GwB3rlL+8Nq9 p6H8zHgcU+JXlVseOHyw==; 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 1hT5no-0001Wv-Lb; Tue, 21 May 2019 14:31:40 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5nQ-00014U-SI for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:18 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 947DC240017; Tue, 21 May 2019 14:31: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 v4 04/10] ata: ahci: mvebu: Rename a platform data flag Date: Tue, 21 May 2019 16:30:17 +0200 Message-Id: <20190521143023.31810-5-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073117_185730_C7AEC14E X-CRM114-Status: GOOD ( 14.81 ) 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 Tue May 21 14:30:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953935 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 5A6051395 for ; Tue, 21 May 2019 14:31:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 469EA1FE8D for ; Tue, 21 May 2019 14:31:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 37647284BD; Tue, 21 May 2019 14:31:56 +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 CA0181FE8D for ; Tue, 21 May 2019 14:31:55 +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=N8XKzwXVK/lhHr EcN+pmOjGZ+9B3/w3RCcsz5swIWSdKs3xuGVTY9kR/lSM0zhkmSOiblF7IDId8rpTJOw4hVW+HGXy Q/7gcWilzFqx+pgEC+fBfVmG7wy0DyWxiHulrJXKcyOBhaY25QNgAuYM55m+3cwkWz5juWp4CVBLK HdgyUwqfV5yePYXrNA62VbxR1f7gDkhhhBS23udQegDpsI1p5jD3FmoT9tsddFzuZglsq/WiafniW QxsyB6BkO7ze3s2dR6vJ1IuCLqLST5NEx1LjFVOhwmcQadCdCJOCQD+A/ZmkNnkvtcsgB3G7wzio8 4QfRVyqMACQCd/8B8raA==; 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 1hT5ny-0001ll-8c; Tue, 21 May 2019 14:31:50 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5nV-00017i-IR for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:25 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 7F693240028; Tue, 21 May 2019 14:31:15 +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 v4 05/10] ata: ahci: mvebu: Add a parameter to a platform data callback Date: Tue, 21 May 2019 16:30:18 +0200 Message-Id: <20190521143023.31810-6-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073122_071436_E226FF39 X-CRM114-Status: GOOD ( 15.87 ) 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 Tue May 21 14:30:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953937 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 BCC7C1395 for ; Tue, 21 May 2019 14:32:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC1DD1FE8D for ; Tue, 21 May 2019 14:32:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A03B2284BD; Tue, 21 May 2019 14:32:03 +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 5106F1FE8D for ; Tue, 21 May 2019 14:32:03 +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=gkdT0OyrCcCQSz 4bSvub+KNIuW9uvbbKQitU4Vfdvvvc4JJVQMhxdBIfijFY53U/adQKumEyOl6HZ46cLRHxd93rCE3 SDtinrxKD5nE7rtx47lJsJAebFi84WFvt62D8fs/I8m7XDxkJjhQACMGxVpmNVKuhh7C1B6qsLNv3 WQpEy37AsoN3fWwq/IvJ2/R3dCUC+WVlL8jlvygivTT0jR46d5/gKJ3mwV2dyHusGowCqTTx18+co cXmnnsy6ffpYIWXRbSFv1TSD50XfAOPqd3EKRmcMDcrqsyvZs2is1B0XD6hxv/dPoAZ+z9sXY2Hhq QR1SMfV0KcDp27V5tiww==; 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 1hT5o8-00021p-E0; Tue, 21 May 2019 14:32:00 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5na-0001FR-PL for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:29 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 44638240012; Tue, 21 May 2019 14:31:19 +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 v4 06/10] dt-bindings: ata: Update ahci_mvebu bindings Date: Tue, 21 May 2019 16:30:19 +0200 Message-Id: <20190521143023.31810-7-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073127_162722_1E9EE8F0 X-CRM114-Status: GOOD ( 10.74 ) 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 Tue May 21 14:30:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953939 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 825FE112C for ; Tue, 21 May 2019 14:32:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C91268AE for ; Tue, 21 May 2019 14:32:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66088284BD; Tue, 21 May 2019 14:32:34 +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 14440285D1 for ; Tue, 21 May 2019 14:32:34 +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=DlDWgN3yHCi5Nq wq0iqmGAFzXHp99P8dlQrmY3DY0JdcYojuoisoYHhBRs89wCLvm9VOU9wKy3M+vHyVxhlTfvg2+Pt qtOMahoKH/EzAev8f7FqdKvHb/M+rC28KkpPNibW3r928Pq3XTFzf3rgGKGIlwvyVYKy2lqnKInMK Q/ia0w+MuWrMdtO8R9JfAzWU6K1YBLUO7cVRnWRDjDYynnGbYdsR5ehI6jwK8ykSSjJBKkqEPlHzi JyMVq3nswMpibzGbBrb+d/5j43ZKcXBdFbTHRGu/4KrKgc7ZNgmK2Me8adj6uYZ08/5B8v+b4+38T 4h4tJlRt6D6J10KnzZEw==; 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 1hT5ob-0002Rj-Qn; Tue, 21 May 2019 14:32:29 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5ne-0001KF-SX for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:32 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 6E4FF240018; Tue, 21 May 2019 14:31: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 v4 07/10] ata: ahci: mvebu: Support A8k compatible Date: Tue, 21 May 2019 16:30:20 +0200 Message-Id: <20190521143023.31810-8-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073131_087609_1104D633 X-CRM114-Status: GOOD ( 12.86 ) 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 Tue May 21 14:30:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953941 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 420E41395 for ; Tue, 21 May 2019 14:32:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F62F1FE8D for ; Tue, 21 May 2019 14:32:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 22EA7284BD; Tue, 21 May 2019 14:32:42 +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 A90861FE8D for ; Tue, 21 May 2019 14:32:41 +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=ejUbkF8wz9xb8w hvjdVHehlS1vDy7xfk1rHMjjSMC4TDo/2YpGab0S5ioGdejKwx3xiog5vUhbJDGxEP9HlSv+y/hqA xL9755fYdo3J5i5x81pesZPEyaBDLsaFSYdqBwqUOUce8PZVzI6R5+f5PKev6zxunaDUBwMAokGPZ dysxF5JCJwXxCkaHf6Moqzedr0O57a10UPnDONvmYfn1HhQxCs9z+5hh8txsNWgAoamObKvT5Imvr W8fNNCDnWGBaPgAo9mue1xObaP6cIiDLY9O9HyMh+eZhyFcWRpB7iUMpbXK5MvLeB/96W/LsRcta6 O28Alo/7LfE3VfN0kcmg==; 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 1hT5oi-0002Xv-F0; Tue, 21 May 2019 14:32:36 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5nl-0001Sk-5D for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:31:43 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 8F8DF24001D; Tue, 21 May 2019 14:31:29 +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 v4 08/10] ata: ahci: mvebu: Add support for A8k legacy DT bindings Date: Tue, 21 May 2019 16:30:21 +0200 Message-Id: <20190521143023.31810-9-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073138_016569_FF3C0B6B X-CRM114-Status: GOOD ( 19.87 ) 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 Tue May 21 14:30:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953943 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 5FE40112C for ; Tue, 21 May 2019 14:32:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E5271FE8D for ; Tue, 21 May 2019 14:32:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 426EF284BD; Tue, 21 May 2019 14:32:49 +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 DFE9D1FE8D for ; Tue, 21 May 2019 14:32:48 +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=OdSXSeAvYt9Fmw ECHKnuPsiA98pT7Md0pbVvYe07qn/+GELd3ubeMH4xX0aVy37BmdnBzbbjS2sLccLP1qdHVE0q3EI qFEFycisapFX9QY3bpfJKvdm9GM+aoVTHt/pJuD/1aObM+5f9JxpVYoCXidehyRIWMAQQSEJGeMKX S26W1CcZBhIRef+E78N3hSMlSKrcnLgBpq1kSfaWFJEIFIAbz465SRQUs6tTssAJg17uuK2cg4VQl auJmB/mZVbqNwYz5Frf9sxAsGWmos5Hy5R+ca8xPHVmi/b3RW/vBGjoRNI6W/RXpeqJyhXCbzSPjV InGTfx0jXP6dFFZXG8FQ==; 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 1hT5or-0002mn-2R; Tue, 21 May 2019 14:32:45 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5nv-0001in-Jl for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:32:00 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 35776240012; Tue, 21 May 2019 14:31: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 v4 09/10] irqchip/irq-mvebu-icu: Remove the double SATA ports interrupt hack Date: Tue, 21 May 2019 16:30:22 +0200 Message-Id: <20190521143023.31810-10-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073148_262316_B0538864 X-CRM114-Status: GOOD ( 13.98 ) 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 Acked-by: Marc Zyngier --- 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 = { From patchwork Tue May 21 14:30:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10953945 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 DF2DB1395 for ; Tue, 21 May 2019 14:33:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAE671FE8D for ; Tue, 21 May 2019 14:33:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE521284BD; Tue, 21 May 2019 14:33:05 +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 730691FE8D for ; Tue, 21 May 2019 14:33:05 +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=MvbgaECOoWk2QBsKsDrR/xNl9sbmge3wwxsvMhHnsEo=; b=Htiz6QFnpql7D+ i0nejX7eJVRWxLmQOfW0GBrJ0N8jUCislVa/qAL9/rnkiRSmaJ75kc3w87p2cAoTIqgeO9vxxSjT4 afMA/Sg6ah8/LgG6N4AFRij/iixolYrc2x6CekELQyYZ+RSUZvhq2Ga5n0xdnvr64wh9C1V68pOB5 bEA44Nf+ZvWTl/1OVa2jGU4eR7TKYU3/ECRxQhTVu/dyViJTREWs3H9yOIb+VxCNBG8rbXhNp004Z J44uZVwsKB4f2LjCpRaji/5GzD6U8TXb4y9a/bRYY8QLIk2Zi0C5vm72T5hBVGnpSNVENX1Idn54o 1bvMnWls1qiZElqJ8zzw==; 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 1hT5p2-00032r-Dk; Tue, 21 May 2019 14:32:56 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hT5o1-0001qr-AX for linux-arm-kernel@lists.infradead.org; Tue, 21 May 2019 14:32:03 +0000 X-Originating-IP: 90.88.22.185 Received: from localhost.localdomain (aaubervilliers-681-1-80-185.w90-88.abo.wanadoo.fr [90.88.22.185]) (Authenticated sender: miquel.raynal@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 4D2F1240004; Tue, 21 May 2019 14:31:46 +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 v4 10/10] arm64: dts: marvell: armada-cp110: Switch to per-port SATA interrupts Date: Tue, 21 May 2019 16:30:23 +0200 Message-Id: <20190521143023.31810-11-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190521143023.31810-1-miquel.raynal@bootlin.com> References: <20190521143023.31810-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-20190521_073153_934328_D4B65666 X-CRM114-Status: GOOD ( 11.77 ) 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 From: Thomas Petazzoni There are two SATA ports per CP110. Each of them has a dedicated interrupt. Describe the real hardware by adding two SATA ports to the CP110 SATA node. Signed-off-by: Thomas Petazzoni Signed-off-by: Miquel Raynal --- arch/arm64/boot/dts/marvell/armada-cp110.dtsi | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi index 4d6e4a097f72..f9fd89961785 100644 --- a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi +++ b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi @@ -301,10 +301,21 @@ "generic-ahci"; reg = <0x540000 0x30000>; dma-coherent; - interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; clocks = <&CP110_LABEL(clk) 1 15>, <&CP110_LABEL(clk) 1 16>; + #address-cells = <1>; + #size-cells = <0>; status = "disabled"; + + sata-port@0 { + reg = <0>; + interrupts = <109 IRQ_TYPE_LEVEL_HIGH>; + }; + + sata-port@1 { + reg = <1>; + interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; + }; }; CP110_LABEL(xor0): xor@6a0000 {