From patchwork Wed Jun 20 08:42:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Cassel X-Patchwork-Id: 10476471 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 3EA0E60383 for ; Wed, 20 Jun 2018 08:43:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EC1828BD5 for ; Wed, 20 Jun 2018 08:43:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2349928D1F; Wed, 20 Jun 2018 08:43:08 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AAFD028BD5 for ; Wed, 20 Jun 2018 08:43:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=DHP9IsNsdwJJASo6+zR49Y+Vlenko8gxuLAuuNuWtic=; b=Kgmz+Z36aySTMkeCnZpTuWQOhY v2oRoQxeLnVzsG1YWe1teaW3tSF7Dk6lFqtnK2QNxB+wWDni3xb1TdYWhMeigP1pkryZwN9fm8viA DOtbtoVgJVZ8d4M5K+bb+ViPSq//223YRFu05HBKRzJ3bR+drtcDJg3e7BbL+BqXFrbnsQ7I+y4eK nnNhS7PAzzk/KGXlwLGm9xI1QlkHaJQl1zyVzlI6PIfJ2dA761NA5x/pM9/MMbukzgMIKGVMZUgV5 M2gDOIkQHop8D9sqblOfUB3WpacGt8/gHzz4coWwAkObB1Tz1hpeiDpL+zDGyx8H1ARFHTymvorBb AFQa68bQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVYhY-00040E-Kq; Wed, 20 Jun 2018 08:42:52 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVYhV-0003zb-4j for ath10k@bombadil.infradead.org; Wed, 20 Jun 2018 08:42:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=sYHap52ZFvU1YoFIXSmQWxFDIVLNqxp0/nUZxn+RUiA=; b=TMmTSMPl9Gb7Xbny623N3b7qr khF4KhCR41fSrkP9kHxwnGPxMBR3TENGstYhb0urBpSTjWHDq4PWM/kZc6eA733lX7uOyo0zgzsjn I0pE3RKJ5BoJ3jASMdLgnCROalLhFJi7qvHH8CUygdeVr4SpvdQTJXwpLsj7CyUPPOTkGtdxRZCj3 ecVIIwAHmfxkvKNbejw7PQ/AcDZJWdLnEipKEcNEi0XXKKYVDFsEhp3mLWC9VYVAfLpunotziCU0A jnsct3c85bmKUbdAzNBi84NMOTbaYtC31oSezGNW2O20nGubJBtwu5UnzyyCRLVLZ22j5tb4ZkmJA LAf6+B/NQ==; Received: from mail-lf0-x242.google.com ([2a00:1450:4010:c07::242]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVYhR-0000hc-Eh for ath10k@lists.infradead.org; Wed, 20 Jun 2018 08:42:46 +0000 Received: by mail-lf0-x242.google.com with SMTP id n24-v6so3707714lfh.3 for ; Wed, 20 Jun 2018 01:42:34 -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=sYHap52ZFvU1YoFIXSmQWxFDIVLNqxp0/nUZxn+RUiA=; b=U9JM/8RwFdaS17LbpXbCXWptnGIcJfe/tM6C3jZ8qTPndyZ8spk0st/f+uDaJZJSUK 4mZTRvU1j0Dad0HcGPnujz9k7ehPn3X6h0mpwaLQTIlmiCg17xIMdai+vLRVfwdahnmQ QYq6etRoMjhxGn9BWsFx8Mhw9VsSHe5YlTqnk= 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=sYHap52ZFvU1YoFIXSmQWxFDIVLNqxp0/nUZxn+RUiA=; b=WmIZwZ7kRBl3XsRs2vMLNgNzueijKLVTB5R3OuptXkGmNpQCZVnC0vW8+Y8Rv3L8cx WeZK0wzhmkyKsOHdZNbqK3ByNm6EWC7WWZ9i+yOrBrpBnht54WDMU+72I/TNG0WTc4mV P/Pkdjy7gJv0bX1w/78Pe2bvz+H/hP/69E4EeMnHXtvIEpA6NK7CtT5k6f4IHNyKqZbR vKq2YNHEXJjKd3XbGK5hquibf80dXOYLuvd278pUYbIK7WHqjx83OWh2LSGHl/xlCIuA 4iTwX7xXZJgIHAe+vbt+tABQGRly9Bf6g26/kH9a0wS7JdXNPwvNC3g6TtFzRfjVVeyk vi8g== X-Gm-Message-State: APt69E0RZK3+Ujd+lNJX1vRQiQz/nM6c/LwYb5Ttpd8BPCniKpU4f5EB Hx/cn0SDV74zutyvs0l089btvg== X-Google-Smtp-Source: ADUXVKJWpHxRqCeghmtVb9Fae9OZh1TCsprzeURFGjtiKnumr9YTr4okShMqAtm7ARrgrTsHcP+s3g== X-Received: by 2002:a2e:3011:: with SMTP id w17-v6mr14437016ljw.20.1529484153062; Wed, 20 Jun 2018 01:42:33 -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.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Jun 2018 01:42:32 -0700 (PDT) From: Niklas Cassel To: Kalle Valo , "David S. Miller" Subject: [PATCH 2/3] ath10k: sdio: allocate correct size for RECV_1MORE_BLOCK rx packets Date: Wed, 20 Jun 2018 10:42:21 +0200 Message-Id: <20180620084222.3521-3-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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180620_044245_524757_3478DB32 X-CRM114-Status: GOOD ( 11.72 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alagusankar@silex-india.com, netdev@vger.kernel.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, ath10k@lists.infradead.org, Niklas Cassel MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Without this, when receiving a packet that has this flag set from firmware, we will read invalid trailer data from the packet, which will be shown as various errors, e.g. "sdio mbox lookahead is zero" or "invalid rx packet" or "payload length x exceeds max htc length". Signed-off-by: Alagu Sankar Signed-off-by: Niklas Cassel --- drivers/net/wireless/ath/ath10k/htc.h | 1 + drivers/net/wireless/ath/ath10k/sdio.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htc.h b/drivers/net/wireless/ath/ath10k/htc.h index 34877597dd6a..cf1068dc3254 100644 --- a/drivers/net/wireless/ath/ath10k/htc.h +++ b/drivers/net/wireless/ath/ath10k/htc.h @@ -58,6 +58,7 @@ enum ath10k_htc_tx_flags { }; enum ath10k_htc_rx_flags { + ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK = 0x01, ATH10K_HTC_FLAG_TRAILER_PRESENT = 0x02, ATH10K_HTC_FLAG_BUNDLE_MASK = 0xF0 }; diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c index d46523b0472c..0c57d6aaa437 100644 --- a/drivers/net/wireless/ath/ath10k/sdio.c +++ b/drivers/net/wireless/ath/ath10k/sdio.c @@ -603,6 +603,9 @@ static int ath10k_sdio_mbox_rx_alloc(struct ath10k *ar, * ATH10K_HTC_FLAG_BUNDLE_MASK flag set, all bundled * packet skb's have been allocated in the previous step. */ + if (htc_hdr->flags & ATH10K_HTC_FLAGS_RECV_1MORE_BLOCK) + full_len += ATH10K_HIF_MBOX_BLOCK_SIZE; + ret = ath10k_sdio_mbox_alloc_rx_pkt(&ar_sdio->rx_pkts[i], act_len, full_len,