From patchwork Wed Mar 6 10:21:37 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 10840801 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 2FBA61515 for ; Wed, 6 Mar 2019 10:23:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1641A2D601 for ; Wed, 6 Mar 2019 10:23:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09DE22D63C; Wed, 6 Mar 2019 10:23:22 +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 02E8E2D601 for ; Wed, 6 Mar 2019 10:23:21 +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=vxl6OU5DR1mswoyWzoX05+dtg7T5eO0cY+w1wKkJJiY=; b=agKdQ+PNkWW/MB RP584yvsxEM+rDSkEN7YWSZDw/6NS3y2QchciYUk1+n7DEVYB2XeRzi8DZOp6MMU3xmVp/iuUQvxd d2jAG92kUC08GPyT3rn0DmTZvw9CM17lXIuFDx+yrxV4i5e/EYMQNr6DLo7pjs3flrOkjKbb7hdQh dZZ5F0jN6CuR1Q4AZ1oKNhPgthZfoNjj4ctIki2rcdCZP21xR1m78f12lRwLV/ZQuANn82cgeLsHh V+aXyYXgk+jk2vKhZQ3BAmRDcT4jaG2xQL/Viiof05N7MtBp3lrHmLGqNgfLaJdI7/dxXU3M7ouIe HNeNA6qOQfJ5003eNO8Q==; 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 1h1Thi-0003Qj-LU; Wed, 06 Mar 2019 10:23:14 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1Tgw-0002Q0-4q for linux-arm-kernel@bombadil.infradead.org; Wed, 06 Mar 2019 10:22:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5/ItDp0O7vJwY+cWFrMmsocKoPsu8ePRWsEhPEatQBI=; b=DgehjXgSALhWfdQJaHb2XGz7Lm lSS3No44kUIpZQMOamJag5h0XRVL57AEVfmhYmDBijX74k8qKKgfMdZ1qQY0q5GaJO0ilUoxl+Yni /mWsprhmGGvwp0k2sYUZo/PREH/EhSIfiXlVvFkJwZLqf0t5RkYvVtL8x+4MnUYAPeQr0T/eSt+K1 Q40qGl07WWD/IFNH3HHmRofLeo3Aoywa+0O9KQ0XqBR9vysDjGb/NDF+oXcdbT0kCrdLJdQURAJQt LYIXjVDKX7BUGBNfSUeM55q3pNoD/PiEi60R6EiWNtyRG1uyQP62eKb88jZ+ABtnwFpQNQxRflZmS VMvOOuQA==; Received: from relay9-d.mail.gandi.net ([217.70.183.199]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h1Tgt-0003AF-8s for linux-arm-kernel@lists.infradead.org; Wed, 06 Mar 2019 10:22:24 +0000 X-Originating-IP: 90.88.150.179 Received: from localhost.localdomain (aaubervilliers-681-1-31-179.w90-88.abo.wanadoo.fr [90.88.150.179]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 64517FF80A; Wed, 6 Mar 2019 10:21:53 +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 v2 01/10] ata: libahci: Ensure the host interrupt status bits are cleared Date: Wed, 6 Mar 2019 11:21:37 +0100 Message-Id: <20190306102146.13005-2-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190306102146.13005-1-miquel.raynal@bootlin.com> References: <20190306102146.13005-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-20190306_102223_370942_16AD68BA X-CRM114-Status: GOOD ( 12.35 ) 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index b5f57c69c487..66d4906a5013 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,10 @@ 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); + spin_lock(&host->lock); + writel(BIT(ap->port_no), mmio + HOST_IRQ_STAT); + spin_unlock(&host->lock); + VPRINTK("EXIT\n"); return IRQ_HANDLED;