Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753887AbdHRAxp (ORCPT ); Thu, 17 Aug 2017 20:53:45 -0400 Received: from mail-cys01nam02on0066.outbound.protection.outlook.com ([104.47.37.66]:26258 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753342AbdHRAxm (ORCPT ); Thu, 17 Aug 2017 20:53:42 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=David.Daney@cavium.com; From: David Daney To: Linus Walleij , Alexandre Courbot , Mark Rutland , Marc Zyngier , Thomas Gleixner , linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, David Daney Subject: [PATCH v8 0/7] genirq/gpio: Add driver for ThunderX and OCTEON-TX SoCs Date: Thu, 17 Aug 2017 17:53:29 -0700 Message-Id: <1503017616-3252-1-git-send-email-david.daney@cavium.com> X-Mailer: git-send-email 1.8.3.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [50.233.148.156] X-ClientProxiedBy: CO2PR07CA0061.namprd07.prod.outlook.com (10.174.192.29) To CY4PR07MB3493.namprd07.prod.outlook.com (10.171.252.150) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aef15407-02e9-4e9d-eae5-08d4e5d39139 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:CY4PR07MB3493; X-Microsoft-Exchange-Diagnostics: 1;CY4PR07MB3493;3:Xc5ArCZvehGrJlYJyWee8jKtCpdQ41r6sS6natIM6bQewMo1j8eT5yNQ0liwEvdbxExh144K2Q/Pd8gHW79ceNVCltXsv+nZvJMvQ34MZPFBi8IWVoKHwN93pSCSCq1XYiM0Xx3EB9sJV+F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3cctljr3b4WeoysFq/ADTHe6tcEO44ktXaVErxg9lQBydCUCVxK5jTnrRXl9P7kuMm6Usm8a7FvyqGz7Tv6as+baZ+qCW1X+JAsOVsksp0sOfDpZ/MkDYy3OoXK4fb8twqkVRMIQJ8OguAyaSyeuPejagXPzgYy3FYgb8FRguw+1nK9WeWZp5eZdMBAQPKT;4:yGvRP6TtSHQGw5caj0vDuBCqrKErzBn7OzFV8hTW2FgVtFFwdvmvuKwqU4eSepzDGSgpkgL7P3aUuLWgguVIZ8eIcI2rNjdcIFmnpR0yC3C4j0SXZQiF4fM62sQ21tGRlZeGnxSK9bCvNLBa86C17L2QEKWaIrltthY0HxoYPvqaTClbZ0X1BmogPi+ZS37e5yPn5uyoVM9xyItf1yV+vToc0mz0QDZOg/teQPYcdM9eQnOzQ4kR1m0/PeVqM9bX X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(6041248)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR07MB3493;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR07MB3493; X-Forefront-PRVS: 040359335D X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(6029001)(189002)(199003)(69596002)(72206003)(50226002)(6116002)(3846002)(4326008)(105586002)(42186005)(6666003)(5003940100001)(4720700003)(50986999)(5660300001)(189998001)(7350300001)(53416004)(33646002)(101416001)(53936002)(478600001)(6512007)(50466002)(2906002)(48376002)(7736002)(68736007)(107886003)(66066001)(25786009)(86362001)(47776003)(97736004)(36756003)(106356001)(6486002)(6506006)(305945005)(81156014)(81166006)(8676002);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR07MB3493;H:ubuntu.caveonetworks.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR07MB3493;23:GYGpbSLy84UaJ20rwoXjp9x6u6W1tO88oea/p3XoV?= =?us-ascii?Q?XljQLYXK1zfYOrobNHQedOhIoKLplt27ZzGPQaL61zExUxFauGR2hsTdaojz?= =?us-ascii?Q?UYeEeeRg+0KxvVgmr6gGVBEqMQWvloseJRkB0C+KqwFgRzdt4FOKrgQgSIyr?= =?us-ascii?Q?GjIeO0Zo3FryQoP7ilpmdkWb/mjQ6pCJtprAeD+uigqoNdlbEG3UfQ9mCXQK?= =?us-ascii?Q?xQ73voskqXG8vTPpmb0nKrLgtfi3MrE6FPoD0JHCBLsSjIKjDHTrn29AUrvw?= =?us-ascii?Q?A8Kknrl2Q3nngYWf3WDbWP9lQWG1K6qYiEDOW022eBgLqXqqKh3v44z5dWif?= =?us-ascii?Q?JpLP0KY9bpBPHNiZ7C5jvWYwQeTbyvB9EeX5kxwvxNBKdVlv/ho4Zh8GKwZ3?= =?us-ascii?Q?UDw2b9wVVL0CnyC3sFpiyqvr2t8euwaPeUy8fQm3p6XzH+91J3dfwreAAFV0?= =?us-ascii?Q?5UF1eW+D/PBETHuGRZ0lq1FPaUhwoiRsGopSORl/XmxmJGrRwd6HV7IqmyU3?= =?us-ascii?Q?1+CjWBvSo6VS3aQCH0U4NyVRx06xd76U17C11f/rHICWCJlhjVqUD8ra2CNv?= =?us-ascii?Q?E/hC1Xrhak3YvrWlQQp54W/mkFcv/v+Ab+bPcRafMzv5KuDznnS7MlLOMjY1?= =?us-ascii?Q?/fFiD/aHHg2uGb0SkbfxdpPalRZgfyGZ4mSmO6j9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L+w4o4rtgSKSNPYwx6j6Q==;24:7/tvtpiW7ABdzDM+g44utBo4F6SE+WOpzLKq1NZazkMUWConv628GrdY1ox+NoDqSzeTaKb38bTlVENVq0XUjP9JUIOI028UfuYJs+/px5w=;7:hWXV2ObdxVPKGNcq4NDHxvX1y4KgGekAgGeoM6pR8O/v2ZKmQf7qP/uBmTxGmI6EGVXYSRZ35zVEpJXN9ZkyIJncHmwolRKoH4NqIJUxSjT0JIg5e2J/atXteTtJnFyECfmg8cICOMmvkJGMyVkVsZuGDw5ie8SDIHMosehptlwPzT/HYD6c21fOguR4OvDiZZ245vkvFLebD9D/HIoUXd4It0E8J8AFOd/SYYqgMe0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2017 00:53:39.8791 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB3493 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2615 Lines: 83 The ThunderX/OCTEON-TX GPIO hardware looks like a PCIe device, with the interrupt signal from each GPIO line being routed to a dedicated MSI-X. This interrupt routing requires that we add some custom processing to the beginning of the MSI-X irqdomain hierarchy. Changes from v7: - Refactoring of irqdomain.c changes as suggested by Marc Zyngier. - Renaming of new handler functions in chip.c and making building of these conditional on a Kconfig variable, suggested by Thomas Gleixner. Changes from v6: - Trivial rebase to v4.13.0-rc4: Omit device tree bindings patch, which was already merged, and fix MAINTAINERS patch collision. Changes from v5: - Added .irq_{request,release}_resources() functions to irq_chip. - Quit calling irq_set_irq_type() in the irq_map() function. - Added more error condition checking to irq_domain_{push,pop}_irq() Changes from v4: - Rebased to post-v4.10 to support .set_config() function. - Added .get_direction() support. - Added PIN_CONFIG_INPUT_DEBOUNCE support. - Removed some improper use of ENOSYS. Changes from v3: - Add some "depends on" to the driver Kconfig to avoid build errors in some architectures when doing COMPILE_TEST builds. Changes from v2: - in 4/6: Added Rob Harring's Acked-by - Added three patches to genirq/irqdomain to support interrupt code in the driver. - Rewrite irq code in driver to use irqdomain hierarchy. - Other naming and style changes as recommended by Linus Walleij. Changes from v1: - in 1/3: Addressed Rob Harring's comments. - in 2/3: Trivial cleanups found in internal review + add some comments. David Daney (7): genirq: Export more irq_chip_*_parent() functions. genirq: Add handle_fasteoi_{level,edge}_irq flow handlers. irqdomain: Factor out code to add and remove items to and from the revmap irqdomain: Check for NULL function pointer in irq_domain_free_irqs_hierarchy() irqdomain: Add irq_domain_{push,pop}_irq() functions. gpio: Add gpio driver support for ThunderX and OCTEON-TX MAINTAINERS: Add entry for THUNDERX GPIO Driver. MAINTAINERS | 5 + drivers/gpio/Kconfig | 9 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-thunderx.c | 639 +++++++++++++++++++++++++++++++++++++++++++ include/linux/irq.h | 2 + include/linux/irqdomain.h | 3 + kernel/irq/Kconfig | 4 + kernel/irq/chip.c | 109 ++++++++ kernel/irq/irqdomain.c | 230 ++++++++++++++-- 9 files changed, 972 insertions(+), 30 deletions(-) create mode 100644 drivers/gpio/gpio-thunderx.c -- 1.8.3.1