From patchwork Mon Dec 30 12:33:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 182611 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6283321ild; Mon, 30 Dec 2019 04:31:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzheku4oYjItO5AOyxNtcfnsNcQgAJOfWXM70EhNfAFrpz5wu69RCptdkBR5IC1Vp+Cf2dz X-Received: by 2002:a05:6830:1e67:: with SMTP id m7mr70824776otr.262.1577709114938; Mon, 30 Dec 2019 04:31:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709114; cv=none; d=google.com; s=arc-20160816; b=E+G6ct7uzNEAF3IU2Y0aPZsGRc7BKgehPy2C8AAxmLDN8FxG7uv8obDULyFJNRCtrY 0XsZhC7Z8jv30tvH8XjVq61a/YGEBvEsIQSmcnSNh5J+qxrayvWUslEkUIUMOCn37fIp KLwNzXNQWuaZ+wp746qUaqmBkvMPldRvAIj1luKna1bdHgMPEJGa5LYDoplBecWttox9 uzzvdpB5d+cjgNusJtJz2kFnND5sPxbx3SwXnvexOER1h/NcbNrRsZ4J2CgN5+L9H7eW auGNRPNVSBKR/QXH7kPSnrXhy4ogAzyiuL3rpy/J5/x4G1DHAH++W1q7n4w4BYnWxx3t Ji1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=80xrZROJ/3yIZ/pEEHiKoJKreAUnrlhI7GU6M+DWOWg=; b=fkkxV3KLDuDyHdd4EfGoVOed/4UuaTnia5ZB3PqrT1pJUkgYPSJw0Y1EwsM340L13D dVMHE3WHBKstANpvae/mT8XyCbiJJlmRUTg/1L6PEcTD4LM/QFXg9aVDFEcDT/PS40Ds 4v2kgUxjLpJReBGP6ZbEA8PvE9bUXKILiW0aHZ9+9LGYe10Ay0MFAkYlCRid8t4GmsjM spTkD6y9jzxGJY+nF5qCYe+Xpdb0/gKLPLptrgsyrU0V/wIc9V1dYx83anEaIl9938L1 gMaIv+HR+eKgUv5hpRKPVbkBTgUmgtz6kLpuPCmkjUSfW4+hyum0/bq0IWGKqxbokBSR FUsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="B/k+5Fq7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k84si19366488oib.46.2019.12.30.04.31.54; Mon, 30 Dec 2019 04:31:54 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="B/k+5Fq7"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727539AbfL3Mbx (ORCPT + 27 others); Mon, 30 Dec 2019 07:31:53 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:33396 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727496AbfL3Mbu (ORCPT ); Mon, 30 Dec 2019 07:31:50 -0500 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVSAE065574; Mon, 30 Dec 2019 06:31:28 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577709088; bh=80xrZROJ/3yIZ/pEEHiKoJKreAUnrlhI7GU6M+DWOWg=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=B/k+5Fq78EyAZtqxi3pKbqncyTFw24QBb1DkmZQY/uUCBOmDTyo2mzbToDXMqPjI1 iyuK6zgWR9u/+jyAaJPXQ5OHsbCPse2ZILhAVD4zK4r9OW3X71SWHZbeAzAC185tvU yECywjzrxvZ1zqEh7YOhrTLzhwFie03PpsqejWng= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVSoD112409; Mon, 30 Dec 2019 06:31:28 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 30 Dec 2019 06:31:28 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE110.ent.ti.com (10.64.6.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 30 Dec 2019 06:31:28 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVEhQ002491; Mon, 30 Dec 2019 06:31:26 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , Bjorn Helgaas , , Subject: [PATCH 4/7] tools: PCI: Add 'e' to clear IRQ Date: Mon, 30 Dec 2019 18:03:12 +0530 Message-ID: <20191230123315.31037-5-kishon@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191230123315.31037-1-kishon@ti.com> References: <20191230123315.31037-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add a new command line option 'e' to invoke "PCITEST_CLEAR_IRQ" ioctl. This can be used to clear the irqs set using the 'i' option. Signed-off-by: Kishon Vijay Abraham I --- tools/pci/pcitest.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index 32b7c6f9043d..449c2c687797 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -30,6 +30,7 @@ struct pci_test { int irqtype; bool set_irqtype; bool get_irqtype; + bool clear_irq; bool read; bool write; bool copy; @@ -74,6 +75,15 @@ static int run_test(struct pci_test *test) fprintf(stdout, "%s\n", irq[ret]); } + if (test->clear_irq) { + ret = ioctl(fd, PCITEST_CLEAR_IRQ); + fprintf(stdout, "CLEAR IRQ:\t\t"); + if (ret < 0) + fprintf(stdout, "FAILED\n"); + else + fprintf(stdout, "%s\n", result[ret]); + } + if (test->legacyirq) { ret = ioctl(fd, PCITEST_LEGACY_IRQ, 0); fprintf(stdout, "LEGACY IRQ:\t"); @@ -153,7 +163,7 @@ int main(int argc, char **argv) /* set default endpoint device */ test->device = "/dev/pci-endpoint-test.0"; - while ((c = getopt(argc, argv, "D:b:m:x:i:Ilhrwcs:")) != EOF) + while ((c = getopt(argc, argv, "D:b:m:x:i:eIlhrwcs:")) != EOF) switch (c) { case 'D': test->device = optarg; @@ -194,6 +204,9 @@ int main(int argc, char **argv) case 'c': test->copy = true; continue; + case 'e': + test->clear_irq = true; + continue; case 's': test->size = strtoul(optarg, NULL, 0); continue; @@ -208,6 +221,7 @@ int main(int argc, char **argv) "\t-m MSI test (msi number between 1..32)\n" "\t-x \tMSI-X test (msix number between 1..2048)\n" "\t-i \tSet IRQ type (0 - Legacy, 1 - MSI, 2 - MSI-X)\n" + "\t-e Clear IRQ\n" "\t-I Get current IRQ type configured\n" "\t-l Legacy IRQ test\n" "\t-r Read buffer test\n"