All of lore.kernel.org
 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

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  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-06-30  2:14   ` [LTP] 答复: " wangxin
  0 siblings, 2 replies; 10+ messages in thread
From: Petr Vorel @ 2021-06-28 20:29 UTC (permalink / raw)
  To: ltp

Hi Xin,

> 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.

I wonder if this is the same issue as the one described by Krzysztof in his
patch:
https://patchwork.ozlabs.org/project/ltp/patch/20210401125127.45600-1-wangxin410@huawei.com/

Could you please share what HW and kernel you use and post dmesg?

Kind regards,
Petr

> 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	[flat|nested] 10+ messages in thread

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  2021-06-28 20:29 ` Petr Vorel
@ 2021-06-29  9:38   ` Krzysztof Kozlowski
  2021-07-07  7:04     ` Krzysztof Kozlowski
  2021-06-30  2:14   ` [LTP] 答复: " wangxin
  1 sibling, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2021-06-29  9:38 UTC (permalink / raw)
  To: ltp

On 28/06/2021 22:29, Petr Vorel wrote:
> Hi Xin,
> 
>> 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.
> 
> I wonder if this is the same issue as the one described by Krzysztof in his
> patch:
> https://patchwork.ozlabs.org/project/ltp/patch/20210401125127.45600-1-wangxin410@huawei.com/
> 
> Could you please share what HW and kernel you use and post dmesg?

This solves my problem. It seems that could be the root cause - early
configuration allocated too small resource? It might be also some
specific BIOS issue (wrong resource allocated?) because in case of
resource assignment failure, the kernel should try to get the original
FW address from BIOS (pcibios_retrieve_fw_addr()) and this apparently
returns NULL translated to -ENOMEM.

I am fine with going with this patch instead of mine.

Best regards,
Krzysztof

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

* [LTP] 答复:  [PATCH] ltp_tpci.c: Add release operation before allocation
  2021-06-28 20:29 ` Petr Vorel
  2021-06-29  9:38   ` Krzysztof Kozlowski
@ 2021-06-30  2:14   ` wangxin
  1 sibling, 0 replies; 10+ messages in thread
From: wangxin @ 2021-06-30  2:14 UTC (permalink / raw)
  To: ltp

Hi Petr,

The following is the kernel version information of the test case. The hardware information is in the attachment.

# uname -a
Linux hulk-168 4.19.195+ #1 SMP Tue Jun 29 09:42:18 EDT 2021 aarch64 aarch64 aarch64 GNU/Linux
# lscpu 
Architecture:        aarch64
Byte Order:          Little Endian
CPU(s):              128
On-line CPU(s) list: 0-127
Thread(s) per core:  1
Core(s) per socket:  64
Socket(s):           2
NUMA node(s):        4
Vendor ID:           0x48
Model:               0
Stepping:            0x1
CPU max MHz:         2600.0000
CPU min MHz:         200.0000
BogoMIPS:            200.00
L1d cache:           64K
L1i cache:           64K
L2 cache:            512K
L3 cache:            65536K
NUMA node0 CPU(s):   0-31
NUMA node1 CPU(s):   32-63
NUMA node2 CPU(s):   64-95
NUMA node3 CPU(s):   96-127
Flags:               fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma dcpop asimddp asimdfhm

Kind regards,
Xin

