From nobody Wed Feb 5 14:10:12 2025 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B5FB24A7EE; Thu, 16 Jan 2025 02:41:52 +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=1736995314; cv=none; b=sjVBAhUPoApRRQEaa7r8y3RtWxOrTaKiLm7JaNCnN4e9mCJ+cKcsTRjBD3zy1rDtV6L6H+GsL4Hc8oxQ3ewB98PaFwgzW33rEkNR/Yy0bR/WtDxAkr72iGzF95Rz/hqR3SdCLgMbQAkFoCqCZ9rh+I8sAZe31wtikzS0G+cpBb8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736995314; c=relaxed/simple; bh=Pm+axbHeP0nV/usgyJWkc8plA1L2nEaoLn6geLvLeNk=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TRC6wyEeNKjnnVr2hmuPRrPyGaSQbh5h1OsGmT6Qu+V7H0TCztj2xcwUkYe0ELr+1G5xA6NbwZPsHArfL3em1gGtMiohNtY4KINrraj867z4nDSf48Dar5+94eN4WfwXK2OlscHXYz/E35w1Imgr8ZIbR80TKVLNmFs1teN8reQ= 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 iyokan2-ex.css.socionext.com) ([172.31.9.54]) by mx.socionext.com with ESMTP; 16 Jan 2025 11:41:51 +0900 Received: from mail.mfilter.local (mail-arc01.css.socionext.com [10.213.46.36]) by iyokan2-ex.css.socionext.com (Postfix) with ESMTP id 9C0442006E93; Thu, 16 Jan 2025 11:41:51 +0900 (JST) Received: from kinkan2.css.socionext.com ([172.31.9.51]) by m-FILTER with ESMTP; Thu, 16 Jan 2025 11:41:51 +0900 Received: from plum.e01.socionext.com (unknown [10.212.245.39]) by kinkan2.css.socionext.com (Postfix) with ESMTP id D7A20AB187; Thu, 16 Jan 2025 11:41:50 +0900 (JST) From: Kunihiko Hayashi To: Manivannan Sadhasivam , =?UTF-8?q?Krzysztof=20Wilczy=C5=84ski?= , Kishon Vijay Abraham I , Arnd Bergmann , Greg Kroah-Hartman , Lorenzo Pieralisi Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi Subject: [RESEND PATCH v1] misc: pci_endpoint_test: Fix irq_type to convey the correct type Date: Thu, 16 Jan 2025 11:41:45 +0900 Message-Id: <20250116024145.2836349-1-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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_t= est.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_en= dpoint_test *test) return true; =20 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_endpoi= nt_test *test, if (!pci_endpoint_test_request_irq(test)) goto err; =20 + irq_type =3D test->irq_type; return true; =20 err: --=20 2.25.1