From patchwork Thu Jun 22 10:57:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Newton X-Patchwork-Id: 9804015 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 7D3D260386 for ; Thu, 22 Jun 2017 10:58:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6D851285CE for ; Thu, 22 Jun 2017 10:58:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 61EC5285D5; Thu, 22 Jun 2017 10:58:17 +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 09155285D1 for ; Thu, 22 Jun 2017 10:58:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752755AbdFVK6O (ORCPT ); Thu, 22 Jun 2017 06:58:14 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36273 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752743AbdFVK6N (ORCPT ); Thu, 22 Jun 2017 06:58:13 -0400 Received: by mail-wr0-f194.google.com with SMTP id 77so3700691wrb.3; Thu, 22 Jun 2017 03:58:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nr1o99mQDtr9iO7+MLJJGoQjKLwr2IAn2TPrrgaasZg=; b=ftMYEq4ew0qz3RiMs6Fv4kLp0g6wMjsgpqpzhGINO4nsTj7pdH3nHzVP57EsXtITKk ffKZ+8hJ5fjSE1gDeUiN84RfUykWl26h0Ukez9japs7zcCkhNXA0vLYQ80LPksudfaNT ovTR9a9GqJNXG8NI4ZffW2NUGuDLVrnLLo0HwbrhtJczkFKDsU8d8kTlYYopScIjekwF Etjpn5DLPgbupNviBGurgSEv2r7k9S3XpGSsYik1f6zaAVFIBqN7Bcws4+55Wfci8CGm RH1i+3vmV2JTiXKwMWU7VHnVSXjIhTv4SV+bL/e1ovZx1ThiiMfPJcSnr1MAjUV3Y2If s70A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nr1o99mQDtr9iO7+MLJJGoQjKLwr2IAn2TPrrgaasZg=; b=cu3CfSEOmqh1mMrU4M/eal5syf9200xP3x/+8iUEYTCv9TP6a0jebM45LMgitXZPc0 O0Y6Lc/c6Imb12gn2N6dYqkq2eurd+qeLarJ7qdaLHGa3Fe+VBoNK/snl9m58Lc+6X/m YDQsXJqlPu1KeMl75NnNt2A0hoZopZj5B8REkfKxtKpHjv6zSBNfrdHPuV2YTu9LrHZ9 k63vGRlyxM9gDaE6jqYCvcHlyOaEg+FB7swV3Uldjt7TvKT4M2R3SRzAw0WgAo786uBt fLXd+dFmzDo7Qyu9DTxrgJcz39geMQxUZlGoqGrIzV3g9o0rfyWE8I1DUR6HQSDjmEiJ xUrg== X-Gm-Message-State: AKS2vOxuVdzj87stNa5ATWORhfGIitDThCtcCv+5X3PSEGE/xYWE6sf8 Ve3HY1uicTjVFlSL X-Received: by 10.223.176.253 with SMTP id j58mr1455031wra.65.1498129087081; Thu, 22 Jun 2017 03:58:07 -0700 (PDT) Received: from localhost.localdomain (cpc99254-seac26-2-0-cust416.7-2.cable.virginm.net. [86.7.141.161]) by smtp.gmail.com with ESMTPSA id l6sm814253wmg.31.2017.06.22.03.58.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Jun 2017 03:58:06 -0700 (PDT) From: Will Newton X-Google-Original-From: Will Newton To: linux-omap@vger.kernel.org Cc: linux-mmc@vger.kernel.org, tony@atomide.com, kishon@ti.com, rk@ti.com, Will Newton Subject: [PATCH v2] omap_hsmmc: Reduce max_segs for reliability Date: Thu, 22 Jun 2017 11:57:53 +0100 Message-Id: <20170622105753.28708-1-willn@resin.io> X-Mailer: git-send-email 2.9.4 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reduce max_segs to 64, a value that allows allocation of an entire EDMA descriptor list within a single page - EDMA descriptors are 40 bytes and the header is much larger. This avoids doing a higher order GFP_ATOMIC allocation in edma_prep_slave_sg when setting up a transfer which can potentially fail due to fragmentation under heavy I/O load. The current value of 1024 is unusually high in comparison to other mmc host drivers which mostly use values of between 1 and 256. The EDMA driver at present splits lists above 20 segments in any case so reducing the size of lists we pass to it shouldn't add much overhead. Signed-off-by: Will Newton Acked-by: Tony Lindgren --- drivers/mmc/host/omap_hsmmc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Changes in v2: - More verbose commit message - Rebased onto current master diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c index 8c39dcc..bbcca93 100644 --- a/drivers/mmc/host/omap_hsmmc.c +++ b/drivers/mmc/host/omap_hsmmc.c @@ -2097,9 +2097,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev) host->dbclk = NULL; } - /* Since we do only SG emulation, we can have as many segs - * as we want. */ - mmc->max_segs = 1024; + /* Set this to a value that allows allocating an entire descriptor + * list within a page (zero order allocation). */ + mmc->max_segs = 64; mmc->max_blk_size = 512; /* Block Length at max can be 1024 */ mmc->max_blk_count = 0xFFFF; /* No. of Blocks is 16 bits */