--- zzzz-none-000/linux-2.6.19.2/drivers/infiniband/core/cma.c 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5504/linux-2.6.19.2/drivers/infiniband/core/cma.c 2007-01-11 07:38:19.000000000 +0000 @@ -63,7 +63,6 @@ }; static struct ib_sa_client sa_client; -static struct rdma_addr_client addr_client; static LIST_HEAD(dev_list); static LIST_HEAD(listen_any_list); static DEFINE_MUTEX(lock); @@ -1626,8 +1625,8 @@ if (cma_any_addr(dst_addr)) ret = cma_resolve_loopback(id_priv); else - ret = rdma_resolve_ip(&addr_client, &id->route.addr.src_addr, - dst_addr, &id->route.addr.dev_addr, + ret = rdma_resolve_ip(&id->route.addr.src_addr, dst_addr, + &id->route.addr.dev_addr, timeout_ms, addr_handler, id_priv); if (ret) goto err; @@ -1763,29 +1762,22 @@ if (!cma_any_addr(addr)) { ret = rdma_translate_ip(addr, &id->route.addr.dev_addr); + if (!ret) { + mutex_lock(&lock); + ret = cma_acquire_dev(id_priv); + mutex_unlock(&lock); + } if (ret) - goto err1; - - mutex_lock(&lock); - ret = cma_acquire_dev(id_priv); - mutex_unlock(&lock); - if (ret) - goto err1; + goto err; } memcpy(&id->route.addr.src_addr, addr, ip_addr_size(addr)); ret = cma_get_port(id_priv); if (ret) - goto err2; + goto err; return 0; -err2: - if (!cma_any_addr(addr)) { - mutex_lock(&lock); - cma_detach_from_dev(id_priv); - mutex_unlock(&lock); - } -err1: +err: cma_comp_exch(id_priv, CMA_ADDR_BOUND, CMA_IDLE); return ret; } @@ -2218,7 +2210,6 @@ return -ENOMEM; ib_sa_register_client(&sa_client); - rdma_addr_register_client(&addr_client); ret = ib_register_client(&cma_client); if (ret) @@ -2226,7 +2217,6 @@ return 0; err: - rdma_addr_unregister_client(&addr_client); ib_sa_unregister_client(&sa_client); destroy_workqueue(cma_wq); return ret; @@ -2235,7 +2225,6 @@ static void cma_cleanup(void) { ib_unregister_client(&cma_client); - rdma_addr_unregister_client(&addr_client); ib_sa_unregister_client(&sa_client); destroy_workqueue(cma_wq); idr_destroy(&sdp_ps);