From patchwork Wed Jun 20 08:42:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 10476637 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 477C460230 for ; Wed, 20 Jun 2018 09:03:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 30018212BE for ; Wed, 20 Jun 2018 09:03:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2296428628; Wed, 20 Jun 2018 09:03:22 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable 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 D0F35212BE for ; Wed, 20 Jun 2018 09:03:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932638AbeFTImf (ORCPT ); Wed, 20 Jun 2018 04:42:35 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:34497 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877AbeFTImd (ORCPT ); Wed, 20 Jun 2018 04:42:33 -0400 Received: by mail-lf0-f67.google.com with SMTP id e13-v6so3401790lfc.1 for ; Wed, 20 Jun 2018 01:42:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=JKpvz3vtYdohxjtXmtyo5SjzMcz9c7S9E23fQ5xXab4=; b=QAinP0cUkQ5zt0rvGHnPqm8C19pbEnTgsOdE7o40ZdxvOw2oQcLgAOSxwX6DLHAuuY QykZ2tKUcx1FH0YkKELwREaH3E4p62NCXRQCX84610BJLQSwnfqxHsrpK1pioz3YvOm7 oV89YuUoBTNtuVg0sY8Ow276CNIH9u0+NeMZY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=JKpvz3vtYdohxjtXmtyo5SjzMcz9c7S9E23fQ5xXab4=; b=ogedAqkNge98ODCfHj63RIYeFfXVewqUqNaXvISXjUzK30wymdON8M4yf+1bd3i8Kj e5iPK3nU4YfkwpCKC981oQx+TvlMrpC/2nvUQLW2dz1mJBZ3sIuBjLL4iRdstC0jsnRr ycobl/LvwMIwFgVTuTjMuNnBOWdxCEJsts7Rw5/YvjXP0SYqiiSQ2pSRH35IMLwq6X4/ B0CMM7oGwomNE5Rxv7jIJ/ND0nuSmoB8mOafAHvmlTp3Kb37SoXfxx+1nJePfnRQw7nP Mf2mpB/bHc0oAKZuKKu87FceR8J1n6FuIi19DdrsdNG25Y+ubuq/DjonVlYc1A2iycpL 35Hw== X-Gm-Message-State: APt69E36HvzwPrWziOlz7oWoZBtopI3sdODWIHb7xJ8myBT8M0E1nSfY SGfg/ny7UQFb/+q0hrTa1+t6lg== X-Google-Smtp-Source: ADUXVKIErsU8106cF3yhAARbMNfvZR03AIjYYlG+OfmTWkM5BZCvGZkfQnP3XZecKt9E8j+VfkwfOg== X-Received: by 2002:a2e:7a0f:: with SMTP id v15-v6mr14038227ljc.68.1529484151743; Wed, 20 Jun 2018 01:42:31 -0700 (PDT) Received: from centauri.lan (h-229-118.A785.priv.bahnhof.se. [5.150.229.118]) by smtp.gmail.com with ESMTPSA id l25-v6sm301267ljj.30.2018.06.20.01.42.30 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 01:42:31 -0700 (PDT) From: Niklas Cassel To: Kalle Valo , "David S. Miller" Cc: alagusankar@silex-india.com, Niklas Cassel , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] ath10k: sdio: use same endpoint id for all packets in a bundle Date: Wed, 20 Jun 2018 10:42:20 +0200 Message-Id: <20180620084222.3521-2-niklas.cassel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180620084222.3521-1-niklas.cassel@linaro.org> References: <20180620084222.3521-1-niklas.cassel@linaro.org> 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 All packets in a bundle should use the same endpoint id as the first lookahead. This matches how things are done is ath6kl, however, this patch can theoretically handle several bundles in ath10k_sdio_mbox_rx_process_packets(). Without this patch we get lots of errors about invalid endpoint id: ath10k_sdio mmc2:0001:1: invalid endpoint in look-ahead: 224 ath10k_sdio mmc2:0001:1: failed to get pending recv messages: -12 ath10k_sdio mmc2:0001:1: failed to process pending SDIO interrupts: -12 Signed-off-by: Alagu Sankar Signed-off-by: Niklas Cassel --- drivers/net/wireless/ath/ath10k/sdio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index d612ce8c9cff..d46523b0472c 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -434,12 +434,14 @@ static int ath10k_sdio_mbox_rx_process_packets(struct ath10k *ar, enum ath10k_htc_ep_id id; int ret, i, *n_lookahead_local; u32 *lookaheads_local; + int lookahead_idx = 0; for (i = 0; i < ar_sdio->n_rx_pkts; i++) { lookaheads_local = lookaheads; n_lookahead_local = n_lookahead; - id = ((struct ath10k_htc_hdr *)&lookaheads[i])->eid; + id = ((struct ath10k_htc_hdr *) + &lookaheads[lookahead_idx++])->eid; if (id >= ATH10K_HTC_EP_COUNT) { ath10k_warn(ar, "invalid endpoint in look-ahead: %d\n", @@ -462,6 +464,7 @@ static int ath10k_sdio_mbox_rx_process_packets(struct ath10k *ar, /* Only read lookahead's from RX trailers * for the last packet in a bundle. */ + lookahead_idx--; lookaheads_local = NULL; n_lookahead_local = NULL; }