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: 9427943 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 8729360755 for ; Mon, 14 Nov 2016 16:36:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 84D0228A35 for ; Mon, 14 Nov 2016 16:36:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 785C828A48; Mon, 14 Nov 2016 16:36:15 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D40BF28A38 for ; Mon, 14 Nov 2016 16:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932849AbcKNQgN (ORCPT ); Mon, 14 Nov 2016 11:36:13 -0500 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33070 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932297AbcKNQf3 (ORCPT ); Mon, 14 Nov 2016 11:35:29 -0500 Received: by mail-lf0-f66.google.com with SMTP id 98so7490676lfs.0 for ; Mon, 14 Nov 2016 08:35:28 -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=GzsHLwury+NcF0yFTohS/MJgupvjoZ0A5rVxXxXGRfg0SENd+iEDtDv4b32S/fzxpT a1vdKE+zqpVWOCWeXxy3ZX2crMfurFkeKqAao03ns2QLUzfnzmHMmo2v8+1uarzqRrEE /rN7ooWfPyurStiDVaQxkzRM2CTDkfaaU7BIzaAvy5Ad2YgiEgnFltN8fSqyVqXCu0Ar LyciHu0CkuVzXs/rvPZPkT5ApY1rKBDWeHdeBUh2a1OtInvSovsEWzZ281a98cKi2i8P SouEyDMwF0M6hE8D4Kz1kkt9qCIiryB3g5tFFMFZkVa1r2U3g36gg1sv9npfYdCVZxw/ kIeg== X-Gm-Message-State: ABUngvdR4way6q3HeY6L3nHfhfcZEF4M6rxtJcmOySr4/2xy0Qyk2usrrfJN5xeZRjmkJg== 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 Cc: Erik Stromdahl 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> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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; }