mcfg: fix MMIO config space checking
diff mbox series

Message ID 1540290136-31422-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show
Series
  • mcfg: fix MMIO config space checking
Related show

Commit Message

Ivan Hu Oct. 23, 2018, 10:22 a.m. UTC
On the newer kernel, string "reserved" from /sys/firmware/memmap/x/type is
changed with capital "R", this causes the mcfg test got the false alarm result:
Low failures: 1
 mcfg: MCFG MMIO config space at 0xe0000000 is not reserved in the memory map table

Modify with checking both "reserved" and "Reserve"

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/lib/src/fwts_memorymap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Hung Oct. 24, 2018, 1:19 a.m. UTC | #1
On 2018-10-23 6:22 p.m., Ivan Hu wrote:
> On the newer kernel, string "reserved" from /sys/firmware/memmap/x/type is
> changed with capital "R", this causes the mcfg test got the false alarm result:
> Low failures: 1
>  mcfg: MCFG MMIO config space at 0xe0000000 is not reserved in the memory map table
> 
> Modify with checking both "reserved" and "Reserve"
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/lib/src/fwts_memorymap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
> index 26750bd..8c96f9d 100644
> --- a/src/lib/src/fwts_memorymap.c
> +++ b/src/lib/src/fwts_memorymap.c
> @@ -56,7 +56,7 @@ static int fwts_memory_map_str_to_type(const char *str)
>  
>  	if (strstr(str, "System RAM"))
>  		return FWTS_MEMORY_MAP_USABLE;
> -	if (strstr(str, "reserved"))
> +	if (strstr(str, "reserved") || strstr(str, "Reserved"))
>  		return FWTS_MEMORY_MAP_RESERVED;
>  	if (strstr(str, "ACPI Non-volatile Storage"))
>  		return FWTS_MEMORY_MAP_ACPI;
> @@ -81,7 +81,7 @@ static char *fwts_memory_map_type_to_str(const int type)
>  {
>  	switch (type) {
>  	case FWTS_MEMORY_MAP_RESERVED:
> -		return "(reserved)";
> +		return "(Reserved)";
>  	case FWTS_MEMORY_MAP_ACPI:
>  		return "(ACPI Non-volatile Storage)";
>  	case FWTS_MEMORY_MAP_USABLE:
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
Colin Ian King Nov. 13, 2018, 9:06 a.m. UTC | #2
On 23/10/2018 11:22, Ivan Hu wrote:
> On the newer kernel, string "reserved" from /sys/firmware/memmap/x/type is
> changed with capital "R", this causes the mcfg test got the false alarm result:
> Low failures: 1
>  mcfg: MCFG MMIO config space at 0xe0000000 is not reserved in the memory map table
> 
> Modify with checking both "reserved" and "Reserve"
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/lib/src/fwts_memorymap.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
> index 26750bd..8c96f9d 100644
> --- a/src/lib/src/fwts_memorymap.c
> +++ b/src/lib/src/fwts_memorymap.c
> @@ -56,7 +56,7 @@ static int fwts_memory_map_str_to_type(const char *str)
>  
>  	if (strstr(str, "System RAM"))
>  		return FWTS_MEMORY_MAP_USABLE;
> -	if (strstr(str, "reserved"))
> +	if (strstr(str, "reserved") || strstr(str, "Reserved"))
>  		return FWTS_MEMORY_MAP_RESERVED;
>  	if (strstr(str, "ACPI Non-volatile Storage"))
>  		return FWTS_MEMORY_MAP_ACPI;
> @@ -81,7 +81,7 @@ static char *fwts_memory_map_type_to_str(const int type)
>  {
>  	switch (type) {
>  	case FWTS_MEMORY_MAP_RESERVED:
> -		return "(reserved)";
> +		return "(Reserved)";
>  	case FWTS_MEMORY_MAP_ACPI:
>  		return "(ACPI Non-volatile Storage)";
>  	case FWTS_MEMORY_MAP_USABLE:
> 
Thanks Ivan.

Acked-by: Colin Ian King <colin.king@canonical.com>

Patch
diff mbox series

diff --git a/src/lib/src/fwts_memorymap.c b/src/lib/src/fwts_memorymap.c
index 26750bd..8c96f9d 100644
--- a/src/lib/src/fwts_memorymap.c
+++ b/src/lib/src/fwts_memorymap.c
@@ -56,7 +56,7 @@  static int fwts_memory_map_str_to_type(const char *str)
 
 	if (strstr(str, "System RAM"))
 		return FWTS_MEMORY_MAP_USABLE;
-	if (strstr(str, "reserved"))
+	if (strstr(str, "reserved") || strstr(str, "Reserved"))
 		return FWTS_MEMORY_MAP_RESERVED;
 	if (strstr(str, "ACPI Non-volatile Storage"))
 		return FWTS_MEMORY_MAP_ACPI;
@@ -81,7 +81,7 @@  static char *fwts_memory_map_type_to_str(const int type)
 {
 	switch (type) {
 	case FWTS_MEMORY_MAP_RESERVED:
-		return "(reserved)";
+		return "(Reserved)";
 	case FWTS_MEMORY_MAP_ACPI:
 		return "(ACPI Non-volatile Storage)";
 	case FWTS_MEMORY_MAP_USABLE: