Commit 9f3d6d7a authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky

s390/cio: update measurement characteristics

Per channel path measurement characteristics are obtained during channel
path registration. However if some properties of a channel path change
we don't update the measurement characteristics.

Make sure to update the characteristics when we change the properties of
a channel path or receive a notification from FW about such a change.
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Reviewed-by: default avatarPeter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 61f0bfcf
...@@ -416,7 +416,8 @@ static void chp_release(struct device *dev) ...@@ -416,7 +416,8 @@ static void chp_release(struct device *dev)
* chp_update_desc - update channel-path description * chp_update_desc - update channel-path description
* @chp - channel-path * @chp - channel-path
* *
* Update the channel-path description of the specified channel-path. * Update the channel-path description of the specified channel-path
* including channel measurement related information.
* Return zero on success, non-zero otherwise. * Return zero on success, non-zero otherwise.
*/ */
int chp_update_desc(struct channel_path *chp) int chp_update_desc(struct channel_path *chp)
...@@ -428,8 +429,10 @@ int chp_update_desc(struct channel_path *chp) ...@@ -428,8 +429,10 @@ int chp_update_desc(struct channel_path *chp)
return rc; return rc;
rc = chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1); rc = chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
if (rc)
return rc;
return rc; return chsc_get_channel_measurement_chars(chp);
} }
/** /**
...@@ -466,11 +469,6 @@ int chp_new(struct chp_id chpid) ...@@ -466,11 +469,6 @@ int chp_new(struct chp_id chpid)
ret = -ENODEV; ret = -ENODEV;
goto out_free; goto out_free;
} }
ret = chsc_get_channel_measurement_chars(chp);
if (ret)
goto out_free;
dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id); dev_set_name(&chp->dev, "chp%x.%02x", chpid.cssid, chpid.id);
/* make it known to the system */ /* make it known to the system */
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/mutex.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/cio.h> #include <asm/cio.h>
...@@ -224,8 +225,9 @@ static int s390_subchannel_remove_chpid(struct subchannel *sch, void *data) ...@@ -224,8 +225,9 @@ static int s390_subchannel_remove_chpid(struct subchannel *sch, void *data)
void chsc_chp_offline(struct chp_id chpid) void chsc_chp_offline(struct chp_id chpid)
{ {
char dbf_txt[15]; struct channel_path *chp = chpid_to_chp(chpid);
struct chp_link link; struct chp_link link;
char dbf_txt[15];
sprintf(dbf_txt, "chpr%x.%02x", chpid.cssid, chpid.id); sprintf(dbf_txt, "chpr%x.%02x", chpid.cssid, chpid.id);
CIO_TRACE_EVENT(2, dbf_txt); CIO_TRACE_EVENT(2, dbf_txt);
...@@ -236,6 +238,11 @@ void chsc_chp_offline(struct chp_id chpid) ...@@ -236,6 +238,11 @@ void chsc_chp_offline(struct chp_id chpid)
link.chpid = chpid; link.chpid = chpid;
/* Wait until previous actions have settled. */ /* Wait until previous actions have settled. */
css_wait_for_slow_path(); css_wait_for_slow_path();
mutex_lock(&chp->lock);
chp_update_desc(chp);
mutex_unlock(&chp->lock);
for_each_subchannel_staged(s390_subchannel_remove_chpid, NULL, &link); for_each_subchannel_staged(s390_subchannel_remove_chpid, NULL, &link);
} }
...@@ -690,8 +697,9 @@ static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow) ...@@ -690,8 +697,9 @@ static void chsc_process_crw(struct crw *crw0, struct crw *crw1, int overflow)
void chsc_chp_online(struct chp_id chpid) void chsc_chp_online(struct chp_id chpid)
{ {
char dbf_txt[15]; struct channel_path *chp = chpid_to_chp(chpid);
struct chp_link link; struct chp_link link;
char dbf_txt[15];
sprintf(dbf_txt, "cadd%x.%02x", chpid.cssid, chpid.id); sprintf(dbf_txt, "cadd%x.%02x", chpid.cssid, chpid.id);
CIO_TRACE_EVENT(2, dbf_txt); CIO_TRACE_EVENT(2, dbf_txt);
...@@ -701,6 +709,11 @@ void chsc_chp_online(struct chp_id chpid) ...@@ -701,6 +709,11 @@ void chsc_chp_online(struct chp_id chpid)
link.chpid = chpid; link.chpid = chpid;
/* Wait until previous actions have settled. */ /* Wait until previous actions have settled. */
css_wait_for_slow_path(); css_wait_for_slow_path();
mutex_lock(&chp->lock);
chp_update_desc(chp);
mutex_unlock(&chp->lock);
for_each_subchannel_staged(__s390_process_res_acc, NULL, for_each_subchannel_staged(__s390_process_res_acc, NULL,
&link); &link);
css_schedule_reprobe(); css_schedule_reprobe();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment