aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/nes
diff options
context:
space:
mode:
authorChien Tung <ctung@neteffect.com>2008-04-23 14:55:45 -0400
committerRoland Dreier <rolandd@cisco.com>2008-04-23 14:55:45 -0400
commitbc5698f3ecc9587e1edb343a2878f8d228c49e0e (patch)
tree3f16097356e04c4b023d31ee920e6804fe57ecce /drivers/infiniband/hw/nes
parente447703123d817b3f802c6eb69171d5342c8832e (diff)
RDMA/nes: Fix adapter reset after PXE boot
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>. Cc: <stable@kernel.org> Signed-off-by: Chien Tung <ctung@neteffect.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/nes')
-rw-r--r--drivers/infiniband/hw/nes/nes_cm.c6
-rw-r--r--drivers/infiniband/hw/nes/nes_hw.c20
2 files changed, 13 insertions, 13 deletions
diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
index 38ea14cc7077..d940fc27129a 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1849,8 +1849,10 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core, struct nes_vnic *nesvni
1849 nfo.rem_addr = ntohl(iph->saddr); 1849 nfo.rem_addr = ntohl(iph->saddr);
1850 nfo.rem_port = ntohs(tcph->source); 1850 nfo.rem_port = ntohs(tcph->source);
1851 1851
1852 nes_debug(NES_DBG_CM, "Received packet: dest=0x%08X:0x%04X src=0x%08X:0x%04X\n", 1852 nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT
1853 iph->daddr, tcph->dest, iph->saddr, tcph->source); 1853 ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n",
1854 NIPQUAD(iph->daddr), tcph->dest,
1855 NIPQUAD(iph->saddr), tcph->source);
1854 1856
1855 /* note: this call is going to increment cm_node ref count */ 1857 /* note: this call is going to increment cm_node ref count */
1856 cm_node = find_node(cm_core, 1858 cm_node = find_node(cm_core,
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index aa53aab91bf8..08964cc7e98a 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -636,6 +636,15 @@ static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_
636 nes_debug(NES_DBG_INIT, "Did not see full soft reset done.\n"); 636 nes_debug(NES_DBG_INIT, "Did not see full soft reset done.\n");
637 return 0; 637 return 0;
638 } 638 }
639
640 i = 0;
641 while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000)
642 mdelay(1);
643 if (i >= 10000) {
644 printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n",
645 nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS));
646 return 0;
647 }
639 } 648 }
640 649
641 /* port reset */ 650 /* port reset */
@@ -684,17 +693,6 @@ static unsigned int nes_reset_adapter_ne020(struct nes_device *nesdev, u8 *OneG_
684 } 693 }
685 } 694 }
686 695
687
688
689 i = 0;
690 while ((nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS) != 0x80) && i++ < 10000)
691 mdelay(1);
692 if (i >= 10000) {
693 printk(KERN_ERR PFX "Internal CPU not ready, status = %02X\n",
694 nes_read_indexed(nesdev, NES_IDX_INT_CPU_STATUS));
695 return 0;
696 }
697
698 return port_count; 696 return port_count;
699} 697}
700 698