qeth: don't query for info if hardware not ready.
When qeth device is queried for ethtool data, hardware operation is performed to extract the necessary information from the card. If the card is not online at the moment (e.g. it is undergoing recovery), this operation produces undesired effects like temporarily freezing the system. This patch prevents execution of the hardware query operation when the card is not online. In such case, ioctl() operation returns error with errno ENODEV. Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Eugene Crosser <Eugene.Crosser@ru.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
c24f337968
commit
511c24456a
@@ -5,17 +5,12 @@
|
||||
|
||||
#include <linux/slab.h>
|
||||
#include <asm/ebcdic.h>
|
||||
#include "qeth_core.h"
|
||||
#include "qeth_l2.h"
|
||||
|
||||
#define QETH_DEVICE_ATTR(_id, _name, _mode, _show, _store) \
|
||||
struct device_attribute dev_attr_##_id = __ATTR(_name, _mode, _show, _store)
|
||||
|
||||
static int qeth_card_hw_is_reachable(struct qeth_card *card)
|
||||
{
|
||||
return (card->state == CARD_STATE_SOFTSETUP) ||
|
||||
(card->state == CARD_STATE_UP);
|
||||
}
|
||||
|
||||
static ssize_t qeth_bridge_port_role_state_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf,
|
||||
int show_state)
|
||||
|
Reference in New Issue
Block a user