Subject: Re: [PATCH 2/2] Force 4K IOPages when eHEA is present in the machine.

From: Nathan Lynch <[email-masked]>
Date: Thu, 20 Mar 2008 02:18:58 -0500

Tony Breeds wrote:
> 
> +#if defined(CONFIG_PPC_PSERIES) && defined(CONFIG_PPC_64K_PAGES)
> +static int __init scan_dt_for_ehea(unsigned long node, const char *uname,
> +                                  int depth, void *data)
> +{
> +	if (depth != 0)
> +		return 0;
> +
> +	if (of_flat_dt_search(node, "HEA ", "ibm,drc-names"))
> +		return 1;
> +
> +	return 0;
> +}
> +#endif

Searching ibm,drc-names is necessary, but is it sufficient?  That is,
can there be a system that has an HEA adapter without that property
being present?  Thinking in particular about single-partition systems
that run without an HMC attached.

>  static void __init htab_init_page_sizes(void)
>  {
>  	int rc;
> +#ifdef CONFIG_PPC_64K_PAGES
> +	int has_ehea = 0;
> +#endif
>  
>  	/* Default to 4K pages only */
>  	memcpy(mmu_psize_defs, mmu_psize_defaults_old,
>  	       sizeof(mmu_psize_defaults_old));
>  
> +#if defined(CONFIG_PPC_PSERIES) && defined(CONFIG_PPC_64K_PAGES)
> +	/* Scan to see if this system can have an EHEA, if so we'll
> +	 * demote io_psize to 4K */
> +	has_ehea = of_scan_flat_dt(scan_dt_for_ehea, NULL);
> +#endif

I'm wondering if some of the ifdef stuff could be avoided if you used
a firmware feature bit to signify the limitation (or the lack of it).
The bit could be set during pSeries_probe.  Just an idea; I don't feel
that strongly about it.