]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
RDMA/nes: Fix adapter reset after PXE boot
authorChien Tung <ctung@neteffect.com>
Sun, 27 Apr 2008 18:35:11 +0000 (18:35 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 May 2008 21:44:38 +0000 (14:44 -0700)
commit: bc5698f3ecc9587e1edb343a2878f8d228c49e0e upstream

After PXE boot, the iw_nes driver does a full reset to ensure the card
is in a clean state.  However, it doesn't wait for firmware to
complete its work before issuing a port reset to enable the ports,
which leads to problems bringing up the ports.

The solution is to wait for firmware to complete its work before
proceeding with port reset.

This bug was flagged by Roland Dreier <rolandd@cisco.com>.

Signed-off-by: Chien Tung <ctung@neteffect.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/infiniband/hw/nes/nes_cm.c
drivers/infiniband/hw/nes/nes_hw.c

index 0bef878e0f65f67ff13a4eeddd711938f5bb44b5..96b1a0effee9a021fd517f137f7ee843c914890b 100644 (file)
@@ -1834,8 +1834,10 @@ int mini_cm_recv_pkt(struct nes_cm_core *cm_core, struct nes_vnic *nesvnic,
        nfo.rem_addr = ntohl(iph->saddr);
        nfo.rem_port = ntohs(tcph->source);
 
-       nes_debug(NES_DBG_CM, "Received packet: dest=0x%08X:0x%04X src=0x%08X:0x%04X\n",
-                       iph->daddr, tcph->dest, iph->saddr, tcph->source);
+       nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT
+                 ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n",
+                 NIPQUAD(iph->daddr), tcph->dest,
+                 NIPQUAD(iph->saddr), tcph->source);
 
        /* note: this call is going to increment cm_node ref count */
        cm_node = find_node(cm_core,
index 49e53e4c1ebef475bf5337bb346472c98a8ec72f..496655e176b83f753ca1f47a488260250c4bc880 100644 (file)
@@ -625,6 +625,15 @@ unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode)
                        nes_debug(NES_DBG_INIT, "Did not see full soft reset done.\n");
                        return 0;
                }
+
+               i = 0;
+               while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000)
+                       mdelay(1);
+               if (i >= 10000) {
+                       printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n",
+                              nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS));
+                       return 0;
+               }
        }
 
        /* port reset */
@@ -673,17 +682,6 @@ unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_Mode)
                }
        }
 
-
-
-       i = 0;
-       while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000)
-               mdelay(1);
-       if (i >= 10000) {
-               printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n",
-                               nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS));
-               return 0;
-       }
-
        return port_count;
 }