From: Sebastian Ott Date: Wed, 9 Sep 2015 08:29:59 +0000 (+0200) Subject: s390/cio: reactivate cmf after hibernate X-Git-Tag: v4.4-rc1~138^2~52 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=ab97d211ef1863942a90d7c93dfd563f0381ca87;p=linux.git s390/cio: reactivate cmf after hibernate During resume from hibernate we already reenable measurement block updates on a per device basis. In addition to that we also need to activate channel measurement globally using the set channel monitor instruction. Signed-off-by: Sebastian Ott Reviewed-by: Martin Schwidefsky Reviewed-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index de7074fc6a2c..b2afad5a5682 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c @@ -1312,6 +1312,19 @@ int cmf_reenable(struct ccw_device *cdev) return cmbops->set(cdev, 2); } +/** + * cmf_reactivate() - reactivate measurement block updates + * + * Use this during resume from hibernate. + */ +void cmf_reactivate(void) +{ + spin_lock(&cmb_area.lock); + if (!list_empty(&cmb_area.list)) + cmf_activate(cmb_area.mem, 1); + spin_unlock(&cmb_area.lock); +} + static int __init init_cmbe(void) { cmbe_cache = kmem_cache_create("cmbe_cache", sizeof(struct cmbe), diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 0268e5fd59b5..25b4ee1fb2f4 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -1089,6 +1089,7 @@ void channel_subsystem_reinit(void) if (chp) chp_update_desc(chp); } + cmf_reactivate(); } #ifdef CONFIG_PROC_FS diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index 8d1d29873172..6b17119c9929 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h @@ -145,6 +145,7 @@ void ccw_device_set_timeout(struct ccw_device *, int); void retry_set_schib(struct ccw_device *cdev); void cmf_retry_copy_block(struct ccw_device *); int cmf_reenable(struct ccw_device *); +void cmf_reactivate(void); int ccw_set_cmf(struct ccw_device *cdev, int enable); extern struct device_attribute dev_attr_cmb_enable; #endif