Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp2374866ybt; Tue, 16 Jun 2020 04:35:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzzZXODuJqO6HpPzb0zHt4kQOoNBGeylBc6ECM43JLZC4VCJcKfYOWJXy2P9F8mI57Wvag X-Received: by 2002:a17:906:1ed2:: with SMTP id m18mr2225568ejj.529.1592307331493; Tue, 16 Jun 2020 04:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592307331; cv=none; d=google.com; s=arc-20160816; b=i8v7abdXtMNuDPkBo7Vo16QJZkKgmxZ5B2tjOwTeuqb0C9KMk9I24ZQYfZJHPPAdzc PASnxnxe5FWRTR/6bcrsJg80Pqox/mjjheFUBwKbGkmmKcj+V0iYd9Qt4DycAHzzGhuf 9nUd2+3ZFYyJ1O3DWiHYfP1Cmiu819g9//C9tQKrpegHZtmhFEmLc80kBnCOyVAlXJ0m gl4m4CsjdoNL95TOrsXHf7rP7LYkIN4xiXD55fkFYIg+XV26U2213PVCQ5OspaYoo6zH B4FbrYzlxZcYhfB3m37iu3shBKk7c/Oct/jjnGU75Xze7kpl8m0k8UjAdibIgAHyWyLX QGMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=ZSg0muGbkwOyh6Ot3lTlpvo0Mmt4wgCAweHT5tRHxm0=; b=qIsJ97ufEnda+O2LMpep9/CHXn7vJZlWuRZ2RLnrymMlo1w5flFnrD+oBbxezNPhmR 0vYACEAIM8I7NX8eVhE9eJm7KxXZw+PGnqd22+0HzpZwClLdhu/H1/rq0p4E0NVbCikQ sm6q34ldIlfSAt6t3WTIPfQhn4ODr2weWbLDg3wb8gN23ut4eTMHz0VFpD6b24dIyRdS r94hoGV3eoGTeWbFolkPNDTi17dwJQBDMSMwusHqWGnJVoo0ry9QIl1xgrVjE98gF/E5 Iq1z2NnUvvD8lJyZI17CbphDYnN9NGH/QUmsdSED6Tsl4vzrHNjlPKS4sBQYPWyzbbFx Wiyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VibwAZSD; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si10123144edp.531.2020.06.16.04.35.08; Tue, 16 Jun 2020 04:35:31 -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=@linaro.org header.s=google header.b=VibwAZSD; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728607AbgFPLdR (ORCPT + 99 others); Tue, 16 Jun 2020 07:33:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726306AbgFPLdN (ORCPT ); Tue, 16 Jun 2020 07:33:13 -0400 Received: from mail-vk1-xa43.google.com (mail-vk1-xa43.google.com [IPv6:2607:f8b0:4864:20::a43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BEAEC08C5C4 for ; Tue, 16 Jun 2020 04:33:13 -0700 (PDT) Received: by mail-vk1-xa43.google.com with SMTP id y23so1623800vkd.13 for ; Tue, 16 Jun 2020 04:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZSg0muGbkwOyh6Ot3lTlpvo0Mmt4wgCAweHT5tRHxm0=; b=VibwAZSD84LU+4hHmx7H20bVV8ZpftSbkJ7qeyM+fPSnWy5b52HMmY8uC6oN/TOJ3N Ppd7MeLLzhu4lLdwL1u8+HFFzEJwEkIRbPl3l2liiO84a2tEXnOOLJLVeD2eQr2LEdo1 GuqKU5ksA+/+QuCtf656nkvB+l8BnzLR+CwMeWI8NMKjSG87T6hTFLog6RcU8uJ5b42y lBqr6ENJXZQ31zwwwbbWm8fG8NZlpIVe4l6fg47KvRL/VkNsBi3g56UkQTQ64+dQKFpF 89zZO5b6w/YjOAiLDeGYGxLcR5EKhAFvvlLFVKqumAr2y0DtwWTd9++bWUxaqHYG4fEh NmyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ZSg0muGbkwOyh6Ot3lTlpvo0Mmt4wgCAweHT5tRHxm0=; b=RDXHnrqxYIwtF12eL0svlixgZAUdJbIrr9dBcnkf3pCUJYfz955efuv60IbPyPxxVt VmpovvvNOFICNQCLwE4Mel1nXqSSxRIKo7PxlS1mtQyqjR9S2wSGA+B9fxMSLeTpEzze O4dG/IHwcDsH8RtzXF78s+A9KMXpRUbNu114qhWMj7j+qaIGTiZz7Vvuh2wHhwr079an Sp0HlbsyyfajIQTCSP/R3rK/qjAOSYclQpmaCcaIxnssEMHamtP+hpp1qRnyCANLbmSl YhhUmZy3JoKEIPmXscC1Co54nIxLT2TkhUv/daLQKcodfOewg0Os6ZFl88FZPialDH6c ZAbw== X-Gm-Message-State: AOAM533EjCLOLiu6XCix36r9yE81GvbnRYxzZ6Jyefy6Bh0+pjUoT56B biKlzcRgeRUxUCAF8XFBTI83XgI5BX5l2JOmfCp8gQ== X-Received: by 2002:a1f:2145:: with SMTP id h66mr1118293vkh.53.1592307192362; Tue, 16 Jun 2020 04:33:12 -0700 (PDT) MIME-Version: 1.0 References: <20200608084458.32014-1-narmstrong@baylibre.com> In-Reply-To: <20200608084458.32014-1-narmstrong@baylibre.com> From: Ulf Hansson Date: Tue, 16 Jun 2020 13:32:36 +0200 Message-ID: Subject: Re: [PATCH] mmc: meson-gx: limit segments to 1 when dram-access-quirk is needed To: Neil Armstrong Cc: "open list:ARM/Amlogic Meson..." , "linux-mmc@vger.kernel.org" , Linux ARM , Linux Kernel Mailing List , Art Nikpal , Christian Hewitt Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 8 Jun 2020 at 10:45, Neil Armstrong wrote: > > The actual max_segs computation leads to failure while using the broadcom > sdio brcmfmac/bcmsdh driver, since the driver tries to make usage of scatter > gather. > > But with the dram-access-quirk we use a 1,5K SRAM bounce buffer, and the > max_segs current value of 3 leads to max transfers to 4,5k, which doesn't work. > > This patch sets max_segs to 1 to better describe the hardware limitation, > and fix the SDIO functionnality with the brcmfmac/bcmsdh driver on Amlogic > G12A/G12B SoCs on boards like SEI510 or Khadas VIM3. > > Reported-by: Art Nikpal > Reported-by: Christian Hewitt > Fixes: acdc8e71d9bb ("mmc: meson-gx: add dram-access-quirk") > Signed-off-by: Neil Armstrong Applied for fixes and by adding a stable tag, thanks! Kind regards Uffe > --- > drivers/mmc/host/meson-gx-mmc.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c > index 35400cf2a2e4..cfaf8e7e22ec 100644 > --- a/drivers/mmc/host/meson-gx-mmc.c > +++ b/drivers/mmc/host/meson-gx-mmc.c > @@ -1143,9 +1143,11 @@ static int meson_mmc_probe(struct platform_device *pdev) > > mmc->caps |= MMC_CAP_CMD23; > if (host->dram_access_quirk) { > + /* Limit segments to 1 due to low available sram memory */ > + mmc->max_segs = 1; > /* Limit to the available sram memory */ > - mmc->max_segs = SD_EMMC_SRAM_DATA_BUF_LEN / mmc->max_blk_size; > - mmc->max_blk_count = mmc->max_segs; > + mmc->max_blk_count = SD_EMMC_SRAM_DATA_BUF_LEN / > + mmc->max_blk_size; > } else { > mmc->max_blk_count = CMD_CFG_LENGTH_MASK; > mmc->max_segs = SD_EMMC_DESC_BUF_LEN / > -- > 2.22.0 >