From patchwork Mon Dec 30 12:33:09 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: 182605 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6282870ild; Mon, 30 Dec 2019 04:31:34 -0800 (PST) X-Google-Smtp-Source: APXvYqwSERrAQKbHMuoSXe5puVBRIfwOgukjrfYstyYI0i3qs2NP07Gx66f4+184wTmt3oTxEe4K X-Received: by 2002:a9d:53c4:: with SMTP id i4mr63465339oth.48.1577709094339; Mon, 30 Dec 2019 04:31:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709094; cv=none; d=google.com; s=arc-20160816; b=ryBllGiIWatjgAQnHpf2EY+BPkTn+tceeOTB7ZqRCZrhHasorRmVTq2Ept4hXZHDKN F9GqhqteDz6WPtX64A553Rbv8Fw88OAvlPDkBA5MK1lwwlZgNgGF9ZjqCFrD1z233ubk m/JEe1j658YZPjz6zFwzndSGbnrNztuuxKomoWKjRUPAkeZaPxC792CoH3fl5kR9fBQn NP2aqrbnDoNEL/AZp3J1KGs75E0hHt3yd2vlwezhk+iN/AC/gcI3jBXu+wvDel44naa2 LcX8TIhsjxtD8LBxcdyNbSrol9Nyrjp1i+9s9K3ELQk/TqKDNMQ0Rjrj+RuPKGr4D/qn jr7Q== 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=iUve48Cr1mGxUmUX5fWUT0DFtlcnvm91lMesp5aocLw=; b=d+ZUZj3g4JD0W0gyyVfViE1w0FcYRMyf0oSVl134+v2ajSF8CR2IUSk3mD5mV+e24C dO5bhpxuP/WIlIdk6yYXjRao9LE/XEHSiE/IiVBpDZuV2HIeOmtUo0en9unSnKJDG71l F2NFMhqYE65rTV8MacFMjGTbG2DP2eq4YwqKP59AgLV3pQW8ach7o/9S93tMCCEZ0IhI Ryd7uS/OIROqP7hAmKOV6u+kxIOoiUvQ2HoRXqvxnEGLKGJDbldWkiF/USsQGJ4wuKZf jqlzjReTIVtTCDj80sdXn0Dk8YxlZdSNpPCQAYoMjyfsTQYDwnYBmgGeWsPUfGCDG8dY uuXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=yU60qJ+O; 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 z14si23766694oth.15.2019.12.30.04.31.33; Mon, 30 Dec 2019 04:31:34 -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=yU60qJ+O; 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 S1727461AbfL3Mbc (ORCPT + 27 others); Mon, 30 Dec 2019 07:31:32 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:33346 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727376AbfL3Mba (ORCPT ); Mon, 30 Dec 2019 07:31:30 -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 xBUCVKVb065543; Mon, 30 Dec 2019 06:31:20 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577709080; bh=iUve48Cr1mGxUmUX5fWUT0DFtlcnvm91lMesp5aocLw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=yU60qJ+OIQFQqXY4q8e2wbNPg+5CyuP09EDbaTnR7667eNGgKuqePveRM8LnRRXWp L8nQgAD4FPRVvo2utlq42cFpQP5/6m8Z18t47uBVHIpdEqsfuaqLIVxz5grcLl3Y43 7TK9AC1VOFbyuB3ShAJmUUgIa0V5SFmUooiDBpFY= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVKvg112284; Mon, 30 Dec 2019 06:31:20 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE102.ent.ti.com (10.64.6.23) 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:20 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.24) 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:20 -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 xBUCVEhN002491; Mon, 30 Dec 2019 06:31:18 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , Bjorn Helgaas , , Subject: [PATCH 1/7] misc: pci_endpoint_test: Avoid using module parameter to determine irqtype Date: Mon, 30 Dec 2019 18:03:09 +0530 Message-ID: <20191230123315.31037-2-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 commit e03327122e2c8e6ae4565ef ("pci_endpoint_test: Add 2 ioctl commands") uses module parameter in pci_endpoint_test_set_irq() 'irqtype' to check if irq vectors of a particular type is already allocated. However with multi-function devices, irqtype will not correctly reflect the irq type of the PCI device. Fix it here by adding 'irqtype' for each PCI device to show the irq type of a particular PCI device. Signed-off-by: Kishon Vijay Abraham I --- drivers/misc/pci_endpoint_test.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index 215f9b8432a3..743ff4dcb3f0 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -99,6 +99,7 @@ struct pci_endpoint_test { struct completion irq_raised; int last_irq; int num_irqs; + int irq_type; /* mutex to protect the ioctls */ struct mutex mutex; struct miscdevice miscdev; @@ -158,6 +159,7 @@ static void pci_endpoint_test_free_irq_vectors(struct pci_endpoint_test *test) struct pci_dev *pdev = test->pdev; pci_free_irq_vectors(pdev); + test->irq_type = IRQ_TYPE_UNDEFINED; } static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test, @@ -192,6 +194,8 @@ static bool pci_endpoint_test_alloc_irq_vectors(struct pci_endpoint_test *test, irq = 0; res = false; } + + test->irq_type = type; test->num_irqs = irq; return res; @@ -331,6 +335,7 @@ static bool pci_endpoint_test_copy(struct pci_endpoint_test *test, size_t size) dma_addr_t orig_dst_phys_addr; size_t offset; size_t alignment = test->alignment; + int irq_type = test->irq_type; u32 src_crc32; u32 dst_crc32; @@ -427,6 +432,7 @@ static bool pci_endpoint_test_write(struct pci_endpoint_test *test, size_t size) dma_addr_t orig_phys_addr; size_t offset; size_t alignment = test->alignment; + int irq_type = test->irq_type; u32 crc32; if (size > SIZE_MAX - alignment) @@ -495,6 +501,7 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test, size_t size) dma_addr_t orig_phys_addr; size_t offset; size_t alignment = test->alignment; + int irq_type = test->irq_type; u32 crc32; if (size > SIZE_MAX - alignment) @@ -556,7 +563,7 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test, return false; } - if (irq_type == req_irq_type) + if (test->irq_type == req_irq_type) return true; pci_endpoint_test_release_irq(test); @@ -568,12 +575,10 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test, if (!pci_endpoint_test_request_irq(test)) goto err; - irq_type = req_irq_type; return true; err: pci_endpoint_test_free_irq_vectors(test); - irq_type = IRQ_TYPE_UNDEFINED; return false; } @@ -653,6 +658,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, test->test_reg_bar = 0; test->alignment = 0; test->pdev = pdev; + test->irq_type = IRQ_TYPE_UNDEFINED; if (no_msi) irq_type = IRQ_TYPE_LEGACY; From patchwork Mon Dec 30 12:33:10 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: 182607 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6283012ild; Mon, 30 Dec 2019 04:31:39 -0800 (PST) X-Google-Smtp-Source: APXvYqzhVHOunCtG4KfjwLb0lBEp7gznNL8IO8JK4ETr27a+N7qIirGM00F2pvC9uyzEFMaPR48+ X-Received: by 2002:aca:d15:: with SMTP id 21mr5221662oin.127.1577709098918; Mon, 30 Dec 2019 04:31:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709098; cv=none; d=google.com; s=arc-20160816; b=vogbbFhhxmSAV1AiLVRurrdwZh7Jdfnx/3CnxH1jefRVwXwjk/8MmZQd0v6zXYeZ82 qdLNpjn84L/Hyqntjenmnbr1mwFzAFPkPguiuUa8xQdLLIrTpssMk43rsAK7KdQNE94A cmKAqmddJsHF3CtkH4C5RFWfXxaAzqe34Q+pItB0KBwHIwwYkuXJMEqTRfGXi6BcM93I le6fid1sy0wZ3Ka3bpsvCRHe6DbxoG/rMCLT6V9XpenpRV9psNuf3CN0EO2SoC2RSQ7a +aFw1FdkYUvPvOHraIz5h6T+m5z6TJCe8XQfQF/UKvyi3mfUte5Eqn2u+IX7bsQQP3eL K9Ag== 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=VtEJU4ab4RUM55E/wEo6hBdB5joL/ciHyw3e3snZOGA=; b=xqgCrD6EE8NIEyhRXN+M7DB/KecAUCa1Cd5eOAZUh0P/lVLk90eFK8yaUt0gCUNq6W mDsTPfezO9sca6kAyLHUxsIz64TN25K36AVbOM3lncJiiXaQ2JUYH4Go5Zjw4oqqexks F5Oa8sGY+9xasAofyp5NipO1ysWxy2ViOcmLEMxc6c7wfOk908gx2R+BWKicsXkjd4/n hIcGS52yZynuGZww+tp3E2gJ04ACcZBGtQLvg7J8U0g3MTkacwTf7ui5kajAhSXHYMyb dHWcyrs06VLZm5UWdQA30Qab90IvwReJ5ahZEEsbp8y3iHt38MSduFHgpzEdSyYMHcyP aFXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="p3v1n3V/"; 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 y140si18812335oia.49.2019.12.30.04.31.38; Mon, 30 Dec 2019 04:31:38 -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="p3v1n3V/"; 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 S1727489AbfL3Mbh (ORCPT + 27 others); Mon, 30 Dec 2019 07:31:37 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:60356 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbfL3Mbf (ORCPT ); Mon, 30 Dec 2019 07:31:35 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVNG2039076; Mon, 30 Dec 2019 06:31:23 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577709083; bh=VtEJU4ab4RUM55E/wEo6hBdB5joL/ciHyw3e3snZOGA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=p3v1n3V/stbuvljQe057ss2Mwvxj5i79vjEypcFk0EyzIHD7NBUW4+y9KWLwfEDQo b3Bs2M5oi1n2pckCLyy5jqEK8mX9tv76zk0rnYswClftBWtA6wadG9TPTPgycJu20d lxjkls/+od90aKMRnR6mnzC2WJWGwgNSl9Aku9kE= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBUCVNUp058554 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Dec 2019 06:31:23 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) 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:23 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE108.ent.ti.com (10.64.6.29) 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:22 -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 xBUCVEhO002491; Mon, 30 Dec 2019 06:31:20 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , Bjorn Helgaas , , Subject: [PATCH 2/7] misc: pci_endpoint_test: Do not request or allocate IRQs in probe Date: Mon, 30 Dec 2019 18:03:10 +0530 Message-ID: <20191230123315.31037-3-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 Allocation of IRQ vectors and requesting IRQ is done as part of PCITEST_SET_IRQTYPE. Do not request or allocate IRQs in probe for AM654 and J721E so that the user space test script has better control of the devices for which the IRQs are configured. Signed-off-by: Kishon Vijay Abraham I --- drivers/misc/pci_endpoint_test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) -- 2.17.1 Reported-by: kbuild test robot Reported-by: kbuild test robot diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index 743ff4dcb3f0..04505890eae9 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -70,6 +70,9 @@ #define is_am654_pci_dev(pdev) \ ((pdev)->device == PCI_DEVICE_ID_TI_AM654) +#define is_j721e_pci_dev(pdev) \ + ((pdev)->device == PCI_DEVICE_ID_TI_J721E) + static DEFINE_IDA(pci_endpoint_test_ida); #define to_endpoint_test(priv) container_of((priv), struct pci_endpoint_test, \ @@ -688,11 +691,13 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, pci_set_master(pdev); - if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type)) - goto err_disable_irq; + if (!(is_am654_pci_dev(pdev) || is_j721e_pci_dev(pdev))) { + if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type)) + goto err_disable_irq; - if (!pci_endpoint_test_request_irq(test)) - goto err_disable_irq; + if (!pci_endpoint_test_request_irq(test)) + goto err_disable_irq; + } for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { if (pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { From patchwork Mon Dec 30 12:33:11 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: 182606 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6282945ild; Mon, 30 Dec 2019 04:31:37 -0800 (PST) X-Google-Smtp-Source: APXvYqx3ieLky81/XQCb6B/mDSj2r5EznpuZ3bhqaoXZcijbnu4J95S9kmHe1dp+saGdotRJK95v X-Received: by 2002:aca:f507:: with SMTP id t7mr5316058oih.156.1577709096940; Mon, 30 Dec 2019 04:31:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709096; cv=none; d=google.com; s=arc-20160816; b=TaysTraA1sRpp1mvPZCg/Lgu4tB+rQWX6tcpgPQJHHpH/ZiWt0EZ7BE3mAW2HnlLDO AXE+baHm0IHj2aGKSo2J85K5tfAFFAPlv6y/oQKuv18Iu/FEdYvLxdOpCBeifg5I9X6p VOJM0XeVIzoNLh+UXMXjfOd+c06xt6yPXYPFTt9kU9cf6CrCmig+1456xjhitAcEtCEm Mi6MOsiT79DfWC1vaEWSbYwKcAPVk6dd+3zdvdhiF89R/zXzzhqpole9/6XfsLv/xabS 78w7eBgNv8MveKlHIe6Ngjcx6GltMT49by1h+BgKSu07V5u77rcHTlAjELuxdgvigPAJ BY1w== 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=eVSu50PxyoLGzegmTZuXEW04AZFEHqRmr98LURXjQNY=; b=vTILOcyAHaTsZCA+1yRxEx07U0jfwm9Bv9jy0/orT7Pu6wDnRVxyBcBn3nftAyYAek gLfvuu1ml1aZCxcd4KHaBUelz8bav/RENCvhoMhQ5qDSIpBXX8nZjqakYuFU2CADL6Wn cp41n7i6N1/onzzuHL4dfUBhalEoB+IO80qS/BjmafX75TrkpUXbquq/fgWFATXB/Nco GBnhdPHeFKPnTWLN+Z56Gd9AShljccZp7WQnGbtrwof/1Jo5hKafyKWQ4Y+dSyg3Mrag rujNQilDPAcyuWe7czxRZDfhb+JaJ2OB7C8lzQCRoKx2mewJ+O0r0OEHxqpHehKz5av7 VZow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=qFBXc9Ad; 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 y140si18812335oia.49.2019.12.30.04.31.36; Mon, 30 Dec 2019 04:31:36 -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=qFBXc9Ad; 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 S1727474AbfL3Mbf (ORCPT + 27 others); Mon, 30 Dec 2019 07:31:35 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:33356 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727376AbfL3Mbd (ORCPT ); Mon, 30 Dec 2019 07:31:33 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVPkP065568; Mon, 30 Dec 2019 06:31:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577709085; bh=eVSu50PxyoLGzegmTZuXEW04AZFEHqRmr98LURXjQNY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=qFBXc9AdPWjfNlmQd7TksEm3UjqRHjuaNum+wmdlzPrC9CgXBvVNcNVK2Iz3P7HTB jn8BhmLHx1pIYpsK8d1E1CtM95YCMEszaLNOaf3aq8H7a8JwuLWbDgpHPX7vSc7OeT bHaFnMLOp7hbPJ2XEQWT1Hr1Y4sscqO9orH9QosU= Received: from DFLE105.ent.ti.com (dfle105.ent.ti.com [10.64.6.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBUCVPHx095049 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Dec 2019 06:31:25 -0600 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE105.ent.ti.com (10.64.6.26) 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:25 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE109.ent.ti.com (10.64.6.30) 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:25 -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 xBUCVEhP002491; Mon, 30 Dec 2019 06:31:23 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , Bjorn Helgaas , , Subject: [PATCH 3/7] misc: pci_endpoint_test: Add ioctl to clear IRQ Date: Mon, 30 Dec 2019 18:03:11 +0530 Message-ID: <20191230123315.31037-4-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 ioctl to clear IRQ which can be used to free the allocated IRQ vectors and free the requested IRQ. Signed-off-by: Kishon Vijay Abraham I --- drivers/misc/pci_endpoint_test.c | 10 ++++++++++ include/uapi/linux/pcitest.h | 1 + 2 files changed, 11 insertions(+) -- 2.17.1 diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index 04505890eae9..861b3d0cea19 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -555,6 +555,13 @@ static bool pci_endpoint_test_read(struct pci_endpoint_test *test, size_t size) return ret; } +static bool 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; +} + static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test, int req_irq_type) { @@ -625,6 +632,9 @@ static long pci_endpoint_test_ioctl(struct file *file, unsigned int cmd, case PCITEST_GET_IRQTYPE: ret = irq_type; break; + case PCITEST_CLEAR_IRQ: + ret = pci_endpoint_test_clear_irq(test); + break; } ret: diff --git a/include/uapi/linux/pcitest.h b/include/uapi/linux/pcitest.h index cbf422e56696..c6d3076fa732 100644 --- a/include/uapi/linux/pcitest.h +++ b/include/uapi/linux/pcitest.h @@ -19,5 +19,6 @@ #define PCITEST_MSIX _IOW('P', 0x7, int) #define PCITEST_SET_IRQTYPE _IOW('P', 0x8, int) #define PCITEST_GET_IRQTYPE _IO('P', 0x9) +#define PCITEST_CLEAR_IRQ _IO('P', 0x10) #endif /* __UAPI_LINUX_PCITEST_H */ 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" From patchwork Mon Dec 30 12:33:13 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: 182608 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6283172ild; Mon, 30 Dec 2019 04:31:47 -0800 (PST) X-Google-Smtp-Source: APXvYqz3PZCtQ9XxjyNS6FOLkVBHA9YmuTUNT9NmEGAbnPFNw8yHiNh7x1sea/cIyC1H5UGe0Arl X-Received: by 2002:a05:6830:20c6:: with SMTP id z6mr70075615otq.272.1577709106980; Mon, 30 Dec 2019 04:31:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709106; cv=none; d=google.com; s=arc-20160816; b=aQzFewNHfxqfsz5w/Pv58erSW6qGVoZNYEDVwfCNOQGZU7DsG9boqBlMyl1VK6Kdgt 6ZN3Ra1MGUQZbCUH9WjRlXKN+j5LgqxHV5w/SXd8eMFYSVKkYig4zfANjqRhcpyACzl7 cwPIQGQYsM7H6VJsvfRagixmsxjgZiMKJuxuVy8G+wctEjDnU/l1j8FSWzp56mPRr4B0 ofaNt61E724AIJobnGh43W6EoW9iIkevwdNyPkMb1KvRPIiZ4LtkokG4TpWEzi11Y0yC d837wUOKg1yB8HiVJA5c7LG2d3pQJYvJLnkzHgQoo4L6B+WYAj24PM79SH2H/6SsK7FJ Q0UA== 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=Dykt1nNdxSlaBSScgYbBExjvH9iWIh6LdXzuuGC21fs=; b=WtLQvbX8TsvIkKid0uMS/tVn8mPF3Eo45WoQe+Vte2ab2S0EB8ceq1QXs8wAATsCs+ ro60Gs22+AlLdWTExJBEckbNTsO32WuD56LS/fLDo3rprY+S+5kfSEyqPHhFuuh3G4d4 ewhFntGeP++lKnDijxInofYlZ9OO0SsVITsxROVXWDyuwb3no5Sr2TOcwE5pyzm9V5OK IfHRTYK/UPlJO0feh8PSkcW/t1dtqX7lsIZqLy5KCoCD/LVlJNzuDReLbywi6P2in6BE r+Bof6JPr71BIjx7Jk4ALEkAAwyZzI+3NW7JPqQvxvb62Au5wYx/b9tTHmhiKUWIzj3a qmYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KPuSKbVP; 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 d188si16789582oib.273.2019.12.30.04.31.44; Mon, 30 Dec 2019 04:31:46 -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=KPuSKbVP; 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 S1727505AbfL3Mbn (ORCPT + 27 others); Mon, 30 Dec 2019 07:31:43 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:60366 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727487AbfL3Mbi (ORCPT ); Mon, 30 Dec 2019 07:31:38 -0500 Received: from fllv0034.itg.ti.com ([10.64.40.246]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVVD1039095; Mon, 30 Dec 2019 06:31:31 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577709091; bh=Dykt1nNdxSlaBSScgYbBExjvH9iWIh6LdXzuuGC21fs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=KPuSKbVPR6zbcYDDgbh/5JZtO8V6nH9bAZK2BK3aEPrAj25xA+68ZR4pEzldrF32o 0HzMt3MU1eRoqYfbcS7PsZeb1dtFhDF7ZZx96FN9wpxvDfOt+I6UWzI3rA6EZjLEwk xR+A2Ihzvo9F5p3xU7mA7kCjk3QMmpXto9vLseDY= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBUCVV0Y058813 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Dec 2019 06:31:31 -0600 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE105.ent.ti.com (157.170.170.35) 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:30 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE109.ent.ti.com (157.170.170.41) 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:30 -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 xBUCVEhR002491; Mon, 30 Dec 2019 06:31:28 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , Bjorn Helgaas , , Subject: [PATCH 5/7] misc: pci_endpoint_test: Fix to support > 10 pci-endpoint-test devices Date: Mon, 30 Dec 2019 18:03:13 +0530 Message-ID: <20191230123315.31037-6-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 Adding more than 10 pci-endpoint-test devices results in "kobject_add_internal failed for pci-endpoint-test.1 with -EEXIST, don't try to register things with the same name in the same directory". This is because commit 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device") limited the length of the "name" to 20 characters. Change the length of the name to 24 in order to support upto 10000 pci-endpoint-test devices. Fixes: 2c156ac71c6b ("misc: Add host side PCI driver for PCI test function device") Signed-off-by: Kishon Vijay Abraham I --- drivers/misc/pci_endpoint_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index 861b3d0cea19..b622e234f57c 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -652,7 +652,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, { int err; int id; - char name[20]; + char name[24]; enum pci_barno bar; void __iomem *base; struct device *dev = &pdev->dev; From patchwork Mon Dec 30 12:33:14 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: 182610 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6283250ild; Mon, 30 Dec 2019 04:31:51 -0800 (PST) X-Google-Smtp-Source: APXvYqz03IqIHuJJmmxvZDhZ9rxKXjKluBKK9qJWy6GFlzgKI+GeobDgpMUT8U9hL8FsGoli8/oF X-Received: by 2002:a05:6830:2009:: with SMTP id e9mr21787043otp.160.1577709110973; Mon, 30 Dec 2019 04:31:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709110; cv=none; d=google.com; s=arc-20160816; b=WWH8Qm7TzNosPYWCs34ER6bDFz4FkKBi3V8G/bugq7Ru+ZK1CqlCUpx47WDQ1z5XC+ seiNbmhZRXx6h2gPcScAvOwHbuZAKhbffXxvoi5eMwAER8otE/eZrz4T81xjnGNmGzEo LqdNTAoDCCk2XyZlqVETRHixVGyvg6UsPl06GnkltXKayNp60Fmu/r/EvXq+K1WqigUc 6wifK9Bh7JF3ClHFRJjJKKCT3z+GP4PbEitlKGVIMRBUP/jQITHLc8a2gu9ZxqabXT5S x0WM4iqN8AczbmNSDuOGM6Q/jaFRc4BrCPS3cumopSzz2bcspXWbsoQp3aygdBQeFsFp +mlg== 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=k383SgYvrZOses1OYvohCYRsQU04lSCHiU+tY0yKKY4=; b=pF1Ogu8x2aafanvuje91obqG8ZaTwv1+3Dc18bwgu/JOv47bgr0EYHJuKwdH5d+nWi IsSBHi2sauVH8NN7SlMwZyIQB9OtX+JDmLh2B8mgXsfkkpoa+SGuiQALv1noIIa9VDDx P1j+tEi9NyY7vlI/mCneQBoozV63ptH/EEyCOXlY7TF4RUV+n/mujsyYSvOsJg8b6aXY TR+1OxyeDdBBamF1lmXrpbEd1b6+FLpdG7eJTvxXPDK8bNk/zZ9gAOzkq4thrlHdf24v 6HON6OT3Ef3KEBMtHjn5stCEvzuChMzqV6BrseGyRj4uK3autQA+qXd5Tp4Tjqqht8Zc jwSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=AuhWXSKY; 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 v76si21085570oif.207.2019.12.30.04.31.50; Mon, 30 Dec 2019 04:31:50 -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=AuhWXSKY; 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 S1727516AbfL3Mbq (ORCPT + 27 others); Mon, 30 Dec 2019 07:31:46 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:33384 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbfL3Mbk (ORCPT ); Mon, 30 Dec 2019 07:31:40 -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 xBUCVX4V065599; Mon, 30 Dec 2019 06:31:33 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577709093; bh=k383SgYvrZOses1OYvohCYRsQU04lSCHiU+tY0yKKY4=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=AuhWXSKYUSGLsCYxQN+EFlK4x2ymRRJCnbIM9lgGeQpEDmDVHmFu14kHL4OADOq90 Ww7wUyEygN8XBWiHNrY70CQ8UrfSk4FrB1sy25lgFdE/aVrz0WDYBGAXIF2eR75w5I 2uRvRAy40fq7MDjKW9CXOEI0hFmUkEcHomXe0xeg= 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 xBUCVX0I112470; Mon, 30 Dec 2019 06:31:33 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) 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:33 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE103.ent.ti.com (10.64.6.24) 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:33 -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 xBUCVEhS002491; Mon, 30 Dec 2019 06:31:31 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , Bjorn Helgaas , , Subject: [PATCH 6/7] misc: pci_endpoint_test: Use full pci-endpoint-test name in request irq Date: Mon, 30 Dec 2019 18:03:14 +0530 Message-ID: <20191230123315.31037-7-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 Use full pci-endpoint-test name in request irq, so that it's easy to profile the device that actually raised the interrupt. Signed-off-by: Kishon Vijay Abraham I --- drivers/misc/pci_endpoint_test.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index b622e234f57c..dae450c1a653 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -108,6 +108,7 @@ struct pci_endpoint_test { struct miscdevice miscdev; enum pci_barno test_reg_bar; size_t alignment; + const char *name; }; struct pci_endpoint_test_data { @@ -226,7 +227,7 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test) for (i = 0; i < test->num_irqs; i++) { err = devm_request_irq(dev, pci_irq_vector(pdev, i), pci_endpoint_test_irqhandler, - IRQF_SHARED, DRV_MODULE_NAME, test); + IRQF_SHARED, test->name, test); if (err) goto fail; } @@ -752,6 +753,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, dev_err(dev, "Failed to register device\n"); goto err_kfree_name; } + test->name = kstrdup(name, GFP_KERNEL); return 0; @@ -792,6 +794,7 @@ static void pci_endpoint_test_remove(struct pci_dev *pdev) misc_deregister(&test->miscdev); kfree(misc_device->name); + kfree(test->name); ida_simple_remove(&pci_endpoint_test_ida, id); for (bar = 0; bar < PCI_STD_NUM_BARS; bar++) { if (test->bar[bar]) From patchwork Mon Dec 30 12:33:15 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: 182609 Delivered-To: patch@linaro.org Received: by 2002:a92:815a:0:0:0:0:0 with SMTP id e87csp6283229ild; Mon, 30 Dec 2019 04:31:49 -0800 (PST) X-Google-Smtp-Source: APXvYqy/wimTa1+hCo1DszY7n+U6z9ZtVw+8TGyGVdvFBciVgdsEByikz2NOtCAuUYwZnUmDVMmH X-Received: by 2002:a05:6830:1257:: with SMTP id s23mr74291089otp.241.1577709109779; Mon, 30 Dec 2019 04:31:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577709109; cv=none; d=google.com; s=arc-20160816; b=nzZkuIf5/4zFVpE68DK6BKMh2QFyRBh+n6M2ehO8L3h1PFRD7qSrwPIDkfA9KeWGny 7fzKq7LkcLWH/sRYzhGswcGI8v0SIF0ZUKA0asNBqktDDq8qPPEU8SETO2JA/LprNpst dmq39ijE3SKawNT0y34F43wLbdYZD0mgM7gsGjHwRTXRLnWXYAtsQZUjI7m8LT1VWEPU F1gHrb98C61KpmezguLcAEiM0T2Wp1XYLZ2bojIEkcXVkAA0+te3h3WCCThkM2NIm6LE Klk7uX7ZiR1c5u9UIL0uEqiWfjyW40ejRIiEfMeHcvUxC/3oNEHuSzXFE76nfeHDfGtB N9Uw== 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=NU/rxry6lKNRKG7KKBr3jvZ2rcYxkceQL6qF8JkV+fA=; b=kSubaZ5P5rTSRSacJMzVT7PU3YJnn8OdRfwiNap3Gog3qWT6S9OER79AcZzq75hpXU WXMjFq/lsB7HHqCvM06fGki0kwoeBO1eMBAv4y2jWd09D89vFYXMDoDdvLzDI4Ks91uF HfowM1S42aHL5ZAQzEoFAwoFoXD12HUEfBqu+ylNzw3zDKIYRUzNkbe4dE7SqkvpM/E8 u5m2lFFtBL21ypsk3RKUmjRNcbI5wPAPcra6lWPvMnh5L166tpkBn+kBTcpf/zyrhszR EH2b5KqJCxLbC1Vs2pgOoQi6539FOzX69+HjkZ3ehREKmlMhQ6PCT3qBOzzoqzxheOvp Yztw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=KT1NIGdT; 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 v76si21085570oif.207.2019.12.30.04.31.49; Mon, 30 Dec 2019 04:31:49 -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=KT1NIGdT; 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 S1727526AbfL3Mbs (ORCPT + 27 others); Mon, 30 Dec 2019 07:31:48 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:46088 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727496AbfL3Mbn (ORCPT ); Mon, 30 Dec 2019 07:31:43 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBUCVa09100332; Mon, 30 Dec 2019 06:31:36 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577709096; bh=NU/rxry6lKNRKG7KKBr3jvZ2rcYxkceQL6qF8JkV+fA=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=KT1NIGdTMEf6Xo2ouarRFsJQczg0WOfU3fBrANPpgQR9EwmSgUodDw5kgt8eQsB4i VE5NCUKOOoGCPsCbUOUsCo3Q2n/Ob3958dM2ZfEVKc5629zwWwXZmXgtUyF0XUBdtf erf5xOkEkOcKIY67bw3kt7VvZkiQxrPA5E6/mjmE= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBUCVa7T095292 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 30 Dec 2019 06:31:36 -0600 Received: from DLEE104.ent.ti.com (157.170.170.34) by DLEE105.ent.ti.com (157.170.170.35) 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:35 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DLEE104.ent.ti.com (157.170.170.34) 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:35 -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 xBUCVEhT002491; Mon, 30 Dec 2019 06:31:33 -0600 From: Kishon Vijay Abraham I To: Kishon Vijay Abraham I , Lorenzo Pieralisi , Arnd Bergmann CC: Greg Kroah-Hartman , Bjorn Helgaas , , Subject: [PATCH 7/7] misc: pci_endpoint_test: Enable legacy interrupt Date: Mon, 30 Dec 2019 18:03:15 +0530 Message-ID: <20191230123315.31037-8-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 PCI core does not enable legacy interrupt if it finds MSI or MSIX interrupt. Explicitly enable legacy interrupt here in order to perform legacy interrupt tests. Signed-off-by: Kishon Vijay Abraham I --- drivers/misc/pci_endpoint_test.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index dae450c1a653..b2458988939e 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -701,6 +701,7 @@ static int pci_endpoint_test_probe(struct pci_dev *pdev, } pci_set_master(pdev); + pci_intx(pdev, true); if (!(is_am654_pci_dev(pdev) || is_j721e_pci_dev(pdev))) { if (!pci_endpoint_test_alloc_irq_vectors(test, irq_type))