summaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_core_main.c
diff options
context:
space:
mode:
authorUrsula Braun2009-11-12 01:11:43 +0100
committerDavid S. Miller2009-11-16 11:42:07 +0100
commitaa90922479513db0d080239324d0d04701418ba5 (patch)
tree6399b72c47c9826049a62d8217f1613f729c47dd /drivers/s390/net/qeth_core_main.c
parentqeth: remaining EDDP cleanup (diff)
downloadkernel-qcow2-linux-aa90922479513db0d080239324d0d04701418ba5.tar.gz
kernel-qcow2-linux-aa90922479513db0d080239324d0d04701418ba5.tar.xz
kernel-qcow2-linux-aa90922479513db0d080239324d0d04701418ba5.zip
qeth: Recognize return codes of ccw_device_set_online
Setting a qeth device online requires to call function ccw_device_set_online() for read-, write-, and data-subchannel. Failures should be detected immediately without an attempt to invoke follow-on activity qeth_qdio_clear_card()., In addition, ccw_device_set_online calls are consolidated in qeth_core_main.c only. Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390/net/qeth_core_main.c')
-rw-r--r--drivers/s390/net/qeth_core_main.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 2c71948c71a1..819a3b5a647d 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -3883,30 +3883,36 @@ static int qeth_core_driver_group(const char *buf, struct device *root_dev,
int qeth_core_hardsetup_card(struct qeth_card *card)
{
struct qdio_ssqd_desc *ssqd;
- int retries = 3;
+ int retries = 0;
int mpno = 0;
int rc;
QETH_DBF_TEXT(SETUP, 2, "hrdsetup");
atomic_set(&card->force_alloc_skb, 0);
retry:
- if (retries < 3) {
+ if (retries)
QETH_DBF_MESSAGE(2, "%s Retrying to do IDX activates.\n",
dev_name(&card->gdev->dev));
- ccw_device_set_offline(CARD_DDEV(card));
- ccw_device_set_offline(CARD_WDEV(card));
- ccw_device_set_offline(CARD_RDEV(card));
- ccw_device_set_online(CARD_RDEV(card));
- ccw_device_set_online(CARD_WDEV(card));
- ccw_device_set_online(CARD_DDEV(card));
- }
+ ccw_device_set_offline(CARD_DDEV(card));
+ ccw_device_set_offline(CARD_WDEV(card));
+ ccw_device_set_offline(CARD_RDEV(card));
+ rc = ccw_device_set_online(CARD_RDEV(card));
+ if (rc)
+ goto retriable;
+ rc = ccw_device_set_online(CARD_WDEV(card));
+ if (rc)
+ goto retriable;
+ rc = ccw_device_set_online(CARD_DDEV(card));
+ if (rc)
+ goto retriable;
rc = qeth_qdio_clear_card(card, card->info.type != QETH_CARD_TYPE_IQD);
+retriable:
if (rc == -ERESTARTSYS) {
QETH_DBF_TEXT(SETUP, 2, "break1");
return rc;
} else if (rc) {
QETH_DBF_TEXT_(SETUP, 2, "1err%d", rc);
- if (--retries < 0)
+ if (++retries > 3)
goto out;
else
goto retry;