From patchwork Mon Nov 14 16:33:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9427951 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B56560471 for ; Mon, 14 Nov 2016 16:36:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8803428A35 for ; Mon, 14 Nov 2016 16:36:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7CFD328A49; Mon, 14 Nov 2016 16:36:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 25D4128A35 for ; Mon, 14 Nov 2016 16:36:28 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6KF5-0000lt-4H; Mon, 14 Nov 2016 16:36:23 +0000 Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6KEX-0000Rc-Iy for ath10k@lists.infradead.org; Mon, 14 Nov 2016 16:35:52 +0000 Received: by mail-lf0-x242.google.com with SMTP id o141so7513455lff.1 for ; Mon, 14 Nov 2016 08:35:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O20ytevmI4hvPhWeAY8oIR/u4plIMdLcgCqYUatjuaI=; b=I+/I7RmSfYvlzpQEjOHpmEBpTuoU8DmzvsyklugjtQwMMk/LWbC88VuCnDphBcB29I Lv90GITKo9xfFn96hIojV1vr0ru6FArNN4GGT92M3DgXPzexsGkCKvOPUHFg1jMlazXZ cZV+SUqPafpNsadqC14CUVpq+CAk7FGEoKmrhrgKLO1xiBtNb+6STxgPqxb84GIgE0f0 YYw3mR115IVq1M/UANJtCWxgrmdulj6RCJUQXfPAV8ELZmUW/kBeFpmvPJQ1VkrSFsBU hSCLEX6exhjGsI4Aobd9Xi0MKq9bwXACK8X9LC+hM1N9wre7mBPPp7azLoXuOHG/JAoW GeDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O20ytevmI4hvPhWeAY8oIR/u4plIMdLcgCqYUatjuaI=; b=DQ28GM8VsdZfAu82GGllUdRzdFTUlmSPkmA2fh5nRbOTFOssuuvuHTMr9Lx1bIzgCT zLuBN0FfYfUuLoJEJ+6kcZrtxeLRAldj27aUvniQ/hTO3lwebrPw1Rk9LW4rGZt31Deh pNA2ag3SZXJrU4nAf+8h2iHJnOmTOXy/gNC4M9bSEu1f3MUiETkIDwGBqXG5oJ2Cf5jB T+t1sHtghRJPGjZbGuwYilPo5KMZZRZ+WZqHPF8b8kFBMza/qwtR9YKOHm9cqHw+RljF 0QJDLYzZJ8abi+x+Af3iRJ7kraKJiNdTbElAK3OCuQX+0Xsy5wmwOJVofH2fnxMk5R5d /Ujw== X-Gm-Message-State: ABUngvecS2Deig7MY/MO4+HbIOsagHJFCg7VZHSvUkoflDCuKP8Yh9rsEbhL9ifPsVjqGg== X-Received: by 10.25.20.199 with SMTP id 68mr8985068lfu.111.1479141327410; Mon, 14 Nov 2016 08:35:27 -0800 (PST) Received: from erik-desktop.lan (81-233-218-8-no25.tbcn.telia.com. [81.233.218.8]) by smtp.gmail.com with ESMTPSA id w67sm5105849lff.16.2016.11.14.08.35.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 08:35:26 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC 03/12] ath10k: htc: Changed order of wait target and ep connect Date: Mon, 14 Nov 2016 17:33:33 +0100 Message-Id: <1479141222-8493-4-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1479141222-8493-1-git-send-email-erik.stromdahl@gmail.com> References: <1479141222-8493-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161114_083550_027582_5B526207 X-CRM114-Status: GOOD ( 11.89 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Erik Stromdahl MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch changes the order in which the driver waits for the target to become ready and the service connect of the HTC control service. The HTC control service is connected before the driver starts waiting for the HTC ready control message. The reason for this is that the HTC ready control message is transmitted on EP 0 and that sdio/mbox based systems will ignore messages received on unconnected endpoints. Signed-off-by: Erik Stromdahl --- drivers/net/wireless/ath/ath10k/htc.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/htc.c b/drivers/net/wireless/ath/ath10k/htc.c index e3f7bf4..7257366 100644 --- a/drivers/net/wireless/ath/ath10k/htc.c +++ b/drivers/net/wireless/ath/ath10k/htc.c @@ -606,6 +606,22 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) u16 credit_count; u16 credit_size; + /* setup our pseudo HTC control endpoint connection */ + memset(&conn_req, 0, sizeof(conn_req)); + memset(&conn_resp, 0, sizeof(conn_resp)); + conn_req.ep_ops.ep_tx_complete = ath10k_htc_control_tx_complete; + conn_req.ep_ops.ep_rx_complete = ath10k_htc_control_rx_complete; + conn_req.max_send_queue_depth = ATH10K_NUM_CONTROL_TX_BUFFERS; + conn_req.service_id = ATH10K_HTC_SVC_ID_RSVD_CTRL; + + /* connect fake service */ + status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp); + if (status) { + ath10k_err(ar, "could not connect to htc service (%d)\n", + status); + return status; + } + time_left = wait_for_completion_timeout(&htc->ctl_resp, ATH10K_HTC_WAIT_TIMEOUT_HZ); if (!time_left) { @@ -665,22 +681,6 @@ int ath10k_htc_wait_target(struct ath10k_htc *htc) ath10k_htc_setup_target_buffer_assignments(htc); - /* setup our pseudo HTC control endpoint connection */ - memset(&conn_req, 0, sizeof(conn_req)); - memset(&conn_resp, 0, sizeof(conn_resp)); - conn_req.ep_ops.ep_tx_complete = ath10k_htc_control_tx_complete; - conn_req.ep_ops.ep_rx_complete = ath10k_htc_control_rx_complete; - conn_req.max_send_queue_depth = ATH10K_NUM_CONTROL_TX_BUFFERS; - conn_req.service_id = ATH10K_HTC_SVC_ID_RSVD_CTRL; - - /* connect fake service */ - status = ath10k_htc_connect_service(htc, &conn_req, &conn_resp); - if (status) { - ath10k_err(ar, "could not connect to htc service (%d)\n", - status); - return status; - } - return 0; }