diff options
author | Vineeth Vijayan <vneethv@linux.ibm.com> | 2022-11-17 07:31:50 +0100 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2023-01-22 18:42:34 +0100 |
commit | ca34cda73fd4c8fd93c488addc2eeb20af9e923f (patch) | |
tree | 3a1888b205248d163205ab5423ce55a0827d7a13 /drivers/s390/cio | |
parent | s390/ipl: use kstrtobool() instead of strtobool() (diff) | |
download | linux-ca34cda73fd4c8fd93c488addc2eeb20af9e923f.tar.xz linux-ca34cda73fd4c8fd93c488addc2eeb20af9e923f.zip |
s390/cio: evaluate devices with non-operational paths
css_schedule_reprobe() function calls the evaluation for CSS_EVAL_UNREG
which is specific to the idset of unregistered subchannels. This
evaluation was introduced because, previously, if the underlying device
become not-accessible, the subchannel was unregistered. But, in the recent
changes in cio,with the commit '2297791c92d0 s390/cio: dont unregister
subchannel from child-drivers', we no longer unregister the subchannels
just because of a non-operational device. This allows to have subchannels
without any operational device connected on it. So, a css_schedule_reprobe
function on unregistered subchannel does not have any effect.
Change this functionality to evaluate the subchannels which does not
have a working path to the device. This could be due the erroneous
device or due to the erraneous path. Evaluate based on the values of OPM
and PAM&POM.
Here we introduced a new idset function,to keep I/O subchannels in the
idset when the last seen status indicates that the device has no working
path. A device has no working path if all available paths have been tried
without success.A failed I/O attempt on a path is indicated as a 0 bit
value in the POM mask. By looking at the POM mask bit values of available
paths (1 in PAM) that Linux is supposed to use (1 in vary mask OPM), we
can identify a non-working device as a device where the bit-wise and of
the PAM, POM and OPM mask return 0.
css_schedule_reprobe() is being used by dasd-driver and chsc-cio
component. dasd driver, when it detects a change in the pathgroup, invokes
the re-evaluation of the subchannel. And chsc-cio component upon a CRW
event, (resource accessibility event). In both the cases, it makes much
better sense to re-evalute the subchannel with no-valid path.
Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
Reported-by: Eric Farman <farman@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Tested-by: Eric Farman <farman@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/css.c | 21 | ||||
-rw-r--r-- | drivers/s390/cio/css.h | 2 |
2 files changed, 16 insertions, 7 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index c7db95398500..dfbb998db86f 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -740,12 +740,21 @@ void css_schedule_eval_all(void) spin_unlock_irqrestore(&slow_subchannel_lock, flags); } -static int __unset_registered(struct device *dev, void *data) +static int __unset_validpath(struct device *dev, void *data) { struct idset *set = data; struct subchannel *sch = to_subchannel(dev); + struct pmcw *pmcw = &sch->schib.pmcw; + + /* Here we want to make sure that we are considering only those subchannels + * which do not have an operational device attached to it. This can be found + * with the help of PAM and POM values of pmcw. OPM provides the information + * about any path which is currently vary-off, so that we should not consider. + */ + if (sch->st == SUBCHANNEL_TYPE_IO && + (sch->opm & pmcw->pam & pmcw->pom)) + idset_sch_del(set, sch->schid); - idset_sch_del(set, sch->schid); return 0; } @@ -774,8 +783,8 @@ void css_schedule_eval_cond(enum css_eval_cond cond, unsigned long delay) } idset_fill(set); switch (cond) { - case CSS_EVAL_UNREG: - bus_for_each_dev(&css_bus_type, NULL, set, __unset_registered); + case CSS_EVAL_NO_PATH: + bus_for_each_dev(&css_bus_type, NULL, set, __unset_validpath); break; case CSS_EVAL_NOT_ONLINE: bus_for_each_dev(&css_bus_type, NULL, set, __unset_online); @@ -798,11 +807,11 @@ void css_wait_for_slow_path(void) flush_workqueue(cio_work_q); } -/* Schedule reprobing of all unregistered subchannels. */ +/* Schedule reprobing of all subchannels with no valid operational path. */ void css_schedule_reprobe(void) { /* Schedule with a delay to allow merging of subsequent calls. */ - css_schedule_eval_cond(CSS_EVAL_UNREG, 1 * HZ); + css_schedule_eval_cond(CSS_EVAL_NO_PATH, 1 * HZ); } EXPORT_SYMBOL_GPL(css_schedule_reprobe); diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index ede0b905bc6f..ea5550554297 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h @@ -38,7 +38,7 @@ * Conditions used to specify which subchannels need evaluation */ enum css_eval_cond { - CSS_EVAL_UNREG, /* unregistered subchannels */ + CSS_EVAL_NO_PATH, /* Subchannels with no operational paths */ CSS_EVAL_NOT_ONLINE /* sch without an online-device */ }; |