staging: vchiq_arm: Improve error log for vchiq_platform_init
authorStefan Wahren <stefan.wahren@i2se.com>
Mon, 23 Jan 2023 19:16:29 +0000 (20:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jan 2023 09:10:54 +0000 (10:10 +0100)
During sending the base address of the slots to the VideoCore
firmware via mailbox property, issues could happened on the ARM
and on the VideoCore side. So better separate the error handling
in order to provide more details. This should help to narrow
down the possible cause.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Link: https://lore.kernel.org/r/20230123191629.21019-1-stefan.wahren@i2se.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c

index 22de23f..cddcd3c 100644 (file)
@@ -541,9 +541,15 @@ int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state *state)
        channelbase = slot_phys;
        err = rpi_firmware_property(fw, RPI_FIRMWARE_VCHIQ_INIT,
                                    &channelbase, sizeof(channelbase));
-       if (err || channelbase) {
-               dev_err(dev, "failed to set channelbase\n");
-               return err ? : -ENXIO;
+       if (err) {
+               dev_err(dev, "failed to send firmware property: %d\n", err);
+               return err;
+       }
+
+       if (channelbase) {
+               dev_err(dev, "failed to set channelbase (response: %x)\n",
+                       channelbase);
+               return -ENXIO;
        }
 
        vchiq_log_info(vchiq_arm_log_level, "vchiq_init - done (slots %pK, phys %pad)",