From patchwork Sun Jul 19 06:59:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sven Auhagen X-Patchwork-Id: 11672215 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B87E4138C for ; Sun, 19 Jul 2020 07:01:45 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 841612073A for ; Sun, 19 Jul 2020 07:01:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="oKK1wNjW"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=voleatech.de header.i=@voleatech.de header.b="NTpEgyiL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 841612073A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=voleatech.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References:List-Owner; bh=wZnIb3mH8Yue9Bb11BcKTrFn1bwyBrZxL809z9TWcYo=; b=oKK1wNjWKs6i3I09jMklq5YgnQ HR2y5Q8VLemJByPO4XFtc7QrCIqoAaKp3pQunj3mZAfymlGieoS9lnouCp9jKXiSgTYl8Tv7GJUtA DJckQa+AL7qiBTsw6h6SAIQdwfhrSaKXERrmbprFEIH0FRYGazCXMRzFcKi7RfWRsq16ZFmsBUfJC 6/B8V3LNGYYN1bvURV4CfX0ojKlIMJP+hd74jCgTSXkaePCpVJNku0g9VEfH6aQ0pZxVYXhdmJ8si uThxyw31OKRprTqfgbPbqyJH+BKgY0EqV/F89LGwXJTGanvno+C7JxtEUgGDLqEUTQTxSUn2rxCRk XY1RSfaQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jx3Iq-0007wh-D6; Sun, 19 Jul 2020 07:00:04 +0000 Received: from mail-eopbgr50104.outbound.protection.outlook.com ([40.107.5.104] helo=EUR03-VE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jx3Ie-0007sQ-7w for linux-arm-kernel@lists.infradead.org; Sun, 19 Jul 2020 06:59:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iKZ9gxH5ekKNxC4C5/Z9HFn3ib30IjfsuUHA+kple5xuVkhk/QY5IBHFDhl0Ek230IG+4Jh2Ly3FkU9ZhkeS2IrBYe+wZbrxeKu2kLpelIvudKGx+1Qkpjel98DSg/bTen8Qdx8s45MnBpFhdhtOFVEHedvv/D9JKRfI6+lfRecRVnHlOCsohtSPrBZES3WAhc+a3kpTaummuHnFmppu0Hi9/57/NDNcSaP0eVqrKkmzkmAAotMn3rlqvwYFfzMA9ry/AZAa7yD1NUQ/WWZ/S+KYVGDA1/ZTSz5ZANbaDIh03YgDMdUuioXstUE7XXaHQPhdtr7/bPSFSGH2OVLTNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zDC2bRUORaPVhaon8cHIeQOHaHLqj3tuUgiiQ3+iI30=; b=ES5HUch/tEjC0LC58MtS5dbuZo3zfe3crF2TzavMnZWJdc7zuhxJllKc8FMaQmqEp6xhDhuWMRhRH/0ILoy4/kHRnHe5pbgP51eijsb2SmwzZOFm0gtQRLJ7BoRZa9HN2RZY5zObdapRAIkkkxNeYyccUXXjxKJ+DUYikVpLe5Q47QWJgLn8cRdsQy92bJtaH+i0iykz+uGALLmG3sQxkB/sfs4qI5a0RKCyFU8OsfdcHONGjScGYjYloobe4zLwbP90t5albvJwx8XSIVMRwIfBdH4uIL51sj0CdqJEgki9OKs+tgReWzZ+os3FcqefXuSXCuAY3vUu5x0w8aCnmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=voleatech.de; dmarc=pass action=none header.from=voleatech.de; dkim=pass header.d=voleatech.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=voleatech.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=zDC2bRUORaPVhaon8cHIeQOHaHLqj3tuUgiiQ3+iI30=; b=NTpEgyiLywolHdJoLuWzgCzyQVLCWRL+DiNPval22kNnst7Yu44CI+wqdp8IfWvmRNfL3niJbzvqm3YpdrrL/vEoiJb5O6QZQ067TyXrkH/DzOGcs1IapfG5fBTzWqm6M23w0mkcR+shdhfGNBWZ1HXo0/rsZlm8vaR/GJcPszE= Authentication-Results: lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=none action=none header.from=voleatech.de; Received: from AM4PR0501MB2785.eurprd05.prod.outlook.com (2603:10a6:200:5d::11) by AM0PR05MB6690.eurprd05.prod.outlook.com (2603:10a6:20b:146::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Sun, 19 Jul 2020 06:59:44 +0000 Received: from AM4PR0501MB2785.eurprd05.prod.outlook.com ([fe80::39a1:e237:5fef:6f39]) by AM4PR0501MB2785.eurprd05.prod.outlook.com ([fe80::39a1:e237:5fef:6f39%11]) with mapi id 15.20.3195.025; Sun, 19 Jul 2020 06:59:44 +0000 From: sven.auhagen@voleatech.de To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 0/7] Armada8k enable per-port SATA interrupts and drop a hack in the IRQ subsystem Date: Sun, 19 Jul 2020 08:59:35 +0200 Message-Id: <20200719065942.24693-1-sven.auhagen@voleatech.de> X-Mailer: git-send-email 2.24.3 (Apple Git-128) X-ClientProxiedBy: AM0PR01CA0099.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::40) To AM4PR0501MB2785.eurprd05.prod.outlook.com (2603:10a6:200:5d::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from SvensMacBookAir.sven.lan (109.193.235.168) by AM0PR01CA0099.eurprd01.prod.exchangelabs.com (2603:10a6:208:10e::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.17 via Frontend Transport; Sun, 19 Jul 2020 06:59:43 +0000 X-Mailer: git-send-email 2.24.3 (Apple Git-128) X-Originating-IP: [109.193.235.168] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 829e2d92-2c73-4d8e-9a0a-08d82bb1513f X-MS-TrafficTypeDiagnostic: AM0PR05MB6690: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5797; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FSDCe4Li0+s20Cj4PIRiqDqFnLg8Zh8oCGkcR3QvxoVXVP3HU6haZUcHkRt+ftE6s2GWKi2SBNq0EHW0wM8kYL9hbVGPQrzHkBp0sJqhWtVvL6im8VgQTUkOSZU8zLfuUgT+msMSCwasvw/DTJ0Hpp1wFGr0Yxs5h8lmqkuWvv5jv+OjTWFQ//Jd9OpjyZQ8CN7ODUedX7zUGBmBi+/E+8LCIPeEQLe+MaM7RtPtTipJ6lTRnWLcqS8D8VYsKEHb0YgMrgHQtEB8Jx8/OEkPWhsZ0JCadCxtgKVV2FFAATmY6d32p1H2CEPS0kBaw299jX67U0V7U0HukzMW8Dhm2Iqe9FypZxvnR4Tx3xOSiZ3qWieS060ovHuyYnLc0ZYI X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM4PR0501MB2785.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(39830400003)(396003)(376002)(346002)(136003)(2616005)(4326008)(66574015)(6916009)(7416002)(86362001)(508600001)(1076003)(956004)(316002)(16526019)(6486002)(6512007)(9686003)(186003)(66556008)(66476007)(6506007)(6666004)(52116002)(8676002)(2906002)(26005)(36756003)(66946007)(83380400001)(5660300002)(8936002)(32563001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: uE/gcCtDJBQJpHi3YMeS5tQUwM5OPn25PL10wFY+w79QOf7Q84C5uCS9Gl5nqUQtxL7l+ro2HzhVCptxsc3Cs7eZJDafD4EbLnAb76uPqy2W/aOLC2Za4qpLeu9nCW//0v4eMawuYanhKHUXIa8A8py1yqFvYLJMiVfClGf07yOnVAx9kJH8bR2C1Kv0nzy7zjO6Q+jML0JoEWYt3AdrQScf9OXdo4Il1loC+K5+tnfLTuwwoTtK1JUgOMnyKSD+B+GrronYZQlY8noRSihvm0GPM+t9zSlvrzM3J0uYBr6dNpdGyA7R/bKlNgcGaklkroZ8MAYIw5truIIx7NTFhjXWHJaxT0JNJXjsKCDRu2ekYxmRazRezZ/juZ8juUPDVz36xhkEr8ILiVP4IY+T+ssLfNiJopI/h5fhEfNmLnI4CbPFR4ABRnC/ZHSLiNjok8Hf8uBVBgp9P6PfaBjpqjTrXRncfbAViAAx7AUKoFwDzRPHNT+eonh18KwHtTMs X-OriginatorOrg: voleatech.de X-MS-Exchange-CrossTenant-Network-Message-Id: 829e2d92-2c73-4d8e-9a0a-08d82bb1513f X-MS-Exchange-CrossTenant-AuthSource: AM4PR0501MB2785.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2020 06:59:44.6842 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b82a99f6-7981-4a72-9534-4d35298f847b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cVviVxHv8gpJ6IvdXM6jOr2muKSQr8Z/C3e5CrPv+JJTqNMRvGNofGiFtT9FCHgT98A1Z+N4LaOxqy787LJkBaRjQejec36knymFX8SKjz0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6690 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200719_025952_369556_3FBF7466 X-CRM114-Status: GOOD ( 17.57 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [40.107.5.104 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [40.107.5.104 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 MSGID_FROM_MTA_HEADER Message-Id was added by a relay X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, andrew@lunn.ch, baruch@tkos.co.il, jason@lakedaemon.net, linux-ide@vger.kernel.org, antoine.tenart@bootlin.com, gregory.clement@bootlin.com, maxime.chevallier@bootlin.com, nadavh@marvell.com, hdegoede@redhat.com, robh+dt@kernel.org, axboe@kernel.dk, thomas.petazzoni@bootlin.com, miquel.raynal@bootlin.com, marc.zyngier@arm.com, tglx@linutronix.de, sebastian.hesselbarth@gmail.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Sven Auhagen Hello, there were already 4 versions of this series from Miquèl. I talked to Miquèl and I fixed up the last comments from v4. I am looking for feedback if this patch series is now ready to be merged and what should be further changed. Here is the original cover letter: Some time ago, when the initial support for Armada CP110 was contributed, the SATA core was not able to handle per-port interrupts. Despite the hardware reality, the device tree only represents one main interrupt for the two ports. Having both SATA ports enabled at the same time has been achieved by a hack in the ICU driver(1) that faked the use of the two interrupts, no matter which SATA port was in use. Now that the SATA core is ready to handle more than one interrupt, this series adds support for it in the libahci_platform code. The CP110 device tree must be updated to reflect the two SATA ports available and their respective interrupts. To do not break DT backward compatibility, the ahci_platform driver now embeds a special quirk which checks if the DT is valid (only for A8k compatible) and, if needed, creates the two missing sub-nodes, and assign them the relevant "reg" and "interrupts" properties, before removing the main SATA node "interrupts" one. (1) The ICU is an irqchip aggregating the CP110 (south-bridge) interrupts into MSIs for the AP806 (north-bridge). Best Sven Changes in v5 ============= * Rebase on top of v5.8-rc3 * Move code to ahci mvebu and use custom functions Changes in v4 ============= * Rebase on top of v5.2-rc1 * s/ARM64/arm64/ in the DT change commit title. Changes in v3 ============= * Removed useless locking when acking the SATA host IRQ_STAT bit. * As spotted by Hans, do not enable the AHCI_HFLAG_MULTI_MSI flag only if more than one port is enabled, DTs might declare only one interrupt and have multiple ports. Added Hans' Reviewed-by tag. * Added Rob's Reviewed-by tags. * Added explicit references to the 'Device Tree' being the culprit for the hacks which are being treated in patch "ata: ahci: mvebu: Add support for A8k legacy bindings" as suggested by Marc. * Modified all DTs to avoid enabling/disabling the SATA ports independently, which does not work. Either both ports are enabled, or none. Tested on MacchiatoBin that all three availabe ports on the board are functional. Changes in v2 ============= * In the AHCI world, the 'irq' is now an '*irqs' array, I ensured it is allocated even when not using *_platform drivers. * Moved the whole logic from the generic ahci_platform.c driver to the Marvell's ahci_mvebu.c driver. * Dropped the whole DT manipulation quirk. * Instead used a hack to configure both interrupts when using the deprecated bindings, this hack is a8k specific but there is a flag that is passed to the core during the ahci_platform_get_resources() to indicate that the number of ports must be forced to 2 no matter the number of child nodes. * The A8k based Clearfog-GT actually uses the SATA IP (Baruch's info) so do not remove the SATA node from the DT. Instead, change the DTS to fit the new bindings (the board only uses the second port at offset 1). * Added bindings documentation about the A8k AHCI compatible (existing in DTs, missing in the doc). * SATA Sub-nodes representing ports already are documented, I just added a mention that they can also have an interrupts property which is mutually exclusive with the root SATA node. Miquel Raynal (5): ata: ahci: mvebu: Rename a platform data flag ata: ahci: mvebu: Support A8k compatible irqchip/irq-mvebu-icu: Remove the double SATA ports interrupt hack dt-bindings: ata: Update ahci bindings with possible per-port interrupts dt-bindings: ata: Update ahci_mvebu bindings Sven Auhagen (2): ata: ahci: mvebu: Add support for A8k legacy DT bindings arm64: dts: marvell: armada-cp110: Switch to per-port SATA interrupts .../devicetree/bindings/ata/ahci-platform.txt | 7 + arch/arm64/boot/dts/marvell/armada-cp11x.dtsi | 6 +- drivers/ata/ahci.h | 3 + drivers/ata/ahci_mvebu.c | 254 +++++++++++++++++- drivers/ata/libahci.c | 3 +- drivers/ata/libahci_platform.c | 3 + drivers/irqchip/irq-mvebu-icu.c | 18 -- include/linux/ahci_platform.h | 1 + 8 files changed, 265 insertions(+), 30 deletions(-)