From nobody Wed Jan 22 13:01:11 2025 Received: from mx.socionext.com (mx.socionext.com [202.248.49.38]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9B0461494A3; Wed, 22 Jan 2025 02:25:03 +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=1737512705; cv=none; b=X4FCr4GOwyziCJPIk5OZuP8Wl70wDhAALx0eg74X5/YTnGyXMR+RoMxb/EgLYiek07bEIH59GkNMfr6pR4ZCv6/u4TCcfE9whZuFxqrAfZkoxzRQ6LCoyfg9DLzUxf4YPq3N5RZC0wbtbPBd0sgZ6KeCEv6IEZm/zNQtN/bBgDM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737512705; c=relaxed/simple; bh=t/vh29f67FFXM/scGWVX11/EjOoNhgxeZRGL5kwotWo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XkpCkkOL0xFbgmKLczK8Jk9fa3lelYfuRI5u+e1/gYuhUi6xq60c4wCeWWZ2CTr4NNE75olHJWH7560j3vLpEm/4Q7ozv7DXJLgiHs87xdJC/zU6G840YR4geDEW+rI/+90EgkA92cTwhJfsiT8i1U13ZwN1lJljPevlQvUrwXQ= 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; 22 Jan 2025 11:24:55 +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 9492F2010183; Wed, 22 Jan 2025 11:24:55 +0900 (JST) Received: from kinkan2.css.socionext.com ([172.31.9.51]) by m-FILTER with ESMTP; Wed, 22 Jan 2025 11:24:55 +0900 Received: from plum.e01.socionext.com (unknown [10.212.245.39]) by kinkan2.css.socionext.com (Postfix) with ESMTP id 4CEE6C3C1E; Wed, 22 Jan 2025 11:24:54 +0900 (JST) From: Kunihiko Hayashi To: Manivannan Sadhasivam , =?UTF-8?q?Krzysztof=20Wilczy=8F=AB=CDski?= , Kishon Vijay Abraham I , Arnd Bergmann , Greg Kroah-Hartman , Lorenzo Pieralisi , Gustavo Pimentel Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Kunihiko Hayashi , stable@vger.kernel.org Subject: [PATCH v2 2/3] misc: pci_endpoint_test: Fix disyplaying irq_type after request_irq error Date: Wed, 22 Jan 2025 11:24:45 +0900 Message-Id: <20250122022446.2898248-3-hayashi.kunihiko@socionext.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20250122022446.2898248-1-hayashi.kunihiko@socionext.com> References: <20250122022446.2898248-1-hayashi.kunihiko@socionext.com> 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. For example, the following message shows "MSI 3" even if the current irq type becomes "MSI-X". # pcitest -i 2 pci-endpoint-test 0000:01:00.0: Failed to request IRQ 30 for MSI 3 SET IRQ TYPE TO MSI-X: NOT OKAY Fix this issue by using test->irq_type instead of global "irq_type". Cc: stable@vger.kernel.org Fixes: b2ba9225e031 ("misc: pci_endpoint_test: Avoid using module parameter= to determine irqtype") Signed-off-by: Kunihiko Hayashi --- drivers/misc/pci_endpoint_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/pci_endpoint_test.c b/drivers/misc/pci_endpoint_t= est.c index 302955c20979..a342587fc78a 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)); --=20 2.25.1