From patchwork Mon Dec 16 07:39:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kunihiko Hayashi X-Patchwork-Id: 13909305 X-Patchwork-Delegate: kw@linux.com Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0501B1B6CF0; Mon, 16 Dec 2024 07:41:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.248.49.38 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734334865; cv=none; b=WYotKdebst9AqOsh5gsk5+v/AuTcQ0IX7xNQCNPC3HlwK6ITqxCHRm9Iz/AQnedOyh1oD9sZpmh/Qg3FdJrQIkhj6jsJtXZC56zm8HBq4+m3ySPwMKunl5byS9eN40xyq/QXjBw3Arblhc5RdJg2RdOVqazphCUklJD0Si644Eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734334865; c=relaxed/simple; bh=Pm+axbHeP0nV/usgyJWkc8plA1L2nEaoLn6geLvLeNk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Tw0Ubmi2WcMK40kT9q7xkBK9QLOIo1bR9OSRav6rJCBp0gnAwX3uNFuzaqo/yC6M1JFmRu2BIZdAix6Am3PeohdwqiDupLAJa3LLLOOFaJ+lCYx4CH0ln43yBPvBfx5XoBcJ6/u6dCZ460zlJmfh1Pm/AVAxLG2Fp7yyjeYeMS0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=socionext.com; spf=pass smtp.mailfrom=socionext.com; arc=none smtp.client-ip=202.248.49.38 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=socionext.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=socionext.com Received: from unknown (HELO kinkan2-ex.css.socionext.com) ([172.31.9.52]) by mx.socionext.com with ESMTP; 16 Dec 2024 16:39:54 +0900 Received: from mail.mfilter.local (mail-arc01.css.socionext.com [10.213.46.36]) by kinkan2-ex.css.socionext.com (Postfix) with ESMTP id 6C8DB2008474; Mon, 16 Dec 2024 16:39:54 +0900 (JST) Received: from kinkan2.css.socionext.com ([172.31.9.51]) by m-FILTER with ESMTP; Mon, 16 Dec 2024 16:39:54 +0900 Received: from plum.e01.socionext.com (unknown [10.212.245.39]) by kinkan2.css.socionext.com (Postfix) with ESMTP id C414CAB187; Mon, 16 Dec 2024 16:39:53 +0900 (JST) From: Kunihiko Hayashi To: =?unknown-8bit?q?Manivannan_Sadhasivam_=3Cmanivannan=2Esadhasivam=40lina?= =?unknown-8bit?q?ro=2Eorg=3E=2C_Krzysztof_Wilczy=8F=AB=CDski__=3Ckw=40linux?= =?unknown-8bit?q?=2Ecom=3E=2C_Kishon_Vijay_Abraham_I_=3Ckishon=40kernel=2Eo?= =?unknown-8bit?q?rg=3E=2C_Arnd_Bergmann_=3Carnd=40arndb=2Ede=3E=2C_Greg_Kro?= =?unknown-8bit?q?ah-Hartman_=3Cgregkh=40linuxfoundation=2Eorg=3E=2C_Lorenzo?= =?unknown-8bit?q?_Pieralisi_=3Clpieralisi=40kernel=2Eorg=3E?= Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [PATCH 1/2] misc: pci_endpoint_test: Fix irq_type to convey the correct type Date: Mon, 16 Dec 2024 16:39:40 +0900 Message-Id: <20241216073941.2572407-1-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 There are two variables that indicate the interrupt type to be used in the next test execution, global "irq_type" and test->irq_type. The former is referenced from pci_endpoint_test_get_irq() to preserve the current type for ioctl(PCITEST_GET_IRQTYPE). In pci_endpoint_test_request_irq(), since this global variable is referenced when an error occurs, the unintended error message is displayed. And the type set in pci_endpoint_test_set_irq() isn't reflected in the global "irq_type", so ioctl(PCITEST_GET_IRQTYPE) returns the previous type. As a result, the wrong type will be displayed in "pcitest". This patch fixes these two issues. Fixes: b2ba9225e031 ("misc: pci_endpoint_test: Avoid using module parameter to determine irqtype") Signed-off-by: Kunihiko Hayashi --- drivers/misc/pci_endpoint_test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_test.c index e73b3078cdb6..854480921470 100644 --- a/drivers/misc/pci_endpoint_test.c +++ b/drivers/misc/pci_endpoint_test.c @@ -235,7 +235,7 @@ static bool pci_endpoint_test_request_irq(struct pci_endpoint_test *test) return true; fail: - switch (irq_type) { + switch (test->irq_type) { case IRQ_TYPE_INTX: dev_err(dev, "Failed to request IRQ %d for Legacy\n", pci_irq_vector(pdev, i)); @@ -739,6 +739,7 @@ static bool pci_endpoint_test_set_irq(struct pci_endpoint_test *test, if (!pci_endpoint_test_request_irq(test)) goto err; + irq_type = test->irq_type; return true; err: