Commit 92db71b
Myron Stowe
misc: pci_endpoint_test: Defer IRQ allocation until ioctl(PCITEST_SET_IRQTYPE)
JIRA: https://issues.redhat.com/browse/RHEL-86521
Upstream Status: 442caca
commit 442caca
Author: Niklas Cassel <cassel@kernel.org>
Date: Wed Apr 16 16:28:26 2025 +0200
misc: pci_endpoint_test: Defer IRQ allocation until ioctl(PCITEST_SET_IRQTYPE)
Commit a402006 ("misc: pci_endpoint_test: Remove global 'irq_type'
and 'no_msi'") changed so that the default IRQ vector requested by
pci_endpoint_test_probe() was no longer the module param 'irq_type', but
instead test->irq_type. test->irq_type is by default IRQ_TYPE_UNDEFINED
(until someone calls ioctl(PCITEST_SET_IRQTYPE)).
However, the commit also changed so that after initializing test->irq_type
to IRQ_TYPE_UNDEFINED, it also overrides it with driver_data->irq_type, if
the PCI device and vendor ID provides driver_data.
This causes a regression for PCI device and vendor IDs that do not provide
driver_data, and the host side pci_endpoint_test_driver driver failed to
probe on such platforms:
pci-endpoint-test 0001:01:00.0: Invalid IRQ type selected
pci-endpoint-test 0001:01:00.0: probe with driver pci-endpoint-test failed with error -22
Considering that the pci endpoint selftests and the old pcitest.sh always
call ioctl(PCITEST_SET_IRQTYPE) before performing any test that requires
IRQs, fix the regression by removing the allocation of IRQs in
pci_endpoint_test_probe(). The IRQ allocation will occur when
ioctl(PCITEST_SET_IRQTYPE) is called.
A positive side effect of this is that even if the endpoint controller has
issues with IRQs, the user can do still do all the tests/ioctls() that do
not require working IRQs, e.g. PCITEST_BAR and PCITEST_BARS.
This also means that we can remove the now unused irq_type from
driver_data. The irq_type will always be the one configured by the user
using ioctl(PCITEST_SET_IRQTYPE). (A user that does not know, or care
which irq_type that is used, can use PCITEST_IRQ_TYPE_AUTO. This has
superseded the need for a default irq_type in driver_data.)
[bhelgaas: add probe failure details]
Fixes: a402006 ("misc: pci_endpoint_test: Remove global 'irq_type' and 'no_msi'")
Signed-off-by: Niklas Cassel <cassel@kernel.org>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20250416142825.336554-2-cassel@kernel.org
Signed-off-by: Myron Stowe <mstowe@redhat.com>1 parent a7062ea commit 92db71b
1 file changed
+1
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
949 | 948 | | |
950 | 949 | | |
951 | 950 | | |
952 | | - | |
953 | 951 | | |
954 | 952 | | |
955 | 953 | | |
| |||
971 | 969 | | |
972 | 970 | | |
973 | 971 | | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | 972 | | |
979 | 973 | | |
980 | 974 | | |
| |||
1010 | 1004 | | |
1011 | 1005 | | |
1012 | 1006 | | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | 1007 | | |
1018 | 1008 | | |
1019 | 1009 | | |
1020 | 1010 | | |
1021 | 1011 | | |
1022 | 1012 | | |
1023 | 1013 | | |
1024 | | - | |
| 1014 | + | |
1025 | 1015 | | |
1026 | 1016 | | |
1027 | 1017 | | |
| |||
1037 | 1027 | | |
1038 | 1028 | | |
1039 | 1029 | | |
1040 | | - | |
1041 | | - | |
1042 | | - | |
1043 | 1030 | | |
1044 | 1031 | | |
1045 | 1032 | | |
| |||
1052 | 1039 | | |
1053 | 1040 | | |
1054 | 1041 | | |
1055 | | - | |
1056 | | - | |
1057 | 1042 | | |
1058 | 1043 | | |
1059 | 1044 | | |
| |||
1093 | 1078 | | |
1094 | 1079 | | |
1095 | 1080 | | |
1096 | | - | |
1097 | 1081 | | |
1098 | 1082 | | |
1099 | 1083 | | |
1100 | 1084 | | |
1101 | 1085 | | |
1102 | | - | |
1103 | 1086 | | |
1104 | 1087 | | |
1105 | 1088 | | |
1106 | 1089 | | |
1107 | | - | |
1108 | 1090 | | |
1109 | 1091 | | |
1110 | 1092 | | |
1111 | 1093 | | |
1112 | | - | |
1113 | 1094 | | |
1114 | 1095 | | |
1115 | 1096 | | |
| |||
0 commit comments