]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/cio: make fmt1 channel path descriptor optional
authorSebastian Ott <sebott@linux.vnet.ibm.com>
Thu, 14 Jul 2016 09:30:37 +0000 (11:30 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 15 Jul 2016 12:31:59 +0000 (14:31 +0200)
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 <sebott@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/cio/chp.c
drivers/s390/cio/chsc.c

index 50597f9522fe375ed764aab8842a400e56ef808d..d3b72eab2b8fc41bb1845ec5b5040b16efc6b8b2 100644 (file)
@@ -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;
 }
 
 /**
index 452193f7298cc5d5ecb3826f8c25550f7bd2bed9..39bb2ea7b78fd112370d4921e85a197d7ed0520b 100644 (file)
@@ -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);