From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37298C433EC for ; Tue, 14 Jul 2020 19:01:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0FA2122B51 for ; Tue, 14 Jul 2020 19:01:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594753292; bh=hieG4kLY8y4c6e+4fHOysQN0bav8nSD+YYv5fN2DRUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=H2hGIfi8qmBu+KQ3vKFOvLSadroirV91qx/eHJBrvW2Mvd8KlxeTf+WCNi48HVtAj B3e5biiLkTIoO91qymHz4EK/M8V34Re/QWf8ye2j5vQlxApIkRQmR1bBRd9wIxw/nP kMPRRejhDLKm8ncfdCAyDhYi7PV06e4Q1waJY/lY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729694AbgGNS7m (ORCPT ); Tue, 14 Jul 2020 14:59:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:58324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731287AbgGNS7l (ORCPT ); Tue, 14 Jul 2020 14:59:41 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 950A122507; Tue, 14 Jul 2020 18:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594753181; bh=hieG4kLY8y4c6e+4fHOysQN0bav8nSD+YYv5fN2DRUU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DCz58qfAi8GRv6vVjDhi7NVvtq5I0mQId96YF4wfwKHBH4vfxaKuE3xtzR6aF4lAj vd27aDYVSpBFTjLDo46M0KERuonXeaRxNOuWBo7R+YuZJEFHmfy40htQRDMEAfduLo YuFQBqUyuaAc04ZssYvCzLDGbmqRFPGQ3ug4LpLI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Art Nikpal , Christian Hewitt , Neil Armstrong , Kevin Hilman , Ulf Hansson Subject: [PATCH 5.7 150/166] mmc: meson-gx: limit segments to 1 when dram-access-quirk is needed Date: Tue, 14 Jul 2020 20:45:15 +0200 Message-Id: <20200714184123.010825967@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200714184115.844176932@linuxfoundation.org> References: <20200714184115.844176932@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Neil Armstrong commit 27a5e7d36d383970affae801d77141deafd536a8 upstream. 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 functionality 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 Reviewed-by: Kevin Hilman Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20200608084458.32014-1-narmstrong@baylibre.com Signed-off-by: Ulf Hansson Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/meson-gx-mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- 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 platfo 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 /