From patchwork Sat Jun 10 11:36:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9779789 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 D9A59603B4 for ; Sat, 10 Jun 2017 11:36:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C77E3286E5 for ; Sat, 10 Jun 2017 11:36:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBABA28715; Sat, 10 Jun 2017 11:36:56 +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.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 6B74A2871B for ; Sat, 10 Jun 2017 11:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751958AbdFJLgz (ORCPT ); Sat, 10 Jun 2017 07:36:55 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:33036 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751955AbdFJLgy (ORCPT ); Sat, 10 Jun 2017 07:36:54 -0400 Received: by mail-wr0-f193.google.com with SMTP id v104so11846665wrb.0 for ; Sat, 10 Jun 2017 04:36:54 -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=9tKH+uKdd+R8tVajAynIJtQrkYCUokrRq6IziqFgtC0=; b=PpMwq6mj5ig19aTowh72ScWpeYFhqU9iVgaWXIoEMxg4MGYcLumvAnPE7AosAFDesi 6juLP6nzxwW9xdAFbHNZFzCrzmcXzBkV6jX+vUBJ9Ym7PyybsCZ+x8Kawo48MMx4B2tD GGgnIlXzf09ZD8G/coALT4bZGCgE1RRPY2jYTaBojAmIGFZz9zHMUudyW9NtTZQkZFEe J2CXVAwPJRr7GIrVWJd/53DlT0+lfIm6x3C3zfNvo1GL0VpuCwGGYleuDNwY7wJ5NL8G MLUVkyn7PQNWfqkTU1HU8AM6VHbO2DAWvBWQEJqgC8Am2k2TO0y0jdM0TE31eBNmrfyE 4ITA== 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=9tKH+uKdd+R8tVajAynIJtQrkYCUokrRq6IziqFgtC0=; b=D+Ewmttn3Oi80jOcdETDs1Y4RAH2KZPvr0gmG+WXd8kTvpK55tBLuoUSx0FydLM4cl 1R+mNqE1m0MU/pAS8ksC3iNp+tin2IUrvr139VXF5nbggm7UnOoFBM/5Yxj0Gqmc7ccs M1sT14DPYHqQuZHQdNsyuRJB9UHy5GqLhRWJ8VIn1gE3iT4WX0p4uWDiJseCCisCiM+g m3UwpZd0Jvb5+37MtZTs+ZJxt+A3pwetIbZjACtVfHCjdeapVcnHefCsW2gl+VXc+e8Y EQ0YEFjJvZaGO9dFbCtWKPrfxw4qONqjmlpTe1qoKWmkcILOzkOZC7oq2CfpBYyc8Gxy CFng== X-Gm-Message-State: AKS2vOzBN6+J5XhuA/nGXaqv0WekUo6zErnv2xNVWYQhaBExeBRwdhQJ yQ5lYO5XeiiBg+J6 X-Received: by 10.28.65.85 with SMTP id o82mr2632414wma.79.1497094613236; Sat, 10 Jun 2017 04:36:53 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdd:1100:64e5:35be:fc4c:8457? (p200300C6EBDD110064E535BEFC4C8457.dip0.t-ipconnect.de. [2003:c6:ebdd:1100:64e5:35be:fc4c:8457]) by smtp.googlemail.com with ESMTPSA id 6sm3732343wrg.61.2017.06.10.04.36.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Jun 2017 04:36:52 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH v2] mmc: meson-gx: work around broken SDIO with certain WiFi chips To: Kevin Hilman , Ulf Hansson Cc: "open list:ARM/Amlogic Meson..." , Martin Blumenstingl , "linux-mmc@vger.kernel.org" Message-ID: <8ac1f97a-afbb-dde9-7e60-3e51396cb8ff@gmail.com> Date: Sat, 10 Jun 2017 13:36:38 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There have been reports about SDIO failing with certain WiFi chips in descriptor chain mode. SD / eMMC are working fine. So let's fall back to bounce buffer mode for command SD_IO_RW_EXTENDED. This was reported to fix the error. Fixes: 79ed05e329c3 "mmc: meson-gx: add support for descriptor chain mode" Cc: # 4.12.x Signed-off-by: Heiner Kallweit Tested-by: Martin Blumenstingl --- v2: - fixed affected WiFi chip: actually it is AP6255 - added tested-by --- drivers/mmc/host/meson-gx-mmc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 1842ed34..4cdbe3c0 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -210,6 +210,15 @@ static void meson_mmc_get_transfer_mode(struct mmc_host *mmc, int i; bool use_desc_chain_mode = true; + /* + * Broken SDIO with AP6255-based WiFi on Khadas VIM Pro has been + * reported. For some strange reason this occurs in descriptor + * chain mode only. So let's fall back to bounce buffer mode + * for command SD_IO_RW_EXTENDED. + */ + if (mrq->cmd->opcode == SD_IO_RW_EXTENDED) + return; + for_each_sg(data->sg, sg, data->sg_len, i) /* check for 8 byte alignment */ if (sg->offset & 7) {