diff mbox series

[v2,11/11] astbmc: Fail SFC init if SIO is unavailable

Message ID 20180925040635.5233-12-andrew@aj.id.au
State Superseded
Headers show
Series Add and integrate an IPMI flash implementation | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/make_check success Test make_check on branch master

Commit Message

Andrew Jeffery Sept. 25, 2018, 4:06 a.m. UTC
If SuperIO is unavailable then the driver cannot perform accesses on
which it currently depends. Test for SuperIO availability during
initialsation and bail out immediately if it is absent.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
---
 hw/ast-bmc/ast-sf-ctrl.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Andrew Jeffery Oct. 8, 2018, 11:35 p.m. UTC | #1
On Tue, 25 Sep 2018, at 14:36, Andrew Jeffery wrote:
> If SuperIO is unavailable then the driver cannot perform accesses on
> which it currently depends. Test for SuperIO availability during
> initialsation and bail out immediately if it is absent.
> 
> Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
> ---
>  hw/ast-bmc/ast-sf-ctrl.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/hw/ast-bmc/ast-sf-ctrl.c b/hw/ast-bmc/ast-sf-ctrl.c
> index 32fc63ae33d6..839af376d4de 100644
> --- a/hw/ast-bmc/ast-sf-ctrl.c
> +++ b/hw/ast-bmc/ast-sf-ctrl.c
> @@ -950,6 +950,9 @@ int ast_sf_open(uint8_t type, struct spi_flash_ctrl **ctrl)
>  	uint32_t hicr7;
>  #endif /* __SKIBOOT__ */
>  
> +	if (!ast_sio_is_enabled())
> +		return -ENODEV;
> +

This hunk should actually be inside the `#ifdef __SKIBOOT__`, otherwise
building e.g. pflash fails.

>  	if (type != AST_SF_TYPE_PNOR && type != AST_SF_TYPE_BMC
>  	    && type != AST_SF_TYPE_MEM)
>  		return -EINVAL;
> -- 
> 2.17.1
>
diff mbox series

Patch

diff --git a/hw/ast-bmc/ast-sf-ctrl.c b/hw/ast-bmc/ast-sf-ctrl.c
index 32fc63ae33d6..839af376d4de 100644
--- a/hw/ast-bmc/ast-sf-ctrl.c
+++ b/hw/ast-bmc/ast-sf-ctrl.c
@@ -950,6 +950,9 @@  int ast_sf_open(uint8_t type, struct spi_flash_ctrl **ctrl)
 	uint32_t hicr7;
 #endif /* __SKIBOOT__ */
 
+	if (!ast_sio_is_enabled())
+		return -ENODEV;
+
 	if (type != AST_SF_TYPE_PNOR && type != AST_SF_TYPE_BMC
 	    && type != AST_SF_TYPE_MEM)
 		return -EINVAL;