From patchwork Fri Aug 19 14:50:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 12948856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3608C32771 for ; Fri, 19 Aug 2022 14:50:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349629AbiHSOuf (ORCPT ); Fri, 19 Aug 2022 10:50:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349621AbiHSOue (ORCPT ); Fri, 19 Aug 2022 10:50:34 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43973EEC7E for ; Fri, 19 Aug 2022 07:50:33 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id g8so445739plq.11 for ; Fri, 19 Aug 2022 07:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=wz+KARvUZRNT6YKJjGhmT8Zsv9A5Qj7HDH8ifDRs8a4=; b=Xl298vBrOjKy25RecID8qShMPyWy6PpJrdWhgTv7NMsSsg4Ma7UDQzGHt+oK/ArPxA 2eltgydhBQMFXrDmQKx23iAUYrjTm61BPA2i7MzoDm0TcqUGi8MI/Y/5eqM2yY5VcliI TRLVUrYBCuj0MUguApBkgsJPNby05M8o5pKmvTUGdrZPvmRhcHGcfrhyhitA6Bx9mLFR UCxOeZW7UjZJLO42WH9XEQJ3pNZq0N0QqjIPlDWwuv1lGBMJiUBb/rJDtp9WDJY02mTK C3Iy9ptuOumSXeozWccDd2UHgCv9fYqj3uNewRtovax5VP4H1tNs5yoM8l1ZizmF9sZG +AIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=wz+KARvUZRNT6YKJjGhmT8Zsv9A5Qj7HDH8ifDRs8a4=; b=a14Y6U4JlD4RwNPZhIIs90lhTZ3pYw6zRyLs3+sYiRr5oUI09vknuHlt7AK059/BLN /KrvfV2CS5Quhgs5uoqHI+qoAFfgzFuNAOtVoI9RIuIPrbDo+tpJ2W9repq97bDPYOv0 K8W+lt4ExOIlyGNSmHF8u6vPPl+OZZGLMss8fosay7AhzhYXfAceXu2E1jtX27wGA5hm 8yeLidu7cJJ+nEztXGDoHHo8t3tAWran9fFGxXz7J/a9aBFk9BLvi2qV4819nMmNjKBD L6P6twi5UHj8sjvs1XZ6pg0/snfBm6R3HDt8Vai9Tv4InSlBxyq8Q+Bj6M7CmcTYHltK wZMA== X-Gm-Message-State: ACgBeo35zzpWkY2el1pSWs7gWOICdp61T4HSAJMI4T48Bvv8QE4dk0cp uzxqSsHlLHihuK9HlydkX8// X-Google-Smtp-Source: AA6agR4GRFxgUYb5ZjTjGYv3p5ANaiHL4MV0LWXRwUoARVybfJICGuEr4RHaTaEdQwEWnmucZsbl2Q== X-Received: by 2002:a17:90b:3852:b0:1fa:e83b:3d2c with SMTP id nl18-20020a17090b385200b001fae83b3d2cmr2835054pjb.125.1660920632672; Fri, 19 Aug 2022 07:50:32 -0700 (PDT) Received: from localhost.localdomain ([117.217.188.127]) by smtp.gmail.com with ESMTPSA id x24-20020a17090a789800b001f312e7665asm3268380pjk.47.2022.08.19.07.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 07:50:32 -0700 (PDT) From: Manivannan Sadhasivam To: kishon@ti.com, gregkh@linuxfoundation.org, lpieralisi@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mie@igel.co.jp, kw@linux.com, Manivannan Sadhasivam Subject: [PATCH 1/5] misc: pci_endpoint_test: Remove unnecessary WARN_ON Date: Fri, 19 Aug 2022 20:20:14 +0530 Message-Id: <20220819145018.35732-2-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> References: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org If unable to map test_reg_bar, then probe will fail with a dedicated error message. So there is no real need of WARN_ON here. Signed-off-by: Manivannan Sadhasivam --- drivers/misc/pci_endpoint_test.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index 8f786a225dcf..db0458039d7d 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -820,10 +820,8 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { if (pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { base = pci_ioremap_bar(pdev, bar); - if (!base) { + if (!base) dev_err(dev, "Failed to read BAR%d\n", bar); - WARN_ON(bar == test_reg_bar); - } test->bar[bar] = base; } } From patchwork Fri Aug 19 14:50:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 12948857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 10261C32771 for ; Fri, 19 Aug 2022 14:50:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349636AbiHSOuj (ORCPT ); Fri, 19 Aug 2022 10:50:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349627AbiHSOui (ORCPT ); Fri, 19 Aug 2022 10:50:38 -0400 Received: from mail-pg1-x536.google.com (mail-pg1-x536.google.com [IPv6:2607:f8b0:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA0AEEEC6B for ; Fri, 19 Aug 2022 07:50:37 -0700 (PDT) Received: by mail-pg1-x536.google.com with SMTP id s206so3884923pgs.3 for ; Fri, 19 Aug 2022 07:50:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=PJbWCWiBLM+YzpJrLJ/X7qT7YEAaUvAS4mt01XLF6Uk=; b=MU2I1lddeHrrzqtQsTQDtJj0NNNjZ5X1rjGFTJEs7Ud2l3mNhqYXwmiANpOMznrvPa f8Rvl1qwL+pyQWvt4FczZwTmvLUsCE58LMlaB8FB5ok6vaJ2Ci9WyGd+5FherYreVyOs kT8VLn8ycPzTCWbLIAws1zek9hiVZJwI2/tncJwfCHF7ufHF8P1Ik2tu120uSZJ2c2I+ WRgdrBzSkd1ncCKLJZ2QD6uNTLYqcTD1IGW4f4GWQyQNdNCYu6vQsXNJ7g60NJ0rtYj8 4ot8tb5GIUe/9wONJ2z5IxbFmWZ8Oeb2snlFHLybqrncKpzJDuG7Szi9DX/5rjSYyAtx 0JnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=PJbWCWiBLM+YzpJrLJ/X7qT7YEAaUvAS4mt01XLF6Uk=; b=ta6czUEBPuOsWV58nx6e7XtHu/UTwMVDsywHJ6tS6VrFW8V0aS0V3My44FSjmCIDtl dZ6315GE9kK/FkSLMTnvB/imwLv3NL3tNwwYm1D6clOmcDilqXauava2y0S8mkH+W+OT TJfzESbVlfppDVfpJX3E27/GX3Zq+/i0haxndhIZqKM/xbd0OpvW65vETrsBXTaHSWZP gtsfTqTJbK+ZtrN/nTVSYcDDbAzYmLeq93H+DnB8tnNT9dTsLYcxBxlUd7QSvPWlXLpp BBrK6WYV/sS4YSognyWPbLiAoZ0kDo8rQOQW7bTz4WA9Tem+SoV6Eaw4eX3y258pdgyG YIMw== X-Gm-Message-State: ACgBeo2M5woWuH485I/Adm9n77yawCUBr5FMQFzvE2FW6xuBSJW3svXo 220nFbrF+yuCkFWKvA8swM74 X-Google-Smtp-Source: AA6agR42P6SZZnI/0zFyyrx2bpwyApLhI7YVElhyb1v5PABvvNFHnmCTvXuytbQk5pasJ1vRFW66ZA== X-Received: by 2002:a05:6a00:2393:b0:535:58e7:8f90 with SMTP id f19-20020a056a00239300b0053558e78f90mr8241569pfc.84.1660920637056; Fri, 19 Aug 2022 07:50:37 -0700 (PDT) Received: from localhost.localdomain ([117.217.188.127]) by smtp.gmail.com with ESMTPSA id x24-20020a17090a789800b001f312e7665asm3268380pjk.47.2022.08.19.07.50.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 07:50:36 -0700 (PDT) From: Manivannan Sadhasivam To: kishon@ti.com, gregkh@linuxfoundation.org, lpieralisi@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mie@igel.co.jp, kw@linux.com, Manivannan Sadhasivam Subject: [PATCH 2/5] misc: pci_endpoint_test: Fix the return value of IOCTL Date: Fri, 19 Aug 2022 20:20:15 +0530 Message-Id: <20220819145018.35732-3-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> References: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org IOCTLs are supposed to return 0 for success and negative error codes for failure. Currently, this driver is returning 0 for failure and 1 for success, that's not correct. Hence, fix it! Signed-off-by: Manivannan Sadhasivam --- drivers/misc/pci_endpoint_test.c | 163 ++++++++++++++----------------- 1 file changed, 76 insertions(+), 87 deletions(-) diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index db0458039d7d..bbf903c5a5bd 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -174,13 +174,12 @@ static void pci_endpoint_test_free_irq_vectors(struct pci_endpoint_test *test) test->irq_type = IRQ_TYPE_UNDEFINED; } -static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test, +static int pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test, int type) { - int irq = -1; + int irq = -EINVAL; struct pci_dev *pdev = test->pdev; struct device *dev = &pdev->dev; - bool res = true; switch (type) { case IRQ_TYPE_LEGACY: @@ -202,15 +201,16 @@ static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test, dev_err(dev, "Invalid IRQ type selected\n"); } + test->irq_type = type; + if (irq < 0) { - irq = 0; - res = false; + test->num_irqs = 0; + return irq; } - test->irq_type = type; test->num_irqs = irq; - return res; + return 0; } static void pci_endpoint_test_release_irq(struct pci_endpoint_test *test) @@ -225,7 +225,7 @@ static void pci_endpoint_test_release_irq(struct pci_endpoint_test *test) test->num_irqs = 0; } -static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test) +static int pci_endpoint_test_request_irq(struct pci_endpoint_test *test) { int i; int err; @@ -240,7 +240,7 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test) goto fail; } - return true; + return 0; fail: switch (irq_type) { @@ -260,10 +260,10 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test) break; } - return false; + return err; } -static bool pci_endpoint_test_bar(struct pci_endpoint_test *test, +static int pci_endpoint_test_bar(struct pci_endpoint_test *test, enum pci_barno barno) { int j; @@ -272,7 +272,7 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test, struct pci_dev *pdev = test->pdev; if (!test->bar[barno]) - return false; + return -ENOMEM; size = pci_resource_len(pdev, barno); @@ -285,13 +285,13 @@ static bool pci_endpoint_test_bar(struct pci_endpoint_test *test, for (j = 0; j < size; j += 4) { val = pci_endpoint_test_bar_readl(test, barno, j); if (val != 0xA0A0A0A0) - return false; + return -EINVAL; } - return true; + return 0; } -static bool pci_endpoint_test_legacy_irq(struct pci_endpoint_test *test) +static int pci_endpoint_test_legacy_irq(struct pci_endpoint_test *test) { u32 val; @@ -303,12 +303,12 @@ static bool pci_endpoint_test_legacy_irq(struct pci_endpoint_test *test) val = wait_for_completion_timeout(&test->irq_raised, msecs_to_jiffies(1000)); if (!val) - return false; + return -ETIMEDOUT; - return true; + return 0; } -static bool pci_endpoint_test_msi_irq(struct pci_endpoint_test *test, +static int pci_endpoint_test_msi_irq(struct pci_endpoint_test *test, u16 msi_num, bool msix) { u32 val; @@ -324,19 +324,18 @@ static bool pci_endpoint_test_msi_irq(struct pci_endpoint_test *test, val = wait_for_completion_timeout(&test->irq_raised, msecs_to_jiffies(1000)); if (!val) - return false; + return -ETIMEDOUT; - if (pci_irq_vector(pdev, msi_num - 1) == test->last_irq) - return true; + if (pci_irq_vector(pdev, msi_num - 1) != test->last_irq) + return -EINVAL; - return false; + return 0; } -static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, +static int pci_endpoint_test_copy(struct pci_endpoint_test *test, unsigned long arg) { struct pci_endpoint_test_xfer_param param; - bool ret = false; void *src_addr; void *dst_addr; u32 flags = 0; @@ -360,12 +359,12 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, err = copy_from_user(¶m, (void __user *)arg, sizeof(param)); if (err) { dev_err(dev, "Failed to get transfer param\n"); - return false; + return -EFAULT; } size = param.size; if (size > SIZE_MAX - alignment) - goto err; + return -EINVAL; use_dma = !!(param.flags & PCITEST_FLAGS_USE_DMA); if (use_dma) @@ -373,22 +372,21 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) { dev_err(dev, "Invalid IRQ type option\n"); - goto err; + return -EINVAL; } orig_src_addr = kzalloc(size + alignment, GFP_KERNEL); if (!orig_src_addr) { dev_err(dev, "Failed to allocate source buffer\n"); - ret = false; - goto err; + return -ENOMEM; } get_random_bytes(orig_src_addr, size + alignment); orig_src_phys_addr = dma_map_single(dev, orig_src_addr, size + alignment, DMA_TO_DEVICE); - if (dma_mapping_error(dev, orig_src_phys_addr)) { + err = dma_mapping_error(dev, orig_src_phys_addr); + if (err) { dev_err(dev, "failed to map source buffer address\n"); - ret = false; goto err_src_phys_addr; } @@ -412,15 +410,15 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, orig_dst_addr = kzalloc(size + alignment, GFP_KERNEL); if (!orig_dst_addr) { dev_err(dev, "Failed to allocate destination address\n"); - ret = false; + err = -ENOMEM; goto err_dst_addr; } orig_dst_phys_addr = dma_map_single(dev, orig_dst_addr, size + alignment, DMA_FROM_DEVICE); - if (dma_mapping_error(dev, orig_dst_phys_addr)) { + err = dma_mapping_error(dev, orig_dst_phys_addr); + if (err) { dev_err(dev, "failed to map destination buffer address\n"); - ret = false; goto err_dst_phys_addr; } @@ -453,8 +451,8 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, DMA_FROM_DEVICE); dst_crc32 = crc32_le(~0, dst_addr, size); - if (dst_crc32 == src_crc32) - ret = true; + if (dst_crc32 != src_crc32) + err = -EINVAL; err_dst_phys_addr: kfree(orig_dst_addr); @@ -465,16 +463,13 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, err_src_phys_addr: kfree(orig_src_addr); - -err: - return ret; + return err; } -static bool pci_endpoint_test_write(struct pci_endpoint_test *test, +static int pci_endpoint_test_write(struct pci_endpoint_test *test, unsigned long arg) { struct pci_endpoint_test_xfer_param param; - bool ret = false; u32 flags = 0; bool use_dma; u32 reg; @@ -492,14 +487,14 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test, int err; err = copy_from_user(¶m, (void __user *)arg, sizeof(param)); - if (err != 0) { + if (err) { dev_err(dev, "Failed to get transfer param\n"); - return false; + return -EFAULT; } size = param.size; if (size > SIZE_MAX - alignment) - goto err; + return -EINVAL; use_dma = !!(param.flags & PCITEST_FLAGS_USE_DMA); if (use_dma) @@ -507,23 +502,22 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test, if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) { dev_err(dev, "Invalid IRQ type option\n"); - goto err; + return -EINVAL; } orig_addr = kzalloc(size + alignment, GFP_KERNEL); if (!orig_addr) { dev_err(dev, "Failed to allocate address\n"); - ret = false; - goto err; + return -ENOMEM; } get_random_bytes(orig_addr, size + alignment); orig_phys_addr = dma_map_single(dev, orig_addr, size + alignment, DMA_TO_DEVICE); - if (dma_mapping_error(dev, orig_phys_addr)) { + err = dma_mapping_error(dev, orig_phys_addr); + if (err) { dev_err(dev, "failed to map source buffer address\n"); - ret = false; goto err_phys_addr; } @@ -556,24 +550,21 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test, wait_for_completion(&test->irq_raised); reg = pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_STATUS); - if (reg & STATUS_READ_SUCCESS) - ret = true; + if (!(reg & STATUS_READ_SUCCESS)) + err = -EINVAL; dma_unmap_single(dev, orig_phys_addr, size + alignment, DMA_TO_DEVICE); err_phys_addr: kfree(orig_addr); - -err: - return ret; + return err; } -static bool pci_endpoint_test_read(struct pci_endpoint_test *test, +static int pci_endpoint_test_read(struct pci_endpoint_test *test, unsigned long arg) { struct pci_endpoint_test_xfer_param param; - bool ret = false; u32 flags = 0; bool use_dma; size_t size; @@ -592,12 +583,12 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test, err = copy_from_user(¶m, (void __user *)arg, sizeof(param)); if (err) { dev_err(dev, "Failed to get transfer param\n"); - return false; + return -EFAULT; } size = param.size; if (size > SIZE_MAX - alignment) - goto err; + return -EINVAL; use_dma = !!(param.flags & PCITEST_FLAGS_USE_DMA); if (use_dma) @@ -605,21 +596,20 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test, if (irq_type < IRQ_TYPE_LEGACY || irq_type > IRQ_TYPE_MSIX) { dev_err(dev, "Invalid IRQ type option\n"); - goto err; + return -EINVAL; } orig_addr = kzalloc(size + alignment, GFP_KERNEL); if (!orig_addr) { dev_err(dev, "Failed to allocate destination address\n"); - ret = false; - goto err; + return -ENOMEM; } orig_phys_addr = dma_map_single(dev, orig_addr, size + alignment, DMA_FROM_DEVICE); - if (dma_mapping_error(dev, orig_phys_addr)) { + err = dma_mapping_error(dev, orig_phys_addr); + if (err) { dev_err(dev, "failed to map source buffer address\n"); - ret = false; goto err_phys_addr; } @@ -651,50 +641,51 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test, DMA_FROM_DEVICE); crc32 = crc32_le(~0, addr, size); - if (crc32 == pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_CHECKSUM)) - ret = true; + if (crc32 != pci_endpoint_test_readl(test, PCI_ENDPOINT_TEST_CHECKSUM)) + err = -EINVAL; err_phys_addr: kfree(orig_addr); -err: - return ret; + return err; } -static bool pci_endpoint_test_clear_irq(struct pci_endpoint_test *test) +static int pci_endpoint_test_clear_irq(struct pci_endpoint_test *test) { pci_endpoint_test_release_irq(test); pci_endpoint_test_free_irq_vectors(test); - return true; + + return 0; } -static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test, +static int pci_endpoint_test_set_irq(struct pci_endpoint_test *test, int req_irq_type) { struct pci_dev *pdev = test->pdev; struct device *dev = &pdev->dev; + int err; if (req_irq_type < IRQ_TYPE_LEGACY || req_irq_type > IRQ_TYPE_MSIX) { dev_err(dev, "Invalid IRQ type option\n"); - return false; + return -EINVAL; } if (test->irq_type == req_irq_type) - return true; + return 0; pci_endpoint_test_release_irq(test); pci_endpoint_test_free_irq_vectors(test); - if (!pci_endpoint_test_alloc_irq_vectors(test, req_irq_type)) - goto err; - - if (!pci_endpoint_test_request_irq(test)) - goto err; + err = pci_endpoint_test_alloc_irq_vectors(test, req_irq_type); + if (err) + return err; - return true; + err = pci_endpoint_test_request_irq(test); + if (err) { + pci_endpoint_test_free_irq_vectors(test); + return err; + } -err: - pci_endpoint_test_free_irq_vectors(test); - return false; + return 0; } static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd, @@ -812,10 +803,9 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, pci_set_master(pdev); - if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type)) { - err = -EINVAL; + err = pci_endpoint_test_alloc_irq_vectors(test, irq_type); + if (err) goto err_disable_irq; - } for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { if (pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { @@ -850,10 +840,9 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, goto err_ida_remove; } - if (!pci_endpoint_test_request_irq(test)) { - err = -EINVAL; + err = pci_endpoint_test_request_irq(test); + if (err) goto err_kfree_test_name; - } misc_device = &test->miscdev; misc_device->minor = MISC_DYNAMIC_MINOR; From patchwork Fri Aug 19 14:50:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 12948858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B286DC32771 for ; Fri, 19 Aug 2022 14:50:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349643AbiHSOuo (ORCPT ); Fri, 19 Aug 2022 10:50:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349638AbiHSOun (ORCPT ); Fri, 19 Aug 2022 10:50:43 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D107EEC77 for ; Fri, 19 Aug 2022 07:50:42 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id p18so4329447plr.8 for ; Fri, 19 Aug 2022 07:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=vikAzh9NWoFPTJPPXjTU2UjuhH8xGYu4rC/hhqXWXiE=; b=SJ++9QfiwF1/vLcdgXuesPGMMZzLwSuVFwhiYShXragKwRtGPCjpbMkpbcTwiMMpZz 7oGb/hSMKV10ZUEEjIMQ/SE7AbWAYNXBrKGuYmPxW35kgfWtQxgSOoskSWvj1Xh8xwIh 9QBSoafSIEwTgIrWcF+cq+C2xzY33+kvQjjccRzw/jY3sUPJUSpnWSWsobrIQMrMADlN 27nVUYh2DKCsvVlmndPMR8+HkoNNIRN/+caUqBGueXqzUcT9bYRwCF7Ef/XC1ulAXMan wEGRcpc0DyEQA9v2slHGd9rzVK/SUjQd/2yW6qhE4lB2FmlCDtEEWJpJq3NmJksZzQfA +owA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=vikAzh9NWoFPTJPPXjTU2UjuhH8xGYu4rC/hhqXWXiE=; b=sekk93uZx85KQ0P9J15D67Mk+4YrpcJ5HTkzECfHPBqOz69lxYtjtRsm4ZHDZ1rGXL E4FH6bTkKrGBgPCm269iu4PJv+pcvwUuS06DGzkRt3KsET9gTX74tqwIYFZ+u6Ed+bxp VNjUq6PLqI0XOZKFiLrbHK2NLbB98jRbXRhKUKbg04mDu93gV9olsj+flSB2TIp3MrzV 83sRhjqgXld4AtHl+81PEi/85GJxloKQODPGZIJD6HG76pCahIom9/m7KHtWDu5EEjmE S1P79Mv5d0fsBS7g+L8IcdalkiL0rViaXoJFMYMGEdPm/Epo5wUWN7380aJ5iZijCBsN CZRw== X-Gm-Message-State: ACgBeo1TFH96n51I2q9c3m/FWnFpmI8XNJeMoWOM2oHao02jkaE610gw nqQoh3+6JSjB2XPV9hLVy4Y/ X-Google-Smtp-Source: AA6agR6NZlmh0EuKkvQIeFSe/N2REdZBOHn4R3Ur/UABybOUhs+9AMwZwzmtg+XZ8EwycD8yldEc8Q== X-Received: by 2002:a17:90b:17ce:b0:1f4:d068:5722 with SMTP id me14-20020a17090b17ce00b001f4d0685722mr14055637pjb.28.1660920641497; Fri, 19 Aug 2022 07:50:41 -0700 (PDT) Received: from localhost.localdomain ([117.217.188.127]) by smtp.gmail.com with ESMTPSA id x24-20020a17090a789800b001f312e7665asm3268380pjk.47.2022.08.19.07.50.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 07:50:40 -0700 (PDT) From: Manivannan Sadhasivam To: kishon@ti.com, gregkh@linuxfoundation.org, lpieralisi@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mie@igel.co.jp, kw@linux.com, Manivannan Sadhasivam Subject: [PATCH 3/5] tools: PCI: Fix parsing the return value of IOCTLs Date: Fri, 19 Aug 2022 20:20:16 +0530 Message-Id: <20220819145018.35732-4-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> References: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org "pci_endpoint_test" driver now returns 0 for success and negative error code for failure. So adapt to the change by reporting FAILURE if the return value is < 0, and SUCCESS otherwise. Signed-off-by: Manivannan Sadhasivam --- tools/pci/pcitest.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index 441b54234635..a4e5b17cc3b5 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -18,7 +18,6 @@ #define BILLION 1E9 -static char *result[] = { "NOT OKAY", "OKAY" }; static char *irq[] = { "LEGACY", "MSI", "MSI-X" }; struct pci_test { @@ -54,9 +53,9 @@ static int run_test(struct pci_test *test) ret = ioctl(fd, PCITEST_BAR, test->barnum); fprintf(stdout, "BAR%d:\t\t", test->barnum); if (ret < 0) - fprintf(stdout, "TEST FAILED\n"); + fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->set_irqtype) { @@ -65,16 +64,18 @@ static int run_test(struct pci_test *test) if (ret < 0) fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->get_irqtype) { ret = ioctl(fd, PCITEST_GET_IRQTYPE); fprintf(stdout, "GET IRQ TYPE:\t\t"); - if (ret < 0) + if (ret < 0) { fprintf(stdout, "FAILED\n"); - else + } else { fprintf(stdout, "%s\n", irq[ret]); + ret = 0; + } } if (test->clear_irq) { @@ -83,34 +84,34 @@ static int run_test(struct pci_test *test) if (ret < 0) fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->legacyirq) { ret = ioctl(fd, PCITEST_LEGACY_IRQ, 0); fprintf(stdout, "LEGACY IRQ:\t"); if (ret < 0) - fprintf(stdout, "TEST FAILED\n"); + fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->msinum > 0 && test->msinum <= 32) { ret = ioctl(fd, PCITEST_MSI, test->msinum); fprintf(stdout, "MSI%d:\t\t", test->msinum); if (ret < 0) - fprintf(stdout, "TEST FAILED\n"); + fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->msixnum > 0 && test->msixnum <= 2048) { ret = ioctl(fd, PCITEST_MSIX, test->msixnum); fprintf(stdout, "MSI-X%d:\t\t", test->msixnum); if (ret < 0) - fprintf(stdout, "TEST FAILED\n"); + fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->write) { @@ -120,9 +121,9 @@ static int run_test(struct pci_test *test) ret = ioctl(fd, PCITEST_WRITE, ¶m); fprintf(stdout, "WRITE (%7ld bytes):\t\t", test->size); if (ret < 0) - fprintf(stdout, "TEST FAILED\n"); + fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->read) { @@ -132,9 +133,9 @@ static int run_test(struct pci_test *test) ret = ioctl(fd, PCITEST_READ, ¶m); fprintf(stdout, "READ (%7ld bytes):\t\t", test->size); if (ret < 0) - fprintf(stdout, "TEST FAILED\n"); + fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } if (test->copy) { @@ -144,14 +145,14 @@ static int run_test(struct pci_test *test) ret = ioctl(fd, PCITEST_COPY, ¶m); fprintf(stdout, "COPY (%7ld bytes):\t\t", test->size); if (ret < 0) - fprintf(stdout, "TEST FAILED\n"); + fprintf(stdout, "FAILED\n"); else - fprintf(stdout, "%s\n", result[ret]); + fprintf(stdout, "SUCCESS\n"); } fflush(stdout); close(fd); - return (ret < 0) ? ret : 1 - ret; /* return 0 if test succeeded */ + return ret; } int main(int argc, char **argv) From patchwork Fri Aug 19 14:50:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 12948859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0B35C32771 for ; Fri, 19 Aug 2022 14:50:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349650AbiHSOur (ORCPT ); Fri, 19 Aug 2022 10:50:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349646AbiHSOuq (ORCPT ); Fri, 19 Aug 2022 10:50:46 -0400 Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2613EEF05 for ; Fri, 19 Aug 2022 07:50:45 -0700 (PDT) Received: by mail-pj1-x1030.google.com with SMTP id pm17so4842495pjb.3 for ; Fri, 19 Aug 2022 07:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=XInyNyoE5i7OhwCUXB49kMUFySGOdTQm0Z6ZisLc1Ak=; b=AiicFUozRBRJgx3EpLjmOHxJhWiUomCIY+PJWCn2zF7fAJwBHOAXxq09QXRY6fE2mU E5SvbACXNdUTI64ZSg5Iqtv3KHSenqvEMq5FMoHHc8JlyqZZREBNwnE1EqjlSYq2Xxz9 cTdxA++GVnsxqSw7mhJ2WM03g7kMmH1P8ooHM+54WU9UDryXHPdb+NjZQaitwBimBJyY sMp2kUNSa1unMZ4TTC5CVVoo02tM0azkMeEnr+mApeCuTzf9/XTai+jpVhfl37BxQXr3 vAmME1yZhBfH3gqgR2zijWT19yWHmV7FEpx8QSd10hEw7A90p3KkHANHL9pvqty3oyQY zqOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=XInyNyoE5i7OhwCUXB49kMUFySGOdTQm0Z6ZisLc1Ak=; b=ehqrjq2X5HpgRKmsx/3qE1lyyc79q7spYVSXX3fWrvPaChy74ql7ZVu+I/NQNn03vM sSHxCBUCzr7RRAkSjZ5K2GIM9W/IdMcnuF6R+rcL3+9zrJPh72XS69KPaqyRjFgkRh23 5AkosmyQ4sumt34EWNwqEiRbxLfZyodG4Qh4e3z/YGpUoFrLLc5uhc17oh/CbVZqnVPO Z+xK5e21L3lb98EvEECjoRsKtSraGgr5u/vAEITkVi3OzCf9uTC1o8wExui6mBSMY/oG uSNOzvl1UkI2DPNTmxVnYBXdHWiQSJnjx7vWveuDCrQTPFWizUzANgAOe79Ojj4400XY glWA== X-Gm-Message-State: ACgBeo36u0scPMFKzGzVE6CWOg+ZUJMHW0M0x5m2u/9Zxb+sZrUCADjr sZ8vQoE6aBQf5rh5rKHD9haY X-Google-Smtp-Source: AA6agR4ff8A9bwFpTHkfw+a+dW3aETF6Yw+WGS7v0D0J/1vNaUKBj6e9GJaazVuNhb3NxoXfhSt11A== X-Received: by 2002:a17:902:b607:b0:170:c7fc:388a with SMTP id b7-20020a170902b60700b00170c7fc388amr7684061pls.29.1660920645412; Fri, 19 Aug 2022 07:50:45 -0700 (PDT) Received: from localhost.localdomain ([117.217.188.127]) by smtp.gmail.com with ESMTPSA id x24-20020a17090a789800b001f312e7665asm3268380pjk.47.2022.08.19.07.50.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 07:50:44 -0700 (PDT) From: Manivannan Sadhasivam To: kishon@ti.com, gregkh@linuxfoundation.org, lpieralisi@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mie@igel.co.jp, kw@linux.com, Manivannan Sadhasivam Subject: [PATCH 4/5] tools: PCI: Fix memory leak Date: Fri, 19 Aug 2022 20:20:17 +0530 Message-Id: <20220819145018.35732-5-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> References: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Memory allocated for "test" needs to be freed at the end of the main(). Signed-off-by: Manivannan Sadhasivam --- tools/pci/pcitest.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/pci/pcitest.c b/tools/pci/pcitest.c index a4e5b17cc3b5..a416a66802f3 100644 --- a/tools/pci/pcitest.c +++ b/tools/pci/pcitest.c @@ -157,7 +157,7 @@ static int run_test(struct pci_test *test) int main(int argc, char **argv) { - int c; + int c, ret; struct pci_test *test; test = calloc(1, sizeof(*test)); @@ -249,5 +249,8 @@ int main(int argc, char **argv) return -EINVAL; } - return run_test(test); + ret = run_test(test); + free(test); + + return ret; } From patchwork Fri Aug 19 14:50:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manivannan Sadhasivam X-Patchwork-Id: 12948860 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE712C32771 for ; Fri, 19 Aug 2022 14:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349663AbiHSOuy (ORCPT ); Fri, 19 Aug 2022 10:50:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349658AbiHSOuv (ORCPT ); Fri, 19 Aug 2022 10:50:51 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 038CEEEF06 for ; Fri, 19 Aug 2022 07:50:50 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id w11-20020a17090a380b00b001f73f75a1feso7759969pjb.2 for ; Fri, 19 Aug 2022 07:50:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=fm7QTBEvZYoh+uEnOcc/Xv3rhrfE/CRJJFQjFwf7qiE=; b=kTGHznXS4z9k9KSMxh2zmGsSAbQq549AyrNmdgNpiushumZ0U5Dxj6DmkhmutuPc5U VCqR9K4edCyQXiPQ+FigDGtWxQsuWB0OKEIv2oqxey/1NNe/0Vp1q98z+LiBjNwgezh1 T85aAXYXQgK3FV3Z6zdmhJUyrau0IUdjB/8Y7hYR7GBtwBLW17T7q6TudNBQV1D8jmLa 7zMTAV6cIITTjgGDqOUzUHTjgP/hvl6fRFRpiKXeQDniWQEV34AuK4y6Zgj7wXyx6SUs /uORDfVxdJZr8pG7YQ3tiC5wCYwpLmSOOxqZFU0t60j3sIjAUt4yIMB6upMwFpzeOaxj sThw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=fm7QTBEvZYoh+uEnOcc/Xv3rhrfE/CRJJFQjFwf7qiE=; b=iPXOjJP7XIo9lQZZkpYz6dogHfGIWrUOXL4lGcDVtgbM/y+0cVUupcew5FbgQFg6mc mHtNs+9sfyG+SECuo57s30QFKDNto1amaVCDkVT8QwdBKZdg95F/1cO0JeckN+GICYqZ D6MbysNt0/5TCeDrHnpXdDX6GDZRUGbzc09oLl3znhq+CSS6yGtMD3UQ+7OgnzvtwroV 3TLAriASDCRGhtTomHso9V1pKOaDK02GjWUTIBi1Bb9sE78g6F9gP4NDbrjXLe7Yq9RH DjGwdL4RM+ssisEOBEqsi27fF1rAK4cgKzGGaF2H0F9YilzGxbrTL5pGH44FY/gAB7CY UlBw== X-Gm-Message-State: ACgBeo1mpV+EsVJWtLjLmn7Jvf83/r/XW/YAa3ibNCmDktTFlRLgxjYd ccbGBBmxKq1NTnEiyZA2xajt X-Google-Smtp-Source: AA6agR4WqLDdcp7eFf5epnHlvSLLcn/RdBV0PTQWnRxZD+k4r5blFdID/lUqi3LNfdQB0Rkh2y4Dhg== X-Received: by 2002:a17:902:e5cc:b0:16f:1153:c519 with SMTP id u12-20020a170902e5cc00b0016f1153c519mr7883043plf.151.1660920649485; Fri, 19 Aug 2022 07:50:49 -0700 (PDT) Received: from localhost.localdomain ([117.217.188.127]) by smtp.gmail.com with ESMTPSA id x24-20020a17090a789800b001f312e7665asm3268380pjk.47.2022.08.19.07.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 07:50:49 -0700 (PDT) From: Manivannan Sadhasivam To: kishon@ti.com, gregkh@linuxfoundation.org, lpieralisi@kernel.org Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, mie@igel.co.jp, kw@linux.com, Manivannan Sadhasivam Subject: [PATCH 5/5] Documentation: PCI: endpoint: Use the correct return value of pcitest.sh Date: Fri, 19 Aug 2022 20:20:18 +0530 Message-Id: <20220819145018.35732-6-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> References: <20220819145018.35732-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org pcitest.sh now reports SUCCESS and FAILED instead of OKAY and NOT_OKAY. Signed-off-by: Manivannan Sadhasivam --- Documentation/PCI/endpoint/pci-test-howto.rst | 152 +++++++++--------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/Documentation/PCI/endpoint/pci-test-howto.rst b/Documentation/PCI/endpoint/pci-test-howto.rst index 909f770a07d6..3bc43b9f9856 100644 --- a/Documentation/PCI/endpoint/pci-test-howto.rst +++ b/Documentation/PCI/endpoint/pci-test-howto.rst @@ -144,92 +144,92 @@ pcitest.sh Output # pcitest.sh BAR tests - BAR0: OKAY - BAR1: OKAY - BAR2: OKAY - BAR3: OKAY - BAR4: NOT OKAY - BAR5: NOT OKAY + BAR0: SUCCESS + BAR1: SUCCESS + BAR2: SUCCESS + BAR3: SUCCESS + BAR4: FAILED + BAR5: FAILED Interrupt tests - SET IRQ TYPE TO LEGACY: OKAY - LEGACY IRQ: NOT OKAY - SET IRQ TYPE TO MSI: OKAY - MSI1: OKAY - MSI2: OKAY - MSI3: OKAY - MSI4: OKAY - MSI5: OKAY - MSI6: OKAY - MSI7: OKAY - MSI8: OKAY - MSI9: OKAY - MSI10: OKAY - MSI11: OKAY - MSI12: OKAY - MSI13: OKAY - MSI14: OKAY - MSI15: OKAY - MSI16: OKAY - MSI17: NOT OKAY - MSI18: NOT OKAY - MSI19: NOT OKAY - MSI20: NOT OKAY - MSI21: NOT OKAY - MSI22: NOT OKAY - MSI23: NOT OKAY - MSI24: NOT OKAY - MSI25: NOT OKAY - MSI26: NOT OKAY - MSI27: NOT OKAY - MSI28: NOT OKAY - MSI29: NOT OKAY - MSI30: NOT OKAY - MSI31: NOT OKAY - MSI32: NOT OKAY - SET IRQ TYPE TO MSI-X: OKAY - MSI-X1: OKAY - MSI-X2: OKAY - MSI-X3: OKAY - MSI-X4: OKAY - MSI-X5: OKAY - MSI-X6: OKAY - MSI-X7: OKAY - MSI-X8: OKAY - MSI-X9: NOT OKAY - MSI-X10: NOT OKAY - MSI-X11: NOT OKAY - MSI-X12: NOT OKAY - MSI-X13: NOT OKAY - MSI-X14: NOT OKAY - MSI-X15: NOT OKAY - MSI-X16: NOT OKAY + SET IRQ TYPE TO LEGACY: SUCCESS + LEGACY IRQ: FAILED + SET IRQ TYPE TO MSI: SUCCESS + MSI1: SUCCESS + MSI2: SUCCESS + MSI3: SUCCESS + MSI4: SUCCESS + MSI5: SUCCESS + MSI6: SUCCESS + MSI7: SUCCESS + MSI8: SUCCESS + MSI9: SUCCESS + MSI10: SUCCESS + MSI11: SUCCESS + MSI12: SUCCESS + MSI13: SUCCESS + MSI14: SUCCESS + MSI15: SUCCESS + MSI16: SUCCESS + MSI17: FAILED + MSI18: FAILED + MSI19: FAILED + MSI20: FAILED + MSI21: FAILED + MSI22: FAILED + MSI23: FAILED + MSI24: FAILED + MSI25: FAILED + MSI26: FAILED + MSI27: FAILED + MSI28: FAILED + MSI29: FAILED + MSI30: FAILED + MSI31: FAILED + MSI32: FAILED + SET IRQ TYPE TO MSI-X: SUCCESS + MSI-X1: SUCCESS + MSI-X2: SUCCESS + MSI-X3: SUCCESS + MSI-X4: SUCCESS + MSI-X5: SUCCESS + MSI-X6: SUCCESS + MSI-X7: SUCCESS + MSI-X8: SUCCESS + MSI-X9: FAILED + MSI-X10: FAILED + MSI-X11: FAILED + MSI-X12: FAILED + MSI-X13: FAILED + MSI-X14: FAILED + MSI-X15: FAILED + MSI-X16: FAILED [...] - MSI-X2047: NOT OKAY - MSI-X2048: NOT OKAY + MSI-X2047: FAILED + MSI-X2048: FAILED Read Tests - SET IRQ TYPE TO MSI: OKAY - READ ( 1 bytes): OKAY - READ ( 1024 bytes): OKAY - READ ( 1025 bytes): OKAY - READ (1024000 bytes): OKAY - READ (1024001 bytes): OKAY + SET IRQ TYPE TO MSI: SUCCESS + READ ( 1 bytes): SUCCESS + READ ( 1024 bytes): SUCCESS + READ ( 1025 bytes): SUCCESS + READ (1024000 bytes): SUCCESS + READ (1024001 bytes): SUCCESS Write Tests - WRITE ( 1 bytes): OKAY - WRITE ( 1024 bytes): OKAY - WRITE ( 1025 bytes): OKAY - WRITE (1024000 bytes): OKAY - WRITE (1024001 bytes): OKAY + WRITE ( 1 bytes): SUCCESS + WRITE ( 1024 bytes): SUCCESS + WRITE ( 1025 bytes): SUCCESS + WRITE (1024000 bytes): SUCCESS + WRITE (1024001 bytes): SUCCESS Copy Tests - COPY ( 1 bytes): OKAY - COPY ( 1024 bytes): OKAY - COPY ( 1025 bytes): OKAY - COPY (1024000 bytes): OKAY - COPY (1024001 bytes): OKAY + COPY ( 1 bytes): SUCCESS + COPY ( 1024 bytes): SUCCESS + COPY ( 1025 bytes): SUCCESS + COPY (1024000 bytes): SUCCESS + COPY (1024001 bytes): SUCCESS