Subject: cio: Provide robustness against missing interrupts to internal IO
From: Sebastian Ott <sebott@linux.vnet.ibm.com>

Summary:     cio: Provide robustness against missing interrupts to internal IO
Description: With this feature for the common I/O layer, channel paths
             with missing interrupts during internal I/O do not make
             devices with remaining functioning channel paths unusable
             to device drivers.
Upstream-ID: -
Problem-ID:  LS1114

Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
---
 README        |    1 +
 zconf/lscss   |   51 ++++++++++++++++++++++++++++++++++++++-------------
 zconf/lscss.8 |   15 +++++++++++++++
 3 files changed, 54 insertions(+), 13 deletions(-)

--- a/README
+++ b/README
@@ -223,6 +223,7 @@ Release History:
           memory balloon, as well as a history function to access previous data.
           Any data from /proc/vmstat and /proc/meminfo can now be used in rules
           and user-defined variables.
+    - lscss: Add --vpm option
 
     Bug Fixes:
     - lsluns: Show all active LUNs for "--active", not just well known LUNs
--- a/zconf/lscss
+++ b/zconf/lscss
@@ -54,6 +54,8 @@ function print_usage() {
 		 		identifiers.
 		 	--avail
 		 		Show availability attribute of IO devices.
+		 	--vpm
+		 		Show verified path mask.
 		 	-v|--version
 		 		Show tools and command version.
 		 	-u|--uppercase
@@ -82,7 +84,8 @@ SUBCHANNEL_TYPE_EADM=3
 
 IDFORMAT=[[:xdigit:]]*.[0-3].[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]
 
-unset SCH_IO SCH_CHSC SCH_EADM SHOW_AVAIL UPPERCASE SHORTID DEVTYPES DEVRANGE RANGE
+unset SCH_IO SCH_CHSC SCH_EADM SHOW_AVAIL UPPERCASE SHORTID DEVTYPES DEVRANGE
+unset RANGE SHOW_VPM
 shopt -s nocasematch
 shopt -s nullglob
 
@@ -193,6 +196,9 @@ while [ $# -gt 0 ]; do
 	--avail)
 	    SHOW_AVAIL=true
 	    ;;
+	--vpm)
+	    SHOW_VPM=true
+	    ;;
 	-d|--devrange)
 	    DEVRANGE=true
             ;;
@@ -305,12 +311,14 @@ function print_io()
 	    CUTYPE=""
 	    DEV="none"
 	    AVAIL=""
+	    VPM=""
 	fi
 	if [ ${SCH##*/} == "defunct" ] ; then
 	    SCH="n/a"
 	    PIM="  "
 	    PAM="  "
 	    POM="  "
+	    VPM="  "
 	    C=("  " "  " "  " "  " "  " "  " "  " "  ")
 	    if [ "$SHORTID" -a ${DEV:0:4} != "0.0." ] ; then
 		continue
@@ -318,6 +326,10 @@ function print_io()
 	else
 	    read PIM PAM POM 2> /dev/null < $SCH/pimpampom || continue
 	    read -a C 2> /dev/null < $SCH/chpids || continue
+	    if [ $SHOW_VPM ] ;then
+		read VPM 2> /dev/null < $SCH/vpm || continue
+		VPM=$VPM" "
+	    fi
 	    SCH=${SCH##*/}
 	    if [ "$SHORTID" -a ${SCH:0:4} != "0.0." ] ; then
 		continue
@@ -329,11 +341,33 @@ function print_io()
 	fi
 	printf "%-8.8s %-8.8s  %-7.7s %-7.7s %3.3s" \
 	    "$DEV" "$SCH" "$DEVTYPE" "$CUTYPE" "$ONLINE"
-	printf "  %s  %s  %s   %s%s%s%s %s%s%s%s %s\n" \
-	    "$PIM" "$PAM" "$POM" "${C[@]}" "$AVAIL"
+	printf "  %s  %s  %s  %s %s%s%s%s %s%s%s%s %s\n" \
+	    "$PIM" "$PAM" "$POM" "$VPM" "${C[@]}" "$AVAIL"
     done
 }
 
+function print_io_header()
+{
+    local HEADER="Device   Subchan.  DevType CU Type Use  PIM PAM POM "
+    local LINE="----------------------------------------------------"
+
+    if [ \( "$SCH_CHSC" -o "$SCH_EADM" \) ] ;then
+	echo "IO Subchannels and Devices:"
+    fi
+    if [ $SHOW_VPM ] ;then
+	HEADER=$HEADER"VPM"
+	LINE=$LINE"---"
+    fi
+    HEADER=$HEADER" CHPIDs"
+    LINE=$LINE"------------------"
+    if [ $SHOW_AVAIL ] ;then
+	HEADER=$HEADER"            Avail."
+	LINE=$LINE"-------"
+    fi
+    echo "$HEADER"
+    echo "$LINE"
+}
+
 function print_chsc()
 {
     list_sch_of_type $SUBCHANNEL_TYPE_CHSC |
@@ -367,16 +401,7 @@ function print_eadm()
 }
 
 if [ $SCH_IO ] ;then
-    if [ \( "$SCH_CHSC" -o "$SCH_EADM" \) ] ;then
-	echo "IO Subchannels and Devices:"
-    fi
-    if [ $SHOW_AVAIL ] ;then
-	echo "Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs            Avail."
-	echo "-----------------------------------------------------------------------------"
-    else
-	echo "Device   Subchan.  DevType CU Type Use  PIM PAM POM  CHPIDs"
-	echo "----------------------------------------------------------------------"
-    fi
+    print_io_header
     print_io | if [ $UPPERCASE ] ;then
 	tr "[:lower:]" "[:upper:]"
     else
--- a/zconf/lscss.8
+++ b/zconf/lscss.8
@@ -41,6 +41,21 @@ Indicate that RANGE refers to device ide
 Show availability attribute of IO devices.
 
 .TP 8
+.BR --vpm
+Show verified path mask.
+VPM is an internal path mask used by Linux. A channel path can be used by Linux device drivers
+to do IO if the corresponding bit is set in the VPM. Events that can lead to a channel path
+not being available include:
+.RS
+.IP \[bu] 4
+The corresponding bit is not set in at least one of the PIM, PAM, or POM masks.
+.IP \[bu]
+The channel path is varied offline.
+.IP \[bu]
+Linux received no interrupt to IO using this channel path.
+.RE
+
+.TP 8
 .BR -v | --version
 Print the version of the s390-tools package and the command.
 
