Commit 28a7e4c9 authored by Ursula Braun's avatar Ursula Braun Committed by Jeff Garzik

qeth: avoid qeth recovery problems

Do not touch IFF_UP flag during qeth recovery, but invoke dev_close()
in case of failing recovery.
Cancel outstanding control commands in case of Data Checks or
Channel Checks.
Do not invoke qeth_l2_del_all_mc() in case of a hard stop to speed up
removal of qeth devices.
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: default avatarJeff Garzik <jgarzik@redhat.com>
parent f1d58672
...@@ -760,7 +760,7 @@ static int qeth_get_problem(struct ccw_device *cdev, struct irb *irb) ...@@ -760,7 +760,7 @@ static int qeth_get_problem(struct ccw_device *cdev, struct irb *irb)
if (sense[SENSE_COMMAND_REJECT_BYTE] & if (sense[SENSE_COMMAND_REJECT_BYTE] &
SENSE_COMMAND_REJECT_FLAG) { SENSE_COMMAND_REJECT_FLAG) {
QETH_DBF_TEXT(TRACE, 2, "CMDREJi"); QETH_DBF_TEXT(TRACE, 2, "CMDREJi");
return 0; return 1;
} }
if ((sense[2] == 0xaf) && (sense[3] == 0xfe)) { if ((sense[2] == 0xaf) && (sense[3] == 0xfe)) {
QETH_DBF_TEXT(TRACE, 2, "AFFE"); QETH_DBF_TEXT(TRACE, 2, "AFFE");
...@@ -884,6 +884,7 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm, ...@@ -884,6 +884,7 @@ static void qeth_irq(struct ccw_device *cdev, unsigned long intparm,
} }
rc = qeth_get_problem(cdev, irb); rc = qeth_get_problem(cdev, irb);
if (rc) { if (rc) {
qeth_clear_ipacmd_list(card);
qeth_schedule_recovery(card); qeth_schedule_recovery(card);
goto out; goto out;
} }
...@@ -4147,6 +4148,7 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev) ...@@ -4147,6 +4148,7 @@ static void qeth_core_remove_device(struct ccwgroup_device *gdev)
unsigned long flags; unsigned long flags;
struct qeth_card *card = dev_get_drvdata(&gdev->dev); struct qeth_card *card = dev_get_drvdata(&gdev->dev);
QETH_DBF_TEXT(SETUP, 2, "removedv");
if (card->discipline.ccwgdriver) { if (card->discipline.ccwgdriver) {
card->discipline.ccwgdriver->remove(gdev); card->discipline.ccwgdriver->remove(gdev);
qeth_core_free_discipline(card); qeth_core_free_discipline(card);
......
...@@ -395,7 +395,8 @@ static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode) ...@@ -395,7 +395,8 @@ static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)
} }
if (card->state == CARD_STATE_SOFTSETUP) { if (card->state == CARD_STATE_SOFTSETUP) {
qeth_l2_process_vlans(card, 1); qeth_l2_process_vlans(card, 1);
qeth_l2_del_all_mc(card); if (!card->use_hard_stop)
qeth_l2_del_all_mc(card);
qeth_clear_ipacmd_list(card); qeth_clear_ipacmd_list(card);
card->state = CARD_STATE_HARDSETUP; card->state = CARD_STATE_HARDSETUP;
} }
...@@ -826,7 +827,6 @@ static int qeth_l2_open(struct net_device *dev) ...@@ -826,7 +827,6 @@ static int qeth_l2_open(struct net_device *dev)
} }
card->data.state = CH_STATE_UP; card->data.state = CH_STATE_UP;
card->state = CARD_STATE_UP; card->state = CARD_STATE_UP;
card->dev->flags |= IFF_UP;
netif_start_queue(dev); netif_start_queue(dev);
if (!card->lan_online && netif_carrier_ok(dev)) if (!card->lan_online && netif_carrier_ok(dev))
...@@ -841,7 +841,6 @@ static int qeth_l2_stop(struct net_device *dev) ...@@ -841,7 +841,6 @@ static int qeth_l2_stop(struct net_device *dev)
QETH_DBF_TEXT(TRACE, 4, "qethstop"); QETH_DBF_TEXT(TRACE, 4, "qethstop");
netif_tx_disable(dev); netif_tx_disable(dev);
card->dev->flags &= ~IFF_UP;
if (card->state == CARD_STATE_UP) if (card->state == CARD_STATE_UP)
card->state = CARD_STATE_SOFTSETUP; card->state = CARD_STATE_SOFTSETUP;
return 0; return 0;
...@@ -1138,9 +1137,13 @@ static int qeth_l2_recover(void *ptr) ...@@ -1138,9 +1137,13 @@ static int qeth_l2_recover(void *ptr)
if (!rc) if (!rc)
PRINT_INFO("Device %s successfully recovered!\n", PRINT_INFO("Device %s successfully recovered!\n",
CARD_BUS_ID(card)); CARD_BUS_ID(card));
else else {
rtnl_lock();
dev_close(card->dev);
rtnl_unlock();
PRINT_INFO("Device %s could not be recovered!\n", PRINT_INFO("Device %s could not be recovered!\n",
CARD_BUS_ID(card)); CARD_BUS_ID(card));
}
return 0; return 0;
} }
......
...@@ -2795,7 +2795,6 @@ static int qeth_l3_open(struct net_device *dev) ...@@ -2795,7 +2795,6 @@ static int qeth_l3_open(struct net_device *dev)
return -ENODEV; return -ENODEV;
card->data.state = CH_STATE_UP; card->data.state = CH_STATE_UP;
card->state = CARD_STATE_UP; card->state = CARD_STATE_UP;
card->dev->flags |= IFF_UP;
netif_start_queue(dev); netif_start_queue(dev);
if (!card->lan_online && netif_carrier_ok(dev)) if (!card->lan_online && netif_carrier_ok(dev))
...@@ -2809,7 +2808,6 @@ static int qeth_l3_stop(struct net_device *dev) ...@@ -2809,7 +2808,6 @@ static int qeth_l3_stop(struct net_device *dev)
QETH_DBF_TEXT(TRACE, 4, "qethstop"); QETH_DBF_TEXT(TRACE, 4, "qethstop");
netif_tx_disable(dev); netif_tx_disable(dev);
card->dev->flags &= ~IFF_UP;
if (card->state == CARD_STATE_UP) if (card->state == CARD_STATE_UP)
card->state = CARD_STATE_SOFTSETUP; card->state = CARD_STATE_SOFTSETUP;
return 0; return 0;
...@@ -3218,9 +3216,13 @@ static int qeth_l3_recover(void *ptr) ...@@ -3218,9 +3216,13 @@ static int qeth_l3_recover(void *ptr)
if (!rc) if (!rc)
PRINT_INFO("Device %s successfully recovered!\n", PRINT_INFO("Device %s successfully recovered!\n",
CARD_BUS_ID(card)); CARD_BUS_ID(card));
else else {
rtnl_lock();
dev_close(card->dev);
rtnl_unlock();
PRINT_INFO("Device %s could not be recovered!\n", PRINT_INFO("Device %s could not be recovered!\n",
CARD_BUS_ID(card)); CARD_BUS_ID(card));
}
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment