Skip to content

Commit

Permalink
s390/cio: make fmt1 channel path descriptor optional
Browse files Browse the repository at this point in the history
Not all machines / hypervisors support the chsc commands to fetch
the fmt1 descriptor. When these commands fail the channel path would
currently not be available to linux.

Since users of these descriptors can already deal with invalid data
make fetching it optional. The only data that is mandatory for us is
the fmt0 channel path descriptor.

Also make the return code for missing facilities in
chsc_get_channel_measurement_chars consistent to other functions.

Signed-off-by: Sebastian Ott <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: Peter Oberparleiter <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Jul 15, 2016
1 parent 6228c2a commit 0b60137
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions drivers/s390/cio/chp.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,14 @@ int chp_update_desc(struct channel_path *chp)
if (rc)
return rc;

rc = chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
if (rc)
return rc;
/*
* Fetching the following data is optional. Not all machines or
* hypervisors implement the required chsc commands.
*/
chsc_determine_fmt1_channel_path_desc(chp->chpid, &chp->desc_fmt1);
chsc_get_channel_measurement_chars(chp);

return chsc_get_channel_measurement_chars(chp);
return 0;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion drivers/s390/cio/chsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1020,7 +1020,7 @@ int chsc_get_channel_measurement_chars(struct channel_path *chp)
chp->cmg = -1;

if (!css_chsc_characteristics.scmc || !css_chsc_characteristics.secm)
return 0;
return -EINVAL;

spin_lock_irq(&chsc_page_lock);
memset(chsc_page, 0, PAGE_SIZE);
Expand Down

0 comments on commit 0b60137

Please sign in to comment.