-----????-----
???: Petr Vorel [mailto:pvorel@suse.cz] 
????: 2021?6?29? 4:30
???: wangxin (CQ) <wangxin410@huawei.com>
??: ltp@lists.linux.it; Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
??: Re: [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation

Hi Xin,

> 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.

I wonder if this is the same issue as the one described by Krzysztof in his
patch:
https://patchwork.ozlabs.org/project/ltp/patch/20210401125127.45600-1-wangxin410@huawei.com/

Could you please share what HW and kernel you use and post dmesg?

Kind regards,
Petr

> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dmesg.log
Type: application/octet-stream
Size: 135634 bytes
Desc: dmesg.log
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210630/6e9839e7/attachment-0001.obj>

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

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  2021-06-29  9:38   ` Krzysztof Kozlowski
@ 2021-07-07  7:04     ` Krzysztof Kozlowski
  2021-07-07  7:21       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-07  7:04 UTC (permalink / raw)
  To: ltp

On 29/06/2021 11:38, Krzysztof Kozlowski wrote:
> On 28/06/2021 22:29, Petr Vorel wrote:
>> Hi Xin,
>>
>>> 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.
>>
>> I wonder if this is the same issue as the one described by Krzysztof in his
>> patch:
>> https://patchwork.ozlabs.org/project/ltp/patch/20210401125127.45600-1-wangxin410@huawei.com/
>>
>> Could you please share what HW and kernel you use and post dmesg?
> 
> This solves my problem. It seems that could be the root cause - early
> configuration allocated too small resource? It might be also some
> specific BIOS issue (wrong resource allocated?) because in case of
> resource assignment failure, the kernel should try to get the original
> FW address from BIOS (pcibios_retrieve_fw_addr()) and this apparently
> returns NULL translated to -ENOMEM.
> 
> I am fine with going with this patch instead of mine.
> 

Is there anything stopping Xin's patch from being applied? LGTM:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Best regards,
Krzysztof

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

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  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
  0 siblings, 2 replies; 10+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-07  7:21 UTC (permalink / raw)
  To: ltp

On 07/07/2021 09:04, Krzysztof Kozlowski wrote:
> On 29/06/2021 11:38, Krzysztof Kozlowski wrote:
>> On 28/06/2021 22:29, Petr Vorel wrote:
>>> Hi Xin,
>>>
>>>> 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.
>>>
>>> I wonder if this is the same issue as the one described by Krzysztof in his
>>> patch:
>>> https://patchwork.ozlabs.org/project/ltp/patch/20210401125127.45600-1-wangxin410@huawei.com/
>>>
>>> Could you please share what HW and kernel you use and post dmesg?
>>
>> This solves my problem. It seems that could be the root cause - early
>> configuration allocated too small resource? It might be also some
>> specific BIOS issue (wrong resource allocated?) because in case of
>> resource assignment failure, the kernel should try to get the original
>> FW address from BIOS (pcibios_retrieve_fw_addr()) and this apparently
>> returns NULL translated to -ENOMEM.
>>
>> I am fine with going with this patch instead of mine.
>>
> 
> Is there anything stopping Xin's patch from being applied? LGTM:
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> 

Oh, I see what's wrong with the patch - it's corrupted, not possible to
apply.

Best regards,
Krzysztof

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

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  2021-07-07  7:21       ` Krzysztof Kozlowski
@ 2021-07-26  8:36         ` Petr Vorel
  2021-07-26  8:40         ` Petr Vorel
  1 sibling, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2021-07-26  8:36 UTC (permalink / raw)
  To: ltp

Hi all,

> On 07/07/2021 09:04, Krzysztof Kozlowski wrote:
> > On 29/06/2021 11:38, Krzysztof Kozlowski wrote:
> >> On 28/06/2021 22:29, Petr Vorel wrote:
> >>> Hi Xin,

> >>>> 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.

> >>> I wonder if this is the same issue as the one described by Krzysztof in his
> >>> patch:
> >>> https://patchwork.ozlabs.org/project/ltp/patch/20210401125127.45600-1-wangxin410@huawei.com/

> >>> Could you please share what HW and kernel you use and post dmesg?

> >> This solves my problem. It seems that could be the root cause - early
> >> configuration allocated too small resource? It might be also some
> >> specific BIOS issue (wrong resource allocated?) because in case of
> >> resource assignment failure, the kernel should try to get the original
> >> FW address from BIOS (pcibios_retrieve_fw_addr()) and this apparently
> >> returns NULL translated to -ENOMEM.

> >> I am fine with going with this patch instead of mine.


> > Is there anything stopping Xin's patch from being applied? LGTM:
Lack of time :)

> > Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>

Reviewed-by: Petr Vorel <pvorel@suse.cz>

> Oh, I see what's wrong with the patch - it's corrupted, not possible to
> apply.

Trivial fix, I'll merge it shortly.

Kind regards,
Petr

> Best regards,
> Krzysztof

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

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  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
  1 sibling, 1 reply; 10+ messages in thread
From: Petr Vorel @ 2021-07-26  8:40 UTC (permalink / raw)
  To: ltp

Hi Krzysztof

...
> > Is there anything stopping Xin's patch from being applied? LGTM:

BTW does it solve your issue "tpci: accept ENOMEM resource failure with
virtio-pci" [1] ?

Kind regards,
Petr

[1] https://patchwork.ozlabs.org/project/ltp/patch/20210618130536.54806-2-krzysztof.kozlowski@canonical.com/

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

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  2021-07-26  8:40         ` Petr Vorel
@ 2021-07-26  8:44           ` Krzysztof Kozlowski
  2021-07-26  8:55             ` Petr Vorel
  0 siblings, 1 reply; 10+ messages in thread
From: Krzysztof Kozlowski @ 2021-07-26  8:44 UTC (permalink / raw)
  To: ltp

On 26/07/2021 10:40, Petr Vorel wrote:
> Hi Krzysztof
> 
> ...
>>> Is there anything stopping Xin's patch from being applied? LGTM:
> 
> BTW does it solve your issue "tpci: accept ENOMEM resource failure with
> virtio-pci" [1] ?

Yes, it solves. My patch can be dropped. Thanks!


Best regards,
Krzysztof

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

* [LTP] [PATCH] ltp_tpci.c: Add release operation before allocation
  2021-07-26  8:44           ` Krzysztof Kozlowski
@ 2021-07-26  8:55             ` Petr Vorel
  0 siblings, 0 replies; 10+ messages in thread
From: Petr Vorel @ 2021-07-26  8:55 UTC (permalink / raw)
  To: ltp

> On 26/07/2021 10:40, Petr Vorel wrote:
> > Hi Krzysztof

> > ...
> >>> Is there anything stopping Xin's patch from being applied? LGTM:

> > BTW does it solve your issue "tpci: accept ENOMEM resource failure with
> > virtio-pci" [1] ?

> Yes, it solves. My patch can be dropped. Thanks!
Good, thanks for confirmation.

Merged!

Kind regards,
Petr

> Best regards,
> Krzysztof

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.