qlcnic: fix caching window register
authorAmit Kumar Salecha <amit.salecha@qlogic.com>
Thu, 13 May 2010 03:07:44 +0000 (03:07 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 May 2010 10:06:54 +0000 (03:06 -0700)
o Window register is not per pci-func, so caching can
result in expected result.

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_hw.c
drivers/net/qlcnic/qlcnic_main.c

index 2fba9cd5946f0ba12ad39017a80e305dd071b3e7..cfedcbdd8c75a33c8bad8440f43db46a5f095ebd 100644 (file)
@@ -399,9 +399,6 @@ struct qlcnic_hardware_context {
 
        unsigned long pci_len0;
 
-       u32 ocm_win;
-       u32 crb_win;
-
        rwlock_t crb_lock;
        struct mutex mem_lock;
 
index 7a72b8d06bcbff55af9f219fcded0cda0f1c128d..0c2e1f08f4593af61350bf4bcd4d45452a27f4f4 100644 (file)
@@ -776,9 +776,6 @@ qlcnic_pci_set_crbwindow_2M(struct qlcnic_adapter *adapter, ulong off)
 
        window = CRB_HI(off);
 
-       if (adapter->ahw.crb_win == window)
-               return;
-
        writel(window, addr);
        if (readl(addr) != window) {
                if (printk_ratelimit())
@@ -786,7 +783,6 @@ qlcnic_pci_set_crbwindow_2M(struct qlcnic_adapter *adapter, ulong off)
                                "failed to set CRB window to %d off 0x%lx\n",
                                window, off);
        }
-       adapter->ahw.crb_win = window;
 }
 
 int
@@ -874,7 +870,6 @@ qlcnic_pci_set_window_2M(struct qlcnic_adapter *adapter,
        /* read back to flush */
        readl(adapter->ahw.ocm_win_crb);
 
-       adapter->ahw.ocm_win = window;
        *start = QLCNIC_PCI_OCM0_2M + GET_MEM_OFFS_2M(addr);
        return 0;
 }
index 3d90bb2fc7db4173580ada14f61c3b0c0a6dcd12..bd6730e53fd0cc9e14a8e4d82b39dccd3cdd7a8c 100644 (file)
@@ -517,13 +517,6 @@ qlcnic_setup_pci_map(struct qlcnic_adapter *adapter)
        struct pci_dev *pdev = adapter->pdev;
        int pci_func = adapter->ahw.pci_func;
 
-       /*
-        * Set the CRB window to invalid. If any register in window 0 is
-        * accessed it should set the window to 0 and then reset it to 1.
-        */
-       adapter->ahw.crb_win = -1;
-       adapter->ahw.ocm_win = -1;
-
        /* remap phys address */
        mem_base = pci_resource_start(pdev, 0); /* 0 is for BAR 0 */
        mem_len = pci_resource_len(pdev, 0);
@@ -1311,9 +1304,6 @@ qlcnic_resume(struct pci_dev *pdev)
        pci_set_master(pdev);
        pci_restore_state(pdev);
 
-       adapter->ahw.crb_win = -1;
-       adapter->ahw.ocm_win = -1;
-
        err = qlcnic_start_firmware(adapter);
        if (err) {
                dev_err(&pdev->dev, "failed to start firmware\n");