Commit 442caca
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.org1 parent 0747c13 commit 442caca
1 file changed
+1
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
126 | 125 | | |
127 | 126 | | |
128 | 127 | | |
| |||
948 | 947 | | |
949 | 948 | | |
950 | 949 | | |
951 | | - | |
952 | 950 | | |
953 | 951 | | |
954 | 952 | | |
| |||
970 | 968 | | |
971 | 969 | | |
972 | 970 | | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | 971 | | |
978 | 972 | | |
979 | 973 | | |
| |||
1009 | 1003 | | |
1010 | 1004 | | |
1011 | 1005 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | 1006 | | |
1017 | 1007 | | |
1018 | 1008 | | |
1019 | 1009 | | |
1020 | 1010 | | |
1021 | 1011 | | |
1022 | 1012 | | |
1023 | | - | |
| 1013 | + | |
1024 | 1014 | | |
1025 | 1015 | | |
1026 | 1016 | | |
| |||
1036 | 1026 | | |
1037 | 1027 | | |
1038 | 1028 | | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | 1029 | | |
1043 | 1030 | | |
1044 | 1031 | | |
| |||
1051 | 1038 | | |
1052 | 1039 | | |
1053 | 1040 | | |
1054 | | - | |
1055 | | - | |
1056 | 1041 | | |
1057 | 1042 | | |
1058 | 1043 | | |
| |||
1092 | 1077 | | |
1093 | 1078 | | |
1094 | 1079 | | |
1095 | | - | |
1096 | 1080 | | |
1097 | 1081 | | |
1098 | 1082 | | |
1099 | 1083 | | |
1100 | 1084 | | |
1101 | | - | |
1102 | 1085 | | |
1103 | 1086 | | |
1104 | 1087 | | |
1105 | 1088 | | |
1106 | | - | |
1107 | 1089 | | |
1108 | 1090 | | |
1109 | 1091 | | |
1110 | 1092 | | |
1111 | | - | |
1112 | 1093 | | |
1113 | 1094 | | |
1114 | 1095 | | |
| |||
0 commit comments