Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4624159pxj; Wed, 12 May 2021 09:28:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFgBKwPMvzj/TnEhUvILzTWS9nCpqzXRZHpZDchmahjj6UzWrCpd1rvjMBPxcUyrbj/3Eg X-Received: by 2002:a17:907:75d5:: with SMTP id jl21mr38919094ejc.280.1620836923021; Wed, 12 May 2021 09:28:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620836923; cv=none; d=google.com; s=arc-20160816; b=jMbLj6FCP7A2gOkWTQvSItln1DcFanKmDt/6fHQuh63Yj6gFSJU9sKltUNCLHCEgnr VsBK3n6Wxz3b5cjhDh7Ig+7Uuwk10JRuqSncic3apoe5hTuy+eA/CVlH+DJG5tONC3NZ YPtcjSoMj7s6PZsFq04CJ1DWP120QeOlvggs/S2EbKvxEdVftJVhCCdnsEZtcN7osdnd T8VWUclORodc+uzZyq8/o0IkmtIwTTRa4Ce8sH3OfPSZWdVltFqEX0T6vt1WGZZnMKeA cuW8dr6Cxx+2sUpEVeblj7nQuy/FOglH4l/ZEdwDAP8xbSgcnChd3d16aTVaTqO8ov3R BvKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=g1ZqHy7RHIgo5Cjf6gkrJeiuZRN6mv1Zp9JqQg50oWA=; b=GGCUy74f0KDZp58yghjQDg8F7Fuh1ONKy/Gz46hxoQYZ6/BqTwwWoymfjK+/7a+Xj+ 85XnoFlaoWElvWcbtrm4HIpH4UvTC8Nu3rkbQj1lJYmMgtNmKNi5Hr/l22vXxmlcSYFg Xq1MinUt7h6reFBwLyLIkrB9WGE44PH2I/DipPoXhRPCoQ3E6yPpKevEOB7RDbPOIMMx LaTpylEgy29qPBnJcfLxGaM297WzVn0yyiy8KkMRqqY76yyfpoiJWqONwjklymT+mH4F +fGnOLAbT1mmFWpB42WcwA/uWUicG5mmpcr13Vb/tVTxOwKqb2bAOaPV8wSMFtC2Zv5S kBug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DLY2Gt2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si285400ejy.454.2021.05.12.09.28.19; Wed, 12 May 2021 09:28:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DLY2Gt2A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241031AbhELQ0P (ORCPT + 99 others); Wed, 12 May 2021 12:26:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:57044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236383AbhELPhu (ORCPT ); Wed, 12 May 2021 11:37:50 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A53086198D; Wed, 12 May 2021 15:19:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832771; bh=Iuj9liknWKOtP4UbPNW9qRgos7GzblhTtIiJ3GyAzGU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DLY2Gt2AZcDJ63989qsHNdMAJl1LxUupaGpDm1En4JINOehZpxfn89tVyozePC3io XGchKlVVBh9vu/29z3BtbgjOrQHta0/oNYOu5IzYn68B/BUJ8aPG4R0k8xK4Y/R131 SjUHlRZyZBrH+/S4U52nsZ1I+wTIZPE+wA3L8+CM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Wang , Felix Fietkau , Sasha Levin Subject: [PATCH 5.10 417/530] mt76: mt7663s: make all of packets 4-bytes aligned in sdio tx aggregation Date: Wed, 12 May 2021 16:48:47 +0200 Message-Id: <20210512144833.475146182@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang [ Upstream commit 455ae5aabcc72fed7e5c803d59d122415500dc08 ] Each packet should be padded with the additional zero to become 4-bytes alignment in sdio tx aggregation. Fixes: 1522ff731f84 ("mt76: mt7663s: introduce sdio tx aggregation") Signed-off-by: Sean Wang Signed-off-by: Felix Fietkau Signed-off-by: Sasha Levin --- drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c index 595519c58255..2c269fee8555 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_txrx.c @@ -195,6 +195,7 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, enum mt76_txq_id qid) int err, nframes = 0, len = 0, pse_sz = 0, ple_sz = 0; struct mt76_queue *q = dev->q_tx[qid]; struct mt76_sdio *sdio = &dev->sdio; + u8 pad; while (q->first != q->head) { struct mt76_queue_entry *e = &q->entry[q->first]; @@ -210,7 +211,8 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, enum mt76_txq_id qid) goto next; } - if (len + e->skb->len + 4 > MT76S_XMIT_BUF_SZ) + pad = roundup(e->skb->len, 4) - e->skb->len; + if (len + e->skb->len + pad + 4 > MT76S_XMIT_BUF_SZ) break; if (mt7663s_tx_pick_quota(sdio, qid, e->buf_sz, &pse_sz, @@ -228,6 +230,11 @@ static int mt7663s_tx_run_queue(struct mt76_dev *dev, enum mt76_txq_id qid) len += iter->len; nframes++; } + + if (unlikely(pad)) { + memset(sdio->xmit_buf[qid] + len, 0, pad); + len += pad; + } next: q->first = (q->first + 1) % q->ndesc; e->done = true; -- 2.30.2