Re: [PATCH v2] hab: Print events on info command.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Denis,

On Fri, Oct 05, 2018 at 06:58:04AM +0000, Denis OSTERLAND wrote:
> From: Denis Osterland <Denis.Osterland@xxxxxxxxx>
> 
> This patch adds hab_get_status convenience function
> and uses it in hab info command.
> It returns -EIO if MMU is disabled and -ENXIO if no HAB device
> is available.
> 
> Signed-off-by: Denis Osterland <Denis.Osterland@xxxxxxxxx>
> ---
> v1 -> v2: use runtime if, as suggested by Andrey Smirnov,
>           add hab_get_status to have hab implementation
>           selection at a central place
> 
>  commands/hab.c |  3 +++
>  include/hab.h  | 15 +++++++++++++++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/commands/hab.c b/commands/hab.c
> index 0d7ee8e76..af51e73fc 100644
> --- a/commands/hab.c
> +++ b/commands/hab.c
> @@ -72,6 +72,9 @@ static int do_hab(int argc, char *argv[])
>  		else
>  			printf("devel mode\n");
>  
> +		if (hab_get_status() == -EIO)
> +			printf("Disable MMU to access HAB API!\n");
> +
>  		return 0;
>  	}
>  
> diff --git a/include/hab.h b/include/hab.h
> index 78c2b865b..7c2ffab5e 100644
> --- a/include/hab.h
> +++ b/include/hab.h
> @@ -19,6 +19,7 @@
>  #define __HABV4_H
>  
>  #include <errno.h>
> +#include <mach/generic.h>
>  
>  #ifdef CONFIG_HABV4
>  int imx28_hab_get_status(void);
> @@ -43,6 +44,20 @@ static inline int imx25_hab_get_status(void)
>  }
>  #endif
>  
> +static inline int hab_get_status(void)
> +{
> +	if (IS_ENABLED(CONFIG_MMU))
> +		return -EIO;

This restriction makes this patch rather unhandy to use. Internally we
use imx*_hab_get_status() indeed with MMU enabled and it works fine, but
we call it before mmu_init is called. In this state the MMU is enabled
already, but the zero page is not yet set to faulting. So I think the
problem is not the MMU as such, but instead the faulting zero page.

It would be great if we could overcome this issue. One way to do this
would be to add a function pair mmu_zero_page_map() and
mmu_zero_page_set_faulting() to be called in hab_get_status().

I don't know if you are willing to add that, but I don't want to
motivate people to disable the MMU, so the patch is not acceptable as
is.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux