From patchwork Fri Nov 18 19:22:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Stromdahl X-Patchwork-Id: 9437239 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 51E7660238 for ; Fri, 18 Nov 2016 19:24:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 49C0B29900 for ; Fri, 18 Nov 2016 19:24:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E87A299D3; Fri, 18 Nov 2016 19:24:49 +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 673EA29900 for ; Fri, 18 Nov 2016 19:24:44 +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 1c7om4-0006Fi-Vc; Fri, 18 Nov 2016 19:24:36 +0000 Received: from mail-qk0-x244.google.com ([2607:f8b0:400d:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c7om1-0005vW-IW for ath10k@lists.infradead.org; Fri, 18 Nov 2016 19:24:34 +0000 Received: by mail-qk0-x244.google.com with SMTP id h201so34193727qke.3 for ; Fri, 18 Nov 2016 11:24:15 -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=NFRgb6CxmLe3MwOivt6/EKyvKI143VmqEt+Q2PLJook=; b=C2lG5hdQlcYyMu69MmvwJ7t1X/JhLIPbTDD/s9gha8zhK9tO9qFxPnEbVqPkLB1mEf pMO2Rw7N2rS7Xyq7pXtjYlXdSPdv214Zz+uor0+YpmKe34HjVOYc++CBwm7LoIZlbIrk yod/X8WvjKa9SDV1HT3DnwO7Xu0DHwdCEQH6O9DgNCOjAUw91KRhdA9jWrrJRG4sGYI3 N3kG7g+RmYxBdxptiUIwedfDgojEGQHWnj/J8cBpanNK0KQNWf/MSJEL7WNVi+e9PZXh dBQB8tWzxXSEwofjgmCd6GqYBvBmUmlP+QiG/w/gThZY9FCi21XJpSokBulBnAApa8BW 4uzQ== 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=NFRgb6CxmLe3MwOivt6/EKyvKI143VmqEt+Q2PLJook=; b=cPhi0ulemTU2bnVvxPVxv7GJZO1GEwdaoeqdb90hjZMlwmoerAOixYN6cVBEjcHQc9 6gFmI4ghlC4YsAp9r4YJf4zwHx1XZDS/nVddOTqWPdEFGoz22dl41WjImurMNYrqs4Vs tLQOOruw06dft/QGzLHEMaF5PhJ0XgcTqxNP8zYoD6/NlRcvVYcR/MQBMxPS1u4I+JKu 9zLkXJlveJ6G12QEOSCKcSMogLdKslS3VqMXx2nbwODC6ZrTBLbdoHgce30f3ziZSLra AIxgP0IzePPUYNRN+jkudTpkAHeU0Kb6C0d/+eHEL2J0cEAzsVVF0jOs2vU7G9fF3Klo mQhQ== X-Gm-Message-State: AKaTC00EzK4U6iHG8jXCRtaVR2lA4aTbQhphOM/0WpWceY+YLNi/+id859yNapJSwjMk8A== X-Received: by 10.46.9.129 with SMTP id 123mr805395ljj.20.1479497054804; Fri, 18 Nov 2016 11:24:14 -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 23sm2623298ljf.48.2016.11.18.11.24.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Nov 2016 11:24:14 -0800 (PST) From: Erik Stromdahl To: kvalo@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Subject: [RFC v2 04/11] ath10k: htc: Changed order of wait target and ep connect Date: Fri, 18 Nov 2016 20:22:44 +0100 Message-Id: <1479496971-19174-5-git-send-email-erik.stromdahl@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1479496971-19174-1-git-send-email-erik.stromdahl@gmail.com> References: <1479496971-19174-1-git-send-email-erik.stromdahl@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161118_112433_746319_ADD383AA X-CRM114-Status: GOOD ( 13.28 ) 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 message. The HTC ready message contains the total number of transmit credits the driver can distribute between endpoints. Since the HTC control service does not use any flow control it is not necessary to wait for the ready message before connecting the service. There will be no credits assigned to this service anyway. Besides, connecting the HTC control service does not yield any bus traffic at all. The ready message will always be transmitted on endpoint 0 (which is always assigned to the HTC control service) so it makes more sense if HTC control has been connected before the ready message is received. 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 79d44de..6ff5837 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; }