Fwd: ACK: [PATCH] mtrr: fix mtrr checking without devices that are under bridges
IvanHu
ivan.hu at canonical.com
Thu Aug 23 08:59:40 UTC 2012
-------- Original Message --------
Subject: ACK: [PATCH] mtrr: fix mtrr checking without devices that are
under bridges
Date: Tue, 21 Aug 2012 09:11:47 +0100
From: Colin Ian King <colin.king at canonical.com>
To: IvanHu <ivan.hu at canonical.com>
On 21/08/12 07:27, IvanHu wrote:
> On 08/17/2012 08:37 PM, Colin Ian King wrote:
>> On 14/08/12 11:50, Ivan Hu wrote:
>>> The issue seems that only check the bridges, doesn't check the devices
>>> under
>>> the bridges. This causes the test fail. Fix the parser PCI Bus char and
>>> prfetchable char.
>>>
>>> Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
>>> ---
>>> src/bios/mtrr/mtrr.c | 8 ++++----
>>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/src/bios/mtrr/mtrr.c b/src/bios/mtrr/mtrr.c
>>> index 4818c64..5bb27b8 100644
>>> --- a/src/bios/mtrr/mtrr.c
>>> +++ b/src/bios/mtrr/mtrr.c
>>> @@ -356,11 +356,11 @@ static int is_prefetchable(fwts_framework *fw,
>>> char *device, uint64_t address)
>>> fwts_list_foreach(item, lspci_output) {
>>> char *str = strstr(fwts_text_list_text(item), "Memory at ");
>>> if (str && strtoull(str+10, NULL, 16) == address) {
>>> - if (strstr(str, "Non-Prefetchable"))
>>> + if (strstr(str, "non-prefetchable"))
>>> pref = 0;
>>> - else if (strstr(str, "(Prefetchable"))
>>> + else if (strstr(str, "(prefetchable"))
>>> pref = 1;
>>> - else if (strstr(str, ", Prefetchable"))
>>> + else if (strstr(str, ", prefetchable"))
>>> pref = 1;
>>> }
>>> }
>>> @@ -419,7 +419,7 @@ static int validate_iomem(fwts_framework *fw)
>>> * For pci bridges, we note the increased depth and
>>> * otherwise skip the entry
>>> */
>>> - if (strstr(buffer, ": PCI Bus #")) {
>>> + if (strstr(buffer, ": PCI Bus ")) {
>>> pcidepth++;
>>> continue;
>>> }
>>>
>> I wonder if this is a regression because of changes in the output of
>> lspci? Does this break on earlier releases?
>>
>>
>
> I've checked release 11.10. It also breaks on the release 11.10.
>
> Ivan
OK, well, lets call that an ACK. I think in the longer term perhaps we
should be less reliant on lspci output because it is liable to change
over time. I suspect this has been a bug ever since day #1 when it was
imported into fwts. Good catch.
Acked-by: Colin Ian King <colin.king at canonical.com>
More information about the fwts-devel
mailing list