]> rtime.felk.cvut.cz Git - linux-imx.git/commitdiff
qlcnic: avoid using reset_devices as it may become obsolete.
authorRajesh Borundia <rajesh.borundia@qlogic.com>
Tue, 23 Nov 2010 01:25:21 +0000 (01:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 28 Nov 2010 18:47:16 +0000 (10:47 -0800)
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>
drivers/net/qlcnic/qlcnic.h
drivers/net/qlcnic/qlcnic_ctx.c
drivers/net/qlcnic/qlcnic_hdr.h
drivers/net/qlcnic/qlcnic_main.c

index 56f54ffabb2fb27df75599ea03208510d4c81ac6..9513a83b9537ddef77edf1a497592183b5540c0a 100644 (file)
@@ -923,6 +923,7 @@ struct qlcnic_ipaddr {
 #define QLCNIC_MACSPOOF                        0x200
 #define QLCNIC_MAC_OVERRIDE_DISABLED   0x400
 #define QLCNIC_PROMISC_DISABLED                0x800
+#define QLCNIC_NEED_FLR                        0x1000
 #define QLCNIC_IS_MSI_FAMILY(adapter) \
        ((adapter)->flags & (QLCNIC_MSI_ENABLED | QLCNIC_MSIX_ENABLED))
 
index 3ad1f3eba289441e43d6db49721c8ac3a4e862c9..29cbc2a6e79f61c9d37e86675a2597dba58ac6aa 100644 (file)
@@ -480,8 +480,10 @@ int qlcnic_fw_create_ctx(struct qlcnic_adapter *adapter)
 {
        int err;
 
-       if (reset_devices)
+       if (adapter->flags & QLCNIC_NEED_FLR) {
                pci_reset_function(adapter->pdev);
+               adapter->flags &= ~QLCNIC_NEED_FLR;
+       }
 
        err = qlcnic_fw_cmd_create_rx_ctx(adapter);
        if (err)
index 4290b80cde1ad5b179e241f1576e8c2648e83709..566e0e8437e4f96922e5a505d555e8370da74765 100644 (file)
@@ -722,7 +722,7 @@ enum {
 #define QLCNIC_DEV_NPAR_OPER           1 /* NPAR Operational */
 #define QLCNIC_DEV_NPAR_OPER_TIMEO     30 /* Operational time out */
 
-#define QLC_DEV_CHECK_ACTIVE(VAL, FN)          ((VAL) &= (1 << (FN * 4)))
+#define QLC_DEV_CHECK_ACTIVE(VAL, FN)          ((VAL) & (1 << (FN * 4)))
 #define QLC_DEV_SET_REF_CNT(VAL, FN)           ((VAL) |= (1 << (FN * 4)))
 #define QLC_DEV_CLR_REF_CNT(VAL, FN)           ((VAL) &= ~(1 << (FN * 4)))
 #define QLC_DEV_SET_RST_RDY(VAL, FN)           ((VAL) |= (1 << (FN * 4)))
index a3dcd04be22f6291e2546f84e474cef31e7fae34..899df5a81fda395e548cbf484209d5b0a2874ae5 100644 (file)
@@ -1485,6 +1485,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        uint8_t revision_id;
        uint8_t pci_using_dac;
        char brd_name[QLCNIC_MAX_BOARD_NAME_LEN];
+       u32 val;
 
        err = pci_enable_device(pdev);
        if (err)
@@ -1546,6 +1547,10 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        if (err)
                goto err_out_iounmap;
 
+       val = QLCRD32(adapter, QLCNIC_CRB_DRV_ACTIVE);
+       if (QLC_DEV_CHECK_ACTIVE(val, adapter->portnum))
+               adapter->flags |= QLCNIC_NEED_FLR;
+
        err = adapter->nic_ops->start_firmware(adapter);
        if (err) {
                dev_err(&pdev->dev, "Loading fw failed.Please Reboot\n");