From patchwork Wed Apr 15 10:07:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xu Yilun X-Patchwork-Id: 11490845 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 A90FF112C for ; Wed, 15 Apr 2020 10:10:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9A54020787 for ; Wed, 15 Apr 2020 10:10:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896238AbgDOKK2 (ORCPT ); Wed, 15 Apr 2020 06:10:28 -0400 Received: from mga03.intel.com ([134.134.136.65]:27969 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2896221AbgDOKKS (ORCPT ); Wed, 15 Apr 2020 06:10:18 -0400 IronPort-SDR: 7Uewr7cbYjd3+VfwGxh2UPNtlKM9Th2Mv8OMRO/vxxSe6dgNw/suE8ILHROXRKs+KP6KQ7qgU5 AoTzBNAGg1jg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Apr 2020 03:10:16 -0700 IronPort-SDR: aId59wJtQvTdJVURjpuzjsl1e0DTZ33paKQgcXPpmz6CSWPmo9nLWko1C0YtQI/B5nMddxu6ib qYokxNtlvjKA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,386,1580803200"; d="scan'208";a="253482866" Received: from yilunxu-optiplex-7050.sh.intel.com ([10.239.159.141]) by orsmga003.jf.intel.com with ESMTP; 15 Apr 2020 03:10:14 -0700 From: Xu Yilun To: mdf@kernel.org, linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org Cc: trix@redhat.com, bhu@redhat.com, Xu Yilun Subject: [PATCH v4 0/7] Add interrupt support to FPGA DFL drivers Date: Wed, 15 Apr 2020 18:07:28 +0800 Message-Id: <1586945255-30823-1-git-send-email-yilun.xu@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-fpga-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fpga@vger.kernel.org This patchset add interrupt support to FPGA DFL drivers. With these patches, DFL driver will parse and assign interrupt resources for enumerated feature devices and their sub features. This patchset also introduces a set of APIs for user to monitor DFL interrupts. Three sub features (DFL FME error, DFL AFU error and user interrupt) drivers now support these APIs. Patch #1: DFL framework change. Accept interrupt info input from DFL bus driver, and add interrupt parsing and assignment for feature sub devices. Patch #2: DFL pci driver change, add interrupt info on DFL enumeration. Patch #3: DFL framework change. Add helper functions for feature sub device drivers to handle interrupt and notify users. Patch #4: Add interrupt support for AFU error reporting sub feature. Patch #5: Add interrupt support for FME global error reporting sub feature. Patch #6: Add interrupt support for a new sub feature, to handle user interrupts implemented in AFU. Patch #7: Documentation for DFL interrupt handling. Main changes from v1: - Early validating irq table for each feature in parse_feature_irq() in Patch #1. - Changes IOCTL interfaces. use DFL_FPGA_FME/PORT_XXX_GET_IRQ_NUM instead of DFL_FPGA_FME/PORT_XXX_GET_INFO, delete flag field for DFL_FPGA_FME/PORT_XXX_SET_IRQ param Main changes from v2: - put parse_feature_irqs() inside create_feature_instance(). - refines code for dfl_fpga_set_irq_triggers, delete local variable j. - put_user() instead of copy_to_user() for DFL_FPGA_XXX_GET_IRQ_NUM IOCTL Main changes from v3: - rebased to 5.7-rc1. - fail the dfl enumeration when irq parsing error happens. - Add 2 helper functions in dfl.c to handle generic irq ioctls in feature drivers. Xu Yilun (7): fpga: dfl: parse interrupt info for feature devices on enumeration fpga: dfl: pci: add irq info for feature devices enumeration fpga: dfl: introduce interrupt trigger setting API fpga: dfl: afu: add interrupt support for port error reporting fpga: dfl: fme: add interrupt support for global error reporting fpga: dfl: afu: add AFU interrupt support Documentation: fpga: dfl: add descriptions for interrupt related interfaces. Documentation/fpga/dfl.rst | 19 +++ drivers/fpga/dfl-afu-error.c | 22 +++ drivers/fpga/dfl-afu-main.c | 36 +++++ drivers/fpga/dfl-fme-error.c | 23 ++++ drivers/fpga/dfl-fme-main.c | 6 + drivers/fpga/dfl-pci.c | 80 +++++++++-- drivers/fpga/dfl.c | 311 ++++++++++++++++++++++++++++++++++++++++++ drivers/fpga/dfl.h | 57 ++++++++ include/uapi/linux/fpga-dfl.h | 82 +++++++++++ 9 files changed, 627 insertions(+), 9 deletions(-)