From patchwork Wed Apr 5 18:33:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9665425 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 61F5260353 for ; Wed, 5 Apr 2017 18:33:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5741A28178 for ; Wed, 5 Apr 2017 18:33:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A305285A3; Wed, 5 Apr 2017 18:33:43 +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 EA2C328178 for ; Wed, 5 Apr 2017 18:33:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932548AbdDESdl (ORCPT ); Wed, 5 Apr 2017 14:33:41 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:36132 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755283AbdDESdj (ORCPT ); Wed, 5 Apr 2017 14:33:39 -0400 Received: by mail-wr0-f193.google.com with SMTP id k6so5037487wre.3 for ; Wed, 05 Apr 2017 11:33:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=j3X2Q0QhSguCCZaEBS18rjKYaa/vtDFOa2qgvRwsuzw=; b=L4sbXDUsvGfYzizi2xWfdiozdLq005CsFwD12KVjS6ryK9fF+g+goUbWEivm1jjUvo ppTM6+thCZzi3rpyyTXmeQ0j0Iy85UbsOzKskGfkbLEeqCI/ZTzMJBC5X6q6L8lgNM/Q Mf9AjIVhT5QNednPWkmP4obgC0UW6w8FRnbgcXodRVKb+Qhf+cqx6Y4ab6YbYjPjXa4f HIp4erEL2yzYjQ3qmv1wzx6q+mLBPQ645JVOmhD3fhBDxD6g6Dm5+OGFoj5hBFxcAa5n nncHLkOUlKx4DWgtzJ6CA/6PABY6x4eaFHiwMk3TcxxZLldAkDoDjtaXQcaqJe+AEr/E tbwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=j3X2Q0QhSguCCZaEBS18rjKYaa/vtDFOa2qgvRwsuzw=; b=XxAPMKwZ1G24cVPxx6Oph20tWeThYLJ9BvEtjyx1qyjSU+7sXKCE2sEsl2+MlEKS/v YQbvwKsxsILAYSeo2/krgOWXtxuPP4Uq7BtTNCRGnRxfq4tf3mcmF3md919XXH7SH5s0 f0WzKs2pTf4z+6CYl4RR5MTUeN67u5HK3wvjIuchIu/7tVwoE4gJ2u6VB8Cjc5tORkd4 2PRyI4IwbouCPbZ7ISNfqT5jXOGWYA5OC6cKwWnDmCBMLqIcgcd7xN7JsjvZjXd5yYuP 1Sq7PIHcBrY6Xa8/2+t7EAe38U8CPOMNvUUIQDXos+4dHlaZHntuIqrccrMdcdMQLBdb i+Fw== X-Gm-Message-State: AFeK/H1N4997hJPQ9+hI65re7ItO82jaGukEQ9JbgV+4lDAcoWMzXAn+U5uDiNIhwDViOw== X-Received: by 10.28.232.14 with SMTP id f14mr10843084wmh.106.1491417218484; Wed, 05 Apr 2017 11:33:38 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdc:4000:41d9:7591:cd31:ea6? (p200300C6EBDC400041D97591CD310EA6.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:41d9:7591:cd31:ea6]) by smtp.googlemail.com with ESMTPSA id t85sm23303319wmt.23.2017.04.05.11.33.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Apr 2017 11:33:37 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH] brcmfmac: properly align buffers on certain platforms with 64 bit DMA To: Arend van Spriel , Franky Lin , Hante Meuleman Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com, Helmut Klein Message-ID: <7120e0d6-8687-2622-7432-cb78dae3e122@gmail.com> Date: Wed, 5 Apr 2017 20:33:26 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 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 Systems with 64 bit DMA at least partially require buffers to be used for DMA to be 8-byte-aligned. One example is Amlogic Meson GX. Switching the MMC/SDIO driver for this platform to SG DMA mode resulted in problems due to unaligned buffers. Fortunately the brcmfmac driver has a global define for the alignment. Changing it to 8 fixed the issues with Meson GX. Suggested-by: Helmut Klein Tested-by: Helmut Klein Signed-off-by: Heiner Kallweit --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c index a999f950..fc64b891 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c @@ -540,7 +540,11 @@ static int qcount[NUMPRIO]; /* Limit on rounding up frames */ static const uint max_roundup = 512; +#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT +#define ALIGNMENT 8 +#else #define ALIGNMENT 4 +#endif enum brcmf_sdio_frmtype { BRCMF_SDIO_FT_NORMAL,