public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
@ 2021-04-01 12:51 Wang Xin
  2021-06-28 20:29 ` Petr Vorel
  0 siblings, 1 reply; 10+ messages in thread
From: Wang Xin @ 2021-04-01 12:51 UTC (permalink / raw)
  To: ltp

When we run the test case, the following results will be obtained:
test_pci  283  TPASS  :  PCI bus 7d slot 00 : Test-case '11'
test_pci  284  TFAIL  :  tpci.c:74: PCI bus 7d slot 00 : Test-case '12'
...
test_pci  300  TFAIL  :  tpci.c:74: PCI bus 7d slot 01 : Test-case '12'
test_pci  301  TPASS  :  PCI bus 7d slot 01 : Test-case '13'

The analysis is that the space allocated by the bios is insufficient.
The solution to this problem can be in add pci_release_resource(dev, i)
before system resources are reallocated.Because the resources have been
allocated when the system is initialized.If it is redistributed, it
should be released and then allocated.

Signed-off-by: Wang Xin <wangxin410@huawei.com>
---
 testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
index e29821dda..5b0896093 100644
--- a/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
+++ b/testcases/kernel/device-drivers/pci/tpci_kernel/ltp_tpci.c
@@ -439,6 +439,7 @@ static int test_assign_resources(void)
 		if (r->flags & IORESOURCE_MEM &&
 			r->flags & IORESOURCE_PREFETCH) {
+			pci_release_resource(dev, i);
 			ret = pci_assign_resource(dev, i);
 			prk_info("assign resource to '%d', ret '%d'", i, ret);
 			rc |= (ret < 0 && ret != -EBUSY) ? TFAIL : TPASS;
2.17.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-07-26  8:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-01 12:51 [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation Wang Xin
2021-06-28 20:29 ` Petr Vorel
2021-06-29  9:38   ` Krzysztof Kozlowski
2021-07-07  7:04     ` Krzysztof Kozlowski
2021-07-07  7:21       ` Krzysztof Kozlowski
2021-07-26  8:36         ` Petr Vorel
2021-07-26  8:40         ` Petr Vorel
2021-07-26  8:44           ` Krzysztof Kozlowski
2021-07-26  8:55             ` Petr Vorel
2021-06-30  2:14   ` [LTP] 答复: " wangxin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox