On 10/16/2015 06:30 PM, Gabriel Krisman Bertazi wrote:
> Send a Change Cache parameters during IOA initialization to enable
> Sync Cache by default on adapters that support it.
> 
> Signed-off-by: Gabriel Krisman Bertazi <kris...@linux.vnet.ibm.com>
> ---
>  iprlib.c | 10 ++++++++++
>  iprlib.h |  3 +++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/iprlib.c b/iprlib.c
> index 609ffe3..7875442 100644
> --- a/iprlib.c
> +++ b/iprlib.c
> @@ -7588,6 +7588,14 @@ int ipr_set_ioa_attr(struct ipr_ioa *ioa, struct 
> ipr_ioa_attr *attr, int save)
>               }
>       }
> 
> +     if (ioa->has_vset_write_cache && attr->vset_write_cache &&
> +         power_cur_mode != POWER_BAREMETAL) {
> +             /* vset cache should not be disabled adapter-wide
> +                for any reason.  So we don't save the parameter here. */
> +             ipr_change_cache_parameters(ioa,
> +                                         IPR_IOA_SET_VSET_CACHE_ENABLED);
> +     }
> +
>       get_dual_ioa_state(ioa);        /* for preferred_primary */
>       get_subsys_config(ioa);         /* for gscsi_only_ha */
>       return 0;
> @@ -9434,6 +9442,8 @@ static void init_ioa_dev(struct ipr_dev *dev)
>               attr.active_active = 1;
>       if (dev->ioa->configure_rebuild_verify)
>               attr.disable_rebuild_verify = 1;
> +     if (dev->ioa->has_vset_write_cache)
> +             attr.vset_write_cache = 1;

As I was looking at this bit of code, I noticed we have a bug in 
ipr_modify_ioa_attr
which is unrelated to this function. ipr_modify_ioa_attr is the function that 
should
be reading any saved attributes for the IOA from the config file, and it 
doesn't look
like we are looking at IPR_ARRAY_REBUILD_RATE or 
IPR_ARRAY_DISABLE_REBUILD_VERIFY. We'll
need to fix this up in a follow on patch.

For this particular patch, what you have is fine, since we aren't yet exposing 
a way
to disable this on a per adapter basis.

Acked-by: Brian King <brk...@linux.vnet.ibm.com>

>       ipr_modify_ioa_attr(dev->ioa, &attr);
>       if (ipr_set_ioa_attr(dev->ioa, &attr, 0))
>               return;
> diff --git a/iprlib.h b/iprlib.h
> index 33ab390..0856d6c 100644
> --- a/iprlib.h
> +++ b/iprlib.h
> @@ -222,6 +222,8 @@ typedef uint64_t u64;
>  #define IPR_IOA_SET_CACHING_DISABLED         0x10
>  #define IPR_IOA_SET_CACHING_DUAL_DISABLED    0x20
>  #define IPR_IOA_SET_CACHING_DUAL_ENABLED     0x30
> +#define IPR_IOA_SET_VSET_CACHE_ENABLED            0x40
> +#define IPR_IOA_SET_VSET_CACHE_DISABLED      0x50
> 
>  #define PHYSICAL_LOCATION_LENGTH     1024
> 
> @@ -1407,6 +1409,7 @@ struct ipr_ioa_attr {
>       int caching;
>       int rebuild_rate;
>       int disable_rebuild_verify;
> +     int vset_write_cache;
>  };
> 
>  #define IPR_DEV_MAX_PATHS    2
> 


-- 
Brian King
Power Linux I/O
IBM Linux Technology Center


------------------------------------------------------------------------------
_______________________________________________
Iprdd-devel mailing list
Iprdd-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iprdd-devel

Reply via email to