From patchwork Thu Jun 8 18:43:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9776263 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 A72E460350 for ; Thu, 8 Jun 2017 18:43:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D6A5285B3 for ; Thu, 8 Jun 2017 18:43:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 90907285BA; Thu, 8 Jun 2017 18:43:19 +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 16261285B3 for ; Thu, 8 Jun 2017 18:43:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751392AbdFHSnS (ORCPT ); Thu, 8 Jun 2017 14:43:18 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35863 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbdFHSnR (ORCPT ); Thu, 8 Jun 2017 14:43:17 -0400 Received: by mail-wm0-f66.google.com with SMTP id d17so3796230wme.3 for ; Thu, 08 Jun 2017 11:43:16 -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=qMqMaJt7DytMavwA3KfTUsepv2wEVSc9WFSl2UkuHI0=; b=LNAHSWNjqXeC2XG2WfwnorE+milt2gmvvw1H4PMv1uraygI2GHa6Dq89+3rvmxTmE5 i/ckNKoxGa5X2nSqVyNUdsEYwPl9BJqvkBch5HPyfBv4v+N9us6wbNarEVYTvgMiRBgZ ekQXTqev4NmYJRlZj3O+R3YnEVubCmcg61+Cyej/SXo6ewu8zAZXUqgLupNCYsnCBb5u 5eV2iL4HXUgozD8+8ZCjiQai3BNupeC7KP7yaqHBh78w05brgi64dScFaQI9Hg4CM8dB TC6ThJyDUgIxuywxVArtq2Gje9srnZhjhye/cw061FX7Kyo5nGcTWXRYHldEz2J9fViq 9PHA== 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=qMqMaJt7DytMavwA3KfTUsepv2wEVSc9WFSl2UkuHI0=; b=iD1kVx1KZaIevD0sioWgkAMBWtXKXTP0YmVsd7u7CunjE6niJIVEoCAIAaoY2fKFkS +5RX1DcLtWCu5mPFL0M2EhzC6/2OZsAjx9BE3neds7S+uN4/H6RrkFwC1qCssnIMK9v6 QHD0GKlMJ+YynC3oCiAM+PTwDYwva+ggQzF7F6HplVF1PFl5mT48Owc1LAsvtqxWCqiL qBGai2oJT/tB9//nmn6HQ9+irBjRUBTsUQCRnMYD86RywkH9fJCGAWd8DblClC67vv2L jTo51WfjhBlJVPvMNfXXXLi3o6OwbDEfcOcMne2cviF3YGock3sJNxxnF7uOq2AHwhIL xW9Q== X-Gm-Message-State: AODbwcCvLqyrMVo/6SVyqMIqqBZMCors9OUbFyPRLofTPb4U24RMtv4f oe29tfgVlrHiIGiN X-Received: by 10.28.109.210 with SMTP id b79mr4546680wmi.55.1496947395950; Thu, 08 Jun 2017 11:43:15 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdd:1100:565:334a:6f73:1edb? (p200300C6EBDD11000565334A6F731EDB.dip0.t-ipconnect.de. [2003:c6:ebdd:1100:565:334a:6f73:1edb]) by smtp.googlemail.com with ESMTPSA id u198sm7936213wmd.29.2017.06.08.11.43.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 11:43:15 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH] 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: Date: Thu, 8 Jun 2017 20:43:04 +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 this 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 --- 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 AP6335-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) {