diff options
author | Rajesh Borundia <rajesh.borundia@qlogic.com> | 2010-11-22 20:25:21 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-28 13:47:16 -0500 |
commit | b0044bcfa95ddf2e317863fb29121c284b6725ca (patch) | |
tree | ced7b7d4d06ab51fa3bcdfe19a5191e380e85e52 /drivers/net | |
parent | 5584b8078a60e34ec7d37c9b67a0f3d389a1a2f6 (diff) |
qlcnic: avoid using reset_devices as it may become obsolete.
In kdump environment do not depend upon reset_devices parameter
to reset the pci function as this parameter may become obsolete.
Instead use an adapter specific mechanism to determine if the pci
function needs to be reset.
Per function refcount is maintained in driver, which is set in probe
and reset in remove handler of adapter. If the probe detects the count
as non zero then reset the function.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/qlcnic/qlcnic.h | 1 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_ctx.c | 4 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_hdr.h | 2 | ||||
-rw-r--r-- | drivers/net/qlcnic/qlcnic_main.c | 5 |
4 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h index 56f54ffabb2f..9513a83b9537 100644 --- a/drivers/net/qlcnic/qlcnic.h +++ b/drivers/net/qlcnic/qlcnic.h | |||
@@ -923,6 +923,7 @@ struct qlcnic_ipaddr { | |||
923 | #define QLCNIC_MACSPOOF 0x200 | 923 | #define QLCNIC_MACSPOOF 0x200 |
924 | #define QLCNIC_MAC_OVERRIDE_DISABLED 0x400 | 924 | #define QLCNIC_MAC_OVERRIDE_DISABLED 0x400 |
925 | #define QLCNIC_PROMISC_DISABLED 0x800 | 925 | #define QLCNIC_PROMISC_DISABLED 0x800 |
926 | #define QLCNIC_NEED_FLR 0x1000 | ||
926 | #define QLCNIC_IS_MSI_FAMILY(adapter) \ | 927 | #define QLCNIC_IS_MSI_FAMILY(adapter) \ |
927 | ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) | 928 | ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED)) |
928 | 929 | ||
diff --git a/drivers/net/qlcnic/qlcnic_ctx.c b/drivers/net/qlcnic/qlcnic_ctx.c index 3ad1f3eba289..29cbc2a6e79f 100644 --- a/drivers/net/qlcnic/qlcnic_ctx.c +++ b/drivers/net/qlcnic/qlcnic_ctx.c | |||
@@ -480,8 +480,10 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *adapter) | |||
480 | { | 480 | { |
481 | int err; | 481 | int err; |
482 | 482 | ||
483 | if (reset_devices) | 483 | if (adapter->flags & QLCNIC_NEED_FLR) { |
484 | pci_reset_function(adapter->pdev); | 484 | pci_reset_function(adapter->pdev); |
485 | adapter->flags &= ~QLCNIC_NEED_FLR; | ||
486 | } | ||
485 | 487 | ||
486 | err = qlcnic_fw_cmd_create_rx_ctx(adapter); | 488 | err = qlcnic_fw_cmd_create_rx_ctx(adapter); |
487 | if (err) | 489 | if (err) |
diff --git a/drivers/net/qlcnic/qlcnic_hdr.h b/drivers/net/qlcnic/qlcnic_hdr.h index 4290b80cde1a..566e0e8437e4 100644 --- a/drivers/net/qlcnic/qlcnic_hdr.h +++ b/drivers/net/qlcnic/qlcnic_hdr.h | |||
@@ -722,7 +722,7 @@ enum { | |||
722 | #define QLCNIC_DEV_NPAR_OPER 1 /* NPAR Operational */ | 722 | #define QLCNIC_DEV_NPAR_OPER 1 /* NPAR Operational */ |
723 | #define QLCNIC_DEV_NPAR_OPER_TIMEO 30 /* Operational time out */ | 723 | #define QLCNIC_DEV_NPAR_OPER_TIMEO 30 /* Operational time out */ |
724 | 724 | ||
725 | #define QLC_DEV_CHECK_ACTIVE(VAL, FN) ((VAL) &= (1 << (FN * 4))) | 725 | #define QLC_DEV_CHECK_ACTIVE(VAL, FN) ((VAL) & (1 << (FN * 4))) |
726 | #define QLC_DEV_SET_REF_CNT(VAL, FN) ((VAL) |= (1 << (FN * 4))) | 726 | #define QLC_DEV_SET_REF_CNT(VAL, FN) ((VAL) |= (1 << (FN * 4))) |
727 | #define QLC_DEV_CLR_REF_CNT(VAL, FN) ((VAL) &= ~(1 << (FN * 4))) | 727 | #define QLC_DEV_CLR_REF_CNT(VAL, FN) ((VAL) &= ~(1 << (FN * 4))) |
728 | #define QLC_DEV_SET_RST_RDY(VAL, FN) ((VAL) |= (1 << (FN * 4))) | 728 | #define QLC_DEV_SET_RST_RDY(VAL, FN) ((VAL) |= (1 << (FN * 4))) |
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c index a3dcd04be22f..899df5a81fda 100644 --- a/drivers/net/qlcnic/qlcnic_main.c +++ b/drivers/net/qlcnic/qlcnic_main.c | |||
@@ -1485,6 +1485,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1485 | uint8_t revision_id; | 1485 | uint8_t revision_id; |
1486 | uint8_t pci_using_dac; | 1486 | uint8_t pci_using_dac; |
1487 | char brd_name[QLCNIC_MAX_BOARD_NAME_LEN]; | 1487 | char brd_name[QLCNIC_MAX_BOARD_NAME_LEN]; |
1488 | u32 val; | ||
1488 | 1489 | ||
1489 | err = pci_enable_device(pdev); | 1490 | err = pci_enable_device(pdev); |
1490 | if (err) | 1491 | if (err) |
@@ -1546,6 +1547,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1546 | if (err) | 1547 | if (err) |
1547 | goto err_out_iounmap; | 1548 | goto err_out_iounmap; |
1548 | 1549 | ||
1550 | val = QLCRD32(adapter, QLCNIC_CRB_DRV_ACTIVE); | ||
1551 | if (QLC_DEV_CHECK_ACTIVE(val, adapter->portnum)) | ||
1552 | adapter->flags |= QLCNIC_NEED_FLR; | ||
1553 | |||
1549 | err = adapter->nic_ops->start_firmware(adapter); | 1554 | err = adapter->nic_ops->start_firmware(adapter); |
1550 | if (err) { | 1555 | if (err) { |
1551 | dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n"); | 1556 | dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n"); |