From patchwork Mon Jan 30 19:33:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9546039 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 EFA89604A0 for ; Mon, 30 Jan 2017 19:34:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E076226E97 for ; Mon, 30 Jan 2017 19:34:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D24612816B; Mon, 30 Jan 2017 19:34:25 +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=-1.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8A11B27F17 for ; Mon, 30 Jan 2017 19:34:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cYHiU-0003L6-DJ; Mon, 30 Jan 2017 19:34:18 +0000 Received: from mail-wm0-x242.google.com ([2a00:1450:400c:c09::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cYHiR-0003HV-5S; Mon, 30 Jan 2017 19:34:16 +0000 Received: by mail-wm0-x242.google.com with SMTP id v77so18032947wmv.0; Mon, 30 Jan 2017 11:33:53 -0800 (PST) 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=4Lq+TlZFNL4weHU7EUp+nQryRADKm6Na4g589YXUiRI=; b=BOOlstB4KU2zFHihM74lADub19nTm20VqFtKukxrkxgHiQewBbXmcb9+/A2GhB/LR4 nGQFJKxIqnNsTiEmObHBhr2jYSdzcUmgFdVkIdivyz7KQU/xM/fXJ79GawLq45Rf104V j+yi7S88+IxvcMfXBbG7BDQ1lbHabsoq0BMWbdNPvHWWDhjwI5dW01IfjdfjIF5TlTmx S6zXu4gmTXKN7JQO6C3I5q2P6ZTf3Fj0gW1zXNWpttNHa4BFmHkdqWlujFD17uDfhv9d OJ4GO4zMO5MuMb3m2psw2pb9MvtpVMrgNWSV4mKYS8eqvvTBOwdpkBsNIOhjWyCevRco 7AsQ== 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=4Lq+TlZFNL4weHU7EUp+nQryRADKm6Na4g589YXUiRI=; b=h5nI1iTrIUs60+qrotjT6u8fbWajbVksxqUwknCQEUhcGtmRT55bPFmKElvLlh5Xnc pGsJ6yaqG2U6FzaDtOGepJmjKIPrHzsocEq3NpuV04RR1t0nX1CsV7U4HZMFxUaEEHpD doCOpFjEU/tTL/29wMHFVAG3HQW1Hefv8EudFg+OQvbvQcQgRGY7emHIGQW7lDyJNsuy /yj7dqZzMYjYCOiP1IWAT8Fxtimhkn3QjbXnLJnsWNFOKH8Y0GR7T8yeG2nUCtGBrWBp d51hRezCpFPClRS9RRBP+mV1TDrJROv1Vu7KbKJTDDkDCbK1jbQfVRyqTc2hE80cUzxh +m7Q== X-Gm-Message-State: AIkVDXLSx/ucsS09rgADLajNCPYlvlyBI62Ev8FaQWy2ZjfHh3xOpM6ItijtrLk56R/tUQ== X-Received: by 10.28.141.199 with SMTP id p190mr16203238wmd.89.1485804832295; Mon, 30 Jan 2017 11:33:52 -0800 (PST) Received: from ?IPv6:2003:c6:ebc5:6c00:7569:871a:d177:3bc5? (p200300C6EBC56C007569871AD1773BC5.dip0.t-ipconnect.de. [2003:c6:ebc5:6c00:7569:871a:d177:3bc5]) by smtp.googlemail.com with ESMTPSA id 8sm28073069wmg.1.2017.01.30.11.33.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Jan 2017 11:33:51 -0800 (PST) From: Heiner Kallweit Subject: [PATCH v3] mmc: meson-gx: set max block count To: Ulf Hansson , Kevin Hilman , Carlo Caione Message-ID: Date: Mon, 30 Jan 2017 20:33:47 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170130_113415_392139_30F70F50 X-CRM114-Status: UNSURE ( 7.36 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, "linux-arm-kernel@lists.infradead.org" Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP So far max_blk_count isn't set what results in a default of value 8 to be used (PAGE_SIZE / block size). Block length field has 9 bits, so set max_blk_count to 2^9-1 = 511. In addition set max_req_size because max_blk_count is also limited by max_req_size / block_size. Signed-off-by: Heiner Kallweit Acked-by: Kevin Hilman --- v2: - block length field has 9 bits, so set max_blk_count to 2^9-1 = 511 - in addition set max_req_size because max_blk_count is also limited by max_req_size / block_size v3: - extend commit message --- drivers/mmc/host/meson-gx-mmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 83361f1f..d4d174ed 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -810,6 +810,8 @@ static int meson_mmc_probe(struct platform_device *pdev) goto free_host; } + mmc->max_blk_count = CMD_CFG_LENGTH_MASK; + mmc->max_req_size = mmc->max_blk_count * mmc->max_blk_size; mmc->ops = &meson_mmc_ops; mmc_add_host(mmc);