From: Conor Dooley <[email protected]>
If a service request fails, a non-zero, per-service error code will be
set. Since the individual service drivers may wish to handle things
differently, there's little point trying to do anything intelligent in
the system controller driver. Let the caller know that things went wrong
& leave the details of handling the error to it.
Fixes: d0054a470c33 ("soc: add microchip polarfire soc system controller")
Signed-off-by: Conor Dooley <[email protected]>
---
drivers/soc/microchip/mpfs-sys-controller.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c
index 6e20207b5756..539fc24b397d 100644
--- a/drivers/soc/microchip/mpfs-sys-controller.c
+++ b/drivers/soc/microchip/mpfs-sys-controller.c
@@ -52,6 +52,12 @@ int mpfs_blocking_transaction(struct mpfs_sys_controller *sys_controller, struct
mutex_unlock(&transaction_lock);
+ if (ret)
+ return ret;
+
+ if (msg->response->resp_status)
+ ret = -EIO;
+
return ret;
}
EXPORT_SYMBOL(mpfs_blocking_transaction);
--
2.38.1
On Wed, 23 Nov 2022 09:56:51 PST (-0800), Conor Dooley wrote:
> From: Conor Dooley <[email protected]>
>
> If a service request fails, a non-zero, per-service error code will be
> set. Since the individual service drivers may wish to handle things
> differently, there's little point trying to do anything intelligent in
> the system controller driver. Let the caller know that things went wrong
> & leave the details of handling the error to it.
>
> Fixes: d0054a470c33 ("soc: add microchip polarfire soc system controller")
> Signed-off-by: Conor Dooley <[email protected]>
> ---
> drivers/soc/microchip/mpfs-sys-controller.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/soc/microchip/mpfs-sys-controller.c b/drivers/soc/microchip/mpfs-sys-controller.c
> index 6e20207b5756..539fc24b397d 100644
> --- a/drivers/soc/microchip/mpfs-sys-controller.c
> +++ b/drivers/soc/microchip/mpfs-sys-controller.c
> @@ -52,6 +52,12 @@ int mpfs_blocking_transaction(struct mpfs_sys_controller *sys_controller, struct
>
> mutex_unlock(&transaction_lock);
>
> + if (ret)
> + return ret;
> +
> + if (msg->response->resp_status)
> + ret = -EIO;
> +
> return ret;
> }
> EXPORT_SYMBOL(mpfs_blocking_transaction);
Reviewed-by: Palmer Dabbelt <[email protected]>