]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mwl8k: don't touch 'command done' interrupt during firmware load
authorLennert Buytenhek <buytenh@wantstofly.org>
Thu, 16 Jul 2009 10:44:45 +0000 (12:44 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Thu, 20 Aug 2009 15:38:06 +0000 (11:38 -0400)
Since firmware load commands don't generate 'command done' interrupts
like normal commands do, polling for command done interrupts just
unnecessarily slows down the firmware load process.  Removing this bit
of code speeds up loading a typical firmware image from 840 msec to
180 msec.

Signed-off-by: Lennert Buytenhek <buytenh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwl8k.c

index 5aa80420c0d134962a8bb5059e7938d1767a4220..cc0aa80ca8770c198f74047fafaa7f5d6561256a 100644 (file)
@@ -411,7 +411,6 @@ mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length)
 {
        void __iomem *regs = priv->regs;
        dma_addr_t dma_addr;
-       int rc;
        int loops;
 
        dma_addr = pci_map_single(priv->pdev, data, length, PCI_DMA_TODEVICE);
@@ -425,7 +424,6 @@ mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length)
        iowrite32(MWL8K_H2A_INT_DUMMY,
                regs + MWL8K_HIU_H2A_INTERRUPT_EVENTS);
 
-       rc = -ETIMEDOUT;
        loops = 1000;
        do {
                u32 int_code;
@@ -433,7 +431,6 @@ mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length)
                int_code = ioread32(regs + MWL8K_HIU_INT_CODE);
                if (int_code == MWL8K_INT_CODE_CMD_FINISHED) {
                        iowrite32(0, regs + MWL8K_HIU_INT_CODE);
-                       rc = 0;
                        break;
                }
 
@@ -442,26 +439,7 @@ mwl8k_send_fw_load_cmd(struct mwl8k_priv *priv, void *data, int length)
 
        pci_unmap_single(priv->pdev, dma_addr, length, PCI_DMA_TODEVICE);
 
-       /*
-        * Clear 'command done' interrupt bit.
-        */
-       loops = 1000;
-       do {
-               u32 status;
-
-               status = ioread32(priv->regs +
-                               MWL8K_HIU_A2H_INTERRUPT_STATUS);
-               if (status & MWL8K_A2H_INT_OPC_DONE) {
-                       iowrite32(~MWL8K_A2H_INT_OPC_DONE,
-                               priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS);
-                       ioread32(priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS);
-                       break;
-               }
-
-               udelay(1);
-       } while (--loops);
-
-       return rc;
+       return loops ? 0 : -ETIMEDOUT;
 }
 
 static int mwl8k_load_fw_image(struct mwl8k_priv *priv,