aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2013-03-11 07:58:18 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2013-04-17 08:07:26 -0400
commitcce0eacc225b402824e2fc72936b3796e7659fc6 (patch)
treece22f4ddf3f5fe003b21f8d1a2d27353c0293926 /drivers/s390/cio
parenta75a282d7238f6020957b14d8a14a1e851b9e1dd (diff)
s390/cio: collect format 1 channel-path description data
Collect format 1 channel-path description data for each CHPID and update the information in one place. Reviewed-by: Sebastian Ott <sebott@linux.vnet.ibm.com> Signed-off-by: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r--drivers/s390/cio/chp.c22
-rw-r--r--drivers/s390/cio/chp.h2
-rw-r--r--drivers/s390/cio/chsc.c11
-rw-r--r--drivers/s390/cio/css.c5
4 files changed, 31 insertions, 9 deletions
diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c
index 50ad5fdd815d..21fabc6d5a9c 100644
--- a/drivers/s390/cio/chp.c
+++ b/drivers/s390/cio/chp.c
@@ -377,6 +377,26 @@ static void chp_release(struct device *dev)
377} 377}
378 378
379/** 379/**
380 * chp_update_desc - update channel-path description
381 * @chp - channel-path
382 *
383 * Update the channel-path description of the specified channel-path.
384 * Return zero on success, non-zero otherwise.
385 */
386int chp_update_desc(struct channel_path *chp)
387{
388 int rc;
389
390 rc = chsc_determine_base_channel_path_desc(chp->chpid, &chp->desc);
391 if (rc)
392 return rc;
393
394 rc = chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
395
396 return rc;
397}
398
399/**
380 * chp_new - register a new channel-path 400 * chp_new - register a new channel-path
381 * @chpid - channel-path ID 401 * @chpid - channel-path ID
382 * 402 *
@@ -403,7 +423,7 @@ int chp_new(struct chp_id chpid)
403 mutex_init(&chp->lock); 423 mutex_init(&chp->lock);
404 424
405 /* Obtain channel path description and fill it in. */ 425 /* Obtain channel path description and fill it in. */
406 ret = chsc_determine_base_channel_path_desc(chpid, &chp->desc); 426 ret = chp_update_desc(chp);
407 if (ret) 427 if (ret)
408 goto out_free; 428 goto out_free;
409 if ((chp->desc.flags & 0x80) == 0) { 429 if ((chp->desc.flags & 0x80) == 0) {
diff --git a/drivers/s390/cio/chp.h b/drivers/s390/cio/chp.h
index e1399dbee834..9284b785a06f 100644
--- a/drivers/s390/cio/chp.h
+++ b/drivers/s390/cio/chp.h
@@ -44,6 +44,7 @@ struct channel_path {
44 struct mutex lock; /* Serialize access to below members. */ 44 struct mutex lock; /* Serialize access to below members. */
45 int state; 45 int state;
46 struct channel_path_desc desc; 46 struct channel_path_desc desc;
47 struct channel_path_desc_fmt1 desc_fmt1;
47 /* Channel-measurement related stuff: */ 48 /* Channel-measurement related stuff: */
48 int cmg; 49 int cmg;
49 int shared; 50 int shared;
@@ -62,6 +63,7 @@ int chp_is_registered(struct chp_id chpid);
62void *chp_get_chp_desc(struct chp_id chpid); 63void *chp_get_chp_desc(struct chp_id chpid);
63void chp_remove_cmg_attr(struct channel_path *chp); 64void chp_remove_cmg_attr(struct channel_path *chp);
64int chp_add_cmg_attr(struct channel_path *chp); 65int chp_add_cmg_attr(struct channel_path *chp);
66int chp_update_desc(struct channel_path *chp);
65int chp_new(struct chp_id chpid); 67int chp_new(struct chp_id chpid);
66void chp_cfg_schedule(struct chp_id chpid, int configure); 68void chp_cfg_schedule(struct chp_id chpid, int configure);
67void chp_cfg_cancel_deconfigure(struct chp_id chpid); 69void chp_cfg_cancel_deconfigure(struct chp_id chpid);
diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
index e16c553f6556..8ea7d9b2c671 100644
--- a/drivers/s390/cio/chsc.c
+++ b/drivers/s390/cio/chsc.c
@@ -376,7 +376,7 @@ static void chsc_process_sei_chp_avail(struct chsc_sei_nt0_area *sei_area)
376 continue; 376 continue;
377 } 377 }
378 mutex_lock(&chp->lock); 378 mutex_lock(&chp->lock);
379 chsc_determine_base_channel_path_desc(chpid, &chp->desc); 379 chp_update_desc(chp);
380 mutex_unlock(&chp->lock); 380 mutex_unlock(&chp->lock);
381 } 381 }
382} 382}
@@ -631,8 +631,8 @@ int chsc_chp_vary(struct chp_id chpid, int on)
631 * Redo PathVerification on the devices the chpid connects to 631 * Redo PathVerification on the devices the chpid connects to
632 */ 632 */
633 if (on) { 633 if (on) {
634 /* Try to update the channel path descritor. */ 634 /* Try to update the channel path description. */
635 chsc_determine_base_channel_path_desc(chpid, &chp->desc); 635 chp_update_desc(chp);
636 for_each_subchannel_staged(s390_subchannel_vary_chpid_on, 636 for_each_subchannel_staged(s390_subchannel_vary_chpid_on,
637 __s390_vary_chpid_on, &chpid); 637 __s390_vary_chpid_on, &chpid);
638 } else 638 } else
@@ -825,9 +825,10 @@ int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
825{ 825{
826 struct chsc_response_struct *chsc_resp; 826 struct chsc_response_struct *chsc_resp;
827 struct chsc_scpd *scpd_area; 827 struct chsc_scpd *scpd_area;
828 unsigned long flags;
828 int ret; 829 int ret;
829 830
830 spin_lock_irq(&chsc_page_lock); 831 spin_lock_irqsave(&chsc_page_lock, flags);
831 scpd_area = chsc_page; 832 scpd_area = chsc_page;
832 ret = chsc_determine_channel_path_desc(chpid, 0, 0, 1, 0, scpd_area); 833 ret = chsc_determine_channel_path_desc(chpid, 0, 0, 1, 0, scpd_area);
833 if (ret) 834 if (ret)
@@ -835,7 +836,7 @@ int chsc_determine_fmt1_channel_path_desc(struct chp_id chpid,
835 chsc_resp = (void *)&scpd_area->response; 836 chsc_resp = (void *)&scpd_area->response;
836 memcpy(desc, &chsc_resp->data, sizeof(*desc)); 837 memcpy(desc, &chsc_resp->data, sizeof(*desc));
837out: 838out:
838 spin_unlock_irq(&chsc_page_lock); 839 spin_unlock_irqrestore(&chsc_page_lock, flags);
839 return ret; 840 return ret;
840} 841}
841 842
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index a239237d43f3..658d9349c837 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -1065,9 +1065,8 @@ void channel_subsystem_reinit(void)
1065 chsc_enable_facility(CHSC_SDA_OC_MSS); 1065 chsc_enable_facility(CHSC_SDA_OC_MSS);
1066 chp_id_for_each(&chpid) { 1066 chp_id_for_each(&chpid) {
1067 chp = chpid_to_chp(chpid); 1067 chp = chpid_to_chp(chpid);
1068 if (!chp) 1068 if (chp)
1069 continue; 1069 chp_update_desc(chp);
1070 chsc_determine_base_channel_path_desc(chpid, &chp->desc);
1071 } 1070 }
1072} 1071}
1073 1072