diff mbox series

[V2] acpi: dmar: add a warning when PCI device is not found

Message ID 20210806173622.1978360-1-alex.hung@canonical.com
State Accepted
Headers show
Series [V2] acpi: dmar: add a warning when PCI device is not found | expand

Commit Message

Alex Hung Aug. 6, 2021, 5:36 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1936458

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---

[V2] Add PCI SEG:BUS:DEV:FUNC to the warning message.

 src/acpi/dmar/dmar.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Colin Ian King Aug. 6, 2021, 6:10 p.m. UTC | #1
On 06/08/2021 18:36, Alex Hung wrote:
> BugLink: https://bugs.launchpad.net/bugs/1936458
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
> 
> [V2] Add PCI SEG:BUS:DEV:FUNC to the warning message.
> 
>  src/acpi/dmar/dmar.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/acpi/dmar/dmar.c b/src/acpi/dmar/dmar.c
> index af9ee277..5b06c8c7 100644
> --- a/src/acpi/dmar/dmar.c
> +++ b/src/acpi/dmar/dmar.c
> @@ -166,8 +166,11 @@ static int acpi_parse_one_dev_scope(fwts_framework *fw,
>  			goto error;
>  		dev_type = read_pci_device_secondary_bus_number(seg, bus,
>  			path->dev, path->fn, &sec_bus);
> -		if (dev_type < 0) /* no such device */
> +		if (dev_type < 0) {	/* no such device */
> +			fwts_warning(fw, "PCI device %04Xh:%02Xh:%02Xh.%02Xh is not found.",
> +				     seg, bus, path->dev, path->fn);
>  			goto error;
> +		}
>  		path++;
>  		count--;
>  		bus = sec_bus;
> 

Good idea. Looks good to me.

Acked-by: Colin Ian King <colin.king@canonical.com>
Ivan Hu Aug. 9, 2021, 3:05 a.m. UTC | #2
On 8/7/21 1:36 AM, Alex Hung wrote:
> BugLink: https://bugs.launchpad.net/bugs/1936458
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
> 
> [V2] Add PCI SEG:BUS:DEV:FUNC to the warning message.
> 
>  src/acpi/dmar/dmar.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/acpi/dmar/dmar.c b/src/acpi/dmar/dmar.c
> index af9ee277..5b06c8c7 100644
> --- a/src/acpi/dmar/dmar.c
> +++ b/src/acpi/dmar/dmar.c
> @@ -166,8 +166,11 @@ static int acpi_parse_one_dev_scope(fwts_framework *fw,
>  			goto error;
>  		dev_type = read_pci_device_secondary_bus_number(seg, bus,
>  			path->dev, path->fn, &sec_bus);
> -		if (dev_type < 0) /* no such device */
> +		if (dev_type < 0) {	/* no such device */
> +			fwts_warning(fw, "PCI device %04Xh:%02Xh:%02Xh.%02Xh is not found.",
> +				     seg, bus, path->dev, path->fn);
>  			goto error;
> +		}
>  		path++;
>  		count--;
>  		bus = sec_bus;
> 


Acked-by: Ivan Hu <ivan.hu@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/dmar/dmar.c b/src/acpi/dmar/dmar.c
index af9ee277..5b06c8c7 100644
--- a/src/acpi/dmar/dmar.c
+++ b/src/acpi/dmar/dmar.c
@@ -166,8 +166,11 @@  static int acpi_parse_one_dev_scope(fwts_framework *fw,
 			goto error;
 		dev_type = read_pci_device_secondary_bus_number(seg, bus,
 			path->dev, path->fn, &sec_bus);
-		if (dev_type < 0) /* no such device */
+		if (dev_type < 0) {	/* no such device */
+			fwts_warning(fw, "PCI device %04Xh:%02Xh:%02Xh.%02Xh is not found.",
+				     seg, bus, path->dev, path->fn);
 			goto error;
+		}
 		path++;
 		count--;
 		bus = sec_bus;